From 27ad08b32462741df2310b6c8c89edef4c03546a Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 3 Oct 2023 18:47:20 +0000 Subject: [PATCH] CodeGen from PR 26059 in Azure/azure-rest-api-specs Merge 3939ce49f6a5bcc25c4b8f099b8aca624956d1d3 into 7dc72e8b070d449d29e2d679c219914637cdbfa5 --- .../CHANGELOG.md | 4 +- .../README.md | 6 +- .../SAMPLE.md | 923 ++++++++- .../pom.xml | 11 +- .../hybridcompute/HybridComputeManager.java | 137 +- .../fluent/AgentVersionsClient.java | 67 + .../fluent/ExtensionMetadatasClient.java | 79 + .../fluent/HybridComputeManagementClient.java | 56 + .../fluent/HybridIdentityMetadatasClient.java | 81 + .../fluent/LicenseProfilesClient.java | 248 +++ .../hybridcompute/fluent/LicensesClient.java | 315 +++ .../fluent/MachineRunCommandsClient.java | 294 +++ .../hybridcompute/fluent/MachinesClient.java | 130 +- .../fluent/NetworkProfilesClient.java | 41 + .../fluent/ResourceProvidersClient.java | 81 + .../fluent/models/AgentVersionInner.java | 102 + .../fluent/models/AgentVersionsListInner.java | 80 + .../models/EsuProfileUpdateProperties.java | 50 + .../fluent/models/ExtensionValueInner.java | 86 + .../models/ExtensionValueProperties.java | 69 + .../models/HybridIdentityMetadataInner.java | 123 ++ .../HybridIdentityMetadataProperties.java | 95 + .../fluent/models/LicenseInner.java | 155 ++ .../LicenseProfileArmEsuProperties.java | 53 + .../fluent/models/LicenseProfileInner.java | 157 ++ ...MachineInstanceViewEsuPropertiesInner.java | 85 + ...icenseProfileMachineInstanceViewInner.java | 54 + .../models/LicenseProfileProperties.java | 131 ++ .../LicenseProfileUpdateProperties.java | 65 + .../fluent/models/LicenseProperties.java | 123 ++ .../models/LicenseUpdateProperties.java | 188 ++ ...LicenseUpdatePropertiesLicenseDetails.java | 158 ++ .../MachineAssessPatchesResultInner.java | 204 ++ .../fluent/models/MachineExtensionInner.java | 4 +- .../MachineExtensionUpdateProperties.java | 47 +- .../fluent/models/MachineInner.java | 537 ++++- .../MachineInstallPatchesResultInner.java | 266 +++ .../fluent/models/MachinePropertiesInner.java | 665 +++++++ .../fluent/models/MachineRunCommandInner.java | 378 ++++ .../models/MachineRunCommandProperties.java | 406 ++++ .../models/MachineUpdateProperties.java | 93 +- .../fluent/models/NetworkProfileInner.java | 55 + .../fluent/models/OperationValueInner.java | 15 + .../fluent/models/PatchSettings.java | 78 + .../PrivateEndpointConnectionInner.java | 4 +- .../models/PrivateLinkResourceInner.java | 4 +- .../implementation/AgentVersionImpl.java | 40 + .../AgentVersionsClientImpl.java | 289 +++ .../implementation/AgentVersionsImpl.java | 82 + .../implementation/AgentVersionsListImpl.java | 52 + .../ExtensionMetadatasClientImpl.java | 445 +++++ .../ExtensionMetadatasImpl.java | 74 + .../implementation/ExtensionValueImpl.java | 57 + .../HybridComputeManagementClientBuilder.java | 2 +- .../HybridComputeManagementClientImpl.java | 114 +- .../HybridIdentityMetadataImpl.java | 59 + .../HybridIdentityMetadatasClientImpl.java | 531 +++++ .../HybridIdentityMetadatasImpl.java | 75 + .../implementation/LicenseImpl.java | 246 +++ .../implementation/LicenseProfileImpl.java | 228 +++ ...eMachineInstanceViewEsuPropertiesImpl.java | 77 + ...LicenseProfileMachineInstanceViewImpl.java | 40 + .../LicenseProfilesClientImpl.java | 1331 +++++++++++++ .../implementation/LicenseProfilesImpl.java | 159 ++ .../implementation/LicensesClientImpl.java | 1754 +++++++++++++++++ .../implementation/LicensesImpl.java | 187 ++ .../MachineAssessPatchesResultImpl.java | 76 + .../implementation/MachineExtensionImpl.java | 40 +- .../MachineExtensionsClientImpl.java | 15 +- .../implementation/MachineImpl.java | 183 +- .../MachineInstallPatchesResultImpl.java | 96 + .../implementation/MachinePropertiesImpl.java | 191 ++ .../implementation/MachineRunCommandImpl.java | 307 +++ .../MachineRunCommandsClientImpl.java | 1508 ++++++++++++++ .../MachineRunCommandsImpl.java | 190 ++ .../implementation/MachinesClientImpl.java | 630 +++++- .../implementation/MachinesImpl.java | 50 +- .../implementation/NetworkProfileImpl.java | 40 + .../NetworkProfilesClientImpl.java | 210 ++ .../implementation/NetworkProfilesImpl.java | 60 + .../implementation/OperationValueImpl.java | 4 + .../PrivateEndpointConnectionsClientImpl.java | 12 +- .../PrivateLinkResourcesClientImpl.java | 6 +- .../PrivateLinkScopesClientImpl.java | 21 +- .../ResourceProvidersClientImpl.java | 360 ++++ .../implementation/ResourceProvidersImpl.java | 47 + .../models/AgentConfiguration.java | 154 ++ .../models/AgentConfigurationMode.java | 50 + .../hybridcompute/models/AgentUpgrade.java | 162 ++ .../hybridcompute/models/AgentVersion.java | 38 + .../hybridcompute/models/AgentVersions.java | 59 + .../models/AgentVersionsList.java | 32 + .../hybridcompute/models/ArcKindEnum.java | 62 + .../models/AssessmentModeTypes.java | 47 + .../AvailablePatchCountByClassification.java | 159 ++ .../hybridcompute/models/CloudMetadata.java | 39 + .../models/ConfigurationExtension.java | 54 + .../hybridcompute/models/EsuEligibility.java | 50 + .../hybridcompute/models/EsuKey.java | 76 + .../hybridcompute/models/EsuKeyState.java | 47 + .../hybridcompute/models/EsuServerType.java | 47 + .../hybridcompute/models/ExecutionState.java | 62 + .../models/ExtensionMetadatas.java | 72 + .../models/ExtensionTargetProperties.java | 50 + .../hybridcompute/models/ExtensionValue.java | 67 + .../models/ExtensionValueListResult.java | 44 + .../models/ExtensionsResourceStatus.java | 155 ++ .../models/ExtensionsStatusLevelTypes.java | 54 + .../models/HybridComputePrivateLinkScope.java | 9 + ...bridComputePrivateLinkScopeProperties.java | 19 + .../models/HybridIdentityMetadata.java | 67 + .../models/HybridIdentityMetadataList.java | 89 + .../models/HybridIdentityMetadatas.java | 73 + .../hybridcompute/models/Identity.java | 2 +- .../hybridcompute/models/IpAddress.java | 94 + .../models/LastAttemptStatusEnum.java | 47 + .../hybridcompute/models/License.java | 354 ++++ .../models/LicenseAssignmentState.java | 47 + .../hybridcompute/models/LicenseCoreType.java | 47 + .../hybridcompute/models/LicenseDetails.java | 184 ++ .../hybridcompute/models/LicenseEdition.java | 47 + .../hybridcompute/models/LicenseProfile.java | 288 +++ ...rmEsuPropertiesWithoutAssignedLicense.java | 71 + .../LicenseProfileMachineInstanceView.java | 25 + ...ofileMachineInstanceViewEsuProperties.java | 68 + ...censeProfileStorageModelEsuProperties.java | 58 + .../models/LicenseProfileUpdate.java | 76 + .../hybridcompute/models/LicenseProfiles.java | 138 ++ .../models/LicenseProfilesListResult.java | 91 + .../hybridcompute/models/LicenseState.java | 47 + .../hybridcompute/models/LicenseTarget.java | 47 + .../hybridcompute/models/LicenseType.java | 44 + .../hybridcompute/models/LicenseUpdate.java | 191 ++ .../hybridcompute/models/Licenses.java | 179 ++ .../models/LicensesListResult.java | 91 + .../hybridcompute/models/LinuxParameters.java | 110 ++ .../hybridcompute/models/Machine.java | 233 ++- .../models/MachineAssessPatchesResult.java | 94 + .../models/MachineExtension.java | 120 +- .../models/MachineExtensionProperties.java | 45 +- .../models/MachineExtensionUpdate.java | 214 +- .../models/MachineExtensionUpgrade.java | 63 + .../MachineInstallPatchesParameters.java | 152 ++ .../models/MachineInstallPatchesResult.java | 132 ++ .../models/MachineProperties.java | 386 +--- .../models/MachineRunCommand.java | 483 +++++ .../models/MachineRunCommandInstanceView.java | 237 +++ .../models/MachineRunCommandScriptSource.java | 147 ++ .../models/MachineRunCommandUpdate.java | 33 + .../models/MachineRunCommands.java | 143 ++ .../models/MachineRunCommandsListResult.java | 84 + .../hybridcompute/models/MachineUpdate.java | 182 +- .../hybridcompute/models/Machines.java | 61 +- .../models/NetworkInterface.java | 54 + .../hybridcompute/models/NetworkProfile.java | 25 + .../hybridcompute/models/NetworkProfiles.java | 36 + .../hybridcompute/models/OSProfile.java | 62 +- .../models/OSProfileLinuxConfiguration.java | 89 + .../models/OSProfileWindowsConfiguration.java | 89 + .../hybridcompute/models/OperationValue.java | 7 + .../hybridcompute/models/OsType.java | 47 + .../hybridcompute/models/PatchModeTypes.java | 53 + .../models/PatchOperationStartedBy.java | 47 + .../models/PatchOperationStatus.java | 59 + .../models/PatchServiceUsed.java | 59 + .../models/PrivateEndpointConnection.java | 9 +- .../PrivateEndpointConnectionDataModel.java | 98 + .../PrivateEndpointConnectionProperties.java | 16 + .../models/PrivateLinkResource.java | 2 +- .../models/ProvisioningState.java | 65 + .../models/ResourceProviders.java | 40 + .../models/RunCommandInputParameter.java | 89 + .../models/RunCommandManagedIdentity.java | 88 + .../hybridcompute/models/ServiceStatus.java | 76 + .../hybridcompute/models/ServiceStatuses.java | 84 + .../hybridcompute/models/Subnet.java | 50 + .../VMGuestPatchClassificationLinux.java | 50 + .../VMGuestPatchClassificationWindows.java | 65 + .../models/VMGuestPatchRebootSetting.java | 50 + .../models/VMGuestPatchRebootStatus.java | 59 + .../models/WindowsParameters.java | 163 ++ .../generated/AgentVersionGetSamples.java | 20 + .../generated/AgentVersionListSamples.java | 20 + .../ExtensionMetadataGetSamples.java | 27 + .../ExtensionMetadataListSamples.java | 22 + .../HybridIdentityMetadataGetSamples.java | 22 + ...IdentityMetadataListByMachinesSamples.java | 21 + .../LicenseProfilesCreateOrUpdateSamples.java | 27 + .../LicenseProfilesDeleteSamples.java | 20 + .../generated/LicenseProfilesGetSamples.java | 20 + .../generated/LicenseProfilesListSamples.java | 20 + .../LicenseProfilesUpdateSamples.java | 27 + .../LicensesCreateOrUpdateSamples.java | 40 + .../generated/LicensesDeleteSamples.java | 20 + .../LicensesGetByResourceGroupSamples.java | 22 + .../LicensesListByResourceGroupSamples.java | 20 + .../generated/LicensesListSamples.java | 21 + .../generated/LicensesUpdateSamples.java | 40 + .../LicensesValidateLicenseSamples.java | 41 + ...achineExtensionsCreateOrUpdateSamples.java | 31 +- .../MachineExtensionsDeleteSamples.java | 2 +- .../MachineExtensionsGetSamples.java | 2 +- .../MachineExtensionsListSamples.java | 7 +- .../MachineExtensionsUpdateSamples.java | 41 +- ...chineRunCommandsCreateOrUpdateSamples.java | 43 + .../MachineRunCommandsDeleteSamples.java | 22 + .../MachineRunCommandsGetSamples.java | 22 + .../MachineRunCommandsListSamples.java | 20 + .../MachineRunCommandsUpdateSamples.java | 41 + .../MachinesAssessPatchesSamples.java | 21 + .../generated/MachinesDeleteSamples.java | 2 +- .../MachinesGetByResourceGroupSamples.java | 20 +- .../MachinesInstallPatchesSamples.java | 44 + .../MachinesListByResourceGroupSamples.java | 4 +- .../generated/MachinesListSamples.java | 2 +- .../generated/NetworkProfileGetSamples.java | 20 + .../generated/OperationsListSamples.java | 21 + ...pointConnectionsCreateOrUpdateSamples.java | 2 +- ...ivateEndpointConnectionsDeleteSamples.java | 2 +- .../PrivateEndpointConnectionsGetSamples.java | 2 +- ...nectionsListByPrivateLinkScopeSamples.java | 2 +- .../PrivateLinkResourcesGetSamples.java | 2 +- ...esourcesListByPrivateLinkScopeSamples.java | 2 +- ...rivateLinkScopesCreateOrUpdateSamples.java | 5 +- .../PrivateLinkScopesDeleteSamples.java | 2 +- ...teLinkScopesGetByResourceGroupSamples.java | 2 +- ...GetValidationDetailsForMachineSamples.java | 2 +- ...LinkScopesGetValidationDetailsSamples.java | 2 +- ...eLinkScopesListByResourceGroupSamples.java | 2 +- .../PrivateLinkScopesListSamples.java | 2 +- .../PrivateLinkScopesUpdateTagsSamples.java | 3 +- ...ourceProviderUpgradeExtensionsSamples.java | 49 + .../generated/ConnectionDetailTests.java | 25 - ...bridComputePrivateLinkScopeInnerTests.java | 54 - ...omputePrivateLinkScopeListResultTests.java | 92 - ...omputePrivateLinkScopePropertiesTests.java | 30 - .../generated/IdentityTests.java | 29 - .../generated/LocationDataTests.java | 39 - .../generated/MachineExtensionInnerTests.java | 87 - ...MachineExtensionUpdatePropertiesTests.java | 44 - .../MachineExtensionUpdateTests.java | 63 - ...hineExtensionsCreateOrUpdateMockTests.java | 120 -- .../MachineExtensionsDeleteMockTests.java | 61 - ...ineExtensionsGetWithResponseMockTests.java | 79 - .../MachineExtensionsListMockTests.java | 77 - .../MachineExtensionsListResultTests.java | 117 -- .../MachineUpdatePropertiesTests.java | 48 - .../generated/MachineUpdateTests.java | 81 - ...eByResourceGroupWithResponseMockTests.java | 61 - .../generated/OSProfileTests.java | 21 - .../generated/OperationListResultTests.java | 25 - .../generated/OperationValueDisplayTests.java | 25 - .../generated/OperationValueInnerTests.java | 26 - .../PrivateEndpointConnectionInnerTests.java | 43 - ...vateEndpointConnectionListResultTests.java | 25 - ...vateEndpointConnectionPropertiesTests.java | 38 - ...intConnectionsCreateOrUpdateMockTests.java | 84 - ...ateEndpointConnectionsDeleteMockTests.java | 63 - ...ntConnectionsGetWithResponseMockTests.java | 73 - ...ctionsListByPrivateLinkScopeMockTests.java | 75 - .../PrivateEndpointPropertyTests.java | 25 - .../PrivateLinkResourceInnerTests.java | 27 - .../PrivateLinkResourceListResultTests.java | 25 - .../PrivateLinkResourcePropertiesTests.java | 25 - ...LinkResourcesGetWithResponseMockTests.java | 67 - ...ourcesListByPrivateLinkScopeMockTests.java | 65 - ...eLinkScopeValidationDetailsInnerTests.java | 34 - ...esCreateOrUpdateWithResponseMockTests.java | 93 - .../PrivateLinkScopesDeleteMockTests.java | 61 - ...tByResourceGroupWithResponseMockTests.java | 73 - ...etailsForMachineWithResponseMockTests.java | 71 - ...alidationDetailsWithResponseMockTests.java | 71 - ...inkScopesListByResourceGroupMockTests.java | 73 - .../PrivateLinkScopesListMockTests.java | 73 - .../PrivateLinkScopesResourceTests.java | 46 - ...nkServiceConnectionStatePropertyTests.java | 30 - .../generated/ResourceUpdateTests.java | 43 - .../generated/TagsResourceTests.java | 37 - 278 files changed, 25845 insertions(+), 3109 deletions(-) create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/AgentVersionsClient.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/ExtensionMetadatasClient.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/HybridIdentityMetadatasClient.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/LicenseProfilesClient.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/LicensesClient.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/MachineRunCommandsClient.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/NetworkProfilesClient.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/ResourceProvidersClient.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/AgentVersionInner.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/AgentVersionsListInner.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/EsuProfileUpdateProperties.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/ExtensionValueInner.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/ExtensionValueProperties.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/HybridIdentityMetadataInner.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/HybridIdentityMetadataProperties.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/LicenseInner.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/LicenseProfileArmEsuProperties.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/LicenseProfileInner.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/LicenseProfileMachineInstanceViewEsuPropertiesInner.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/LicenseProfileMachineInstanceViewInner.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/LicenseProfileProperties.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/LicenseProfileUpdateProperties.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/LicenseProperties.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/LicenseUpdateProperties.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/LicenseUpdatePropertiesLicenseDetails.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineAssessPatchesResultInner.java rename sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/{ => fluent}/models/MachineExtensionUpdateProperties.java (79%) create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineInstallPatchesResultInner.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachinePropertiesInner.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineRunCommandInner.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineRunCommandProperties.java rename sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/{ => fluent}/models/MachineUpdateProperties.java (55%) create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/NetworkProfileInner.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/PatchSettings.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/AgentVersionImpl.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/AgentVersionsClientImpl.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/AgentVersionsImpl.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/AgentVersionsListImpl.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/ExtensionMetadatasClientImpl.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/ExtensionMetadatasImpl.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/ExtensionValueImpl.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/HybridIdentityMetadataImpl.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/HybridIdentityMetadatasClientImpl.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/HybridIdentityMetadatasImpl.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/LicenseImpl.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/LicenseProfileImpl.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/LicenseProfileMachineInstanceViewEsuPropertiesImpl.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/LicenseProfileMachineInstanceViewImpl.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/LicenseProfilesClientImpl.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/LicenseProfilesImpl.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/LicensesClientImpl.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/LicensesImpl.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachineAssessPatchesResultImpl.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachineInstallPatchesResultImpl.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachinePropertiesImpl.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachineRunCommandImpl.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachineRunCommandsClientImpl.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachineRunCommandsImpl.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/NetworkProfileImpl.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/NetworkProfilesClientImpl.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/NetworkProfilesImpl.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/ResourceProvidersClientImpl.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/ResourceProvidersImpl.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/AgentConfiguration.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/AgentConfigurationMode.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/AgentUpgrade.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/AgentVersion.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/AgentVersions.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/AgentVersionsList.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ArcKindEnum.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/AssessmentModeTypes.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/AvailablePatchCountByClassification.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/CloudMetadata.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ConfigurationExtension.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/EsuEligibility.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/EsuKey.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/EsuKeyState.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/EsuServerType.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ExecutionState.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ExtensionMetadatas.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ExtensionTargetProperties.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ExtensionValue.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ExtensionValueListResult.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ExtensionsResourceStatus.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ExtensionsStatusLevelTypes.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/HybridIdentityMetadata.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/HybridIdentityMetadataList.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/HybridIdentityMetadatas.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/IpAddress.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LastAttemptStatusEnum.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/License.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicenseAssignmentState.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicenseCoreType.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicenseDetails.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicenseEdition.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicenseProfile.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicenseProfileArmEsuPropertiesWithoutAssignedLicense.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicenseProfileMachineInstanceView.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicenseProfileMachineInstanceViewEsuProperties.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicenseProfileStorageModelEsuProperties.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicenseProfileUpdate.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicenseProfiles.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicenseProfilesListResult.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicenseState.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicenseTarget.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicenseType.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicenseUpdate.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/Licenses.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicensesListResult.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LinuxParameters.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineAssessPatchesResult.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtensionUpgrade.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineInstallPatchesParameters.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineInstallPatchesResult.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineRunCommand.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineRunCommandInstanceView.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineRunCommandScriptSource.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineRunCommandUpdate.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineRunCommands.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineRunCommandsListResult.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/NetworkInterface.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/NetworkProfile.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/NetworkProfiles.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/OSProfileLinuxConfiguration.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/OSProfileWindowsConfiguration.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/OsType.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PatchModeTypes.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PatchOperationStartedBy.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PatchOperationStatus.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PatchServiceUsed.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateEndpointConnectionDataModel.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ProvisioningState.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ResourceProviders.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/RunCommandInputParameter.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/RunCommandManagedIdentity.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ServiceStatus.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ServiceStatuses.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/Subnet.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/VMGuestPatchClassificationLinux.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/VMGuestPatchClassificationWindows.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/VMGuestPatchRebootSetting.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/VMGuestPatchRebootStatus.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/WindowsParameters.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/AgentVersionGetSamples.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/AgentVersionListSamples.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/ExtensionMetadataGetSamples.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/ExtensionMetadataListSamples.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/HybridIdentityMetadataGetSamples.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/HybridIdentityMetadataListByMachinesSamples.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/LicenseProfilesCreateOrUpdateSamples.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/LicenseProfilesDeleteSamples.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/LicenseProfilesGetSamples.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/LicenseProfilesListSamples.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/LicenseProfilesUpdateSamples.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/LicensesCreateOrUpdateSamples.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/LicensesDeleteSamples.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/LicensesGetByResourceGroupSamples.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/LicensesListByResourceGroupSamples.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/LicensesListSamples.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/LicensesUpdateSamples.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/LicensesValidateLicenseSamples.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineRunCommandsCreateOrUpdateSamples.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineRunCommandsDeleteSamples.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineRunCommandsGetSamples.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineRunCommandsListSamples.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineRunCommandsUpdateSamples.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachinesAssessPatchesSamples.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachinesInstallPatchesSamples.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/NetworkProfileGetSamples.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/OperationsListSamples.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/ResourceProviderUpgradeExtensionsSamples.java delete mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/ConnectionDetailTests.java delete mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/HybridComputePrivateLinkScopeInnerTests.java delete mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/HybridComputePrivateLinkScopeListResultTests.java delete mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/HybridComputePrivateLinkScopePropertiesTests.java delete mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/IdentityTests.java delete mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/LocationDataTests.java delete mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionInnerTests.java delete mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionUpdatePropertiesTests.java delete mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionUpdateTests.java delete mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsCreateOrUpdateMockTests.java delete mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsDeleteMockTests.java delete mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsGetWithResponseMockTests.java delete mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsListMockTests.java delete mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsListResultTests.java delete mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineUpdatePropertiesTests.java delete mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineUpdateTests.java delete mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachinesDeleteByResourceGroupWithResponseMockTests.java delete mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/OSProfileTests.java delete mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/OperationListResultTests.java delete mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/OperationValueDisplayTests.java delete mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/OperationValueInnerTests.java delete mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionInnerTests.java delete mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionListResultTests.java delete mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionPropertiesTests.java delete mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsCreateOrUpdateMockTests.java delete mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsDeleteMockTests.java delete mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java delete mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsListByPrivateLinkScopeMockTests.java delete mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointPropertyTests.java delete mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkResourceInnerTests.java delete mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkResourceListResultTests.java delete mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkResourcePropertiesTests.java delete mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkResourcesGetWithResponseMockTests.java delete mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkResourcesListByPrivateLinkScopeMockTests.java delete mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopeValidationDetailsInnerTests.java delete mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesCreateOrUpdateWithResponseMockTests.java delete mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesDeleteMockTests.java delete mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesGetByResourceGroupWithResponseMockTests.java delete mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesGetValidationDetailsForMachineWithResponseMockTests.java delete mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesGetValidationDetailsWithResponseMockTests.java delete mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesListByResourceGroupMockTests.java delete mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesListMockTests.java delete mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesResourceTests.java delete mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkServiceConnectionStatePropertyTests.java delete mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/ResourceUpdateTests.java delete mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/TagsResourceTests.java diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/CHANGELOG.md b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/CHANGELOG.md index 94b29cf68cccd..9fe68d762f2d5 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/CHANGELOG.md +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.0.0-beta.3 (Unreleased) +## 1.0.0-beta.1 (2023-10-03) + +- Azure Resource Manager HybridCompute client library for Java. This package contains Microsoft Azure SDK for HybridCompute Management SDK. The Hybrid Compute Management Client. Package tag package-preview-2023-10. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/README.md b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/README.md index ab533a0ade0c5..a24e367addbac 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/README.md +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/README.md @@ -2,7 +2,7 @@ Azure Resource Manager HybridCompute client library for Java. -This package contains Microsoft Azure SDK for HybridCompute Management SDK. The Hybrid Compute Management Client. Package tag package-preview-2021-03. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for HybridCompute Management SDK. The Hybrid Compute Management Client. Package tag package-preview-2023-10. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-hybridcompute - 1.0.0-beta.2 + 1.0.0-beta.3 ``` [//]: # ({x-version-update-end}) @@ -103,3 +103,5 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fhybridcompute%2Fazure-resourcemanager-hybridcompute%2FREADME.png) diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/SAMPLE.md b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/SAMPLE.md index d138f23c8c8fb..6b417e9d4e06a 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/SAMPLE.md +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/SAMPLE.md @@ -1,6 +1,39 @@ # Code snippets and samples +## AgentVersion + +- [Get](#agentversion_get) +- [List](#agentversion_list) + +## ExtensionMetadata + +- [Get](#extensionmetadata_get) +- [List](#extensionmetadata_list) + +## HybridIdentityMetadata + +- [Get](#hybrididentitymetadata_get) +- [ListByMachines](#hybrididentitymetadata_listbymachines) + +## LicenseProfiles + +- [CreateOrUpdate](#licenseprofiles_createorupdate) +- [Delete](#licenseprofiles_delete) +- [Get](#licenseprofiles_get) +- [List](#licenseprofiles_list) +- [Update](#licenseprofiles_update) + +## Licenses + +- [CreateOrUpdate](#licenses_createorupdate) +- [Delete](#licenses_delete) +- [GetByResourceGroup](#licenses_getbyresourcegroup) +- [List](#licenses_list) +- [ListByResourceGroup](#licenses_listbyresourcegroup) +- [Update](#licenses_update) +- [ValidateLicense](#licenses_validatelicense) + ## MachineExtensions - [CreateOrUpdate](#machineextensions_createorupdate) @@ -9,13 +42,31 @@ - [List](#machineextensions_list) - [Update](#machineextensions_update) +## MachineRunCommands + +- [CreateOrUpdate](#machineruncommands_createorupdate) +- [Delete](#machineruncommands_delete) +- [Get](#machineruncommands_get) +- [List](#machineruncommands_list) +- [Update](#machineruncommands_update) + ## Machines +- [AssessPatches](#machines_assesspatches) - [Delete](#machines_delete) - [GetByResourceGroup](#machines_getbyresourcegroup) +- [InstallPatches](#machines_installpatches) - [List](#machines_list) - [ListByResourceGroup](#machines_listbyresourcegroup) +## NetworkProfile + +- [Get](#networkprofile_get) + +## Operations + +- [List](#operations_list) + ## PrivateEndpointConnections - [CreateOrUpdate](#privateendpointconnections_createorupdate) @@ -38,18 +89,453 @@ - [List](#privatelinkscopes_list) - [ListByResourceGroup](#privatelinkscopes_listbyresourcegroup) - [UpdateTags](#privatelinkscopes_updatetags) + +## ResourceProvider + +- [UpgradeExtensions](#resourceprovider_upgradeextensions) +### AgentVersion_Get + +```java +/** Samples for AgentVersion Get. */ +public final class AgentVersionGetSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/AgentVersion_GetLatest.json + */ + /** + * Sample code: GET Agent Versions. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void gETAgentVersions(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager.agentVersions().getWithResponse("myOsType", "1.27", com.azure.core.util.Context.NONE); + } +} +``` + +### AgentVersion_List + +```java +/** Samples for AgentVersion List. */ +public final class AgentVersionListSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/AgentVersions_Get.json + */ + /** + * Sample code: GET Agent Versions. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void gETAgentVersions(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager.agentVersions().listWithResponse("myOsType", com.azure.core.util.Context.NONE); + } +} +``` + +### ExtensionMetadata_Get + +```java +/** Samples for ExtensionMetadata Get. */ +public final class ExtensionMetadataGetSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/extension/ExtensionMetadata_Get.json + */ + /** + * Sample code: GET an extensions metadata. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void gETAnExtensionsMetadata(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager + .extensionMetadatas() + .getWithResponse( + "EastUS", + "microsoft.azure.monitor", + "azuremonitorlinuxagent", + "1.9.1", + com.azure.core.util.Context.NONE); + } +} +``` + +### ExtensionMetadata_List + +```java +/** Samples for ExtensionMetadata List. */ +public final class ExtensionMetadataListSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/extension/ExtensionMetadata_List.json + */ + /** + * Sample code: GET a list of extensions. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void gETAListOfExtensions(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager + .extensionMetadatas() + .list("EastUS", "microsoft.azure.monitor", "azuremonitorlinuxagent", com.azure.core.util.Context.NONE); + } +} +``` + +### HybridIdentityMetadata_Get + +```java +/** Samples for HybridIdentityMetadata Get. */ +public final class HybridIdentityMetadataGetSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/HybridIdentityMetadata_Get.json + */ + /** + * Sample code: GetHybridIdentityMetadata. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void getHybridIdentityMetadata(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager + .hybridIdentityMetadatas() + .getWithResponse("testrg", "ContosoVm", "default", com.azure.core.util.Context.NONE); + } +} +``` + +### HybridIdentityMetadata_ListByMachines + +```java +/** Samples for HybridIdentityMetadata ListByMachines. */ +public final class HybridIdentityMetadataListByMachinesSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/HybridIdentityMetadata_ListByVirtualMachines.json + */ + /** + * Sample code: HybridIdentityMetadataListByVirtualMachines. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void hybridIdentityMetadataListByVirtualMachines( + com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager.hybridIdentityMetadatas().listByMachines("testrg", "ContosoVm", com.azure.core.util.Context.NONE); + } +} +``` + +### LicenseProfiles_CreateOrUpdate + +```java +/** Samples for LicenseProfiles CreateOrUpdate. */ +public final class LicenseProfilesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/licenseProfile/LicenseProfile_CreateOrUpdate.json + */ + /** + * Sample code: Create or Update a License Profile. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void createOrUpdateALicenseProfile( + com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager + .licenseProfiles() + .define() + .withRegion("eastus2euap") + .withExistingMachine("myResourceGroup", "myMachine") + .withAssignedLicense("{LicenseResourceId}") + .create(); + } +} +``` + +### LicenseProfiles_Delete + +```java +/** Samples for LicenseProfiles Delete. */ +public final class LicenseProfilesDeleteSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/licenseProfile/LicenseProfile_Delete.json + */ + /** + * Sample code: Delete a License Profile. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void deleteALicenseProfile(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager.licenseProfiles().delete("myResourceGroup", "myMachine", com.azure.core.util.Context.NONE); + } +} +``` + +### LicenseProfiles_Get + +```java +/** Samples for LicenseProfiles Get. */ +public final class LicenseProfilesGetSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/licenseProfile/LicenseProfile_Get.json + */ + /** + * Sample code: Get License Profile. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void getLicenseProfile(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager.licenseProfiles().getWithResponse("myResourceGroup", "myMachine", com.azure.core.util.Context.NONE); + } +} +``` + +### LicenseProfiles_List + +```java +/** Samples for LicenseProfiles List. */ +public final class LicenseProfilesListSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/licenseProfile/LicenseProfile_List.json + */ + /** + * Sample code: List all License Profiles. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void listAllLicenseProfiles(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager.licenseProfiles().list("myResourceGroup", "myMachine", com.azure.core.util.Context.NONE); + } +} +``` + +### LicenseProfiles_Update + +```java +import com.azure.resourcemanager.hybridcompute.models.LicenseProfile; + +/** Samples for LicenseProfiles Update. */ +public final class LicenseProfilesUpdateSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/licenseProfile/LicenseProfile_Update.json + */ + /** + * Sample code: Update a License Profile. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void updateALicenseProfile(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + LicenseProfile resource = + manager + .licenseProfiles() + .getWithResponse("myResourceGroup", "myMachine", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withAssignedLicense("{LicenseResourceId}").apply(); + } +} +``` + +### Licenses_CreateOrUpdate + +```java +import com.azure.resourcemanager.hybridcompute.models.LicenseCoreType; +import com.azure.resourcemanager.hybridcompute.models.LicenseDetails; +import com.azure.resourcemanager.hybridcompute.models.LicenseEdition; +import com.azure.resourcemanager.hybridcompute.models.LicenseState; +import com.azure.resourcemanager.hybridcompute.models.LicenseTarget; +import com.azure.resourcemanager.hybridcompute.models.LicenseType; + +/** Samples for Licenses CreateOrUpdate. */ +public final class LicensesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/license/License_CreateOrUpdate.json + */ + /** + * Sample code: Create or Update a License. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void createOrUpdateALicense(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager + .licenses() + .define("{licenseName}") + .withRegion("eastus2euap") + .withExistingResourceGroup("myResourceGroup") + .withLicenseType(LicenseType.ESU) + .withLicenseDetails( + new LicenseDetails() + .withState(LicenseState.ACTIVATED) + .withTarget(LicenseTarget.WINDOWS_SERVER_2012) + .withEdition(LicenseEdition.DATACENTER) + .withType(LicenseCoreType.P_CORE) + .withProcessors(6)) + .create(); + } +} +``` + +### Licenses_Delete + +```java +/** Samples for Licenses Delete. */ +public final class LicensesDeleteSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/license/License_Delete.json + */ + /** + * Sample code: Delete a License. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void deleteALicense(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager.licenses().delete("myResourceGroup", "{licenseName}", com.azure.core.util.Context.NONE); + } +} +``` + +### Licenses_GetByResourceGroup + +```java +/** Samples for Licenses GetByResourceGroup. */ +public final class LicensesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/license/License_Get.json + */ + /** + * Sample code: Get License. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void getLicense(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager + .licenses() + .getByResourceGroupWithResponse("myResourceGroup", "{licenseName}", com.azure.core.util.Context.NONE); + } +} +``` + +### Licenses_List + +```java +/** Samples for Licenses List. */ +public final class LicensesListSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/license/License_ListBySubscription.json + */ + /** + * Sample code: List Licenses by Subscription. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void listLicensesBySubscription( + com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager.licenses().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Licenses_ListByResourceGroup + +```java +/** Samples for Licenses ListByResourceGroup. */ +public final class LicensesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/license/License_ListByResourceGroup.json + */ + /** + * Sample code: GET all Machine Extensions. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void gETAllMachineExtensions(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager.licenses().listByResourceGroup("myResourceGroup", com.azure.core.util.Context.NONE); + } +} +``` + +### Licenses_Update + +```java +import com.azure.resourcemanager.hybridcompute.models.License; +import com.azure.resourcemanager.hybridcompute.models.LicenseCoreType; +import com.azure.resourcemanager.hybridcompute.models.LicenseEdition; +import com.azure.resourcemanager.hybridcompute.models.LicenseState; +import com.azure.resourcemanager.hybridcompute.models.LicenseTarget; +import com.azure.resourcemanager.hybridcompute.models.LicenseType; + +/** Samples for Licenses Update. */ +public final class LicensesUpdateSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/license/License_Update.json + */ + /** + * Sample code: Update a License. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void updateALicense(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + License resource = + manager + .licenses() + .getByResourceGroupWithResponse("myResourceGroup", "{licenseName}", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withLicenseType(LicenseType.ESU) + .withState(LicenseState.ACTIVATED) + .withTarget(LicenseTarget.WINDOWS_SERVER_2012) + .withEdition(LicenseEdition.DATACENTER) + .withType(LicenseCoreType.P_CORE) + .withProcessors(6) + .apply(); + } +} +``` + +### Licenses_ValidateLicense + +```java +import com.azure.resourcemanager.hybridcompute.fluent.models.LicenseInner; +import com.azure.resourcemanager.hybridcompute.models.LicenseCoreType; +import com.azure.resourcemanager.hybridcompute.models.LicenseDetails; +import com.azure.resourcemanager.hybridcompute.models.LicenseEdition; +import com.azure.resourcemanager.hybridcompute.models.LicenseState; +import com.azure.resourcemanager.hybridcompute.models.LicenseTarget; +import com.azure.resourcemanager.hybridcompute.models.LicenseType; + +/** Samples for Licenses ValidateLicense. */ +public final class LicensesValidateLicenseSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/license/License_ValidateLicense.json + */ + /** + * Sample code: Validate a License. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void validateALicense(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager + .licenses() + .validateLicense( + new LicenseInner() + .withLocation("eastus2euap") + .withLicenseType(LicenseType.ESU) + .withLicenseDetails( + new LicenseDetails() + .withState(LicenseState.ACTIVATED) + .withTarget(LicenseTarget.WINDOWS_SERVER_2012) + .withEdition(LicenseEdition.DATACENTER) + .withType(LicenseCoreType.P_CORE) + .withProcessors(6)), + com.azure.core.util.Context.NONE); + } +} +``` + ### MachineExtensions_CreateOrUpdate ```java -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.hybridcompute.models.MachineExtensionProperties; -import java.io.IOException; +import java.util.HashMap; +import java.util.Map; /** Samples for MachineExtensions CreateOrUpdate. */ public final class MachineExtensionsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/PUTExtension.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/extension/Extension_CreateOrUpdate.json */ /** * Sample code: Create or Update a Machine Extension. @@ -57,7 +543,7 @@ public final class MachineExtensionsCreateOrUpdateSamples { * @param manager Entry point to HybridComputeManager. */ public static void createOrUpdateAMachineExtension( - com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) throws IOException { + com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { manager .machineExtensions() .define("CustomScriptExtension") @@ -69,15 +555,23 @@ public final class MachineExtensionsCreateOrUpdateSamples { .withType("CustomScriptExtension") .withTypeHandlerVersion("1.10") .withSettings( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize( - "{\"commandToExecute\":\"powershell.exe -c \\\"Get-Process | Where-Object { $_.CPU -gt" - + " 10000 }\\\"\"}", - Object.class, - SerializerEncoding.JSON))) + mapOf( + "commandToExecute", + "powershell.exe -c \"Get-Process | Where-Object { $_.CPU -gt 10000 }\""))) .create(); } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } } ``` @@ -87,7 +581,7 @@ public final class MachineExtensionsCreateOrUpdateSamples { /** Samples for MachineExtensions Delete. */ public final class MachineExtensionsDeleteSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/DELETEExtension.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/extension/Extension_Delete.json */ /** * Sample code: Delete a Machine Extension. @@ -106,7 +600,7 @@ public final class MachineExtensionsDeleteSamples { /** Samples for MachineExtensions Get. */ public final class MachineExtensionsGetSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/GETExtension.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/extension/Extension_Get.json */ /** * Sample code: GET Machine Extension. @@ -127,14 +621,15 @@ public final class MachineExtensionsGetSamples { /** Samples for MachineExtensions List. */ public final class MachineExtensionsListSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/LISTExtension.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/extension/Extension_List.json */ /** - * Sample code: GET all Machine Extensions. + * Sample code: GET all Machine Extensions - List. * * @param manager Entry point to HybridComputeManager. */ - public static void gETAllMachineExtensions(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + public static void gETAllMachineExtensionsList( + com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { manager.machineExtensions().list("myResourceGroup", "myMachine", null, com.azure.core.util.Context.NONE); } } @@ -143,16 +638,14 @@ public final class MachineExtensionsListSamples { ### MachineExtensions_Update ```java -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.hybridcompute.models.MachineExtension; -import com.azure.resourcemanager.hybridcompute.models.MachineExtensionUpdateProperties; -import java.io.IOException; +import java.util.HashMap; +import java.util.Map; /** Samples for MachineExtensions Update. */ public final class MachineExtensionsUpdateSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/UpdateExtension.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/extension/Extension_Update.json */ /** * Sample code: Create or Update a Machine Extension. @@ -160,7 +653,7 @@ public final class MachineExtensionsUpdateSamples { * @param manager Entry point to HybridComputeManager. */ public static void createOrUpdateAMachineExtension( - com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) throws IOException { + com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { MachineExtension resource = manager .machineExtensions() @@ -169,21 +662,189 @@ public final class MachineExtensionsUpdateSamples { .getValue(); resource .update() - .withProperties( - new MachineExtensionUpdateProperties() - .withPublisher("Microsoft.Compute") - .withType("CustomScriptExtension") - .withTypeHandlerVersion("1.10") - .withSettings( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize( - "{\"commandToExecute\":\"powershell.exe -c \\\"Get-Process | Where-Object { $_.CPU -lt" - + " 100 }\\\"\"}", - Object.class, - SerializerEncoding.JSON))) + .withPublisher("Microsoft.Compute") + .withType("CustomScriptExtension") + .withTypeHandlerVersion("1.10") + .withEnableAutomaticUpgrade(true) + .withSettings( + mapOf("commandToExecute", "powershell.exe -c \"Get-Process | Where-Object { $_.CPU -lt 100 }\"")) .apply(); } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### MachineRunCommands_CreateOrUpdate + +```java +import com.azure.resourcemanager.hybridcompute.models.MachineRunCommandScriptSource; +import com.azure.resourcemanager.hybridcompute.models.RunCommandInputParameter; +import java.util.Arrays; + +/** Samples for MachineRunCommands CreateOrUpdate. */ +public final class MachineRunCommandsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/runCommand/RunCommands_CreateOrUpdate.json + */ + /** + * Sample code: Create or Update a Run Command. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void createOrUpdateARunCommand(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager + .machineRunCommands() + .define("myRunCommand") + .withRegion("eastus2") + .withExistingMachine("myResourceGroup", "myMachine") + .withSource(new MachineRunCommandScriptSource().withScript("Write-Host Hello World!")) + .withParameters( + Arrays + .asList( + new RunCommandInputParameter().withName("param1").withValue("value1"), + new RunCommandInputParameter().withName("param2").withValue("value2"))) + .withAsyncExecution(false) + .withRunAsUser("user1") + .withRunAsPassword("") + .withTimeoutInSeconds(3600) + .withOutputBlobUri( + "https://mystorageaccount.blob.core.windows.net/myscriptoutputcontainer/MyScriptoutput.txt") + .withErrorBlobUri( + "https://mystorageaccount.blob.core.windows.net/mycontainer/MyScriptError.txt?sp=racw&st=2022-10-07T19:40:21Z&se=2022-10-08T03:40:21Z&spr=https&sv=2021-06-08&sr=b&sig=Yh7B%2Fy83olbYBdfsfbUREvd7ol8Dq5EVP3lAO4Kj4xDcN8%3D") + .create(); + } +} +``` + +### MachineRunCommands_Delete + +```java +/** Samples for MachineRunCommands Delete. */ +public final class MachineRunCommandsDeleteSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/runCommand/RunCommands_Delete.json + */ + /** + * Sample code: Delete a Machine Run Command. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void deleteAMachineRunCommand(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager + .machineRunCommands() + .delete("myResourceGroup", "myMachine", "myRunCommand", com.azure.core.util.Context.NONE); + } +} +``` + +### MachineRunCommands_Get + +```java +/** Samples for MachineRunCommands Get. */ +public final class MachineRunCommandsGetSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/runCommand/RunCommands_Get.json + */ + /** + * Sample code: Get a Run Command. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void getARunCommand(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager + .machineRunCommands() + .getWithResponse("myResourceGroup", "myMachine", "myRunCommand", com.azure.core.util.Context.NONE); + } +} +``` + +### MachineRunCommands_List + +```java +/** Samples for MachineRunCommands List. */ +public final class MachineRunCommandsListSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/runCommand/RunCommands_List.json + */ + /** + * Sample code: GET all Machine Run Commands. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void gETAllMachineRunCommands(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager.machineRunCommands().list("myResourceGroup", "myMachine", null, com.azure.core.util.Context.NONE); + } +} +``` + +### MachineRunCommands_Update + +```java +import com.azure.resourcemanager.hybridcompute.models.MachineRunCommand; +import java.util.HashMap; +import java.util.Map; + +/** Samples for MachineRunCommands Update. */ +public final class MachineRunCommandsUpdateSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/runCommand/RunCommands_Update.json + */ + /** + * Sample code: Update a Run Command. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void updateARunCommand(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + MachineRunCommand resource = + manager + .machineRunCommands() + .getWithResponse("myResourceGroup", "myMachine", "myRunCommand", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Machines_AssessPatches + +```java +/** Samples for Machines AssessPatches. */ +public final class MachinesAssessPatchesSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/machine/Machine_AssessPatches.json + */ + /** + * Sample code: Assess patch state of a machine. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void assessPatchStateOfAMachine( + com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager.machines().assessPatches("myResourceGroupName", "myMachineName", com.azure.core.util.Context.NONE); + } } ``` @@ -193,7 +854,7 @@ public final class MachineExtensionsUpdateSamples { /** Samples for Machines Delete. */ public final class MachinesDeleteSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/Machines_Delete.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/machine/Machines_Delete.json */ /** * Sample code: Delete a Machine. @@ -211,10 +872,28 @@ public final class MachinesDeleteSamples { ### Machines_GetByResourceGroup ```java +import com.azure.resourcemanager.hybridcompute.models.InstanceViewTypes; + /** Samples for Machines GetByResourceGroup. */ public final class MachinesGetByResourceGroupSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/Machines_Get.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/machine/Machines_Get_LicenseProfileInstanceView.json + */ + /** + * Sample code: Get Machine with License Profile Instance View. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void getMachineWithLicenseProfileInstanceView( + com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager + .machines() + .getByResourceGroupWithResponse( + "myResourceGroup", "myMachine", InstanceViewTypes.INSTANCE_VIEW, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/machine/Machines_Get.json */ /** * Sample code: Get Machine. @@ -229,13 +908,56 @@ public final class MachinesGetByResourceGroupSamples { } ``` +### Machines_InstallPatches + +```java +import com.azure.resourcemanager.hybridcompute.models.MachineInstallPatchesParameters; +import com.azure.resourcemanager.hybridcompute.models.VMGuestPatchClassificationWindows; +import com.azure.resourcemanager.hybridcompute.models.VMGuestPatchRebootSetting; +import com.azure.resourcemanager.hybridcompute.models.WindowsParameters; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** Samples for Machines InstallPatches. */ +public final class MachinesInstallPatchesSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/machine/Machine_InstallPatches.json + */ + /** + * Sample code: Install patch state of a machine. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void installPatchStateOfAMachine( + com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager + .machines() + .installPatches( + "myResourceGroupName", + "myMachineName", + new MachineInstallPatchesParameters() + .withMaximumDuration("PT4H") + .withRebootSetting(VMGuestPatchRebootSetting.IF_REQUIRED) + .withWindowsParameters( + new WindowsParameters() + .withClassificationsToInclude( + Arrays + .asList( + VMGuestPatchClassificationWindows.CRITICAL, + VMGuestPatchClassificationWindows.SECURITY)) + .withMaxPatchPublishDate(OffsetDateTime.parse("2021-08-19T02:36:43.0539904+00:00"))), + com.azure.core.util.Context.NONE); + } +} +``` + ### Machines_List ```java /** Samples for Machines List. */ public final class MachinesListSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/Machines_ListBySubscription.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/machine/Machines_ListBySubscription.json */ /** * Sample code: List Machines by resource group. @@ -255,7 +977,7 @@ public final class MachinesListSamples { /** Samples for Machines ListByResourceGroup. */ public final class MachinesListByResourceGroupSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/Machines_ListByResourceGroup.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/machine/Machines_ListByResourceGroup.json */ /** * Sample code: List Machines by resource group. @@ -264,7 +986,46 @@ public final class MachinesListByResourceGroupSamples { */ public static void listMachinesByResourceGroup( com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { - manager.machines().listByResourceGroup("myResourceGroup", com.azure.core.util.Context.NONE); + manager.machines().listByResourceGroup("myResourceGroup", null, com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkProfile_Get + +```java +/** Samples for NetworkProfile Get. */ +public final class NetworkProfileGetSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/NetworkProfile_Get.json + */ + /** + * Sample code: GET Network Profile. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void gETNetworkProfile(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager.networkProfiles().getWithResponse("myResourceGroup", "myMachine", com.azure.core.util.Context.NONE); + } +} +``` + +### Operations_List + +```java +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/Operations_List.json + */ + /** + * Sample code: List Hybrid Compute Provider Operations. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void listHybridComputeProviderOperations( + com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); } } ``` @@ -278,7 +1039,7 @@ import com.azure.resourcemanager.hybridcompute.models.PrivateLinkServiceConnecti /** Samples for PrivateEndpointConnections CreateOrUpdate. */ public final class PrivateEndpointConnectionsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/PrivateEndpointConnectionUpdate.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/privateEndpoint/PrivateEndpointConnection_Update.json */ /** * Sample code: Approve or reject a private endpoint connection with a given name. @@ -308,7 +1069,7 @@ public final class PrivateEndpointConnectionsCreateOrUpdateSamples { /** Samples for PrivateEndpointConnections Delete. */ public final class PrivateEndpointConnectionsDeleteSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/PrivateEndpointConnectionDelete.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/privateEndpoint/PrivateEndpointConnection_Delete.json */ /** * Sample code: Deletes a private endpoint connection with a given name. @@ -334,7 +1095,7 @@ public final class PrivateEndpointConnectionsDeleteSamples { /** Samples for PrivateEndpointConnections Get. */ public final class PrivateEndpointConnectionsGetSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/PrivateEndpointConnectionGet.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/privateEndpoint/PrivateEndpointConnection_Get.json */ /** * Sample code: Gets private endpoint connection. @@ -360,7 +1121,7 @@ public final class PrivateEndpointConnectionsGetSamples { /** Samples for PrivateEndpointConnections ListByPrivateLinkScope. */ public final class PrivateEndpointConnectionsListByPrivateLinkScopeSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/PrivateEndpointConnectionList.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/privateEndpoint/PrivateEndpointConnection_List.json */ /** * Sample code: Gets list of private endpoint connections on a private link scope. @@ -382,7 +1143,7 @@ public final class PrivateEndpointConnectionsListByPrivateLinkScopeSamples { /** Samples for PrivateLinkResources Get. */ public final class PrivateLinkResourcesGetSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/PrivateLinkScopePrivateLinkResourceGet.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/privateLinkScope/PrivateLinkScopePrivateLinkResource_Get.json */ /** * Sample code: Gets private endpoint connection. @@ -405,7 +1166,7 @@ public final class PrivateLinkResourcesGetSamples { /** Samples for PrivateLinkResources ListByPrivateLinkScope. */ public final class PrivateLinkResourcesListByPrivateLinkScopeSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/PrivateLinkScopePrivateLinkResourceListGet.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/privateLinkScope/PrivateLinkScopePrivateLinkResource_ListGet.json */ /** * Sample code: Gets private endpoint connection. @@ -430,7 +1191,7 @@ import java.util.Map; /** Samples for PrivateLinkScopes CreateOrUpdate. */ public final class PrivateLinkScopesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/PrivateLinkScopesCreate.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/privateLinkScope/PrivateLinkScopes_Create.json */ /** * Sample code: PrivateLinkScopeCreate. @@ -447,7 +1208,7 @@ public final class PrivateLinkScopesCreateOrUpdateSamples { } /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/PrivateLinkScopesUpdate.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/privateLinkScope/PrivateLinkScopes_Update.json */ /** * Sample code: PrivateLinkScopeUpdate. @@ -464,6 +1225,7 @@ public final class PrivateLinkScopesCreateOrUpdateSamples { .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -483,7 +1245,7 @@ public final class PrivateLinkScopesCreateOrUpdateSamples { /** Samples for PrivateLinkScopes Delete. */ public final class PrivateLinkScopesDeleteSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/PrivateLinkScopesDelete.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/privateLinkScope/PrivateLinkScopes_Delete.json */ /** * Sample code: PrivateLinkScopesDelete. @@ -504,7 +1266,7 @@ public final class PrivateLinkScopesDeleteSamples { /** Samples for PrivateLinkScopes GetByResourceGroup. */ public final class PrivateLinkScopesGetByResourceGroupSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/PrivateLinkScopesGet.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/privateLinkScope/PrivateLinkScopes_Get.json */ /** * Sample code: PrivateLinkScopeGet. @@ -526,7 +1288,7 @@ public final class PrivateLinkScopesGetByResourceGroupSamples { /** Samples for PrivateLinkScopes GetValidationDetails. */ public final class PrivateLinkScopesGetValidationDetailsSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/PrivateLinkScopesGetValidation.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/privateLinkScope/PrivateLinkScopes_GetValidation.json */ /** * Sample code: PrivateLinkScopeGet. @@ -548,7 +1310,7 @@ public final class PrivateLinkScopesGetValidationDetailsSamples { /** Samples for PrivateLinkScopes GetValidationDetailsForMachine. */ public final class PrivateLinkScopesGetValidationDetailsForMachineSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/PrivateLinkScopesGetValidationForMachine.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/privateLinkScope/PrivateLinkScopes_GetValidationForMachine.json */ /** * Sample code: PrivateLinkScopeGet. @@ -570,7 +1332,7 @@ public final class PrivateLinkScopesGetValidationDetailsForMachineSamples { /** Samples for PrivateLinkScopes List. */ public final class PrivateLinkScopesListSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/PrivateLinkScopesList.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/privateLinkScope/PrivateLinkScopes_List.json */ /** * Sample code: PrivateLinkScopesList.json. @@ -589,7 +1351,7 @@ public final class PrivateLinkScopesListSamples { /** Samples for PrivateLinkScopes ListByResourceGroup. */ public final class PrivateLinkScopesListByResourceGroupSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/PrivateLinkScopesListByResourceGroup.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/privateLinkScope/PrivateLinkScopes_ListByResourceGroup.json */ /** * Sample code: PrivateLinkScopeListByResourceGroup. @@ -613,7 +1375,7 @@ import java.util.Map; /** Samples for PrivateLinkScopes UpdateTags. */ public final class PrivateLinkScopesUpdateTagsSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/PrivateLinkScopesUpdateTagsOnly.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/privateLinkScope/PrivateLinkScopes_UpdateTagsOnly.json */ /** * Sample code: PrivateLinkScopeUpdateTagsOnly. @@ -631,6 +1393,55 @@ public final class PrivateLinkScopesUpdateTagsSamples { resource.update().withTags(mapOf("Tag1", "Value1", "Tag2", "Value2")).apply(); } + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### ResourceProvider_UpgradeExtensions + +```java +import com.azure.resourcemanager.hybridcompute.models.ExtensionTargetProperties; +import com.azure.resourcemanager.hybridcompute.models.MachineExtensionUpgrade; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ResourceProvider UpgradeExtensions. */ +public final class ResourceProviderUpgradeExtensionsSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/extension/Extensions_Upgrade.json + */ + /** + * Sample code: Upgrade Machine Extensions. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void upgradeMachineExtensions(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager + .resourceProviders() + .upgradeExtensions( + "myResourceGroup", + "myMachine", + new MachineExtensionUpgrade() + .withExtensionTargets( + mapOf( + "Microsoft.Azure.Monitoring", + new ExtensionTargetProperties().withTargetVersion("2.0"), + "Microsoft.Compute.CustomScriptExtension", + new ExtensionTargetProperties().withTargetVersion("1.10"))), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/pom.xml b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/pom.xml index 2567d2d5b6fc0..4cd155feb3e10 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/pom.xml +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/pom.xml @@ -1,3 +1,8 @@ + 4.0.0 @@ -13,7 +18,7 @@ jar Microsoft Azure SDK for HybridCompute Management - This package contains Microsoft Azure SDK for HybridCompute Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The Hybrid Compute Management Client. Package tag package-preview-2021-03. + This package contains Microsoft Azure SDK for HybridCompute Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The Hybrid Compute Management Client. Package tag package-preview-2023-10. https://github.com/Azure/azure-sdk-for-java @@ -38,7 +43,9 @@ UTF-8 - true + 0 + 0 + true diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/HybridComputeManager.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/HybridComputeManager.java index 1a8a7225a1197..b7323830ab038 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/HybridComputeManager.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/HybridComputeManager.java @@ -24,19 +24,35 @@ import com.azure.core.util.Configuration; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.hybridcompute.fluent.HybridComputeManagementClient; +import com.azure.resourcemanager.hybridcompute.implementation.AgentVersionsImpl; +import com.azure.resourcemanager.hybridcompute.implementation.ExtensionMetadatasImpl; import com.azure.resourcemanager.hybridcompute.implementation.HybridComputeManagementClientBuilder; +import com.azure.resourcemanager.hybridcompute.implementation.HybridIdentityMetadatasImpl; +import com.azure.resourcemanager.hybridcompute.implementation.LicenseProfilesImpl; +import com.azure.resourcemanager.hybridcompute.implementation.LicensesImpl; import com.azure.resourcemanager.hybridcompute.implementation.MachineExtensionsImpl; +import com.azure.resourcemanager.hybridcompute.implementation.MachineRunCommandsImpl; import com.azure.resourcemanager.hybridcompute.implementation.MachinesImpl; +import com.azure.resourcemanager.hybridcompute.implementation.NetworkProfilesImpl; import com.azure.resourcemanager.hybridcompute.implementation.OperationsImpl; import com.azure.resourcemanager.hybridcompute.implementation.PrivateEndpointConnectionsImpl; import com.azure.resourcemanager.hybridcompute.implementation.PrivateLinkResourcesImpl; import com.azure.resourcemanager.hybridcompute.implementation.PrivateLinkScopesImpl; +import com.azure.resourcemanager.hybridcompute.implementation.ResourceProvidersImpl; +import com.azure.resourcemanager.hybridcompute.models.AgentVersions; +import com.azure.resourcemanager.hybridcompute.models.ExtensionMetadatas; +import com.azure.resourcemanager.hybridcompute.models.HybridIdentityMetadatas; +import com.azure.resourcemanager.hybridcompute.models.LicenseProfiles; +import com.azure.resourcemanager.hybridcompute.models.Licenses; import com.azure.resourcemanager.hybridcompute.models.MachineExtensions; +import com.azure.resourcemanager.hybridcompute.models.MachineRunCommands; import com.azure.resourcemanager.hybridcompute.models.Machines; +import com.azure.resourcemanager.hybridcompute.models.NetworkProfiles; import com.azure.resourcemanager.hybridcompute.models.Operations; import com.azure.resourcemanager.hybridcompute.models.PrivateEndpointConnections; import com.azure.resourcemanager.hybridcompute.models.PrivateLinkResources; import com.azure.resourcemanager.hybridcompute.models.PrivateLinkScopes; +import com.azure.resourcemanager.hybridcompute.models.ResourceProviders; import java.time.Duration; import java.time.temporal.ChronoUnit; import java.util.ArrayList; @@ -46,12 +62,28 @@ /** Entry point to HybridComputeManager. The Hybrid Compute Management Client. */ public final class HybridComputeManager { + private Licenses licenses; + private Machines machines; + private LicenseProfiles licenseProfiles; + private MachineExtensions machineExtensions; + private ResourceProviders resourceProviders; + + private ExtensionMetadatas extensionMetadatas; + private Operations operations; + private NetworkProfiles networkProfiles; + + private HybridIdentityMetadatas hybridIdentityMetadatas; + + private AgentVersions agentVersions; + + private MachineRunCommands machineRunCommands; + private PrivateLinkScopes privateLinkScopes; private PrivateLinkResources privateLinkResources; @@ -223,7 +255,7 @@ public HybridComputeManager authenticate(TokenCredential credential, AzureProfil .append("-") .append("com.azure.resourcemanager.hybridcompute") .append("/") - .append("1.0.0-beta.2"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -280,6 +312,18 @@ public HybridComputeManager authenticate(TokenCredential credential, AzureProfil } } + /** + * Gets the resource collection API of Licenses. It manages License. + * + * @return Resource collection API of Licenses. + */ + public Licenses licenses() { + if (this.licenses == null) { + this.licenses = new LicensesImpl(clientObject.getLicenses(), this); + } + return licenses; + } + /** * Gets the resource collection API of Machines. * @@ -292,6 +336,18 @@ public Machines machines() { return machines; } + /** + * Gets the resource collection API of LicenseProfiles. It manages LicenseProfile. + * + * @return Resource collection API of LicenseProfiles. + */ + public LicenseProfiles licenseProfiles() { + if (this.licenseProfiles == null) { + this.licenseProfiles = new LicenseProfilesImpl(clientObject.getLicenseProfiles(), this); + } + return licenseProfiles; + } + /** * Gets the resource collection API of MachineExtensions. It manages MachineExtension. * @@ -304,6 +360,30 @@ public MachineExtensions machineExtensions() { return machineExtensions; } + /** + * Gets the resource collection API of ResourceProviders. + * + * @return Resource collection API of ResourceProviders. + */ + public ResourceProviders resourceProviders() { + if (this.resourceProviders == null) { + this.resourceProviders = new ResourceProvidersImpl(clientObject.getResourceProviders(), this); + } + return resourceProviders; + } + + /** + * Gets the resource collection API of ExtensionMetadatas. + * + * @return Resource collection API of ExtensionMetadatas. + */ + public ExtensionMetadatas extensionMetadatas() { + if (this.extensionMetadatas == null) { + this.extensionMetadatas = new ExtensionMetadatasImpl(clientObject.getExtensionMetadatas(), this); + } + return extensionMetadatas; + } + /** * Gets the resource collection API of Operations. * @@ -316,6 +396,55 @@ public Operations operations() { return operations; } + /** + * Gets the resource collection API of NetworkProfiles. + * + * @return Resource collection API of NetworkProfiles. + */ + public NetworkProfiles networkProfiles() { + if (this.networkProfiles == null) { + this.networkProfiles = new NetworkProfilesImpl(clientObject.getNetworkProfiles(), this); + } + return networkProfiles; + } + + /** + * Gets the resource collection API of HybridIdentityMetadatas. + * + * @return Resource collection API of HybridIdentityMetadatas. + */ + public HybridIdentityMetadatas hybridIdentityMetadatas() { + if (this.hybridIdentityMetadatas == null) { + this.hybridIdentityMetadatas = + new HybridIdentityMetadatasImpl(clientObject.getHybridIdentityMetadatas(), this); + } + return hybridIdentityMetadatas; + } + + /** + * Gets the resource collection API of AgentVersions. + * + * @return Resource collection API of AgentVersions. + */ + public AgentVersions agentVersions() { + if (this.agentVersions == null) { + this.agentVersions = new AgentVersionsImpl(clientObject.getAgentVersions(), this); + } + return agentVersions; + } + + /** + * Gets the resource collection API of MachineRunCommands. It manages MachineRunCommand. + * + * @return Resource collection API of MachineRunCommands. + */ + public MachineRunCommands machineRunCommands() { + if (this.machineRunCommands == null) { + this.machineRunCommands = new MachineRunCommandsImpl(clientObject.getMachineRunCommands(), this); + } + return machineRunCommands; + } + /** * Gets the resource collection API of PrivateLinkScopes. It manages HybridComputePrivateLinkScope. * @@ -354,8 +483,10 @@ public PrivateEndpointConnections privateEndpointConnections() { } /** - * @return Wrapped service client HybridComputeManagementClient providing direct access to the underlying - * auto-generated API implementation, based on Azure REST API. + * Gets wrapped service client HybridComputeManagementClient providing direct access to the underlying + * auto-generated API implementation, based on Azure REST API. + * + * @return Wrapped service client HybridComputeManagementClient. */ public HybridComputeManagementClient serviceClient() { return this.clientObject; diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/AgentVersionsClient.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/AgentVersionsClient.java new file mode 100644 index 0000000000000..3b652cc831d9c --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/AgentVersionsClient.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridcompute.fluent.models.AgentVersionInner; +import com.azure.resourcemanager.hybridcompute.fluent.models.AgentVersionsListInner; + +/** An instance of this class provides access to all the operations defined in AgentVersionsClient. */ +public interface AgentVersionsClient { + /** + * Gets all Agent Versions along with the download link currently present. + * + * @param osType Defines the os type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Agent Versions along with the download link currently present along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse(String osType, Context context); + + /** + * Gets all Agent Versions along with the download link currently present. + * + * @param osType Defines the os type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Agent Versions along with the download link currently present. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AgentVersionsListInner list(String osType); + + /** + * Gets an Agent Version along with the download link currently present. + * + * @param osType Defines the os type. + * @param version Defines the agent version. To get latest, use latest or else a specific agent version. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Agent Version along with the download link currently present along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String osType, String version, Context context); + + /** + * Gets an Agent Version along with the download link currently present. + * + * @param osType Defines the os type. + * @param version Defines the agent version. To get latest, use latest or else a specific agent version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Agent Version along with the download link currently present. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AgentVersionInner get(String osType, String version); +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/ExtensionMetadatasClient.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/ExtensionMetadatasClient.java new file mode 100644 index 0000000000000..0c4503ecb66e0 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/ExtensionMetadatasClient.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridcompute.fluent.models.ExtensionValueInner; + +/** An instance of this class provides access to all the operations defined in ExtensionMetadatasClient. */ +public interface ExtensionMetadatasClient { + /** + * Gets an Extension Metadata based on location, publisher, extensionType and version. + * + * @param location The location of the Extension being received. + * @param publisher The publisher of the Extension being received. + * @param extensionType The extensionType of the Extension being received. + * @param version The version of the Extension being received. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Extension Metadata based on location, publisher, extensionType and version along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String location, String publisher, String extensionType, String version, Context context); + + /** + * Gets an Extension Metadata based on location, publisher, extensionType and version. + * + * @param location The location of the Extension being received. + * @param publisher The publisher of the Extension being received. + * @param extensionType The extensionType of the Extension being received. + * @param version The version of the Extension being received. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Extension Metadata based on location, publisher, extensionType and version. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExtensionValueInner get(String location, String publisher, String extensionType, String version); + + /** + * Gets all Extension versions based on location, publisher, extensionType. + * + * @param location The location of the Extension being received. + * @param publisher The publisher of the Extension being received. + * @param extensionType The extensionType of the Extension being received. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Extension versions based on location, publisher, extensionType as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location, String publisher, String extensionType); + + /** + * Gets all Extension versions based on location, publisher, extensionType. + * + * @param location The location of the Extension being received. + * @param publisher The publisher of the Extension being received. + * @param extensionType The extensionType of the Extension being received. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Extension versions based on location, publisher, extensionType as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location, String publisher, String extensionType, Context context); +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/HybridComputeManagementClient.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/HybridComputeManagementClient.java index 9363ab1e34962..a5798405807ff 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/HybridComputeManagementClient.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/HybridComputeManagementClient.java @@ -44,6 +44,13 @@ public interface HybridComputeManagementClient { */ Duration getDefaultPollInterval(); + /** + * Gets the LicensesClient object to access its operations. + * + * @return the LicensesClient object. + */ + LicensesClient getLicenses(); + /** * Gets the MachinesClient object to access its operations. * @@ -51,6 +58,13 @@ public interface HybridComputeManagementClient { */ MachinesClient getMachines(); + /** + * Gets the LicenseProfilesClient object to access its operations. + * + * @return the LicenseProfilesClient object. + */ + LicenseProfilesClient getLicenseProfiles(); + /** * Gets the MachineExtensionsClient object to access its operations. * @@ -58,6 +72,20 @@ public interface HybridComputeManagementClient { */ MachineExtensionsClient getMachineExtensions(); + /** + * Gets the ResourceProvidersClient object to access its operations. + * + * @return the ResourceProvidersClient object. + */ + ResourceProvidersClient getResourceProviders(); + + /** + * Gets the ExtensionMetadatasClient object to access its operations. + * + * @return the ExtensionMetadatasClient object. + */ + ExtensionMetadatasClient getExtensionMetadatas(); + /** * Gets the OperationsClient object to access its operations. * @@ -65,6 +93,34 @@ public interface HybridComputeManagementClient { */ OperationsClient getOperations(); + /** + * Gets the NetworkProfilesClient object to access its operations. + * + * @return the NetworkProfilesClient object. + */ + NetworkProfilesClient getNetworkProfiles(); + + /** + * Gets the HybridIdentityMetadatasClient object to access its operations. + * + * @return the HybridIdentityMetadatasClient object. + */ + HybridIdentityMetadatasClient getHybridIdentityMetadatas(); + + /** + * Gets the AgentVersionsClient object to access its operations. + * + * @return the AgentVersionsClient object. + */ + AgentVersionsClient getAgentVersions(); + + /** + * Gets the MachineRunCommandsClient object to access its operations. + * + * @return the MachineRunCommandsClient object. + */ + MachineRunCommandsClient getMachineRunCommands(); + /** * Gets the PrivateLinkScopesClient object to access its operations. * diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/HybridIdentityMetadatasClient.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/HybridIdentityMetadatasClient.java new file mode 100644 index 0000000000000..f973654b85029 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/HybridIdentityMetadatasClient.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridcompute.fluent.models.HybridIdentityMetadataInner; + +/** An instance of this class provides access to all the operations defined in HybridIdentityMetadatasClient. */ +public interface HybridIdentityMetadatasClient { + /** + * Gets HybridIdentityMetadata. + * + *

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

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

Returns the list of HybridIdentityMetadata of the given machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of HybridIdentityMetadata as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByMachines(String resourceGroupName, String machineName); + + /** + * Implements GET HybridIdentityMetadata in a machine. + * + *

Returns the list of HybridIdentityMetadata of the given machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of HybridIdentityMetadata as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByMachines( + String resourceGroupName, String machineName, Context context); +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/LicenseProfilesClient.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/LicenseProfilesClient.java new file mode 100644 index 0000000000000..ba1ba3de2a91a --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/LicenseProfilesClient.java @@ -0,0 +1,248 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.hybridcompute.fluent.models.LicenseProfileInner; +import com.azure.resourcemanager.hybridcompute.models.LicenseProfileUpdate; + +/** An instance of this class provides access to all the operations defined in LicenseProfilesClient. */ +public interface LicenseProfilesClient { + /** + * The operation to create or update a license profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param parameters Parameters supplied to the Create license profile operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes a license profile in a hybrid machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LicenseProfileInner> beginCreateOrUpdate( + String resourceGroupName, String machineName, LicenseProfileInner parameters); + + /** + * The operation to create or update a license profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param parameters Parameters supplied to the Create license profile operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes a license profile in a hybrid machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LicenseProfileInner> beginCreateOrUpdate( + String resourceGroupName, String machineName, LicenseProfileInner parameters, Context context); + + /** + * The operation to create or update a license profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param parameters Parameters supplied to the Create license profile operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a license profile in a hybrid machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LicenseProfileInner createOrUpdate(String resourceGroupName, String machineName, LicenseProfileInner parameters); + + /** + * The operation to create or update a license profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param parameters Parameters supplied to the Create license profile operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a license profile in a hybrid machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LicenseProfileInner createOrUpdate( + String resourceGroupName, String machineName, LicenseProfileInner parameters, Context context); + + /** + * The operation to update a license profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param parameters Parameters supplied to the Update license profile operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes a license profile in a hybrid machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LicenseProfileInner> beginUpdate( + String resourceGroupName, String machineName, LicenseProfileUpdate parameters); + + /** + * The operation to update a license profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param parameters Parameters supplied to the Update license profile operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes a license profile in a hybrid machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LicenseProfileInner> beginUpdate( + String resourceGroupName, String machineName, LicenseProfileUpdate parameters, Context context); + + /** + * The operation to update a license profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param parameters Parameters supplied to the Update license profile operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a license profile in a hybrid machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LicenseProfileInner update(String resourceGroupName, String machineName, LicenseProfileUpdate parameters); + + /** + * The operation to update a license profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param parameters Parameters supplied to the Update license profile operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a license profile in a hybrid machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LicenseProfileInner update( + String resourceGroupName, String machineName, LicenseProfileUpdate parameters, Context context); + + /** + * Retrieves information about the view of a license profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a license profile in a hybrid machine along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String machineName, Context context); + + /** + * Retrieves information about the view of a license profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a license profile in a hybrid machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LicenseProfileInner get(String resourceGroupName, String machineName); + + /** + * The operation to delete a license profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String machineName); + + /** + * The operation to delete a license profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String machineName, Context context); + + /** + * The operation to delete a license profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String machineName); + + /** + * The operation to delete a license profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String machineName, Context context); + + /** + * The operation to get all license profiles of a non-Azure machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List hybrid machine license profile operation response as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String machineName); + + /** + * The operation to get all license profiles of a non-Azure machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List hybrid machine license profile operation response as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String machineName, Context context); +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/LicensesClient.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/LicensesClient.java new file mode 100644 index 0000000000000..7a901c6cb157e --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/LicensesClient.java @@ -0,0 +1,315 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.hybridcompute.fluent.models.LicenseInner; +import com.azure.resourcemanager.hybridcompute.models.LicenseUpdate; + +/** An instance of this class provides access to all the operations defined in LicensesClient. */ +public interface LicensesClient { + /** + * The operation to validate a license. + * + * @param parameters Parameters supplied to the license validation operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes a license in a hybrid machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LicenseInner> beginValidateLicense(LicenseInner parameters); + + /** + * The operation to validate a license. + * + * @param parameters Parameters supplied to the license validation operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes a license in a hybrid machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LicenseInner> beginValidateLicense(LicenseInner parameters, Context context); + + /** + * The operation to validate a license. + * + * @param parameters Parameters supplied to the license validation operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a license in a hybrid machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LicenseInner validateLicense(LicenseInner parameters); + + /** + * The operation to validate a license. + * + * @param parameters Parameters supplied to the license validation operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a license in a hybrid machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LicenseInner validateLicense(LicenseInner parameters, Context context); + + /** + * The operation to create or update a license. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param licenseName The name of the license. + * @param parameters Parameters supplied to the Create license operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes a license in a hybrid machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LicenseInner> beginCreateOrUpdate( + String resourceGroupName, String licenseName, LicenseInner parameters); + + /** + * The operation to create or update a license. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param licenseName The name of the license. + * @param parameters Parameters supplied to the Create license operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes a license in a hybrid machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LicenseInner> beginCreateOrUpdate( + String resourceGroupName, String licenseName, LicenseInner parameters, Context context); + + /** + * The operation to create or update a license. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param licenseName The name of the license. + * @param parameters Parameters supplied to the Create license operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a license in a hybrid machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LicenseInner createOrUpdate(String resourceGroupName, String licenseName, LicenseInner parameters); + + /** + * The operation to create or update a license. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param licenseName The name of the license. + * @param parameters Parameters supplied to the Create license operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a license in a hybrid machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LicenseInner createOrUpdate(String resourceGroupName, String licenseName, LicenseInner parameters, Context context); + + /** + * The operation to update a license. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param licenseName The name of the license. + * @param parameters Parameters supplied to the Update license operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes a license in a hybrid machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LicenseInner> beginUpdate( + String resourceGroupName, String licenseName, LicenseUpdate parameters); + + /** + * The operation to update a license. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param licenseName The name of the license. + * @param parameters Parameters supplied to the Update license operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes a license in a hybrid machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LicenseInner> beginUpdate( + String resourceGroupName, String licenseName, LicenseUpdate parameters, Context context); + + /** + * The operation to update a license. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param licenseName The name of the license. + * @param parameters Parameters supplied to the Update license operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a license in a hybrid machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LicenseInner update(String resourceGroupName, String licenseName, LicenseUpdate parameters); + + /** + * The operation to update a license. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param licenseName The name of the license. + * @param parameters Parameters supplied to the Update license operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a license in a hybrid machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LicenseInner update(String resourceGroupName, String licenseName, LicenseUpdate parameters, Context context); + + /** + * Retrieves information about the view of a license. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param licenseName The name of the license. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a license in a hybrid machine along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String licenseName, Context context); + + /** + * Retrieves information about the view of a license. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param licenseName The name of the license. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a license in a hybrid machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LicenseInner getByResourceGroup(String resourceGroupName, String licenseName); + + /** + * The operation to delete a license. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param licenseName The name of the license. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String licenseName); + + /** + * The operation to delete a license. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param licenseName The name of the license. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String licenseName, Context context); + + /** + * The operation to delete a license. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param licenseName The name of the license. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String licenseName); + + /** + * The operation to delete a license. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param licenseName The name of the license. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String licenseName, Context context); + + /** + * The operation to get all licenses of a non-Azure machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List license operation response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * The operation to get all licenses of a non-Azure machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List license operation response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * The operation to get all licenses of a non-Azure machine. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List license operation response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * The operation to get all licenses of a non-Azure machine. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List license operation response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/MachineRunCommandsClient.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/MachineRunCommandsClient.java new file mode 100644 index 0000000000000..912859b225545 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/MachineRunCommandsClient.java @@ -0,0 +1,294 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.hybridcompute.fluent.models.MachineRunCommandInner; +import com.azure.resourcemanager.hybridcompute.models.MachineRunCommandUpdate; + +/** An instance of this class provides access to all the operations defined in MachineRunCommandsClient. */ +public interface MachineRunCommandsClient { + /** + * The operation to create or update a run command. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param runCommandName The name of the run command. + * @param runCommandProperties Parameters supplied to the Create Run Command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes a Run Command. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MachineRunCommandInner> beginCreateOrUpdate( + String resourceGroupName, + String machineName, + String runCommandName, + MachineRunCommandInner runCommandProperties); + + /** + * The operation to create or update a run command. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param runCommandName The name of the run command. + * @param runCommandProperties Parameters supplied to the Create Run Command. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes a Run Command. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MachineRunCommandInner> beginCreateOrUpdate( + String resourceGroupName, + String machineName, + String runCommandName, + MachineRunCommandInner runCommandProperties, + Context context); + + /** + * The operation to create or update a run command. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param runCommandName The name of the run command. + * @param runCommandProperties Parameters supplied to the Create Run Command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Run Command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MachineRunCommandInner createOrUpdate( + String resourceGroupName, + String machineName, + String runCommandName, + MachineRunCommandInner runCommandProperties); + + /** + * The operation to create or update a run command. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param runCommandName The name of the run command. + * @param runCommandProperties Parameters supplied to the Create Run Command. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Run Command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MachineRunCommandInner createOrUpdate( + String resourceGroupName, + String machineName, + String runCommandName, + MachineRunCommandInner runCommandProperties, + Context context); + + /** + * The operation to update the run command. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param runCommandName The name of the run command. + * @param runCommandProperties Parameters supplied to the Create Run Command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes a Run Command. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MachineRunCommandInner> beginUpdate( + String resourceGroupName, + String machineName, + String runCommandName, + MachineRunCommandUpdate runCommandProperties); + + /** + * The operation to update the run command. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param runCommandName The name of the run command. + * @param runCommandProperties Parameters supplied to the Create Run Command. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes a Run Command. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MachineRunCommandInner> beginUpdate( + String resourceGroupName, + String machineName, + String runCommandName, + MachineRunCommandUpdate runCommandProperties, + Context context); + + /** + * The operation to update the run command. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param runCommandName The name of the run command. + * @param runCommandProperties Parameters supplied to the Create Run Command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Run Command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MachineRunCommandInner update( + String resourceGroupName, + String machineName, + String runCommandName, + MachineRunCommandUpdate runCommandProperties); + + /** + * The operation to update the run command. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param runCommandName The name of the run command. + * @param runCommandProperties Parameters supplied to the Create Run Command. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Run Command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MachineRunCommandInner update( + String resourceGroupName, + String machineName, + String runCommandName, + MachineRunCommandUpdate runCommandProperties, + Context context); + + /** + * The operation to delete a run command. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param runCommandName The name of the run command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String machineName, String runCommandName); + + /** + * The operation to delete a run command. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param runCommandName The name of the run command. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String machineName, String runCommandName, Context context); + + /** + * The operation to delete a run command. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param runCommandName The name of the run command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String machineName, String runCommandName); + + /** + * The operation to delete a run command. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param runCommandName The name of the run command. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String machineName, String runCommandName, Context context); + + /** + * The operation to get a run command. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param runCommandName The name of the run command. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Run Command along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String machineName, String runCommandName, Context context); + + /** + * The operation to get a run command. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param runCommandName The name of the run command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Run Command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MachineRunCommandInner get(String resourceGroupName, String machineName, String runCommandName); + + /** + * The operation to get all the run commands of a non-Azure machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the Run Commands List Result as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String machineName); + + /** + * The operation to get all the run commands of a non-Azure machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the Run Commands List Result as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String machineName, String expand, Context context); +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/MachinesClient.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/MachinesClient.java index d0ecfaa568607..08574840b0364 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/MachinesClient.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/MachinesClient.java @@ -8,14 +8,19 @@ import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.hybridcompute.fluent.models.MachineAssessPatchesResultInner; import com.azure.resourcemanager.hybridcompute.fluent.models.MachineInner; +import com.azure.resourcemanager.hybridcompute.fluent.models.MachineInstallPatchesResultInner; import com.azure.resourcemanager.hybridcompute.models.InstanceViewTypes; +import com.azure.resourcemanager.hybridcompute.models.MachineInstallPatchesParameters; /** An instance of this class provides access to all the operations defined in MachinesClient. */ public interface MachinesClient { /** - * The operation to remove a hybrid machine identity in Azure. + * The operation to delete a hybrid machine. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param machineName The name of the hybrid machine. @@ -29,7 +34,7 @@ public interface MachinesClient { Response deleteWithResponse(String resourceGroupName, String machineName, Context context); /** - * The operation to remove a hybrid machine identity in Azure. + * The operation to delete a hybrid machine. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param machineName The name of the hybrid machine. @@ -69,6 +74,124 @@ Response getByResourceGroupWithResponse( @ServiceMethod(returns = ReturnType.SINGLE) MachineInner getByResourceGroup(String resourceGroupName, String machineName); + /** + * The operation to assess patches on a hybrid machine identity in Azure. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes the properties of an AssessPatches result. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MachineAssessPatchesResultInner> beginAssessPatches( + String resourceGroupName, String name); + + /** + * The operation to assess patches on a hybrid machine identity in Azure. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes the properties of an AssessPatches result. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MachineAssessPatchesResultInner> beginAssessPatches( + String resourceGroupName, String name, Context context); + + /** + * The operation to assess patches on a hybrid machine identity in Azure. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the properties of an AssessPatches result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MachineAssessPatchesResultInner assessPatches(String resourceGroupName, String name); + + /** + * The operation to assess patches on a hybrid machine identity in Azure. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the properties of an AssessPatches result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MachineAssessPatchesResultInner assessPatches(String resourceGroupName, String name, Context context); + + /** + * The operation to install patches on a hybrid machine identity in Azure. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @param installPatchesInput Input for InstallPatches as directly received by the API. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the result summary of an installation operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MachineInstallPatchesResultInner> beginInstallPatches( + String resourceGroupName, String name, MachineInstallPatchesParameters installPatchesInput); + + /** + * The operation to install patches on a hybrid machine identity in Azure. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @param installPatchesInput Input for InstallPatches as directly received by the API. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the result summary of an installation operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MachineInstallPatchesResultInner> beginInstallPatches( + String resourceGroupName, String name, MachineInstallPatchesParameters installPatchesInput, Context context); + + /** + * The operation to install patches on a hybrid machine identity in Azure. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @param installPatchesInput Input for InstallPatches as directly received by the API. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result summary of an installation operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MachineInstallPatchesResultInner installPatches( + String resourceGroupName, String name, MachineInstallPatchesParameters installPatchesInput); + + /** + * The operation to install patches on a hybrid machine identity in Azure. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @param installPatchesInput Input for InstallPatches as directly received by the API. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result summary of an installation operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MachineInstallPatchesResultInner installPatches( + String resourceGroupName, String name, MachineInstallPatchesParameters installPatchesInput, Context context); + /** * Lists all the hybrid machines in the specified resource group. Use the nextLink property in the response to get * the next page of hybrid machines. @@ -87,6 +210,7 @@ Response getByResourceGroupWithResponse( * the next page of hybrid machines. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param expand Expands referenced resources. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -94,7 +218,7 @@ Response getByResourceGroupWithResponse( * @return the List hybrid machine operation response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); + PagedIterable listByResourceGroup(String resourceGroupName, String expand, Context context); /** * Lists all the hybrid machines in the specified subscription. Use the nextLink property in the response to get the diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/NetworkProfilesClient.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/NetworkProfilesClient.java new file mode 100644 index 0000000000000..12bad427e256b --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/NetworkProfilesClient.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.hybridcompute.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridcompute.fluent.models.NetworkProfileInner; + +/** An instance of this class provides access to all the operations defined in NetworkProfilesClient. */ +public interface NetworkProfilesClient { + /** + * The operation to get network information of hybrid machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the network information on this machine along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String machineName, Context context); + + /** + * The operation to get network information of hybrid machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the network information on this machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkProfileInner get(String resourceGroupName, String machineName); +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/ResourceProvidersClient.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/ResourceProvidersClient.java new file mode 100644 index 0000000000000..22c4e9a1c6958 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/ResourceProvidersClient.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.hybridcompute.models.MachineExtensionUpgrade; + +/** An instance of this class provides access to all the operations defined in ResourceProvidersClient. */ +public interface ResourceProvidersClient { + /** + * The operation to Upgrade Machine Extensions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginUpgradeExtensions( + String resourceGroupName, String machineName, MachineExtensionUpgrade extensionUpgradeParameters); + + /** + * The operation to Upgrade Machine Extensions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginUpgradeExtensions( + String resourceGroupName, + String machineName, + MachineExtensionUpgrade extensionUpgradeParameters, + Context context); + + /** + * The operation to Upgrade Machine Extensions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void upgradeExtensions( + String resourceGroupName, String machineName, MachineExtensionUpgrade extensionUpgradeParameters); + + /** + * The operation to Upgrade Machine Extensions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void upgradeExtensions( + String resourceGroupName, + String machineName, + MachineExtensionUpgrade extensionUpgradeParameters, + Context context); +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/AgentVersionInner.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/AgentVersionInner.java new file mode 100644 index 0000000000000..489dd78204cab --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/AgentVersionInner.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes properties of Agent Version. */ +@Fluent +public final class AgentVersionInner { + /* + * Represents the agent version. + */ + @JsonProperty(value = "agentVersion") + private String agentVersion; + + /* + * Represents the download link of specific agent version. + */ + @JsonProperty(value = "downloadLink") + private String downloadLink; + + /* + * Defines the os type. + */ + @JsonProperty(value = "osType") + private String osType; + + /** Creates an instance of AgentVersionInner class. */ + public AgentVersionInner() { + } + + /** + * Get the agentVersion property: Represents the agent version. + * + * @return the agentVersion value. + */ + public String agentVersion() { + return this.agentVersion; + } + + /** + * Set the agentVersion property: Represents the agent version. + * + * @param agentVersion the agentVersion value to set. + * @return the AgentVersionInner object itself. + */ + public AgentVersionInner withAgentVersion(String agentVersion) { + this.agentVersion = agentVersion; + return this; + } + + /** + * Get the downloadLink property: Represents the download link of specific agent version. + * + * @return the downloadLink value. + */ + public String downloadLink() { + return this.downloadLink; + } + + /** + * Set the downloadLink property: Represents the download link of specific agent version. + * + * @param downloadLink the downloadLink value to set. + * @return the AgentVersionInner object itself. + */ + public AgentVersionInner withDownloadLink(String downloadLink) { + this.downloadLink = downloadLink; + return this; + } + + /** + * Get the osType property: Defines the os type. + * + * @return the osType value. + */ + public String osType() { + return this.osType; + } + + /** + * Set the osType property: Defines the os type. + * + * @param osType the osType value to set. + * @return the AgentVersionInner object itself. + */ + public AgentVersionInner withOsType(String osType) { + this.osType = osType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/AgentVersionsListInner.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/AgentVersionsListInner.java new file mode 100644 index 0000000000000..23a48f953f4a5 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/AgentVersionsListInner.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.hybridcompute.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes AgentVersions List. */ +@Fluent +public final class AgentVersionsListInner { + /* + * The list of available Agent Versions. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URI to fetch the next 10 available Agent Versions. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of AgentVersionsListInner class. */ + public AgentVersionsListInner() { + } + + /** + * Get the value property: The list of available Agent Versions. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of available Agent Versions. + * + * @param value the value value to set. + * @return the AgentVersionsListInner object itself. + */ + public AgentVersionsListInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI to fetch the next 10 available Agent Versions. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI to fetch the next 10 available Agent Versions. + * + * @param nextLink the nextLink value to set. + * @return the AgentVersionsListInner object itself. + */ + public AgentVersionsListInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/EsuProfileUpdateProperties.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/EsuProfileUpdateProperties.java new file mode 100644 index 0000000000000..e714b1d7e7878 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/EsuProfileUpdateProperties.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.hybridcompute.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the Update properties of a License Profile. */ +@Fluent +public final class EsuProfileUpdateProperties { + /* + * The resource id of the license. + */ + @JsonProperty(value = "assignedLicense") + private String assignedLicense; + + /** Creates an instance of EsuProfileUpdateProperties class. */ + public EsuProfileUpdateProperties() { + } + + /** + * Get the assignedLicense property: The resource id of the license. + * + * @return the assignedLicense value. + */ + public String assignedLicense() { + return this.assignedLicense; + } + + /** + * Set the assignedLicense property: The resource id of the license. + * + * @param assignedLicense the assignedLicense value to set. + * @return the EsuProfileUpdateProperties object itself. + */ + public EsuProfileUpdateProperties withAssignedLicense(String assignedLicense) { + this.assignedLicense = assignedLicense; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/ExtensionValueInner.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/ExtensionValueInner.java new file mode 100644 index 0000000000000..2dbed12fa9426 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/ExtensionValueInner.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.hybridcompute.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a Extension Metadata. */ +@Immutable +public final class ExtensionValueInner extends ProxyResource { + /* + * The single extension based on search criteria + */ + @JsonProperty(value = "properties") + private ExtensionValueProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of ExtensionValueInner class. */ + public ExtensionValueInner() { + } + + /** + * Get the innerProperties property: The single extension based on search criteria. + * + * @return the innerProperties value. + */ + private ExtensionValueProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the version property: The version of the Extension being received. + * + * @return the version value. + */ + public String version() { + return this.innerProperties() == null ? null : this.innerProperties().version(); + } + + /** + * Get the extensionType property: The type of the Extension being received. + * + * @return the extensionType value. + */ + public String extensionType() { + return this.innerProperties() == null ? null : this.innerProperties().extensionType(); + } + + /** + * Get the publisher property: The publisher of the Extension being received. + * + * @return the publisher value. + */ + public String publisher() { + return this.innerProperties() == null ? null : this.innerProperties().publisher(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/ExtensionValueProperties.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/ExtensionValueProperties.java new file mode 100644 index 0000000000000..e4d1cd9242230 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/ExtensionValueProperties.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.hybridcompute.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes Extension Metadata properties. */ +@Immutable +public final class ExtensionValueProperties { + /* + * The version of the Extension being received. + */ + @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY) + private String version; + + /* + * The type of the Extension being received. + */ + @JsonProperty(value = "extensionType", access = JsonProperty.Access.WRITE_ONLY) + private String extensionType; + + /* + * The publisher of the Extension being received. + */ + @JsonProperty(value = "publisher", access = JsonProperty.Access.WRITE_ONLY) + private String publisher; + + /** Creates an instance of ExtensionValueProperties class. */ + public ExtensionValueProperties() { + } + + /** + * Get the version property: The version of the Extension being received. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Get the extensionType property: The type of the Extension being received. + * + * @return the extensionType value. + */ + public String extensionType() { + return this.extensionType; + } + + /** + * Get the publisher property: The publisher of the Extension being received. + * + * @return the publisher value. + */ + public String publisher() { + return this.publisher; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/HybridIdentityMetadataInner.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/HybridIdentityMetadataInner.java new file mode 100644 index 0000000000000..288d873115730 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/HybridIdentityMetadataInner.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybridcompute.models.Identity; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines the HybridIdentityMetadata. */ +@Fluent +public final class HybridIdentityMetadataInner extends ProxyResource { + /* + * Resource properties. + */ + @JsonProperty(value = "properties", required = true) + private HybridIdentityMetadataProperties innerProperties = new HybridIdentityMetadataProperties(); + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of HybridIdentityMetadataInner class. */ + public HybridIdentityMetadataInner() { + } + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private HybridIdentityMetadataProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the vmId property: The unique identifier for the resource. + * + * @return the vmId value. + */ + public String vmId() { + return this.innerProperties() == null ? null : this.innerProperties().vmId(); + } + + /** + * Set the vmId property: The unique identifier for the resource. + * + * @param vmId the vmId value to set. + * @return the HybridIdentityMetadataInner object itself. + */ + public HybridIdentityMetadataInner withVmId(String vmId) { + if (this.innerProperties() == null) { + this.innerProperties = new HybridIdentityMetadataProperties(); + } + this.innerProperties().withVmId(vmId); + return this; + } + + /** + * Get the publicKey property: The Public Key. + * + * @return the publicKey value. + */ + public String publicKey() { + return this.innerProperties() == null ? null : this.innerProperties().publicKey(); + } + + /** + * Set the publicKey property: The Public Key. + * + * @param publicKey the publicKey value to set. + * @return the HybridIdentityMetadataInner object itself. + */ + public HybridIdentityMetadataInner withPublicKey(String publicKey) { + if (this.innerProperties() == null) { + this.innerProperties = new HybridIdentityMetadataProperties(); + } + this.innerProperties().withPublicKey(publicKey); + return this; + } + + /** + * Get the identity property: Identity for the resource. + * + * @return the identity value. + */ + public Identity identity() { + return this.innerProperties() == null ? null : this.innerProperties().identity(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model HybridIdentityMetadataInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(HybridIdentityMetadataInner.class); +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/HybridIdentityMetadataProperties.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/HybridIdentityMetadataProperties.java new file mode 100644 index 0000000000000..04f76fb8a56ac --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/HybridIdentityMetadataProperties.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.hybridcompute.models.Identity; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines the resource properties. */ +@Fluent +public final class HybridIdentityMetadataProperties { + /* + * The unique identifier for the resource. + */ + @JsonProperty(value = "vmId") + private String vmId; + + /* + * The Public Key. + */ + @JsonProperty(value = "publicKey") + private String publicKey; + + /* + * Identity for the resource. + */ + @JsonProperty(value = "identity", access = JsonProperty.Access.WRITE_ONLY) + private Identity identity; + + /** Creates an instance of HybridIdentityMetadataProperties class. */ + public HybridIdentityMetadataProperties() { + } + + /** + * Get the vmId property: The unique identifier for the resource. + * + * @return the vmId value. + */ + public String vmId() { + return this.vmId; + } + + /** + * Set the vmId property: The unique identifier for the resource. + * + * @param vmId the vmId value to set. + * @return the HybridIdentityMetadataProperties object itself. + */ + public HybridIdentityMetadataProperties withVmId(String vmId) { + this.vmId = vmId; + return this; + } + + /** + * Get the publicKey property: The Public Key. + * + * @return the publicKey value. + */ + public String publicKey() { + return this.publicKey; + } + + /** + * Set the publicKey property: The Public Key. + * + * @param publicKey the publicKey value to set. + * @return the HybridIdentityMetadataProperties object itself. + */ + public HybridIdentityMetadataProperties withPublicKey(String publicKey) { + this.publicKey = publicKey; + return this; + } + + /** + * Get the identity property: Identity for the resource. + * + * @return the identity value. + */ + public Identity identity() { + return this.identity; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/LicenseInner.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/LicenseInner.java new file mode 100644 index 0000000000000..d75e46f85d24b --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/LicenseInner.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.hybridcompute.models.LicenseDetails; +import com.azure.resourcemanager.hybridcompute.models.LicenseType; +import com.azure.resourcemanager.hybridcompute.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Describes a license in a hybrid machine. */ +@Fluent +public final class LicenseInner extends Resource { + /* + * Hybrid Compute License properties + */ + @JsonProperty(value = "properties") + private LicenseProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of LicenseInner class. */ + public LicenseInner() { + } + + /** + * Get the innerProperties property: Hybrid Compute License properties. + * + * @return the innerProperties value. + */ + private LicenseProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public LicenseInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public LicenseInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the tenantId property: Describes the tenant id. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.innerProperties() == null ? null : this.innerProperties().tenantId(); + } + + /** + * Set the tenantId property: Describes the tenant id. + * + * @param tenantId the tenantId value to set. + * @return the LicenseInner object itself. + */ + public LicenseInner withTenantId(String tenantId) { + if (this.innerProperties() == null) { + this.innerProperties = new LicenseProperties(); + } + this.innerProperties().withTenantId(tenantId); + return this; + } + + /** + * Get the licenseType property: The type of the license resource. + * + * @return the licenseType value. + */ + public LicenseType licenseType() { + return this.innerProperties() == null ? null : this.innerProperties().licenseType(); + } + + /** + * Set the licenseType property: The type of the license resource. + * + * @param licenseType the licenseType value to set. + * @return the LicenseInner object itself. + */ + public LicenseInner withLicenseType(LicenseType licenseType) { + if (this.innerProperties() == null) { + this.innerProperties = new LicenseProperties(); + } + this.innerProperties().withLicenseType(licenseType); + return this; + } + + /** + * Get the licenseDetails property: Describes the properties of a License. + * + * @return the licenseDetails value. + */ + public LicenseDetails licenseDetails() { + return this.innerProperties() == null ? null : this.innerProperties().licenseDetails(); + } + + /** + * Set the licenseDetails property: Describes the properties of a License. + * + * @param licenseDetails the licenseDetails value to set. + * @return the LicenseInner object itself. + */ + public LicenseInner withLicenseDetails(LicenseDetails licenseDetails) { + if (this.innerProperties() == null) { + this.innerProperties = new LicenseProperties(); + } + this.innerProperties().withLicenseDetails(licenseDetails); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/LicenseProfileArmEsuProperties.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/LicenseProfileArmEsuProperties.java new file mode 100644 index 0000000000000..4675b6febe23b --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/LicenseProfileArmEsuProperties.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.hybridcompute.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.hybridcompute.models.LicenseProfileArmEsuPropertiesWithoutAssignedLicense; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the properties of a License Profile ARM model. */ +@Fluent +public final class LicenseProfileArmEsuProperties extends LicenseProfileArmEsuPropertiesWithoutAssignedLicense { + /* + * The resource id of the license. + */ + @JsonProperty(value = "assignedLicense") + private String assignedLicense; + + /** Creates an instance of LicenseProfileArmEsuProperties class. */ + public LicenseProfileArmEsuProperties() { + } + + /** + * Get the assignedLicense property: The resource id of the license. + * + * @return the assignedLicense value. + */ + public String assignedLicense() { + return this.assignedLicense; + } + + /** + * Set the assignedLicense property: The resource id of the license. + * + * @param assignedLicense the assignedLicense value to set. + * @return the LicenseProfileArmEsuProperties object itself. + */ + public LicenseProfileArmEsuProperties withAssignedLicense(String assignedLicense) { + this.assignedLicense = assignedLicense; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/LicenseProfileInner.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/LicenseProfileInner.java new file mode 100644 index 0000000000000..bc0d498a982c6 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/LicenseProfileInner.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.hybridcompute.models.EsuEligibility; +import com.azure.resourcemanager.hybridcompute.models.EsuKey; +import com.azure.resourcemanager.hybridcompute.models.EsuKeyState; +import com.azure.resourcemanager.hybridcompute.models.EsuServerType; +import com.azure.resourcemanager.hybridcompute.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Describes a license profile in a hybrid machine. */ +@Fluent +public final class LicenseProfileInner extends Resource { + /* + * Describe the properties of a license profile. + */ + @JsonProperty(value = "properties") + private LicenseProfileProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of LicenseProfileInner class. */ + public LicenseProfileInner() { + } + + /** + * Get the innerProperties property: Describe the properties of a license profile. + * + * @return the innerProperties value. + */ + private LicenseProfileProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public LicenseProfileInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public LicenseProfileInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the assignedLicense property: The resource id of the license. + * + * @return the assignedLicense value. + */ + public String assignedLicense() { + return this.innerProperties() == null ? null : this.innerProperties().assignedLicense(); + } + + /** + * Set the assignedLicense property: The resource id of the license. + * + * @param assignedLicense the assignedLicense value to set. + * @return the LicenseProfileInner object itself. + */ + public LicenseProfileInner withAssignedLicense(String assignedLicense) { + if (this.innerProperties() == null) { + this.innerProperties = new LicenseProfileProperties(); + } + this.innerProperties().withAssignedLicense(assignedLicense); + return this; + } + + /** + * Get the serverType property: The type of the Esu servers. + * + * @return the serverType value. + */ + public EsuServerType serverType() { + return this.innerProperties() == null ? null : this.innerProperties().serverType(); + } + + /** + * Get the esuEligibility property: Indicates the eligibility state of Esu. + * + * @return the esuEligibility value. + */ + public EsuEligibility esuEligibility() { + return this.innerProperties() == null ? null : this.innerProperties().esuEligibility(); + } + + /** + * Get the esuKeyState property: Indicates whether there is an ESU Key currently active for the machine. + * + * @return the esuKeyState value. + */ + public EsuKeyState esuKeyState() { + return this.innerProperties() == null ? null : this.innerProperties().esuKeyState(); + } + + /** + * Get the assignedLicenseImmutableId property: The guid id of the license. + * + * @return the assignedLicenseImmutableId value. + */ + public String assignedLicenseImmutableId() { + return this.innerProperties() == null ? null : this.innerProperties().assignedLicenseImmutableId(); + } + + /** + * Get the esuKeys property: The list of ESU keys. + * + * @return the esuKeys value. + */ + public List esuKeys() { + return this.innerProperties() == null ? null : this.innerProperties().esuKeys(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/LicenseProfileMachineInstanceViewEsuPropertiesInner.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/LicenseProfileMachineInstanceViewEsuPropertiesInner.java new file mode 100644 index 0000000000000..a061c8af5002e --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/LicenseProfileMachineInstanceViewEsuPropertiesInner.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.hybridcompute.models.LicenseAssignmentState; +import com.azure.resourcemanager.hybridcompute.models.LicenseProfileArmEsuPropertiesWithoutAssignedLicense; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties for the Machine ESU profile. */ +@Fluent +public final class LicenseProfileMachineInstanceViewEsuPropertiesInner + extends LicenseProfileArmEsuPropertiesWithoutAssignedLicense { + /* + * The assigned license resource. + */ + @JsonProperty(value = "assignedLicense") + private LicenseInner assignedLicense; + + /* + * Describes the license assignment state (Assigned or NotAssigned). + */ + @JsonProperty(value = "licenseAssignmentState") + private LicenseAssignmentState licenseAssignmentState; + + /** Creates an instance of LicenseProfileMachineInstanceViewEsuPropertiesInner class. */ + public LicenseProfileMachineInstanceViewEsuPropertiesInner() { + } + + /** + * Get the assignedLicense property: The assigned license resource. + * + * @return the assignedLicense value. + */ + public LicenseInner assignedLicense() { + return this.assignedLicense; + } + + /** + * Set the assignedLicense property: The assigned license resource. + * + * @param assignedLicense the assignedLicense value to set. + * @return the LicenseProfileMachineInstanceViewEsuPropertiesInner object itself. + */ + public LicenseProfileMachineInstanceViewEsuPropertiesInner withAssignedLicense(LicenseInner assignedLicense) { + this.assignedLicense = assignedLicense; + return this; + } + + /** + * Get the licenseAssignmentState property: Describes the license assignment state (Assigned or NotAssigned). + * + * @return the licenseAssignmentState value. + */ + public LicenseAssignmentState licenseAssignmentState() { + return this.licenseAssignmentState; + } + + /** + * Set the licenseAssignmentState property: Describes the license assignment state (Assigned or NotAssigned). + * + * @param licenseAssignmentState the licenseAssignmentState value to set. + * @return the LicenseProfileMachineInstanceViewEsuPropertiesInner object itself. + */ + public LicenseProfileMachineInstanceViewEsuPropertiesInner withLicenseAssignmentState( + LicenseAssignmentState licenseAssignmentState) { + this.licenseAssignmentState = licenseAssignmentState; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (assignedLicense() != null) { + assignedLicense().validate(); + } + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/LicenseProfileMachineInstanceViewInner.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/LicenseProfileMachineInstanceViewInner.java new file mode 100644 index 0000000000000..0e6520ad9bbf0 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/LicenseProfileMachineInstanceViewInner.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** License Profile Instance View in Machine Properties. */ +@Fluent +public final class LicenseProfileMachineInstanceViewInner { + /* + * Properties for the Machine ESU profile. + */ + @JsonProperty(value = "esuProfile") + private LicenseProfileMachineInstanceViewEsuPropertiesInner esuProfile; + + /** Creates an instance of LicenseProfileMachineInstanceViewInner class. */ + public LicenseProfileMachineInstanceViewInner() { + } + + /** + * Get the esuProfile property: Properties for the Machine ESU profile. + * + * @return the esuProfile value. + */ + public LicenseProfileMachineInstanceViewEsuPropertiesInner esuProfile() { + return this.esuProfile; + } + + /** + * Set the esuProfile property: Properties for the Machine ESU profile. + * + * @param esuProfile the esuProfile value to set. + * @return the LicenseProfileMachineInstanceViewInner object itself. + */ + public LicenseProfileMachineInstanceViewInner withEsuProfile( + LicenseProfileMachineInstanceViewEsuPropertiesInner esuProfile) { + this.esuProfile = esuProfile; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (esuProfile() != null) { + esuProfile().validate(); + } + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/LicenseProfileProperties.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/LicenseProfileProperties.java new file mode 100644 index 0000000000000..fdee30e5357b8 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/LicenseProfileProperties.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.hybridcompute.models.EsuEligibility; +import com.azure.resourcemanager.hybridcompute.models.EsuKey; +import com.azure.resourcemanager.hybridcompute.models.EsuKeyState; +import com.azure.resourcemanager.hybridcompute.models.EsuServerType; +import com.azure.resourcemanager.hybridcompute.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describe the properties of a license profile. */ +@Fluent +public final class LicenseProfileProperties { + /* + * Hybrid Compute ESU Profile properties + */ + @JsonProperty(value = "esuProfile") + private LicenseProfileArmEsuProperties innerEsuProfile; + + /* + * The provisioning state, which only appears in the response. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** Creates an instance of LicenseProfileProperties class. */ + public LicenseProfileProperties() { + } + + /** + * Get the innerEsuProfile property: Hybrid Compute ESU Profile properties. + * + * @return the innerEsuProfile value. + */ + private LicenseProfileArmEsuProperties innerEsuProfile() { + return this.innerEsuProfile; + } + + /** + * Get the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the assignedLicense property: The resource id of the license. + * + * @return the assignedLicense value. + */ + public String assignedLicense() { + return this.innerEsuProfile() == null ? null : this.innerEsuProfile().assignedLicense(); + } + + /** + * Set the assignedLicense property: The resource id of the license. + * + * @param assignedLicense the assignedLicense value to set. + * @return the LicenseProfileProperties object itself. + */ + public LicenseProfileProperties withAssignedLicense(String assignedLicense) { + if (this.innerEsuProfile() == null) { + this.innerEsuProfile = new LicenseProfileArmEsuProperties(); + } + this.innerEsuProfile().withAssignedLicense(assignedLicense); + return this; + } + + /** + * Get the serverType property: The type of the Esu servers. + * + * @return the serverType value. + */ + public EsuServerType serverType() { + return this.innerEsuProfile() == null ? null : this.innerEsuProfile().serverType(); + } + + /** + * Get the esuEligibility property: Indicates the eligibility state of Esu. + * + * @return the esuEligibility value. + */ + public EsuEligibility esuEligibility() { + return this.innerEsuProfile() == null ? null : this.innerEsuProfile().esuEligibility(); + } + + /** + * Get the esuKeyState property: Indicates whether there is an ESU Key currently active for the machine. + * + * @return the esuKeyState value. + */ + public EsuKeyState esuKeyState() { + return this.innerEsuProfile() == null ? null : this.innerEsuProfile().esuKeyState(); + } + + /** + * Get the assignedLicenseImmutableId property: The guid id of the license. + * + * @return the assignedLicenseImmutableId value. + */ + public String assignedLicenseImmutableId() { + return this.innerEsuProfile() == null ? null : this.innerEsuProfile().assignedLicenseImmutableId(); + } + + /** + * Get the esuKeys property: The list of ESU keys. + * + * @return the esuKeys value. + */ + public List esuKeys() { + return this.innerEsuProfile() == null ? null : this.innerEsuProfile().esuKeys(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerEsuProfile() != null) { + innerEsuProfile().validate(); + } + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/LicenseProfileUpdateProperties.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/LicenseProfileUpdateProperties.java new file mode 100644 index 0000000000000..3e97daf3ef5b3 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/LicenseProfileUpdateProperties.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describe the Update properties of a license profile. */ +@Fluent +public final class LicenseProfileUpdateProperties { + /* + * Hybrid Compute ESU Profile Update properties + */ + @JsonProperty(value = "esuProfile") + private EsuProfileUpdateProperties innerEsuProfile; + + /** Creates an instance of LicenseProfileUpdateProperties class. */ + public LicenseProfileUpdateProperties() { + } + + /** + * Get the innerEsuProfile property: Hybrid Compute ESU Profile Update properties. + * + * @return the innerEsuProfile value. + */ + private EsuProfileUpdateProperties innerEsuProfile() { + return this.innerEsuProfile; + } + + /** + * Get the assignedLicense property: The resource id of the license. + * + * @return the assignedLicense value. + */ + public String assignedLicense() { + return this.innerEsuProfile() == null ? null : this.innerEsuProfile().assignedLicense(); + } + + /** + * Set the assignedLicense property: The resource id of the license. + * + * @param assignedLicense the assignedLicense value to set. + * @return the LicenseProfileUpdateProperties object itself. + */ + public LicenseProfileUpdateProperties withAssignedLicense(String assignedLicense) { + if (this.innerEsuProfile() == null) { + this.innerEsuProfile = new EsuProfileUpdateProperties(); + } + this.innerEsuProfile().withAssignedLicense(assignedLicense); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerEsuProfile() != null) { + innerEsuProfile().validate(); + } + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/LicenseProperties.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/LicenseProperties.java new file mode 100644 index 0000000000000..ecc7fb845ac79 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/LicenseProperties.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.hybridcompute.models.LicenseDetails; +import com.azure.resourcemanager.hybridcompute.models.LicenseType; +import com.azure.resourcemanager.hybridcompute.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the properties of a License Profile. */ +@Fluent +public final class LicenseProperties { + /* + * The provisioning state, which only appears in the response. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Describes the tenant id. + */ + @JsonProperty(value = "tenantId") + private String tenantId; + + /* + * The type of the license resource. + */ + @JsonProperty(value = "licenseType") + private LicenseType licenseType; + + /* + * Describes the properties of a License. + */ + @JsonProperty(value = "licenseDetails") + private LicenseDetails licenseDetails; + + /** Creates an instance of LicenseProperties class. */ + public LicenseProperties() { + } + + /** + * Get the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the tenantId property: Describes the tenant id. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set the tenantId property: Describes the tenant id. + * + * @param tenantId the tenantId value to set. + * @return the LicenseProperties object itself. + */ + public LicenseProperties withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Get the licenseType property: The type of the license resource. + * + * @return the licenseType value. + */ + public LicenseType licenseType() { + return this.licenseType; + } + + /** + * Set the licenseType property: The type of the license resource. + * + * @param licenseType the licenseType value to set. + * @return the LicenseProperties object itself. + */ + public LicenseProperties withLicenseType(LicenseType licenseType) { + this.licenseType = licenseType; + return this; + } + + /** + * Get the licenseDetails property: Describes the properties of a License. + * + * @return the licenseDetails value. + */ + public LicenseDetails licenseDetails() { + return this.licenseDetails; + } + + /** + * Set the licenseDetails property: Describes the properties of a License. + * + * @param licenseDetails the licenseDetails value to set. + * @return the LicenseProperties object itself. + */ + public LicenseProperties withLicenseDetails(LicenseDetails licenseDetails) { + this.licenseDetails = licenseDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (licenseDetails() != null) { + licenseDetails().validate(); + } + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/LicenseUpdateProperties.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/LicenseUpdateProperties.java new file mode 100644 index 0000000000000..d219afcc2400c --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/LicenseUpdateProperties.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.hybridcompute.models.LicenseCoreType; +import com.azure.resourcemanager.hybridcompute.models.LicenseEdition; +import com.azure.resourcemanager.hybridcompute.models.LicenseState; +import com.azure.resourcemanager.hybridcompute.models.LicenseTarget; +import com.azure.resourcemanager.hybridcompute.models.LicenseType; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the Update properties of a License Profile. */ +@Fluent +public final class LicenseUpdateProperties { + /* + * The type of the license resource. + */ + @JsonProperty(value = "licenseType") + private LicenseType licenseType; + + /* + * The licenseDetails property. + */ + @JsonProperty(value = "licenseDetails") + private LicenseUpdatePropertiesLicenseDetails innerLicenseDetails; + + /** Creates an instance of LicenseUpdateProperties class. */ + public LicenseUpdateProperties() { + } + + /** + * Get the licenseType property: The type of the license resource. + * + * @return the licenseType value. + */ + public LicenseType licenseType() { + return this.licenseType; + } + + /** + * Set the licenseType property: The type of the license resource. + * + * @param licenseType the licenseType value to set. + * @return the LicenseUpdateProperties object itself. + */ + public LicenseUpdateProperties withLicenseType(LicenseType licenseType) { + this.licenseType = licenseType; + return this; + } + + /** + * Get the innerLicenseDetails property: The licenseDetails property. + * + * @return the innerLicenseDetails value. + */ + private LicenseUpdatePropertiesLicenseDetails innerLicenseDetails() { + return this.innerLicenseDetails; + } + + /** + * Get the state property: Describes the state of the license. + * + * @return the state value. + */ + public LicenseState state() { + return this.innerLicenseDetails() == null ? null : this.innerLicenseDetails().state(); + } + + /** + * Set the state property: Describes the state of the license. + * + * @param state the state value to set. + * @return the LicenseUpdateProperties object itself. + */ + public LicenseUpdateProperties withState(LicenseState state) { + if (this.innerLicenseDetails() == null) { + this.innerLicenseDetails = new LicenseUpdatePropertiesLicenseDetails(); + } + this.innerLicenseDetails().withState(state); + return this; + } + + /** + * Get the target property: Describes the license target server. + * + * @return the target value. + */ + public LicenseTarget target() { + return this.innerLicenseDetails() == null ? null : this.innerLicenseDetails().target(); + } + + /** + * Set the target property: Describes the license target server. + * + * @param target the target value to set. + * @return the LicenseUpdateProperties object itself. + */ + public LicenseUpdateProperties withTarget(LicenseTarget target) { + if (this.innerLicenseDetails() == null) { + this.innerLicenseDetails = new LicenseUpdatePropertiesLicenseDetails(); + } + this.innerLicenseDetails().withTarget(target); + return this; + } + + /** + * Get the edition property: Describes the edition of the license. The values are either Standard or Datacenter. + * + * @return the edition value. + */ + public LicenseEdition edition() { + return this.innerLicenseDetails() == null ? null : this.innerLicenseDetails().edition(); + } + + /** + * Set the edition property: Describes the edition of the license. The values are either Standard or Datacenter. + * + * @param edition the edition value to set. + * @return the LicenseUpdateProperties object itself. + */ + public LicenseUpdateProperties withEdition(LicenseEdition edition) { + if (this.innerLicenseDetails() == null) { + this.innerLicenseDetails = new LicenseUpdatePropertiesLicenseDetails(); + } + this.innerLicenseDetails().withEdition(edition); + return this; + } + + /** + * Get the type property: Describes the license core type (pCore or vCore). + * + * @return the type value. + */ + public LicenseCoreType type() { + return this.innerLicenseDetails() == null ? null : this.innerLicenseDetails().type(); + } + + /** + * Set the type property: Describes the license core type (pCore or vCore). + * + * @param type the type value to set. + * @return the LicenseUpdateProperties object itself. + */ + public LicenseUpdateProperties withType(LicenseCoreType type) { + if (this.innerLicenseDetails() == null) { + this.innerLicenseDetails = new LicenseUpdatePropertiesLicenseDetails(); + } + this.innerLicenseDetails().withType(type); + return this; + } + + /** + * Get the processors property: Describes the number of processors. + * + * @return the processors value. + */ + public Integer processors() { + return this.innerLicenseDetails() == null ? null : this.innerLicenseDetails().processors(); + } + + /** + * Set the processors property: Describes the number of processors. + * + * @param processors the processors value to set. + * @return the LicenseUpdateProperties object itself. + */ + public LicenseUpdateProperties withProcessors(Integer processors) { + if (this.innerLicenseDetails() == null) { + this.innerLicenseDetails = new LicenseUpdatePropertiesLicenseDetails(); + } + this.innerLicenseDetails().withProcessors(processors); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerLicenseDetails() != null) { + innerLicenseDetails().validate(); + } + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/LicenseUpdatePropertiesLicenseDetails.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/LicenseUpdatePropertiesLicenseDetails.java new file mode 100644 index 0000000000000..03b0ab0ed7825 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/LicenseUpdatePropertiesLicenseDetails.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.hybridcompute.models.LicenseCoreType; +import com.azure.resourcemanager.hybridcompute.models.LicenseEdition; +import com.azure.resourcemanager.hybridcompute.models.LicenseState; +import com.azure.resourcemanager.hybridcompute.models.LicenseTarget; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The LicenseUpdatePropertiesLicenseDetails model. */ +@Fluent +public final class LicenseUpdatePropertiesLicenseDetails { + /* + * Describes the state of the license. + */ + @JsonProperty(value = "state") + private LicenseState state; + + /* + * Describes the license target server. + */ + @JsonProperty(value = "target") + private LicenseTarget target; + + /* + * Describes the edition of the license. The values are either Standard or Datacenter. + */ + @JsonProperty(value = "edition") + private LicenseEdition edition; + + /* + * Describes the license core type (pCore or vCore). + */ + @JsonProperty(value = "type") + private LicenseCoreType type; + + /* + * Describes the number of processors. + */ + @JsonProperty(value = "processors") + private Integer processors; + + /** Creates an instance of LicenseUpdatePropertiesLicenseDetails class. */ + public LicenseUpdatePropertiesLicenseDetails() { + } + + /** + * Get the state property: Describes the state of the license. + * + * @return the state value. + */ + public LicenseState state() { + return this.state; + } + + /** + * Set the state property: Describes the state of the license. + * + * @param state the state value to set. + * @return the LicenseUpdatePropertiesLicenseDetails object itself. + */ + public LicenseUpdatePropertiesLicenseDetails withState(LicenseState state) { + this.state = state; + return this; + } + + /** + * Get the target property: Describes the license target server. + * + * @return the target value. + */ + public LicenseTarget target() { + return this.target; + } + + /** + * Set the target property: Describes the license target server. + * + * @param target the target value to set. + * @return the LicenseUpdatePropertiesLicenseDetails object itself. + */ + public LicenseUpdatePropertiesLicenseDetails withTarget(LicenseTarget target) { + this.target = target; + return this; + } + + /** + * Get the edition property: Describes the edition of the license. The values are either Standard or Datacenter. + * + * @return the edition value. + */ + public LicenseEdition edition() { + return this.edition; + } + + /** + * Set the edition property: Describes the edition of the license. The values are either Standard or Datacenter. + * + * @param edition the edition value to set. + * @return the LicenseUpdatePropertiesLicenseDetails object itself. + */ + public LicenseUpdatePropertiesLicenseDetails withEdition(LicenseEdition edition) { + this.edition = edition; + return this; + } + + /** + * Get the type property: Describes the license core type (pCore or vCore). + * + * @return the type value. + */ + public LicenseCoreType type() { + return this.type; + } + + /** + * Set the type property: Describes the license core type (pCore or vCore). + * + * @param type the type value to set. + * @return the LicenseUpdatePropertiesLicenseDetails object itself. + */ + public LicenseUpdatePropertiesLicenseDetails withType(LicenseCoreType type) { + this.type = type; + return this; + } + + /** + * Get the processors property: Describes the number of processors. + * + * @return the processors value. + */ + public Integer processors() { + return this.processors; + } + + /** + * Set the processors property: Describes the number of processors. + * + * @param processors the processors value to set. + * @return the LicenseUpdatePropertiesLicenseDetails object itself. + */ + public LicenseUpdatePropertiesLicenseDetails withProcessors(Integer processors) { + this.processors = processors; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineAssessPatchesResultInner.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineAssessPatchesResultInner.java new file mode 100644 index 0000000000000..7b9d96ca3f069 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineAssessPatchesResultInner.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.hybridcompute.models.AvailablePatchCountByClassification; +import com.azure.resourcemanager.hybridcompute.models.OsType; +import com.azure.resourcemanager.hybridcompute.models.PatchOperationStartedBy; +import com.azure.resourcemanager.hybridcompute.models.PatchOperationStatus; +import com.azure.resourcemanager.hybridcompute.models.PatchServiceUsed; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Describes the properties of an AssessPatches result. */ +@Fluent +public final class MachineAssessPatchesResultInner { + /* + * The overall success or failure status of the operation. It remains "InProgress" until the operation completes. + * At that point it will become "Unknown", "Failed", "Succeeded", or "CompletedWithWarnings." + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private PatchOperationStatus status; + + /* + * The activity ID of the operation that produced this result. + */ + @JsonProperty(value = "assessmentActivityId", access = JsonProperty.Access.WRITE_ONLY) + private String assessmentActivityId; + + /* + * The overall reboot status of the VM. It will be true when partially installed patches require a reboot to + * complete installation but the reboot has not yet occurred. + */ + @JsonProperty(value = "rebootPending", access = JsonProperty.Access.WRITE_ONLY) + private Boolean rebootPending; + + /* + * Summarization of patches available for installation on the machine by classification. + */ + @JsonProperty(value = "availablePatchCountByClassification") + private AvailablePatchCountByClassification availablePatchCountByClassification; + + /* + * The UTC timestamp when the operation began. + */ + @JsonProperty(value = "startDateTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startDateTime; + + /* + * The UTC timestamp when the operation finished. + */ + @JsonProperty(value = "lastModifiedDateTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastModifiedDateTime; + + /* + * Indicates if operation was triggered by user or by platform. + */ + @JsonProperty(value = "startedBy", access = JsonProperty.Access.WRITE_ONLY) + private PatchOperationStartedBy startedBy; + + /* + * Specifies the patch service used for the operation. + */ + @JsonProperty(value = "patchServiceUsed", access = JsonProperty.Access.WRITE_ONLY) + private PatchServiceUsed patchServiceUsed; + + /* + * The operating system type of the machine. + */ + @JsonProperty(value = "osType", access = JsonProperty.Access.WRITE_ONLY) + private OsType osType; + + /* + * The errors that were encountered during execution of the operation. The details array contains the list of them. + */ + @JsonProperty(value = "errorDetails", access = JsonProperty.Access.WRITE_ONLY) + private ManagementError errorDetails; + + /** Creates an instance of MachineAssessPatchesResultInner class. */ + public MachineAssessPatchesResultInner() { + } + + /** + * Get the status property: The overall success or failure status of the operation. It remains "InProgress" until + * the operation completes. At that point it will become "Unknown", "Failed", "Succeeded", or + * "CompletedWithWarnings.". + * + * @return the status value. + */ + public PatchOperationStatus status() { + return this.status; + } + + /** + * Get the assessmentActivityId property: The activity ID of the operation that produced this result. + * + * @return the assessmentActivityId value. + */ + public String assessmentActivityId() { + return this.assessmentActivityId; + } + + /** + * Get the rebootPending property: The overall reboot status of the VM. It will be true when partially installed + * patches require a reboot to complete installation but the reboot has not yet occurred. + * + * @return the rebootPending value. + */ + public Boolean rebootPending() { + return this.rebootPending; + } + + /** + * Get the availablePatchCountByClassification property: Summarization of patches available for installation on the + * machine by classification. + * + * @return the availablePatchCountByClassification value. + */ + public AvailablePatchCountByClassification availablePatchCountByClassification() { + return this.availablePatchCountByClassification; + } + + /** + * Set the availablePatchCountByClassification property: Summarization of patches available for installation on the + * machine by classification. + * + * @param availablePatchCountByClassification the availablePatchCountByClassification value to set. + * @return the MachineAssessPatchesResultInner object itself. + */ + public MachineAssessPatchesResultInner withAvailablePatchCountByClassification( + AvailablePatchCountByClassification availablePatchCountByClassification) { + this.availablePatchCountByClassification = availablePatchCountByClassification; + return this; + } + + /** + * Get the startDateTime property: The UTC timestamp when the operation began. + * + * @return the startDateTime value. + */ + public OffsetDateTime startDateTime() { + return this.startDateTime; + } + + /** + * Get the lastModifiedDateTime property: The UTC timestamp when the operation finished. + * + * @return the lastModifiedDateTime value. + */ + public OffsetDateTime lastModifiedDateTime() { + return this.lastModifiedDateTime; + } + + /** + * Get the startedBy property: Indicates if operation was triggered by user or by platform. + * + * @return the startedBy value. + */ + public PatchOperationStartedBy startedBy() { + return this.startedBy; + } + + /** + * Get the patchServiceUsed property: Specifies the patch service used for the operation. + * + * @return the patchServiceUsed value. + */ + public PatchServiceUsed patchServiceUsed() { + return this.patchServiceUsed; + } + + /** + * Get the osType property: The operating system type of the machine. + * + * @return the osType value. + */ + public OsType osType() { + return this.osType; + } + + /** + * Get the errorDetails property: The errors that were encountered during execution of the operation. The details + * array contains the list of them. + * + * @return the errorDetails value. + */ + public ManagementError errorDetails() { + return this.errorDetails; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (availablePatchCountByClassification() != null) { + availablePatchCountByClassification().validate(); + } + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineExtensionInner.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineExtensionInner.java index 1f893b5ee14f7..5501264ebd43f 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineExtensionInner.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineExtensionInner.java @@ -21,7 +21,7 @@ public final class MachineExtensionInner extends Resource { private MachineExtensionProperties properties; /* - * The system meta data relating to this resource. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; @@ -51,7 +51,7 @@ public MachineExtensionInner withProperties(MachineExtensionProperties propertie } /** - * Get the systemData property: The system meta data relating to this resource. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtensionUpdateProperties.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineExtensionUpdateProperties.java similarity index 79% rename from sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtensionUpdateProperties.java rename to sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineExtensionUpdateProperties.java index 113b394ab1288..18a4c376960b6 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtensionUpdateProperties.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineExtensionUpdateProperties.java @@ -2,10 +2,12 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.hybridcompute.models; +package com.azure.resourcemanager.hybridcompute.fluent.models; import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; /** Describes the properties of a Machine Extension. */ @Fluent @@ -34,6 +36,13 @@ public final class MachineExtensionUpdateProperties { @JsonProperty(value = "typeHandlerVersion") private String typeHandlerVersion; + /* + * Indicates whether the extension should be automatically upgraded by the platform if there is a newer version + * available. + */ + @JsonProperty(value = "enableAutomaticUpgrade") + private Boolean enableAutomaticUpgrade; + /* * Indicates whether the extension should use a newer minor version if one is available at deployment time. Once * deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set @@ -46,14 +55,16 @@ public final class MachineExtensionUpdateProperties { * Json formatted public settings for the extension. */ @JsonProperty(value = "settings") - private Object settings; + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map settings; /* * The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at * all. */ @JsonProperty(value = "protectedSettings") - private Object protectedSettings; + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map protectedSettings; /** Creates an instance of MachineExtensionUpdateProperties class. */ public MachineExtensionUpdateProperties() { @@ -141,6 +152,28 @@ public MachineExtensionUpdateProperties withTypeHandlerVersion(String typeHandle return this; } + /** + * Get the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version available. + * + * @return the enableAutomaticUpgrade value. + */ + public Boolean enableAutomaticUpgrade() { + return this.enableAutomaticUpgrade; + } + + /** + * Set the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version available. + * + * @param enableAutomaticUpgrade the enableAutomaticUpgrade value to set. + * @return the MachineExtensionUpdateProperties object itself. + */ + public MachineExtensionUpdateProperties withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { + this.enableAutomaticUpgrade = enableAutomaticUpgrade; + return this; + } + /** * Get the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless @@ -170,7 +203,7 @@ public MachineExtensionUpdateProperties withAutoUpgradeMinorVersion(Boolean auto * * @return the settings value. */ - public Object settings() { + public Map settings() { return this.settings; } @@ -180,7 +213,7 @@ public Object settings() { * @param settings the settings value to set. * @return the MachineExtensionUpdateProperties object itself. */ - public MachineExtensionUpdateProperties withSettings(Object settings) { + public MachineExtensionUpdateProperties withSettings(Map settings) { this.settings = settings; return this; } @@ -191,7 +224,7 @@ public MachineExtensionUpdateProperties withSettings(Object settings) { * * @return the protectedSettings value. */ - public Object protectedSettings() { + public Map protectedSettings() { return this.protectedSettings; } @@ -202,7 +235,7 @@ public Object protectedSettings() { * @param protectedSettings the protectedSettings value to set. * @return the MachineExtensionUpdateProperties object itself. */ - public MachineExtensionUpdateProperties withProtectedSettings(Object protectedSettings) { + public MachineExtensionUpdateProperties withProtectedSettings(Map protectedSettings) { this.protectedSettings = protectedSettings; return this; } diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineInner.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineInner.java index c883d1849d630..bf64bc22079d5 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineInner.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineInner.java @@ -7,9 +7,20 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; import com.azure.core.management.SystemData; +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.hybridcompute.models.AgentConfiguration; +import com.azure.resourcemanager.hybridcompute.models.AgentUpgrade; +import com.azure.resourcemanager.hybridcompute.models.ArcKindEnum; +import com.azure.resourcemanager.hybridcompute.models.CloudMetadata; import com.azure.resourcemanager.hybridcompute.models.Identity; -import com.azure.resourcemanager.hybridcompute.models.MachineProperties; +import com.azure.resourcemanager.hybridcompute.models.LocationData; +import com.azure.resourcemanager.hybridcompute.models.MachineExtensionInstanceView; +import com.azure.resourcemanager.hybridcompute.models.OSProfile; +import com.azure.resourcemanager.hybridcompute.models.ServiceStatuses; +import com.azure.resourcemanager.hybridcompute.models.StatusTypes; import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; import java.util.Map; /** Describes a hybrid machine. */ @@ -19,7 +30,13 @@ public final class MachineInner extends Resource { * Hybrid Compute Machine properties */ @JsonProperty(value = "properties") - private MachineProperties properties; + private MachinePropertiesInner innerProperties; + + /* + * The list of extensions affiliated to the machine + */ + @JsonProperty(value = "resources", access = JsonProperty.Access.WRITE_ONLY) + private List resources; /* * Identity for the resource. @@ -28,7 +45,13 @@ public final class MachineInner extends Resource { private Identity identity; /* - * The system meta data relating to this resource. + * Indicates which kind of Arc machine placement on-premises, such as HCI, SCVMM or VMware etc. + */ + @JsonProperty(value = "kind") + private ArcKindEnum kind; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; @@ -38,23 +61,21 @@ public MachineInner() { } /** - * Get the properties property: Hybrid Compute Machine properties. + * Get the innerProperties property: Hybrid Compute Machine properties. * - * @return the properties value. + * @return the innerProperties value. */ - public MachineProperties properties() { - return this.properties; + private MachinePropertiesInner innerProperties() { + return this.innerProperties; } /** - * Set the properties property: Hybrid Compute Machine properties. + * Get the resources property: The list of extensions affiliated to the machine. * - * @param properties the properties value to set. - * @return the MachineInner object itself. + * @return the resources value. */ - public MachineInner withProperties(MachineProperties properties) { - this.properties = properties; - return this; + public List resources() { + return this.resources; } /** @@ -78,7 +99,29 @@ public MachineInner withIdentity(Identity identity) { } /** - * Get the systemData property: The system meta data relating to this resource. + * Get the kind property: Indicates which kind of Arc machine placement on-premises, such as HCI, SCVMM or VMware + * etc. + * + * @return the kind value. + */ + public ArcKindEnum kind() { + return this.kind; + } + + /** + * Set the kind property: Indicates which kind of Arc machine placement on-premises, such as HCI, SCVMM or VMware + * etc. + * + * @param kind the kind value to set. + * @return the MachineInner object itself. + */ + public MachineInner withKind(ArcKindEnum kind) { + this.kind = kind; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ @@ -100,14 +143,476 @@ public MachineInner withTags(Map tags) { return this; } + /** + * Get the locationData property: Metadata pertaining to the geographic location of the resource. + * + * @return the locationData value. + */ + public LocationData locationData() { + return this.innerProperties() == null ? null : this.innerProperties().locationData(); + } + + /** + * Set the locationData property: Metadata pertaining to the geographic location of the resource. + * + * @param locationData the locationData value to set. + * @return the MachineInner object itself. + */ + public MachineInner withLocationData(LocationData locationData) { + if (this.innerProperties() == null) { + this.innerProperties = new MachinePropertiesInner(); + } + this.innerProperties().withLocationData(locationData); + return this; + } + + /** + * Get the agentConfiguration property: Configurable properties that the user can set locally via the azcmagent + * config command, or remotely via ARM. + * + * @return the agentConfiguration value. + */ + public AgentConfiguration agentConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().agentConfiguration(); + } + + /** + * Get the serviceStatuses property: Statuses of dependent services that are reported back to ARM. + * + * @return the serviceStatuses value. + */ + public ServiceStatuses serviceStatuses() { + return this.innerProperties() == null ? null : this.innerProperties().serviceStatuses(); + } + + /** + * Set the serviceStatuses property: Statuses of dependent services that are reported back to ARM. + * + * @param serviceStatuses the serviceStatuses value to set. + * @return the MachineInner object itself. + */ + public MachineInner withServiceStatuses(ServiceStatuses serviceStatuses) { + if (this.innerProperties() == null) { + this.innerProperties = new MachinePropertiesInner(); + } + this.innerProperties().withServiceStatuses(serviceStatuses); + return this; + } + + /** + * Get the cloudMetadata property: The metadata of the cloud environment (Azure/GCP/AWS/OCI...). + * + * @return the cloudMetadata value. + */ + public CloudMetadata cloudMetadata() { + return this.innerProperties() == null ? null : this.innerProperties().cloudMetadata(); + } + + /** + * Set the cloudMetadata property: The metadata of the cloud environment (Azure/GCP/AWS/OCI...). + * + * @param cloudMetadata the cloudMetadata value to set. + * @return the MachineInner object itself. + */ + public MachineInner withCloudMetadata(CloudMetadata cloudMetadata) { + if (this.innerProperties() == null) { + this.innerProperties = new MachinePropertiesInner(); + } + this.innerProperties().withCloudMetadata(cloudMetadata); + return this; + } + + /** + * Get the agentUpgrade property: The info of the machine w.r.t Agent Upgrade. + * + * @return the agentUpgrade value. + */ + public AgentUpgrade agentUpgrade() { + return this.innerProperties() == null ? null : this.innerProperties().agentUpgrade(); + } + + /** + * Set the agentUpgrade property: The info of the machine w.r.t Agent Upgrade. + * + * @param agentUpgrade the agentUpgrade value to set. + * @return the MachineInner object itself. + */ + public MachineInner withAgentUpgrade(AgentUpgrade agentUpgrade) { + if (this.innerProperties() == null) { + this.innerProperties = new MachinePropertiesInner(); + } + this.innerProperties().withAgentUpgrade(agentUpgrade); + return this; + } + + /** + * Get the osProfile property: Specifies the operating system settings for the hybrid machine. + * + * @return the osProfile value. + */ + public OSProfile osProfile() { + return this.innerProperties() == null ? null : this.innerProperties().osProfile(); + } + + /** + * Set the osProfile property: Specifies the operating system settings for the hybrid machine. + * + * @param osProfile the osProfile value to set. + * @return the MachineInner object itself. + */ + public MachineInner withOsProfile(OSProfile osProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new MachinePropertiesInner(); + } + this.innerProperties().withOsProfile(osProfile); + return this; + } + + /** + * Get the licenseProfile property: Specifies the ESU related properties for a machine. + * + * @return the licenseProfile value. + */ + public LicenseProfileMachineInstanceViewInner licenseProfile() { + return this.innerProperties() == null ? null : this.innerProperties().licenseProfile(); + } + + /** + * Set the licenseProfile property: Specifies the ESU related properties for a machine. + * + * @param licenseProfile the licenseProfile value to set. + * @return the MachineInner object itself. + */ + public MachineInner withLicenseProfile(LicenseProfileMachineInstanceViewInner licenseProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new MachinePropertiesInner(); + } + this.innerProperties().withLicenseProfile(licenseProfile); + return this; + } + + /** + * Get the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the status property: The status of the hybrid machine agent. + * + * @return the status value. + */ + public StatusTypes status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Get the lastStatusChange property: The time of the last status change. + * + * @return the lastStatusChange value. + */ + public OffsetDateTime lastStatusChange() { + return this.innerProperties() == null ? null : this.innerProperties().lastStatusChange(); + } + + /** + * Get the errorDetails property: Details about the error state. + * + * @return the errorDetails value. + */ + public List errorDetails() { + return this.innerProperties() == null ? null : this.innerProperties().errorDetails(); + } + + /** + * Get the agentVersion property: The hybrid machine agent full version. + * + * @return the agentVersion value. + */ + public String agentVersion() { + return this.innerProperties() == null ? null : this.innerProperties().agentVersion(); + } + + /** + * Get the vmId property: Specifies the hybrid machine unique ID. + * + * @return the vmId value. + */ + public String vmId() { + return this.innerProperties() == null ? null : this.innerProperties().vmId(); + } + + /** + * Set the vmId property: Specifies the hybrid machine unique ID. + * + * @param vmId the vmId value to set. + * @return the MachineInner object itself. + */ + public MachineInner withVmId(String vmId) { + if (this.innerProperties() == null) { + this.innerProperties = new MachinePropertiesInner(); + } + this.innerProperties().withVmId(vmId); + return this; + } + + /** + * Get the displayName property: Specifies the hybrid machine display name. + * + * @return the displayName value. + */ + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); + } + + /** + * Get the machineFqdn property: Specifies the hybrid machine FQDN. + * + * @return the machineFqdn value. + */ + public String machineFqdn() { + return this.innerProperties() == null ? null : this.innerProperties().machineFqdn(); + } + + /** + * Get the clientPublicKey property: Public Key that the client provides to be used during initial resource + * onboarding. + * + * @return the clientPublicKey value. + */ + public String clientPublicKey() { + return this.innerProperties() == null ? null : this.innerProperties().clientPublicKey(); + } + + /** + * Set the clientPublicKey property: Public Key that the client provides to be used during initial resource + * onboarding. + * + * @param clientPublicKey the clientPublicKey value to set. + * @return the MachineInner object itself. + */ + public MachineInner withClientPublicKey(String clientPublicKey) { + if (this.innerProperties() == null) { + this.innerProperties = new MachinePropertiesInner(); + } + this.innerProperties().withClientPublicKey(clientPublicKey); + return this; + } + + /** + * Get the osName property: The Operating System running on the hybrid machine. + * + * @return the osName value. + */ + public String osName() { + return this.innerProperties() == null ? null : this.innerProperties().osName(); + } + + /** + * Get the osVersion property: The version of Operating System running on the hybrid machine. + * + * @return the osVersion value. + */ + public String osVersion() { + return this.innerProperties() == null ? null : this.innerProperties().osVersion(); + } + + /** + * Get the osType property: The type of Operating System (windows/linux). + * + * @return the osType value. + */ + public String osType() { + return this.innerProperties() == null ? null : this.innerProperties().osType(); + } + + /** + * Set the osType property: The type of Operating System (windows/linux). + * + * @param osType the osType value to set. + * @return the MachineInner object itself. + */ + public MachineInner withOsType(String osType) { + if (this.innerProperties() == null) { + this.innerProperties = new MachinePropertiesInner(); + } + this.innerProperties().withOsType(osType); + return this; + } + + /** + * Get the vmUuid property: Specifies the Arc Machine's unique SMBIOS ID. + * + * @return the vmUuid value. + */ + public String vmUuid() { + return this.innerProperties() == null ? null : this.innerProperties().vmUuid(); + } + + /** + * Get the extensions property: Machine Extensions information (deprecated field). + * + * @return the extensions value. + */ + public List extensions() { + return this.innerProperties() == null ? null : this.innerProperties().extensions(); + } + + /** + * Set the extensions property: Machine Extensions information (deprecated field). + * + * @param extensions the extensions value to set. + * @return the MachineInner object itself. + */ + public MachineInner withExtensions(List extensions) { + if (this.innerProperties() == null) { + this.innerProperties = new MachinePropertiesInner(); + } + this.innerProperties().withExtensions(extensions); + return this; + } + + /** + * Get the osSku property: Specifies the Operating System product SKU. + * + * @return the osSku value. + */ + public String osSku() { + return this.innerProperties() == null ? null : this.innerProperties().osSku(); + } + + /** + * Get the domainName property: Specifies the Windows domain name. + * + * @return the domainName value. + */ + public String domainName() { + return this.innerProperties() == null ? null : this.innerProperties().domainName(); + } + + /** + * Get the adFqdn property: Specifies the AD fully qualified display name. + * + * @return the adFqdn value. + */ + public String adFqdn() { + return this.innerProperties() == null ? null : this.innerProperties().adFqdn(); + } + + /** + * Get the dnsFqdn property: Specifies the DNS fully qualified display name. + * + * @return the dnsFqdn value. + */ + public String dnsFqdn() { + return this.innerProperties() == null ? null : this.innerProperties().dnsFqdn(); + } + + /** + * Get the privateLinkScopeResourceId property: The resource id of the private link scope this machine is assigned + * to, if any. + * + * @return the privateLinkScopeResourceId value. + */ + public String privateLinkScopeResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().privateLinkScopeResourceId(); + } + + /** + * Set the privateLinkScopeResourceId property: The resource id of the private link scope this machine is assigned + * to, if any. + * + * @param privateLinkScopeResourceId the privateLinkScopeResourceId value to set. + * @return the MachineInner object itself. + */ + public MachineInner withPrivateLinkScopeResourceId(String privateLinkScopeResourceId) { + if (this.innerProperties() == null) { + this.innerProperties = new MachinePropertiesInner(); + } + this.innerProperties().withPrivateLinkScopeResourceId(privateLinkScopeResourceId); + return this; + } + + /** + * Get the parentClusterResourceId property: The resource id of the parent cluster (Azure HCI) this machine is + * assigned to, if any. + * + * @return the parentClusterResourceId value. + */ + public String parentClusterResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().parentClusterResourceId(); + } + + /** + * Set the parentClusterResourceId property: The resource id of the parent cluster (Azure HCI) this machine is + * assigned to, if any. + * + * @param parentClusterResourceId the parentClusterResourceId value to set. + * @return the MachineInner object itself. + */ + public MachineInner withParentClusterResourceId(String parentClusterResourceId) { + if (this.innerProperties() == null) { + this.innerProperties = new MachinePropertiesInner(); + } + this.innerProperties().withParentClusterResourceId(parentClusterResourceId); + return this; + } + + /** + * Get the mssqlDiscovered property: Specifies whether any MS SQL instance is discovered on the machine. + * + * @return the mssqlDiscovered value. + */ + public String mssqlDiscovered() { + return this.innerProperties() == null ? null : this.innerProperties().mssqlDiscovered(); + } + + /** + * Set the mssqlDiscovered property: Specifies whether any MS SQL instance is discovered on the machine. + * + * @param mssqlDiscovered the mssqlDiscovered value to set. + * @return the MachineInner object itself. + */ + public MachineInner withMssqlDiscovered(String mssqlDiscovered) { + if (this.innerProperties() == null) { + this.innerProperties = new MachinePropertiesInner(); + } + this.innerProperties().withMssqlDiscovered(mssqlDiscovered); + return this; + } + + /** + * Get the detectedProperties property: Detected properties from the machine. + * + * @return the detectedProperties value. + */ + public Map detectedProperties() { + return this.innerProperties() == null ? null : this.innerProperties().detectedProperties(); + } + + /** + * Get the networkProfile property: Information about the network the machine is on. + * + * @return the networkProfile value. + */ + public NetworkProfileInner networkProfile() { + return this.innerProperties() == null ? null : this.innerProperties().networkProfile(); + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (properties() != null) { - properties().validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + if (resources() != null) { + resources().forEach(e -> e.validate()); } if (identity() != null) { identity().validate(); diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineInstallPatchesResultInner.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineInstallPatchesResultInner.java new file mode 100644 index 0000000000000..3c078ae9f8fe3 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineInstallPatchesResultInner.java @@ -0,0 +1,266 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.hybridcompute.models.OsType; +import com.azure.resourcemanager.hybridcompute.models.PatchOperationStartedBy; +import com.azure.resourcemanager.hybridcompute.models.PatchOperationStatus; +import com.azure.resourcemanager.hybridcompute.models.PatchServiceUsed; +import com.azure.resourcemanager.hybridcompute.models.VMGuestPatchRebootStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The result summary of an installation operation. */ +@Immutable +public final class MachineInstallPatchesResultInner { + /* + * The overall success or failure status of the operation. It remains "InProgress" until the operation completes. + * At that point it will become "Failed", "Succeeded", "Unknown" or "CompletedWithWarnings." + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private PatchOperationStatus status; + + /* + * The activity ID of the operation that produced this result. + */ + @JsonProperty(value = "installationActivityId", access = JsonProperty.Access.WRITE_ONLY) + private String installationActivityId; + + /* + * The reboot state of the VM following completion of the operation. + */ + @JsonProperty(value = "rebootStatus", access = JsonProperty.Access.WRITE_ONLY) + private VMGuestPatchRebootStatus rebootStatus; + + /* + * Whether the operation ran out of time before it completed all its intended actions. + */ + @JsonProperty(value = "maintenanceWindowExceeded", access = JsonProperty.Access.WRITE_ONLY) + private Boolean maintenanceWindowExceeded; + + /* + * The number of patches that were not installed due to the user blocking their installation. + */ + @JsonProperty(value = "excludedPatchCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer excludedPatchCount; + + /* + * The number of patches that were detected as available for install, but did not meet the operation's criteria. + */ + @JsonProperty(value = "notSelectedPatchCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer notSelectedPatchCount; + + /* + * The number of patches that were identified as meeting the installation criteria, but were not able to be + * installed. Typically this happens when maintenanceWindowExceeded == true. + */ + @JsonProperty(value = "pendingPatchCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer pendingPatchCount; + + /* + * The number of patches successfully installed. + */ + @JsonProperty(value = "installedPatchCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer installedPatchCount; + + /* + * The number of patches that could not be installed due to some issue. See errors for details. + */ + @JsonProperty(value = "failedPatchCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer failedPatchCount; + + /* + * The UTC timestamp when the operation began. + */ + @JsonProperty(value = "startDateTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startDateTime; + + /* + * The UTC timestamp when the operation finished. + */ + @JsonProperty(value = "lastModifiedDateTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastModifiedDateTime; + + /* + * Indicates if operation was triggered by user or by platform. + */ + @JsonProperty(value = "startedBy", access = JsonProperty.Access.WRITE_ONLY) + private PatchOperationStartedBy startedBy; + + /* + * Specifies the patch service used for the operation. + */ + @JsonProperty(value = "patchServiceUsed", access = JsonProperty.Access.WRITE_ONLY) + private PatchServiceUsed patchServiceUsed; + + /* + * The operating system type of the machine. + */ + @JsonProperty(value = "osType", access = JsonProperty.Access.WRITE_ONLY) + private OsType osType; + + /* + * The errors that were encountered during execution of the operation. The details array contains the list of them. + */ + @JsonProperty(value = "errorDetails", access = JsonProperty.Access.WRITE_ONLY) + private ManagementError errorDetails; + + /** Creates an instance of MachineInstallPatchesResultInner class. */ + public MachineInstallPatchesResultInner() { + } + + /** + * Get the status property: The overall success or failure status of the operation. It remains "InProgress" until + * the operation completes. At that point it will become "Failed", "Succeeded", "Unknown" or + * "CompletedWithWarnings.". + * + * @return the status value. + */ + public PatchOperationStatus status() { + return this.status; + } + + /** + * Get the installationActivityId property: The activity ID of the operation that produced this result. + * + * @return the installationActivityId value. + */ + public String installationActivityId() { + return this.installationActivityId; + } + + /** + * Get the rebootStatus property: The reboot state of the VM following completion of the operation. + * + * @return the rebootStatus value. + */ + public VMGuestPatchRebootStatus rebootStatus() { + return this.rebootStatus; + } + + /** + * Get the maintenanceWindowExceeded property: Whether the operation ran out of time before it completed all its + * intended actions. + * + * @return the maintenanceWindowExceeded value. + */ + public Boolean maintenanceWindowExceeded() { + return this.maintenanceWindowExceeded; + } + + /** + * Get the excludedPatchCount property: The number of patches that were not installed due to the user blocking their + * installation. + * + * @return the excludedPatchCount value. + */ + public Integer excludedPatchCount() { + return this.excludedPatchCount; + } + + /** + * Get the notSelectedPatchCount property: The number of patches that were detected as available for install, but + * did not meet the operation's criteria. + * + * @return the notSelectedPatchCount value. + */ + public Integer notSelectedPatchCount() { + return this.notSelectedPatchCount; + } + + /** + * Get the pendingPatchCount property: The number of patches that were identified as meeting the installation + * criteria, but were not able to be installed. Typically this happens when maintenanceWindowExceeded == true. + * + * @return the pendingPatchCount value. + */ + public Integer pendingPatchCount() { + return this.pendingPatchCount; + } + + /** + * Get the installedPatchCount property: The number of patches successfully installed. + * + * @return the installedPatchCount value. + */ + public Integer installedPatchCount() { + return this.installedPatchCount; + } + + /** + * Get the failedPatchCount property: The number of patches that could not be installed due to some issue. See + * errors for details. + * + * @return the failedPatchCount value. + */ + public Integer failedPatchCount() { + return this.failedPatchCount; + } + + /** + * Get the startDateTime property: The UTC timestamp when the operation began. + * + * @return the startDateTime value. + */ + public OffsetDateTime startDateTime() { + return this.startDateTime; + } + + /** + * Get the lastModifiedDateTime property: The UTC timestamp when the operation finished. + * + * @return the lastModifiedDateTime value. + */ + public OffsetDateTime lastModifiedDateTime() { + return this.lastModifiedDateTime; + } + + /** + * Get the startedBy property: Indicates if operation was triggered by user or by platform. + * + * @return the startedBy value. + */ + public PatchOperationStartedBy startedBy() { + return this.startedBy; + } + + /** + * Get the patchServiceUsed property: Specifies the patch service used for the operation. + * + * @return the patchServiceUsed value. + */ + public PatchServiceUsed patchServiceUsed() { + return this.patchServiceUsed; + } + + /** + * Get the osType property: The operating system type of the machine. + * + * @return the osType value. + */ + public OsType osType() { + return this.osType; + } + + /** + * Get the errorDetails property: The errors that were encountered during execution of the operation. The details + * array contains the list of them. + * + * @return the errorDetails value. + */ + public ManagementError errorDetails() { + return this.errorDetails; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachinePropertiesInner.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachinePropertiesInner.java new file mode 100644 index 0000000000000..8dd8509eca755 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachinePropertiesInner.java @@ -0,0 +1,665 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.hybridcompute.models.AgentConfiguration; +import com.azure.resourcemanager.hybridcompute.models.AgentUpgrade; +import com.azure.resourcemanager.hybridcompute.models.CloudMetadata; +import com.azure.resourcemanager.hybridcompute.models.LocationData; +import com.azure.resourcemanager.hybridcompute.models.MachineExtensionInstanceView; +import com.azure.resourcemanager.hybridcompute.models.OSProfile; +import com.azure.resourcemanager.hybridcompute.models.ServiceStatuses; +import com.azure.resourcemanager.hybridcompute.models.StatusTypes; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** Describes the properties of a hybrid machine. */ +@Fluent +public final class MachinePropertiesInner { + /* + * Metadata pertaining to the geographic location of the resource. + */ + @JsonProperty(value = "locationData") + private LocationData locationData; + + /* + * Configurable properties that the user can set locally via the azcmagent config command, or remotely via ARM. + */ + @JsonProperty(value = "agentConfiguration", access = JsonProperty.Access.WRITE_ONLY) + private AgentConfiguration agentConfiguration; + + /* + * Statuses of dependent services that are reported back to ARM. + */ + @JsonProperty(value = "serviceStatuses") + private ServiceStatuses serviceStatuses; + + /* + * The metadata of the cloud environment (Azure/GCP/AWS/OCI...). + */ + @JsonProperty(value = "cloudMetadata") + private CloudMetadata cloudMetadata; + + /* + * The info of the machine w.r.t Agent Upgrade + */ + @JsonProperty(value = "agentUpgrade") + private AgentUpgrade agentUpgrade; + + /* + * Specifies the operating system settings for the hybrid machine. + */ + @JsonProperty(value = "osProfile") + private OSProfile osProfile; + + /* + * Specifies the ESU related properties for a machine. + */ + @JsonProperty(value = "licenseProfile") + private LicenseProfileMachineInstanceViewInner licenseProfile; + + /* + * The provisioning state, which only appears in the response. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The status of the hybrid machine agent. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private StatusTypes status; + + /* + * The time of the last status change. + */ + @JsonProperty(value = "lastStatusChange", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastStatusChange; + + /* + * Details about the error state. + */ + @JsonProperty(value = "errorDetails", access = JsonProperty.Access.WRITE_ONLY) + private List errorDetails; + + /* + * The hybrid machine agent full version. + */ + @JsonProperty(value = "agentVersion", access = JsonProperty.Access.WRITE_ONLY) + private String agentVersion; + + /* + * Specifies the hybrid machine unique ID. + */ + @JsonProperty(value = "vmId") + private String vmId; + + /* + * Specifies the hybrid machine display name. + */ + @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) + private String displayName; + + /* + * Specifies the hybrid machine FQDN. + */ + @JsonProperty(value = "machineFqdn", access = JsonProperty.Access.WRITE_ONLY) + private String machineFqdn; + + /* + * Public Key that the client provides to be used during initial resource onboarding + */ + @JsonProperty(value = "clientPublicKey") + private String clientPublicKey; + + /* + * The Operating System running on the hybrid machine. + */ + @JsonProperty(value = "osName", access = JsonProperty.Access.WRITE_ONLY) + private String osName; + + /* + * The version of Operating System running on the hybrid machine. + */ + @JsonProperty(value = "osVersion", access = JsonProperty.Access.WRITE_ONLY) + private String osVersion; + + /* + * The type of Operating System (windows/linux). + */ + @JsonProperty(value = "osType") + private String osType; + + /* + * Specifies the Arc Machine's unique SMBIOS ID + */ + @JsonProperty(value = "vmUuid", access = JsonProperty.Access.WRITE_ONLY) + private String vmUuid; + + /* + * Machine Extensions information (deprecated field) + */ + @JsonProperty(value = "extensions") + private List extensions; + + /* + * Specifies the Operating System product SKU. + */ + @JsonProperty(value = "osSku", access = JsonProperty.Access.WRITE_ONLY) + private String osSku; + + /* + * Specifies the Windows domain name. + */ + @JsonProperty(value = "domainName", access = JsonProperty.Access.WRITE_ONLY) + private String domainName; + + /* + * Specifies the AD fully qualified display name. + */ + @JsonProperty(value = "adFqdn", access = JsonProperty.Access.WRITE_ONLY) + private String adFqdn; + + /* + * Specifies the DNS fully qualified display name. + */ + @JsonProperty(value = "dnsFqdn", access = JsonProperty.Access.WRITE_ONLY) + private String dnsFqdn; + + /* + * The resource id of the private link scope this machine is assigned to, if any. + */ + @JsonProperty(value = "privateLinkScopeResourceId") + private String privateLinkScopeResourceId; + + /* + * The resource id of the parent cluster (Azure HCI) this machine is assigned to, if any. + */ + @JsonProperty(value = "parentClusterResourceId") + private String parentClusterResourceId; + + /* + * Specifies whether any MS SQL instance is discovered on the machine. + */ + @JsonProperty(value = "mssqlDiscovered") + private String mssqlDiscovered; + + /* + * Detected properties from the machine. + */ + @JsonProperty(value = "detectedProperties", access = JsonProperty.Access.WRITE_ONLY) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map detectedProperties; + + /* + * Information about the network the machine is on. + */ + @JsonProperty(value = "networkProfile", access = JsonProperty.Access.WRITE_ONLY) + private NetworkProfileInner networkProfile; + + /** Creates an instance of MachinePropertiesInner class. */ + public MachinePropertiesInner() { + } + + /** + * Get the locationData property: Metadata pertaining to the geographic location of the resource. + * + * @return the locationData value. + */ + public LocationData locationData() { + return this.locationData; + } + + /** + * Set the locationData property: Metadata pertaining to the geographic location of the resource. + * + * @param locationData the locationData value to set. + * @return the MachinePropertiesInner object itself. + */ + public MachinePropertiesInner withLocationData(LocationData locationData) { + this.locationData = locationData; + return this; + } + + /** + * Get the agentConfiguration property: Configurable properties that the user can set locally via the azcmagent + * config command, or remotely via ARM. + * + * @return the agentConfiguration value. + */ + public AgentConfiguration agentConfiguration() { + return this.agentConfiguration; + } + + /** + * Get the serviceStatuses property: Statuses of dependent services that are reported back to ARM. + * + * @return the serviceStatuses value. + */ + public ServiceStatuses serviceStatuses() { + return this.serviceStatuses; + } + + /** + * Set the serviceStatuses property: Statuses of dependent services that are reported back to ARM. + * + * @param serviceStatuses the serviceStatuses value to set. + * @return the MachinePropertiesInner object itself. + */ + public MachinePropertiesInner withServiceStatuses(ServiceStatuses serviceStatuses) { + this.serviceStatuses = serviceStatuses; + return this; + } + + /** + * Get the cloudMetadata property: The metadata of the cloud environment (Azure/GCP/AWS/OCI...). + * + * @return the cloudMetadata value. + */ + public CloudMetadata cloudMetadata() { + return this.cloudMetadata; + } + + /** + * Set the cloudMetadata property: The metadata of the cloud environment (Azure/GCP/AWS/OCI...). + * + * @param cloudMetadata the cloudMetadata value to set. + * @return the MachinePropertiesInner object itself. + */ + public MachinePropertiesInner withCloudMetadata(CloudMetadata cloudMetadata) { + this.cloudMetadata = cloudMetadata; + return this; + } + + /** + * Get the agentUpgrade property: The info of the machine w.r.t Agent Upgrade. + * + * @return the agentUpgrade value. + */ + public AgentUpgrade agentUpgrade() { + return this.agentUpgrade; + } + + /** + * Set the agentUpgrade property: The info of the machine w.r.t Agent Upgrade. + * + * @param agentUpgrade the agentUpgrade value to set. + * @return the MachinePropertiesInner object itself. + */ + public MachinePropertiesInner withAgentUpgrade(AgentUpgrade agentUpgrade) { + this.agentUpgrade = agentUpgrade; + return this; + } + + /** + * Get the osProfile property: Specifies the operating system settings for the hybrid machine. + * + * @return the osProfile value. + */ + public OSProfile osProfile() { + return this.osProfile; + } + + /** + * Set the osProfile property: Specifies the operating system settings for the hybrid machine. + * + * @param osProfile the osProfile value to set. + * @return the MachinePropertiesInner object itself. + */ + public MachinePropertiesInner withOsProfile(OSProfile osProfile) { + this.osProfile = osProfile; + return this; + } + + /** + * Get the licenseProfile property: Specifies the ESU related properties for a machine. + * + * @return the licenseProfile value. + */ + public LicenseProfileMachineInstanceViewInner licenseProfile() { + return this.licenseProfile; + } + + /** + * Set the licenseProfile property: Specifies the ESU related properties for a machine. + * + * @param licenseProfile the licenseProfile value to set. + * @return the MachinePropertiesInner object itself. + */ + public MachinePropertiesInner withLicenseProfile(LicenseProfileMachineInstanceViewInner licenseProfile) { + this.licenseProfile = licenseProfile; + return this; + } + + /** + * Get the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the status property: The status of the hybrid machine agent. + * + * @return the status value. + */ + public StatusTypes status() { + return this.status; + } + + /** + * Get the lastStatusChange property: The time of the last status change. + * + * @return the lastStatusChange value. + */ + public OffsetDateTime lastStatusChange() { + return this.lastStatusChange; + } + + /** + * Get the errorDetails property: Details about the error state. + * + * @return the errorDetails value. + */ + public List errorDetails() { + return this.errorDetails; + } + + /** + * Get the agentVersion property: The hybrid machine agent full version. + * + * @return the agentVersion value. + */ + public String agentVersion() { + return this.agentVersion; + } + + /** + * Get the vmId property: Specifies the hybrid machine unique ID. + * + * @return the vmId value. + */ + public String vmId() { + return this.vmId; + } + + /** + * Set the vmId property: Specifies the hybrid machine unique ID. + * + * @param vmId the vmId value to set. + * @return the MachinePropertiesInner object itself. + */ + public MachinePropertiesInner withVmId(String vmId) { + this.vmId = vmId; + return this; + } + + /** + * Get the displayName property: Specifies the hybrid machine display name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Get the machineFqdn property: Specifies the hybrid machine FQDN. + * + * @return the machineFqdn value. + */ + public String machineFqdn() { + return this.machineFqdn; + } + + /** + * Get the clientPublicKey property: Public Key that the client provides to be used during initial resource + * onboarding. + * + * @return the clientPublicKey value. + */ + public String clientPublicKey() { + return this.clientPublicKey; + } + + /** + * Set the clientPublicKey property: Public Key that the client provides to be used during initial resource + * onboarding. + * + * @param clientPublicKey the clientPublicKey value to set. + * @return the MachinePropertiesInner object itself. + */ + public MachinePropertiesInner withClientPublicKey(String clientPublicKey) { + this.clientPublicKey = clientPublicKey; + return this; + } + + /** + * Get the osName property: The Operating System running on the hybrid machine. + * + * @return the osName value. + */ + public String osName() { + return this.osName; + } + + /** + * Get the osVersion property: The version of Operating System running on the hybrid machine. + * + * @return the osVersion value. + */ + public String osVersion() { + return this.osVersion; + } + + /** + * Get the osType property: The type of Operating System (windows/linux). + * + * @return the osType value. + */ + public String osType() { + return this.osType; + } + + /** + * Set the osType property: The type of Operating System (windows/linux). + * + * @param osType the osType value to set. + * @return the MachinePropertiesInner object itself. + */ + public MachinePropertiesInner withOsType(String osType) { + this.osType = osType; + return this; + } + + /** + * Get the vmUuid property: Specifies the Arc Machine's unique SMBIOS ID. + * + * @return the vmUuid value. + */ + public String vmUuid() { + return this.vmUuid; + } + + /** + * Get the extensions property: Machine Extensions information (deprecated field). + * + * @return the extensions value. + */ + public List extensions() { + return this.extensions; + } + + /** + * Set the extensions property: Machine Extensions information (deprecated field). + * + * @param extensions the extensions value to set. + * @return the MachinePropertiesInner object itself. + */ + public MachinePropertiesInner withExtensions(List extensions) { + this.extensions = extensions; + return this; + } + + /** + * Get the osSku property: Specifies the Operating System product SKU. + * + * @return the osSku value. + */ + public String osSku() { + return this.osSku; + } + + /** + * Get the domainName property: Specifies the Windows domain name. + * + * @return the domainName value. + */ + public String domainName() { + return this.domainName; + } + + /** + * Get the adFqdn property: Specifies the AD fully qualified display name. + * + * @return the adFqdn value. + */ + public String adFqdn() { + return this.adFqdn; + } + + /** + * Get the dnsFqdn property: Specifies the DNS fully qualified display name. + * + * @return the dnsFqdn value. + */ + public String dnsFqdn() { + return this.dnsFqdn; + } + + /** + * Get the privateLinkScopeResourceId property: The resource id of the private link scope this machine is assigned + * to, if any. + * + * @return the privateLinkScopeResourceId value. + */ + public String privateLinkScopeResourceId() { + return this.privateLinkScopeResourceId; + } + + /** + * Set the privateLinkScopeResourceId property: The resource id of the private link scope this machine is assigned + * to, if any. + * + * @param privateLinkScopeResourceId the privateLinkScopeResourceId value to set. + * @return the MachinePropertiesInner object itself. + */ + public MachinePropertiesInner withPrivateLinkScopeResourceId(String privateLinkScopeResourceId) { + this.privateLinkScopeResourceId = privateLinkScopeResourceId; + return this; + } + + /** + * Get the parentClusterResourceId property: The resource id of the parent cluster (Azure HCI) this machine is + * assigned to, if any. + * + * @return the parentClusterResourceId value. + */ + public String parentClusterResourceId() { + return this.parentClusterResourceId; + } + + /** + * Set the parentClusterResourceId property: The resource id of the parent cluster (Azure HCI) this machine is + * assigned to, if any. + * + * @param parentClusterResourceId the parentClusterResourceId value to set. + * @return the MachinePropertiesInner object itself. + */ + public MachinePropertiesInner withParentClusterResourceId(String parentClusterResourceId) { + this.parentClusterResourceId = parentClusterResourceId; + return this; + } + + /** + * Get the mssqlDiscovered property: Specifies whether any MS SQL instance is discovered on the machine. + * + * @return the mssqlDiscovered value. + */ + public String mssqlDiscovered() { + return this.mssqlDiscovered; + } + + /** + * Set the mssqlDiscovered property: Specifies whether any MS SQL instance is discovered on the machine. + * + * @param mssqlDiscovered the mssqlDiscovered value to set. + * @return the MachinePropertiesInner object itself. + */ + public MachinePropertiesInner withMssqlDiscovered(String mssqlDiscovered) { + this.mssqlDiscovered = mssqlDiscovered; + return this; + } + + /** + * Get the detectedProperties property: Detected properties from the machine. + * + * @return the detectedProperties value. + */ + public Map detectedProperties() { + return this.detectedProperties; + } + + /** + * Get the networkProfile property: Information about the network the machine is on. + * + * @return the networkProfile value. + */ + public NetworkProfileInner networkProfile() { + return this.networkProfile; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (locationData() != null) { + locationData().validate(); + } + if (agentConfiguration() != null) { + agentConfiguration().validate(); + } + if (serviceStatuses() != null) { + serviceStatuses().validate(); + } + if (cloudMetadata() != null) { + cloudMetadata().validate(); + } + if (agentUpgrade() != null) { + agentUpgrade().validate(); + } + if (osProfile() != null) { + osProfile().validate(); + } + if (licenseProfile() != null) { + licenseProfile().validate(); + } + if (extensions() != null) { + extensions().forEach(e -> e.validate()); + } + if (networkProfile() != null) { + networkProfile().validate(); + } + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineRunCommandInner.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineRunCommandInner.java new file mode 100644 index 0000000000000..8fc4da89b4550 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineRunCommandInner.java @@ -0,0 +1,378 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.hybridcompute.models.MachineRunCommandInstanceView; +import com.azure.resourcemanager.hybridcompute.models.MachineRunCommandScriptSource; +import com.azure.resourcemanager.hybridcompute.models.RunCommandInputParameter; +import com.azure.resourcemanager.hybridcompute.models.RunCommandManagedIdentity; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Describes a Run Command. */ +@Fluent +public final class MachineRunCommandInner extends Resource { + /* + * Describes Run Command Properties + */ + @JsonProperty(value = "properties") + private MachineRunCommandProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of MachineRunCommandInner class. */ + public MachineRunCommandInner() { + } + + /** + * Get the innerProperties property: Describes Run Command Properties. + * + * @return the innerProperties value. + */ + private MachineRunCommandProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public MachineRunCommandInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public MachineRunCommandInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the source property: The source of the run command script. + * + * @return the source value. + */ + public MachineRunCommandScriptSource source() { + return this.innerProperties() == null ? null : this.innerProperties().source(); + } + + /** + * Set the source property: The source of the run command script. + * + * @param source the source value to set. + * @return the MachineRunCommandInner object itself. + */ + public MachineRunCommandInner withSource(MachineRunCommandScriptSource source) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineRunCommandProperties(); + } + this.innerProperties().withSource(source); + return this; + } + + /** + * Get the parameters property: The parameters used by the script. + * + * @return the parameters value. + */ + public List parameters() { + return this.innerProperties() == null ? null : this.innerProperties().parameters(); + } + + /** + * Set the parameters property: The parameters used by the script. + * + * @param parameters the parameters value to set. + * @return the MachineRunCommandInner object itself. + */ + public MachineRunCommandInner withParameters(List parameters) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineRunCommandProperties(); + } + this.innerProperties().withParameters(parameters); + return this; + } + + /** + * Get the protectedParameters property: The parameters used by the script. + * + * @return the protectedParameters value. + */ + public List protectedParameters() { + return this.innerProperties() == null ? null : this.innerProperties().protectedParameters(); + } + + /** + * Set the protectedParameters property: The parameters used by the script. + * + * @param protectedParameters the protectedParameters value to set. + * @return the MachineRunCommandInner object itself. + */ + public MachineRunCommandInner withProtectedParameters(List protectedParameters) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineRunCommandProperties(); + } + this.innerProperties().withProtectedParameters(protectedParameters); + return this; + } + + /** + * Get the asyncExecution property: Optional. If set to true, provisioning will complete as soon as script starts + * and will not wait for script to complete. + * + * @return the asyncExecution value. + */ + public Boolean asyncExecution() { + return this.innerProperties() == null ? null : this.innerProperties().asyncExecution(); + } + + /** + * Set the asyncExecution property: Optional. If set to true, provisioning will complete as soon as script starts + * and will not wait for script to complete. + * + * @param asyncExecution the asyncExecution value to set. + * @return the MachineRunCommandInner object itself. + */ + public MachineRunCommandInner withAsyncExecution(Boolean asyncExecution) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineRunCommandProperties(); + } + this.innerProperties().withAsyncExecution(asyncExecution); + return this; + } + + /** + * Get the runAsUser property: Specifies the user account on the machine when executing the run command. + * + * @return the runAsUser value. + */ + public String runAsUser() { + return this.innerProperties() == null ? null : this.innerProperties().runAsUser(); + } + + /** + * Set the runAsUser property: Specifies the user account on the machine when executing the run command. + * + * @param runAsUser the runAsUser value to set. + * @return the MachineRunCommandInner object itself. + */ + public MachineRunCommandInner withRunAsUser(String runAsUser) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineRunCommandProperties(); + } + this.innerProperties().withRunAsUser(runAsUser); + return this; + } + + /** + * Get the runAsPassword property: Specifies the user account password on the machine when executing the run + * command. + * + * @return the runAsPassword value. + */ + public String runAsPassword() { + return this.innerProperties() == null ? null : this.innerProperties().runAsPassword(); + } + + /** + * Set the runAsPassword property: Specifies the user account password on the machine when executing the run + * command. + * + * @param runAsPassword the runAsPassword value to set. + * @return the MachineRunCommandInner object itself. + */ + public MachineRunCommandInner withRunAsPassword(String runAsPassword) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineRunCommandProperties(); + } + this.innerProperties().withRunAsPassword(runAsPassword); + return this; + } + + /** + * Get the timeoutInSeconds property: The timeout in seconds to execute the run command. + * + * @return the timeoutInSeconds value. + */ + public Integer timeoutInSeconds() { + return this.innerProperties() == null ? null : this.innerProperties().timeoutInSeconds(); + } + + /** + * Set the timeoutInSeconds property: The timeout in seconds to execute the run command. + * + * @param timeoutInSeconds the timeoutInSeconds value to set. + * @return the MachineRunCommandInner object itself. + */ + public MachineRunCommandInner withTimeoutInSeconds(Integer timeoutInSeconds) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineRunCommandProperties(); + } + this.innerProperties().withTimeoutInSeconds(timeoutInSeconds); + return this; + } + + /** + * Get the outputBlobUri property: Specifies the Azure storage blob where script output stream will be uploaded. Use + * a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. + * Refer outputBlobManagedIdentity parameter. + * + * @return the outputBlobUri value. + */ + public String outputBlobUri() { + return this.innerProperties() == null ? null : this.innerProperties().outputBlobUri(); + } + + /** + * Set the outputBlobUri property: Specifies the Azure storage blob where script output stream will be uploaded. Use + * a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. + * Refer outputBlobManagedIdentity parameter. + * + * @param outputBlobUri the outputBlobUri value to set. + * @return the MachineRunCommandInner object itself. + */ + public MachineRunCommandInner withOutputBlobUri(String outputBlobUri) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineRunCommandProperties(); + } + this.innerProperties().withOutputBlobUri(outputBlobUri); + return this; + } + + /** + * Get the errorBlobUri property: Specifies the Azure storage blob where script error stream will be uploaded. Use a + * SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. + * Refer errorBlobManagedIdentity parameter. + * + * @return the errorBlobUri value. + */ + public String errorBlobUri() { + return this.innerProperties() == null ? null : this.innerProperties().errorBlobUri(); + } + + /** + * Set the errorBlobUri property: Specifies the Azure storage blob where script error stream will be uploaded. Use a + * SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. + * Refer errorBlobManagedIdentity parameter. + * + * @param errorBlobUri the errorBlobUri value to set. + * @return the MachineRunCommandInner object itself. + */ + public MachineRunCommandInner withErrorBlobUri(String errorBlobUri) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineRunCommandProperties(); + } + this.innerProperties().withErrorBlobUri(errorBlobUri); + return this; + } + + /** + * Get the outputBlobManagedIdentity property: User-assigned managed identity that has access to outputBlobUri + * storage blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been given + * access to blob's container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned + * identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer + * https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. + * + * @return the outputBlobManagedIdentity value. + */ + public RunCommandManagedIdentity outputBlobManagedIdentity() { + return this.innerProperties() == null ? null : this.innerProperties().outputBlobManagedIdentity(); + } + + /** + * Set the outputBlobManagedIdentity property: User-assigned managed identity that has access to outputBlobUri + * storage blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been given + * access to blob's container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned + * identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer + * https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. + * + * @param outputBlobManagedIdentity the outputBlobManagedIdentity value to set. + * @return the MachineRunCommandInner object itself. + */ + public MachineRunCommandInner withOutputBlobManagedIdentity(RunCommandManagedIdentity outputBlobManagedIdentity) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineRunCommandProperties(); + } + this.innerProperties().withOutputBlobManagedIdentity(outputBlobManagedIdentity); + return this; + } + + /** + * Get the errorBlobManagedIdentity property: User-assigned managed identity that has access to errorBlobUri storage + * blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been given access + * to blob's container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned identity, make + * sure you add it under VM's identity. For more info on managed identity and Run Command, refer + * https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. + * + * @return the errorBlobManagedIdentity value. + */ + public RunCommandManagedIdentity errorBlobManagedIdentity() { + return this.innerProperties() == null ? null : this.innerProperties().errorBlobManagedIdentity(); + } + + /** + * Set the errorBlobManagedIdentity property: User-assigned managed identity that has access to errorBlobUri storage + * blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been given access + * to blob's container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned identity, make + * sure you add it under VM's identity. For more info on managed identity and Run Command, refer + * https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. + * + * @param errorBlobManagedIdentity the errorBlobManagedIdentity value to set. + * @return the MachineRunCommandInner object itself. + */ + public MachineRunCommandInner withErrorBlobManagedIdentity(RunCommandManagedIdentity errorBlobManagedIdentity) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineRunCommandProperties(); + } + this.innerProperties().withErrorBlobManagedIdentity(errorBlobManagedIdentity); + return this; + } + + /** + * Get the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the instanceView property: The machine run command instance view. + * + * @return the instanceView value. + */ + public MachineRunCommandInstanceView instanceView() { + return this.innerProperties() == null ? null : this.innerProperties().instanceView(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineRunCommandProperties.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineRunCommandProperties.java new file mode 100644 index 0000000000000..da76369969f4e --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineRunCommandProperties.java @@ -0,0 +1,406 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.hybridcompute.models.MachineRunCommandInstanceView; +import com.azure.resourcemanager.hybridcompute.models.MachineRunCommandScriptSource; +import com.azure.resourcemanager.hybridcompute.models.RunCommandInputParameter; +import com.azure.resourcemanager.hybridcompute.models.RunCommandManagedIdentity; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes the properties of a run command. */ +@Fluent +public final class MachineRunCommandProperties { + /* + * The source of the run command script. + */ + @JsonProperty(value = "source") + private MachineRunCommandScriptSource source; + + /* + * The parameters used by the script. + */ + @JsonProperty(value = "parameters") + private List parameters; + + /* + * The parameters used by the script. + */ + @JsonProperty(value = "protectedParameters") + private List protectedParameters; + + /* + * Optional. If set to true, provisioning will complete as soon as script starts and will not wait for script to + * complete. + */ + @JsonProperty(value = "asyncExecution") + private Boolean asyncExecution; + + /* + * Specifies the user account on the machine when executing the run command. + */ + @JsonProperty(value = "runAsUser") + private String runAsUser; + + /* + * Specifies the user account password on the machine when executing the run command. + */ + @JsonProperty(value = "runAsPassword") + private String runAsPassword; + + /* + * The timeout in seconds to execute the run command. + */ + @JsonProperty(value = "timeoutInSeconds") + private Integer timeoutInSeconds; + + /* + * Specifies the Azure storage blob where script output stream will be uploaded. Use a SAS URI with read, append, + * create, write access OR use managed identity to provide the VM access to the blob. Refer + * outputBlobManagedIdentity parameter. + */ + @JsonProperty(value = "outputBlobUri") + private String outputBlobUri; + + /* + * Specifies the Azure storage blob where script error stream will be uploaded. Use a SAS URI with read, append, + * create, write access OR use managed identity to provide the VM access to the blob. Refer + * errorBlobManagedIdentity parameter. + */ + @JsonProperty(value = "errorBlobUri") + private String errorBlobUri; + + /* + * User-assigned managed identity that has access to outputBlobUri storage blob. Use an empty object in case of + * system-assigned identity. Make sure managed identity has been given access to blob's container with 'Storage + * Blob Data Contributor' role assignment. In case of user-assigned identity, make sure you add it under VM's + * identity. For more info on managed identity and Run Command, refer https://aka.ms/ManagedIdentity and + * https://aka.ms/RunCommandManaged + */ + @JsonProperty(value = "outputBlobManagedIdentity") + private RunCommandManagedIdentity outputBlobManagedIdentity; + + /* + * User-assigned managed identity that has access to errorBlobUri storage blob. Use an empty object in case of + * system-assigned identity. Make sure managed identity has been given access to blob's container with 'Storage + * Blob Data Contributor' role assignment. In case of user-assigned identity, make sure you add it under VM's + * identity. For more info on managed identity and Run Command, refer https://aka.ms/ManagedIdentity and + * https://aka.ms/RunCommandManaged + */ + @JsonProperty(value = "errorBlobManagedIdentity") + private RunCommandManagedIdentity errorBlobManagedIdentity; + + /* + * The provisioning state, which only appears in the response. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The machine run command instance view. + */ + @JsonProperty(value = "instanceView", access = JsonProperty.Access.WRITE_ONLY) + private MachineRunCommandInstanceView instanceView; + + /** Creates an instance of MachineRunCommandProperties class. */ + public MachineRunCommandProperties() { + } + + /** + * Get the source property: The source of the run command script. + * + * @return the source value. + */ + public MachineRunCommandScriptSource source() { + return this.source; + } + + /** + * Set the source property: The source of the run command script. + * + * @param source the source value to set. + * @return the MachineRunCommandProperties object itself. + */ + public MachineRunCommandProperties withSource(MachineRunCommandScriptSource source) { + this.source = source; + return this; + } + + /** + * Get the parameters property: The parameters used by the script. + * + * @return the parameters value. + */ + public List parameters() { + return this.parameters; + } + + /** + * Set the parameters property: The parameters used by the script. + * + * @param parameters the parameters value to set. + * @return the MachineRunCommandProperties object itself. + */ + public MachineRunCommandProperties withParameters(List parameters) { + this.parameters = parameters; + return this; + } + + /** + * Get the protectedParameters property: The parameters used by the script. + * + * @return the protectedParameters value. + */ + public List protectedParameters() { + return this.protectedParameters; + } + + /** + * Set the protectedParameters property: The parameters used by the script. + * + * @param protectedParameters the protectedParameters value to set. + * @return the MachineRunCommandProperties object itself. + */ + public MachineRunCommandProperties withProtectedParameters(List protectedParameters) { + this.protectedParameters = protectedParameters; + return this; + } + + /** + * Get the asyncExecution property: Optional. If set to true, provisioning will complete as soon as script starts + * and will not wait for script to complete. + * + * @return the asyncExecution value. + */ + public Boolean asyncExecution() { + return this.asyncExecution; + } + + /** + * Set the asyncExecution property: Optional. If set to true, provisioning will complete as soon as script starts + * and will not wait for script to complete. + * + * @param asyncExecution the asyncExecution value to set. + * @return the MachineRunCommandProperties object itself. + */ + public MachineRunCommandProperties withAsyncExecution(Boolean asyncExecution) { + this.asyncExecution = asyncExecution; + return this; + } + + /** + * Get the runAsUser property: Specifies the user account on the machine when executing the run command. + * + * @return the runAsUser value. + */ + public String runAsUser() { + return this.runAsUser; + } + + /** + * Set the runAsUser property: Specifies the user account on the machine when executing the run command. + * + * @param runAsUser the runAsUser value to set. + * @return the MachineRunCommandProperties object itself. + */ + public MachineRunCommandProperties withRunAsUser(String runAsUser) { + this.runAsUser = runAsUser; + return this; + } + + /** + * Get the runAsPassword property: Specifies the user account password on the machine when executing the run + * command. + * + * @return the runAsPassword value. + */ + public String runAsPassword() { + return this.runAsPassword; + } + + /** + * Set the runAsPassword property: Specifies the user account password on the machine when executing the run + * command. + * + * @param runAsPassword the runAsPassword value to set. + * @return the MachineRunCommandProperties object itself. + */ + public MachineRunCommandProperties withRunAsPassword(String runAsPassword) { + this.runAsPassword = runAsPassword; + return this; + } + + /** + * Get the timeoutInSeconds property: The timeout in seconds to execute the run command. + * + * @return the timeoutInSeconds value. + */ + public Integer timeoutInSeconds() { + return this.timeoutInSeconds; + } + + /** + * Set the timeoutInSeconds property: The timeout in seconds to execute the run command. + * + * @param timeoutInSeconds the timeoutInSeconds value to set. + * @return the MachineRunCommandProperties object itself. + */ + public MachineRunCommandProperties withTimeoutInSeconds(Integer timeoutInSeconds) { + this.timeoutInSeconds = timeoutInSeconds; + return this; + } + + /** + * Get the outputBlobUri property: Specifies the Azure storage blob where script output stream will be uploaded. Use + * a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. + * Refer outputBlobManagedIdentity parameter. + * + * @return the outputBlobUri value. + */ + public String outputBlobUri() { + return this.outputBlobUri; + } + + /** + * Set the outputBlobUri property: Specifies the Azure storage blob where script output stream will be uploaded. Use + * a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. + * Refer outputBlobManagedIdentity parameter. + * + * @param outputBlobUri the outputBlobUri value to set. + * @return the MachineRunCommandProperties object itself. + */ + public MachineRunCommandProperties withOutputBlobUri(String outputBlobUri) { + this.outputBlobUri = outputBlobUri; + return this; + } + + /** + * Get the errorBlobUri property: Specifies the Azure storage blob where script error stream will be uploaded. Use a + * SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. + * Refer errorBlobManagedIdentity parameter. + * + * @return the errorBlobUri value. + */ + public String errorBlobUri() { + return this.errorBlobUri; + } + + /** + * Set the errorBlobUri property: Specifies the Azure storage blob where script error stream will be uploaded. Use a + * SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. + * Refer errorBlobManagedIdentity parameter. + * + * @param errorBlobUri the errorBlobUri value to set. + * @return the MachineRunCommandProperties object itself. + */ + public MachineRunCommandProperties withErrorBlobUri(String errorBlobUri) { + this.errorBlobUri = errorBlobUri; + return this; + } + + /** + * Get the outputBlobManagedIdentity property: User-assigned managed identity that has access to outputBlobUri + * storage blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been given + * access to blob's container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned + * identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer + * https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. + * + * @return the outputBlobManagedIdentity value. + */ + public RunCommandManagedIdentity outputBlobManagedIdentity() { + return this.outputBlobManagedIdentity; + } + + /** + * Set the outputBlobManagedIdentity property: User-assigned managed identity that has access to outputBlobUri + * storage blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been given + * access to blob's container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned + * identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer + * https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. + * + * @param outputBlobManagedIdentity the outputBlobManagedIdentity value to set. + * @return the MachineRunCommandProperties object itself. + */ + public MachineRunCommandProperties withOutputBlobManagedIdentity( + RunCommandManagedIdentity outputBlobManagedIdentity) { + this.outputBlobManagedIdentity = outputBlobManagedIdentity; + return this; + } + + /** + * Get the errorBlobManagedIdentity property: User-assigned managed identity that has access to errorBlobUri storage + * blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been given access + * to blob's container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned identity, make + * sure you add it under VM's identity. For more info on managed identity and Run Command, refer + * https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. + * + * @return the errorBlobManagedIdentity value. + */ + public RunCommandManagedIdentity errorBlobManagedIdentity() { + return this.errorBlobManagedIdentity; + } + + /** + * Set the errorBlobManagedIdentity property: User-assigned managed identity that has access to errorBlobUri storage + * blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been given access + * to blob's container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned identity, make + * sure you add it under VM's identity. For more info on managed identity and Run Command, refer + * https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. + * + * @param errorBlobManagedIdentity the errorBlobManagedIdentity value to set. + * @return the MachineRunCommandProperties object itself. + */ + public MachineRunCommandProperties withErrorBlobManagedIdentity( + RunCommandManagedIdentity errorBlobManagedIdentity) { + this.errorBlobManagedIdentity = errorBlobManagedIdentity; + return this; + } + + /** + * Get the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the instanceView property: The machine run command instance view. + * + * @return the instanceView value. + */ + public MachineRunCommandInstanceView instanceView() { + return this.instanceView; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (source() != null) { + source().validate(); + } + if (parameters() != null) { + parameters().forEach(e -> e.validate()); + } + if (protectedParameters() != null) { + protectedParameters().forEach(e -> e.validate()); + } + if (outputBlobManagedIdentity() != null) { + outputBlobManagedIdentity().validate(); + } + if (errorBlobManagedIdentity() != null) { + errorBlobManagedIdentity().validate(); + } + if (instanceView() != null) { + instanceView().validate(); + } + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineUpdateProperties.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineUpdateProperties.java similarity index 55% rename from sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineUpdateProperties.java rename to sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineUpdateProperties.java index a1e9e601abf02..4ddd5a76ca2b0 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineUpdateProperties.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineUpdateProperties.java @@ -2,9 +2,13 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.hybridcompute.models; +package com.azure.resourcemanager.hybridcompute.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.hybridcompute.models.AgentUpgrade; +import com.azure.resourcemanager.hybridcompute.models.CloudMetadata; +import com.azure.resourcemanager.hybridcompute.models.LocationData; +import com.azure.resourcemanager.hybridcompute.models.OSProfile; import com.fasterxml.jackson.annotation.JsonProperty; /** Describes the ARM updatable properties of a hybrid machine. */ @@ -16,6 +20,24 @@ public final class MachineUpdateProperties { @JsonProperty(value = "locationData") private LocationData locationData; + /* + * Specifies the operating system settings for the hybrid machine. + */ + @JsonProperty(value = "osProfile") + private OSProfile osProfile; + + /* + * The metadata of the cloud environment (Azure/GCP/AWS/OCI...). + */ + @JsonProperty(value = "cloudMetadata") + private CloudMetadata cloudMetadata; + + /* + * The info of the machine w.r.t Agent Upgrade + */ + @JsonProperty(value = "agentUpgrade") + private AgentUpgrade agentUpgrade; + /* * The resource id of the parent cluster (Azure HCI) this machine is assigned to, if any. */ @@ -52,6 +74,66 @@ public MachineUpdateProperties withLocationData(LocationData locationData) { return this; } + /** + * Get the osProfile property: Specifies the operating system settings for the hybrid machine. + * + * @return the osProfile value. + */ + public OSProfile osProfile() { + return this.osProfile; + } + + /** + * Set the osProfile property: Specifies the operating system settings for the hybrid machine. + * + * @param osProfile the osProfile value to set. + * @return the MachineUpdateProperties object itself. + */ + public MachineUpdateProperties withOsProfile(OSProfile osProfile) { + this.osProfile = osProfile; + return this; + } + + /** + * Get the cloudMetadata property: The metadata of the cloud environment (Azure/GCP/AWS/OCI...). + * + * @return the cloudMetadata value. + */ + public CloudMetadata cloudMetadata() { + return this.cloudMetadata; + } + + /** + * Set the cloudMetadata property: The metadata of the cloud environment (Azure/GCP/AWS/OCI...). + * + * @param cloudMetadata the cloudMetadata value to set. + * @return the MachineUpdateProperties object itself. + */ + public MachineUpdateProperties withCloudMetadata(CloudMetadata cloudMetadata) { + this.cloudMetadata = cloudMetadata; + return this; + } + + /** + * Get the agentUpgrade property: The info of the machine w.r.t Agent Upgrade. + * + * @return the agentUpgrade value. + */ + public AgentUpgrade agentUpgrade() { + return this.agentUpgrade; + } + + /** + * Set the agentUpgrade property: The info of the machine w.r.t Agent Upgrade. + * + * @param agentUpgrade the agentUpgrade value to set. + * @return the MachineUpdateProperties object itself. + */ + public MachineUpdateProperties withAgentUpgrade(AgentUpgrade agentUpgrade) { + this.agentUpgrade = agentUpgrade; + return this; + } + /** * Get the parentClusterResourceId property: The resource id of the parent cluster (Azure HCI) this machine is * assigned to, if any. @@ -105,5 +187,14 @@ public void validate() { if (locationData() != null) { locationData().validate(); } + if (osProfile() != null) { + osProfile().validate(); + } + if (cloudMetadata() != null) { + cloudMetadata().validate(); + } + if (agentUpgrade() != null) { + agentUpgrade().validate(); + } } } diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/NetworkProfileInner.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/NetworkProfileInner.java new file mode 100644 index 0000000000000..41cdc8378ef09 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/NetworkProfileInner.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.hybridcompute.models.NetworkInterface; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes the network information on this machine. */ +@Fluent +public final class NetworkProfileInner { + /* + * The list of network interfaces. + */ + @JsonProperty(value = "networkInterfaces") + private List networkInterfaces; + + /** Creates an instance of NetworkProfileInner class. */ + public NetworkProfileInner() { + } + + /** + * Get the networkInterfaces property: The list of network interfaces. + * + * @return the networkInterfaces value. + */ + public List networkInterfaces() { + return this.networkInterfaces; + } + + /** + * Set the networkInterfaces property: The list of network interfaces. + * + * @param networkInterfaces the networkInterfaces value to set. + * @return the NetworkProfileInner object itself. + */ + public NetworkProfileInner withNetworkInterfaces(List networkInterfaces) { + this.networkInterfaces = networkInterfaces; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (networkInterfaces() != null) { + networkInterfaces().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/OperationValueInner.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/OperationValueInner.java index 2f663ffbd5f3b..3db00f32a5f0c 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/OperationValueInner.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/OperationValueInner.java @@ -29,6 +29,12 @@ public final class OperationValueInner { @JsonProperty(value = "display") private OperationValueDisplay display; + /* + * This property indicates if the operation is an action or a data action + */ + @JsonProperty(value = "isDataAction", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isDataAction; + /** Creates an instance of OperationValueInner class. */ public OperationValueInner() { } @@ -71,6 +77,15 @@ public OperationValueInner withDisplay(OperationValueDisplay display) { return this; } + /** + * Get the isDataAction property: This property indicates if the operation is an action or a data action. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + /** * Validates the instance. * diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/PatchSettings.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/PatchSettings.java new file mode 100644 index 0000000000000..d92448aa83ca9 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/PatchSettings.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.hybridcompute.models.AssessmentModeTypes; +import com.azure.resourcemanager.hybridcompute.models.PatchModeTypes; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Specifies the patch settings. */ +@Fluent +public final class PatchSettings { + /* + * Specifies the assessment mode. + */ + @JsonProperty(value = "assessmentMode") + private AssessmentModeTypes assessmentMode; + + /* + * Specifies the patch mode. + */ + @JsonProperty(value = "patchMode") + private PatchModeTypes patchMode; + + /** Creates an instance of PatchSettings class. */ + public PatchSettings() { + } + + /** + * Get the assessmentMode property: Specifies the assessment mode. + * + * @return the assessmentMode value. + */ + public AssessmentModeTypes assessmentMode() { + return this.assessmentMode; + } + + /** + * Set the assessmentMode property: Specifies the assessment mode. + * + * @param assessmentMode the assessmentMode value to set. + * @return the PatchSettings object itself. + */ + public PatchSettings withAssessmentMode(AssessmentModeTypes assessmentMode) { + this.assessmentMode = assessmentMode; + return this; + } + + /** + * Get the patchMode property: Specifies the patch mode. + * + * @return the patchMode value. + */ + public PatchModeTypes patchMode() { + return this.patchMode; + } + + /** + * Set the patchMode property: Specifies the patch mode. + * + * @param patchMode the patchMode value to set. + * @return the PatchSettings object itself. + */ + public PatchSettings withPatchMode(PatchModeTypes patchMode) { + this.patchMode = patchMode; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/PrivateEndpointConnectionInner.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/PrivateEndpointConnectionInner.java index 457a90a2c289a..26906cb0a4f50 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/PrivateEndpointConnectionInner.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/PrivateEndpointConnectionInner.java @@ -20,7 +20,7 @@ public final class PrivateEndpointConnectionInner extends ProxyResource { private PrivateEndpointConnectionProperties properties; /* - * The system meta data relating to this resource. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; @@ -50,7 +50,7 @@ public PrivateEndpointConnectionInner withProperties(PrivateEndpointConnectionPr } /** - * Get the systemData property: The system meta data relating to this resource. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/PrivateLinkResourceInner.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/PrivateLinkResourceInner.java index 6994d21ca666c..de347adac351e 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/PrivateLinkResourceInner.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/PrivateLinkResourceInner.java @@ -20,7 +20,7 @@ public final class PrivateLinkResourceInner extends ProxyResource { private PrivateLinkResourceProperties properties; /* - * The system meta data relating to this resource. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; @@ -50,7 +50,7 @@ public PrivateLinkResourceInner withProperties(PrivateLinkResourceProperties pro } /** - * Get the systemData property: The system meta data relating to this resource. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/AgentVersionImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/AgentVersionImpl.java new file mode 100644 index 0000000000000..3ba70efedbc48 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/AgentVersionImpl.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.hybridcompute.implementation; + +import com.azure.resourcemanager.hybridcompute.fluent.models.AgentVersionInner; +import com.azure.resourcemanager.hybridcompute.models.AgentVersion; + +public final class AgentVersionImpl implements AgentVersion { + private AgentVersionInner innerObject; + + private final com.azure.resourcemanager.hybridcompute.HybridComputeManager serviceManager; + + AgentVersionImpl( + AgentVersionInner innerObject, com.azure.resourcemanager.hybridcompute.HybridComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String agentVersion() { + return this.innerModel().agentVersion(); + } + + public String downloadLink() { + return this.innerModel().downloadLink(); + } + + public String osType() { + return this.innerModel().osType(); + } + + public AgentVersionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hybridcompute.HybridComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/AgentVersionsClientImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/AgentVersionsClientImpl.java new file mode 100644 index 0000000000000..b4d1153103033 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/AgentVersionsClientImpl.java @@ -0,0 +1,289 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.hybridcompute.fluent.AgentVersionsClient; +import com.azure.resourcemanager.hybridcompute.fluent.models.AgentVersionInner; +import com.azure.resourcemanager.hybridcompute.fluent.models.AgentVersionsListInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in AgentVersionsClient. */ +public final class AgentVersionsClientImpl implements AgentVersionsClient { + /** The proxy service used to perform REST calls. */ + private final AgentVersionsService service; + + /** The service client containing this operation class. */ + private final HybridComputeManagementClientImpl client; + + /** + * Initializes an instance of AgentVersionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AgentVersionsClientImpl(HybridComputeManagementClientImpl client) { + this.service = + RestProxy.create(AgentVersionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HybridComputeManagementClientAgentVersions to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HybridComputeManagem") + public interface AgentVersionsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.HybridCompute/osType/{osType}/agentVersions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("osType") String osType, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.HybridCompute/osType/{osType}/agentVersions/{version}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("osType") String osType, + @PathParam("version") String version, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all Agent Versions along with the download link currently present. + * + * @param osType Defines the os type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Agent Versions along with the download link currently present along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync(String osType) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (osType == null) { + return Mono.error(new IllegalArgumentException("Parameter osType is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service.list(this.client.getEndpoint(), this.client.getApiVersion(), osType, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all Agent Versions along with the download link currently present. + * + * @param osType Defines the os type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Agent Versions along with the download link currently present along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync(String osType, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (osType == null) { + return Mono.error(new IllegalArgumentException("Parameter osType is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.list(this.client.getEndpoint(), this.client.getApiVersion(), osType, accept, context); + } + + /** + * Gets all Agent Versions along with the download link currently present. + * + * @param osType Defines the os type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Agent Versions along with the download link currently present on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync(String osType) { + return listWithResponseAsync(osType).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets all Agent Versions along with the download link currently present. + * + * @param osType Defines the os type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Agent Versions along with the download link currently present along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse(String osType, Context context) { + return listWithResponseAsync(osType, context).block(); + } + + /** + * Gets all Agent Versions along with the download link currently present. + * + * @param osType Defines the os type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Agent Versions along with the download link currently present. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AgentVersionsListInner list(String osType) { + return listWithResponse(osType, Context.NONE).getValue(); + } + + /** + * Gets an Agent Version along with the download link currently present. + * + * @param osType Defines the os type. + * @param version Defines the agent version. To get latest, use latest or else a specific agent version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Agent Version along with the download link currently present along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String osType, String version) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (osType == null) { + return Mono.error(new IllegalArgumentException("Parameter osType is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get(this.client.getEndpoint(), this.client.getApiVersion(), osType, version, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an Agent Version along with the download link currently present. + * + * @param osType Defines the os type. + * @param version Defines the agent version. To get latest, use latest or else a specific agent version. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Agent Version along with the download link currently present along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String osType, String version, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (osType == null) { + return Mono.error(new IllegalArgumentException("Parameter osType is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), osType, version, accept, context); + } + + /** + * Gets an Agent Version along with the download link currently present. + * + * @param osType Defines the os type. + * @param version Defines the agent version. To get latest, use latest or else a specific agent version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Agent Version along with the download link currently present on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String osType, String version) { + return getWithResponseAsync(osType, version).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets an Agent Version along with the download link currently present. + * + * @param osType Defines the os type. + * @param version Defines the agent version. To get latest, use latest or else a specific agent version. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Agent Version along with the download link currently present along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String osType, String version, Context context) { + return getWithResponseAsync(osType, version, context).block(); + } + + /** + * Gets an Agent Version along with the download link currently present. + * + * @param osType Defines the os type. + * @param version Defines the agent version. To get latest, use latest or else a specific agent version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Agent Version along with the download link currently present. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AgentVersionInner get(String osType, String version) { + return getWithResponse(osType, version, Context.NONE).getValue(); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/AgentVersionsImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/AgentVersionsImpl.java new file mode 100644 index 0000000000000..170e3ac0a3bce --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/AgentVersionsImpl.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybridcompute.fluent.AgentVersionsClient; +import com.azure.resourcemanager.hybridcompute.fluent.models.AgentVersionInner; +import com.azure.resourcemanager.hybridcompute.fluent.models.AgentVersionsListInner; +import com.azure.resourcemanager.hybridcompute.models.AgentVersion; +import com.azure.resourcemanager.hybridcompute.models.AgentVersions; +import com.azure.resourcemanager.hybridcompute.models.AgentVersionsList; + +public final class AgentVersionsImpl implements AgentVersions { + private static final ClientLogger LOGGER = new ClientLogger(AgentVersionsImpl.class); + + private final AgentVersionsClient innerClient; + + private final com.azure.resourcemanager.hybridcompute.HybridComputeManager serviceManager; + + public AgentVersionsImpl( + AgentVersionsClient innerClient, com.azure.resourcemanager.hybridcompute.HybridComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response listWithResponse(String osType, Context context) { + Response inner = this.serviceClient().listWithResponse(osType, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AgentVersionsListImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AgentVersionsList list(String osType) { + AgentVersionsListInner inner = this.serviceClient().list(osType); + if (inner != null) { + return new AgentVersionsListImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse(String osType, String version, Context context) { + Response inner = this.serviceClient().getWithResponse(osType, version, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AgentVersionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AgentVersion get(String osType, String version) { + AgentVersionInner inner = this.serviceClient().get(osType, version); + if (inner != null) { + return new AgentVersionImpl(inner, this.manager()); + } else { + return null; + } + } + + private AgentVersionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.hybridcompute.HybridComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/AgentVersionsListImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/AgentVersionsListImpl.java new file mode 100644 index 0000000000000..1b39845dd757d --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/AgentVersionsListImpl.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.implementation; + +import com.azure.resourcemanager.hybridcompute.fluent.models.AgentVersionInner; +import com.azure.resourcemanager.hybridcompute.fluent.models.AgentVersionsListInner; +import com.azure.resourcemanager.hybridcompute.models.AgentVersion; +import com.azure.resourcemanager.hybridcompute.models.AgentVersionsList; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class AgentVersionsListImpl implements AgentVersionsList { + private AgentVersionsListInner innerObject; + + private final com.azure.resourcemanager.hybridcompute.HybridComputeManager serviceManager; + + AgentVersionsListImpl( + AgentVersionsListInner innerObject, + com.azure.resourcemanager.hybridcompute.HybridComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new AgentVersionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public AgentVersionsListInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hybridcompute.HybridComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/ExtensionMetadatasClientImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/ExtensionMetadatasClientImpl.java new file mode 100644 index 0000000000000..72dd3859cc556 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/ExtensionMetadatasClientImpl.java @@ -0,0 +1,445 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.hybridcompute.fluent.ExtensionMetadatasClient; +import com.azure.resourcemanager.hybridcompute.fluent.models.ExtensionValueInner; +import com.azure.resourcemanager.hybridcompute.models.ExtensionValueListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ExtensionMetadatasClient. */ +public final class ExtensionMetadatasClientImpl implements ExtensionMetadatasClient { + /** The proxy service used to perform REST calls. */ + private final ExtensionMetadatasService service; + + /** The service client containing this operation class. */ + private final HybridComputeManagementClientImpl client; + + /** + * Initializes an instance of ExtensionMetadatasClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ExtensionMetadatasClientImpl(HybridComputeManagementClientImpl client) { + this.service = + RestProxy.create(ExtensionMetadatasService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HybridComputeManagementClientExtensionMetadatas to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HybridComputeManagem") + public interface ExtensionMetadatasService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/publishers/{publisher}/extensionTypes/{extensionType}/versions/{version}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, + @PathParam("publisher") String publisher, + @PathParam("extensionType") String extensionType, + @PathParam("version") String version, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/publishers/{publisher}/extensionTypes/{extensionType}/versions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, + @PathParam("publisher") String publisher, + @PathParam("extensionType") String extensionType, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets an Extension Metadata based on location, publisher, extensionType and version. + * + * @param location The location of the Extension being received. + * @param publisher The publisher of the Extension being received. + * @param extensionType The extensionType of the Extension being received. + * @param version The version of the Extension being received. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Extension Metadata based on location, publisher, extensionType and version along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String location, String publisher, String extensionType, String version) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (publisher == null) { + return Mono.error(new IllegalArgumentException("Parameter publisher is required and cannot be null.")); + } + if (extensionType == null) { + return Mono.error(new IllegalArgumentException("Parameter extensionType is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + location, + publisher, + extensionType, + version, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an Extension Metadata based on location, publisher, extensionType and version. + * + * @param location The location of the Extension being received. + * @param publisher The publisher of the Extension being received. + * @param extensionType The extensionType of the Extension being received. + * @param version The version of the Extension being received. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Extension Metadata based on location, publisher, extensionType and version along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String location, String publisher, String extensionType, String version, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (publisher == null) { + return Mono.error(new IllegalArgumentException("Parameter publisher is required and cannot be null.")); + } + if (extensionType == null) { + return Mono.error(new IllegalArgumentException("Parameter extensionType is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + location, + publisher, + extensionType, + version, + accept, + context); + } + + /** + * Gets an Extension Metadata based on location, publisher, extensionType and version. + * + * @param location The location of the Extension being received. + * @param publisher The publisher of the Extension being received. + * @param extensionType The extensionType of the Extension being received. + * @param version The version of the Extension being received. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Extension Metadata based on location, publisher, extensionType and version on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String location, String publisher, String extensionType, String version) { + return getWithResponseAsync(location, publisher, extensionType, version) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets an Extension Metadata based on location, publisher, extensionType and version. + * + * @param location The location of the Extension being received. + * @param publisher The publisher of the Extension being received. + * @param extensionType The extensionType of the Extension being received. + * @param version The version of the Extension being received. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Extension Metadata based on location, publisher, extensionType and version along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String location, String publisher, String extensionType, String version, Context context) { + return getWithResponseAsync(location, publisher, extensionType, version, context).block(); + } + + /** + * Gets an Extension Metadata based on location, publisher, extensionType and version. + * + * @param location The location of the Extension being received. + * @param publisher The publisher of the Extension being received. + * @param extensionType The extensionType of the Extension being received. + * @param version The version of the Extension being received. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Extension Metadata based on location, publisher, extensionType and version. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExtensionValueInner get(String location, String publisher, String extensionType, String version) { + return getWithResponse(location, publisher, extensionType, version, Context.NONE).getValue(); + } + + /** + * Gets all Extension versions based on location, publisher, extensionType. + * + * @param location The location of the Extension being received. + * @param publisher The publisher of the Extension being received. + * @param extensionType The extensionType of the Extension being received. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Extension versions based on location, publisher, extensionType along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String location, String publisher, String extensionType) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (publisher == null) { + return Mono.error(new IllegalArgumentException("Parameter publisher is required and cannot be null.")); + } + if (extensionType == null) { + return Mono.error(new IllegalArgumentException("Parameter extensionType is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + location, + publisher, + extensionType, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all Extension versions based on location, publisher, extensionType. + * + * @param location The location of the Extension being received. + * @param publisher The publisher of the Extension being received. + * @param extensionType The extensionType of the Extension being received. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Extension versions based on location, publisher, extensionType along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String location, String publisher, String extensionType, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (publisher == null) { + return Mono.error(new IllegalArgumentException("Parameter publisher is required and cannot be null.")); + } + if (extensionType == null) { + return Mono.error(new IllegalArgumentException("Parameter extensionType is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + location, + publisher, + extensionType, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Gets all Extension versions based on location, publisher, extensionType. + * + * @param location The location of the Extension being received. + * @param publisher The publisher of the Extension being received. + * @param extensionType The extensionType of the Extension being received. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Extension versions based on location, publisher, extensionType as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location, String publisher, String extensionType) { + return new PagedFlux<>(() -> listSinglePageAsync(location, publisher, extensionType)); + } + + /** + * Gets all Extension versions based on location, publisher, extensionType. + * + * @param location The location of the Extension being received. + * @param publisher The publisher of the Extension being received. + * @param extensionType The extensionType of the Extension being received. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Extension versions based on location, publisher, extensionType as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String location, String publisher, String extensionType, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(location, publisher, extensionType, context)); + } + + /** + * Gets all Extension versions based on location, publisher, extensionType. + * + * @param location The location of the Extension being received. + * @param publisher The publisher of the Extension being received. + * @param extensionType The extensionType of the Extension being received. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Extension versions based on location, publisher, extensionType as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location, String publisher, String extensionType) { + return new PagedIterable<>(listAsync(location, publisher, extensionType)); + } + + /** + * Gets all Extension versions based on location, publisher, extensionType. + * + * @param location The location of the Extension being received. + * @param publisher The publisher of the Extension being received. + * @param extensionType The extensionType of the Extension being received. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Extension versions based on location, publisher, extensionType as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String location, String publisher, String extensionType, Context context) { + return new PagedIterable<>(listAsync(location, publisher, extensionType, context)); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/ExtensionMetadatasImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/ExtensionMetadatasImpl.java new file mode 100644 index 0000000000000..bbcaeb86922d2 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/ExtensionMetadatasImpl.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybridcompute.fluent.ExtensionMetadatasClient; +import com.azure.resourcemanager.hybridcompute.fluent.models.ExtensionValueInner; +import com.azure.resourcemanager.hybridcompute.models.ExtensionMetadatas; +import com.azure.resourcemanager.hybridcompute.models.ExtensionValue; + +public final class ExtensionMetadatasImpl implements ExtensionMetadatas { + private static final ClientLogger LOGGER = new ClientLogger(ExtensionMetadatasImpl.class); + + private final ExtensionMetadatasClient innerClient; + + private final com.azure.resourcemanager.hybridcompute.HybridComputeManager serviceManager; + + public ExtensionMetadatasImpl( + ExtensionMetadatasClient innerClient, + com.azure.resourcemanager.hybridcompute.HybridComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String location, String publisher, String extensionType, String version, Context context) { + Response inner = + this.serviceClient().getWithResponse(location, publisher, extensionType, version, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ExtensionValueImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ExtensionValue get(String location, String publisher, String extensionType, String version) { + ExtensionValueInner inner = this.serviceClient().get(location, publisher, extensionType, version); + if (inner != null) { + return new ExtensionValueImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String location, String publisher, String extensionType) { + PagedIterable inner = this.serviceClient().list(location, publisher, extensionType); + return Utils.mapPage(inner, inner1 -> new ExtensionValueImpl(inner1, this.manager())); + } + + public PagedIterable list( + String location, String publisher, String extensionType, Context context) { + PagedIterable inner = + this.serviceClient().list(location, publisher, extensionType, context); + return Utils.mapPage(inner, inner1 -> new ExtensionValueImpl(inner1, this.manager())); + } + + private ExtensionMetadatasClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.hybridcompute.HybridComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/ExtensionValueImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/ExtensionValueImpl.java new file mode 100644 index 0000000000000..a39bbab312c23 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/ExtensionValueImpl.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.hybridcompute.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.hybridcompute.fluent.models.ExtensionValueInner; +import com.azure.resourcemanager.hybridcompute.models.ExtensionValue; + +public final class ExtensionValueImpl implements ExtensionValue { + private ExtensionValueInner innerObject; + + private final com.azure.resourcemanager.hybridcompute.HybridComputeManager serviceManager; + + ExtensionValueImpl( + ExtensionValueInner innerObject, com.azure.resourcemanager.hybridcompute.HybridComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String version() { + return this.innerModel().version(); + } + + public String extensionType() { + return this.innerModel().extensionType(); + } + + public String publisher() { + return this.innerModel().publisher(); + } + + public ExtensionValueInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hybridcompute.HybridComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/HybridComputeManagementClientBuilder.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/HybridComputeManagementClientBuilder.java index b38ce59ecf9f9..8e5b40e2375c6 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/HybridComputeManagementClientBuilder.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/HybridComputeManagementClientBuilder.java @@ -137,7 +137,7 @@ public HybridComputeManagementClientImpl buildClient() { localSerializerAdapter, localDefaultPollInterval, localEnvironment, - subscriptionId, + this.subscriptionId, localEndpoint); return client; } diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/HybridComputeManagementClientImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/HybridComputeManagementClientImpl.java index fac37bfdac2bc..d503b73042241 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/HybridComputeManagementClientImpl.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/HybridComputeManagementClientImpl.java @@ -22,13 +22,21 @@ import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.hybridcompute.fluent.AgentVersionsClient; +import com.azure.resourcemanager.hybridcompute.fluent.ExtensionMetadatasClient; import com.azure.resourcemanager.hybridcompute.fluent.HybridComputeManagementClient; +import com.azure.resourcemanager.hybridcompute.fluent.HybridIdentityMetadatasClient; +import com.azure.resourcemanager.hybridcompute.fluent.LicenseProfilesClient; +import com.azure.resourcemanager.hybridcompute.fluent.LicensesClient; import com.azure.resourcemanager.hybridcompute.fluent.MachineExtensionsClient; +import com.azure.resourcemanager.hybridcompute.fluent.MachineRunCommandsClient; import com.azure.resourcemanager.hybridcompute.fluent.MachinesClient; +import com.azure.resourcemanager.hybridcompute.fluent.NetworkProfilesClient; import com.azure.resourcemanager.hybridcompute.fluent.OperationsClient; import com.azure.resourcemanager.hybridcompute.fluent.PrivateEndpointConnectionsClient; import com.azure.resourcemanager.hybridcompute.fluent.PrivateLinkResourcesClient; import com.azure.resourcemanager.hybridcompute.fluent.PrivateLinkScopesClient; +import com.azure.resourcemanager.hybridcompute.fluent.ResourceProvidersClient; import java.io.IOException; import java.lang.reflect.Type; import java.nio.ByteBuffer; @@ -113,6 +121,18 @@ public Duration getDefaultPollInterval() { return this.defaultPollInterval; } + /** The LicensesClient object to access its operations. */ + private final LicensesClient licenses; + + /** + * Gets the LicensesClient object to access its operations. + * + * @return the LicensesClient object. + */ + public LicensesClient getLicenses() { + return this.licenses; + } + /** The MachinesClient object to access its operations. */ private final MachinesClient machines; @@ -125,6 +145,18 @@ public MachinesClient getMachines() { return this.machines; } + /** The LicenseProfilesClient object to access its operations. */ + private final LicenseProfilesClient licenseProfiles; + + /** + * Gets the LicenseProfilesClient object to access its operations. + * + * @return the LicenseProfilesClient object. + */ + public LicenseProfilesClient getLicenseProfiles() { + return this.licenseProfiles; + } + /** The MachineExtensionsClient object to access its operations. */ private final MachineExtensionsClient machineExtensions; @@ -137,6 +169,30 @@ public MachineExtensionsClient getMachineExtensions() { return this.machineExtensions; } + /** The ResourceProvidersClient object to access its operations. */ + private final ResourceProvidersClient resourceProviders; + + /** + * Gets the ResourceProvidersClient object to access its operations. + * + * @return the ResourceProvidersClient object. + */ + public ResourceProvidersClient getResourceProviders() { + return this.resourceProviders; + } + + /** The ExtensionMetadatasClient object to access its operations. */ + private final ExtensionMetadatasClient extensionMetadatas; + + /** + * Gets the ExtensionMetadatasClient object to access its operations. + * + * @return the ExtensionMetadatasClient object. + */ + public ExtensionMetadatasClient getExtensionMetadatas() { + return this.extensionMetadatas; + } + /** The OperationsClient object to access its operations. */ private final OperationsClient operations; @@ -149,6 +205,54 @@ public OperationsClient getOperations() { return this.operations; } + /** The NetworkProfilesClient object to access its operations. */ + private final NetworkProfilesClient networkProfiles; + + /** + * Gets the NetworkProfilesClient object to access its operations. + * + * @return the NetworkProfilesClient object. + */ + public NetworkProfilesClient getNetworkProfiles() { + return this.networkProfiles; + } + + /** The HybridIdentityMetadatasClient object to access its operations. */ + private final HybridIdentityMetadatasClient hybridIdentityMetadatas; + + /** + * Gets the HybridIdentityMetadatasClient object to access its operations. + * + * @return the HybridIdentityMetadatasClient object. + */ + public HybridIdentityMetadatasClient getHybridIdentityMetadatas() { + return this.hybridIdentityMetadatas; + } + + /** The AgentVersionsClient object to access its operations. */ + private final AgentVersionsClient agentVersions; + + /** + * Gets the AgentVersionsClient object to access its operations. + * + * @return the AgentVersionsClient object. + */ + public AgentVersionsClient getAgentVersions() { + return this.agentVersions; + } + + /** The MachineRunCommandsClient object to access its operations. */ + private final MachineRunCommandsClient machineRunCommands; + + /** + * Gets the MachineRunCommandsClient object to access its operations. + * + * @return the MachineRunCommandsClient object. + */ + public MachineRunCommandsClient getMachineRunCommands() { + return this.machineRunCommands; + } + /** The PrivateLinkScopesClient object to access its operations. */ private final PrivateLinkScopesClient privateLinkScopes; @@ -207,10 +311,18 @@ public PrivateEndpointConnectionsClient getPrivateEndpointConnections() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2021-03-25-preview"; + this.apiVersion = "2023-10-03-preview"; + this.licenses = new LicensesClientImpl(this); this.machines = new MachinesClientImpl(this); + this.licenseProfiles = new LicenseProfilesClientImpl(this); this.machineExtensions = new MachineExtensionsClientImpl(this); + this.resourceProviders = new ResourceProvidersClientImpl(this); + this.extensionMetadatas = new ExtensionMetadatasClientImpl(this); this.operations = new OperationsClientImpl(this); + this.networkProfiles = new NetworkProfilesClientImpl(this); + this.hybridIdentityMetadatas = new HybridIdentityMetadatasClientImpl(this); + this.agentVersions = new AgentVersionsClientImpl(this); + this.machineRunCommands = new MachineRunCommandsClientImpl(this); this.privateLinkScopes = new PrivateLinkScopesClientImpl(this); this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/HybridIdentityMetadataImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/HybridIdentityMetadataImpl.java new file mode 100644 index 0000000000000..06257f8b1725b --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/HybridIdentityMetadataImpl.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.hybridcompute.fluent.models.HybridIdentityMetadataInner; +import com.azure.resourcemanager.hybridcompute.models.HybridIdentityMetadata; +import com.azure.resourcemanager.hybridcompute.models.Identity; + +public final class HybridIdentityMetadataImpl implements HybridIdentityMetadata { + private HybridIdentityMetadataInner innerObject; + + private final com.azure.resourcemanager.hybridcompute.HybridComputeManager serviceManager; + + HybridIdentityMetadataImpl( + HybridIdentityMetadataInner innerObject, + com.azure.resourcemanager.hybridcompute.HybridComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String vmId() { + return this.innerModel().vmId(); + } + + public String publicKey() { + return this.innerModel().publicKey(); + } + + public Identity identity() { + return this.innerModel().identity(); + } + + public HybridIdentityMetadataInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hybridcompute.HybridComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/HybridIdentityMetadatasClientImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/HybridIdentityMetadatasClientImpl.java new file mode 100644 index 0000000000000..912f01bdd74af --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/HybridIdentityMetadatasClientImpl.java @@ -0,0 +1,531 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.hybridcompute.fluent.HybridIdentityMetadatasClient; +import com.azure.resourcemanager.hybridcompute.fluent.models.HybridIdentityMetadataInner; +import com.azure.resourcemanager.hybridcompute.models.HybridIdentityMetadataList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in HybridIdentityMetadatasClient. */ +public final class HybridIdentityMetadatasClientImpl implements HybridIdentityMetadatasClient { + /** The proxy service used to perform REST calls. */ + private final HybridIdentityMetadatasService service; + + /** The service client containing this operation class. */ + private final HybridComputeManagementClientImpl client; + + /** + * Initializes an instance of HybridIdentityMetadatasClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + HybridIdentityMetadatasClientImpl(HybridComputeManagementClientImpl client) { + this.service = + RestProxy + .create(HybridIdentityMetadatasService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HybridComputeManagementClientHybridIdentityMetadatas to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HybridComputeManagem") + public interface HybridIdentityMetadatasService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/hybridIdentityMetadata/{metadataName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("machineName") String machineName, + @PathParam("metadataName") String metadataName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/hybridIdentityMetadata") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByMachines( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("machineName") String machineName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByMachinesNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets HybridIdentityMetadata. + * + *

Implements HybridIdentityMetadata GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param metadataName Name of the HybridIdentityMetadata. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the HybridIdentityMetadata along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String machineName, String metadataName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (machineName == null) { + return Mono.error(new IllegalArgumentException("Parameter machineName is required and cannot be null.")); + } + if (metadataName == null) { + return Mono.error(new IllegalArgumentException("Parameter metadataName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + machineName, + metadataName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets HybridIdentityMetadata. + * + *

Implements HybridIdentityMetadata GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param metadataName Name of the HybridIdentityMetadata. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the HybridIdentityMetadata along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String machineName, String metadataName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (machineName == null) { + return Mono.error(new IllegalArgumentException("Parameter machineName is required and cannot be null.")); + } + if (metadataName == null) { + return Mono.error(new IllegalArgumentException("Parameter metadataName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + machineName, + metadataName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets HybridIdentityMetadata. + * + *

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

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

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

Returns the list of HybridIdentityMetadata of the given machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of HybridIdentityMetadata along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByMachinesSinglePageAsync( + String resourceGroupName, String machineName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (machineName == null) { + return Mono.error(new IllegalArgumentException("Parameter machineName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByMachines( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + machineName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Implements GET HybridIdentityMetadata in a machine. + * + *

Returns the list of HybridIdentityMetadata of the given machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of HybridIdentityMetadata along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByMachinesSinglePageAsync( + String resourceGroupName, String machineName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (machineName == null) { + return Mono.error(new IllegalArgumentException("Parameter machineName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByMachines( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + machineName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Implements GET HybridIdentityMetadata in a machine. + * + *

Returns the list of HybridIdentityMetadata of the given machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of HybridIdentityMetadata as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByMachinesAsync(String resourceGroupName, String machineName) { + return new PagedFlux<>( + () -> listByMachinesSinglePageAsync(resourceGroupName, machineName), + nextLink -> listByMachinesNextSinglePageAsync(nextLink)); + } + + /** + * Implements GET HybridIdentityMetadata in a machine. + * + *

Returns the list of HybridIdentityMetadata of the given machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of HybridIdentityMetadata as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByMachinesAsync( + String resourceGroupName, String machineName, Context context) { + return new PagedFlux<>( + () -> listByMachinesSinglePageAsync(resourceGroupName, machineName, context), + nextLink -> listByMachinesNextSinglePageAsync(nextLink, context)); + } + + /** + * Implements GET HybridIdentityMetadata in a machine. + * + *

Returns the list of HybridIdentityMetadata of the given machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of HybridIdentityMetadata as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByMachines(String resourceGroupName, String machineName) { + return new PagedIterable<>(listByMachinesAsync(resourceGroupName, machineName)); + } + + /** + * Implements GET HybridIdentityMetadata in a machine. + * + *

Returns the list of HybridIdentityMetadata of the given machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of HybridIdentityMetadata as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByMachines( + String resourceGroupName, String machineName, Context context) { + return new PagedIterable<>(listByMachinesAsync(resourceGroupName, machineName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of HybridIdentityMetadata along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByMachinesNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByMachinesNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of HybridIdentityMetadata along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByMachinesNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByMachinesNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/HybridIdentityMetadatasImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/HybridIdentityMetadatasImpl.java new file mode 100644 index 0000000000000..8a63fea6a8fa7 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/HybridIdentityMetadatasImpl.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybridcompute.fluent.HybridIdentityMetadatasClient; +import com.azure.resourcemanager.hybridcompute.fluent.models.HybridIdentityMetadataInner; +import com.azure.resourcemanager.hybridcompute.models.HybridIdentityMetadata; +import com.azure.resourcemanager.hybridcompute.models.HybridIdentityMetadatas; + +public final class HybridIdentityMetadatasImpl implements HybridIdentityMetadatas { + private static final ClientLogger LOGGER = new ClientLogger(HybridIdentityMetadatasImpl.class); + + private final HybridIdentityMetadatasClient innerClient; + + private final com.azure.resourcemanager.hybridcompute.HybridComputeManager serviceManager; + + public HybridIdentityMetadatasImpl( + HybridIdentityMetadatasClient innerClient, + com.azure.resourcemanager.hybridcompute.HybridComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String resourceGroupName, String machineName, String metadataName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, machineName, metadataName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new HybridIdentityMetadataImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public HybridIdentityMetadata get(String resourceGroupName, String machineName, String metadataName) { + HybridIdentityMetadataInner inner = this.serviceClient().get(resourceGroupName, machineName, metadataName); + if (inner != null) { + return new HybridIdentityMetadataImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listByMachines(String resourceGroupName, String machineName) { + PagedIterable inner = + this.serviceClient().listByMachines(resourceGroupName, machineName); + return Utils.mapPage(inner, inner1 -> new HybridIdentityMetadataImpl(inner1, this.manager())); + } + + public PagedIterable listByMachines( + String resourceGroupName, String machineName, Context context) { + PagedIterable inner = + this.serviceClient().listByMachines(resourceGroupName, machineName, context); + return Utils.mapPage(inner, inner1 -> new HybridIdentityMetadataImpl(inner1, this.manager())); + } + + private HybridIdentityMetadatasClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.hybridcompute.HybridComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/LicenseImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/LicenseImpl.java new file mode 100644 index 0000000000000..2777a40782913 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/LicenseImpl.java @@ -0,0 +1,246 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridcompute.fluent.models.LicenseInner; +import com.azure.resourcemanager.hybridcompute.models.License; +import com.azure.resourcemanager.hybridcompute.models.LicenseCoreType; +import com.azure.resourcemanager.hybridcompute.models.LicenseDetails; +import com.azure.resourcemanager.hybridcompute.models.LicenseEdition; +import com.azure.resourcemanager.hybridcompute.models.LicenseState; +import com.azure.resourcemanager.hybridcompute.models.LicenseTarget; +import com.azure.resourcemanager.hybridcompute.models.LicenseType; +import com.azure.resourcemanager.hybridcompute.models.LicenseUpdate; +import com.azure.resourcemanager.hybridcompute.models.ProvisioningState; +import java.util.Collections; +import java.util.Map; + +public final class LicenseImpl implements License, License.Definition, License.Update { + private LicenseInner innerObject; + + private final com.azure.resourcemanager.hybridcompute.HybridComputeManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String tenantId() { + return this.innerModel().tenantId(); + } + + public LicenseType licenseType() { + return this.innerModel().licenseType(); + } + + public LicenseDetails licenseDetails() { + return this.innerModel().licenseDetails(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public LicenseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hybridcompute.HybridComputeManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String licenseName; + + private LicenseUpdate updateParameters; + + public LicenseImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public License create() { + this.innerObject = + serviceManager + .serviceClient() + .getLicenses() + .createOrUpdate(resourceGroupName, licenseName, this.innerModel(), Context.NONE); + return this; + } + + public License create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getLicenses() + .createOrUpdate(resourceGroupName, licenseName, this.innerModel(), context); + return this; + } + + LicenseImpl(String name, com.azure.resourcemanager.hybridcompute.HybridComputeManager serviceManager) { + this.innerObject = new LicenseInner(); + this.serviceManager = serviceManager; + this.licenseName = name; + } + + public LicenseImpl update() { + this.updateParameters = new LicenseUpdate(); + return this; + } + + public License apply() { + this.innerObject = + serviceManager + .serviceClient() + .getLicenses() + .update(resourceGroupName, licenseName, updateParameters, Context.NONE); + return this; + } + + public License apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getLicenses() + .update(resourceGroupName, licenseName, updateParameters, context); + return this; + } + + LicenseImpl(LicenseInner innerObject, com.azure.resourcemanager.hybridcompute.HybridComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.licenseName = Utils.getValueFromIdByName(innerObject.id(), "licenses"); + } + + public License refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getLicenses() + .getByResourceGroupWithResponse(resourceGroupName, licenseName, Context.NONE) + .getValue(); + return this; + } + + public License refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getLicenses() + .getByResourceGroupWithResponse(resourceGroupName, licenseName, context) + .getValue(); + return this; + } + + public LicenseImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public LicenseImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public LicenseImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public LicenseImpl withTenantId(String tenantId) { + this.innerModel().withTenantId(tenantId); + return this; + } + + public LicenseImpl withLicenseType(LicenseType licenseType) { + if (isInCreateMode()) { + this.innerModel().withLicenseType(licenseType); + return this; + } else { + this.updateParameters.withLicenseType(licenseType); + return this; + } + } + + public LicenseImpl withLicenseDetails(LicenseDetails licenseDetails) { + this.innerModel().withLicenseDetails(licenseDetails); + return this; + } + + public LicenseImpl withState(LicenseState state) { + this.updateParameters.withState(state); + return this; + } + + public LicenseImpl withTarget(LicenseTarget target) { + this.updateParameters.withTarget(target); + return this; + } + + public LicenseImpl withEdition(LicenseEdition edition) { + this.updateParameters.withEdition(edition); + return this; + } + + public LicenseImpl withType(LicenseCoreType type) { + this.updateParameters.withType(type); + return this; + } + + public LicenseImpl withProcessors(Integer processors) { + this.updateParameters.withProcessors(processors); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/LicenseProfileImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/LicenseProfileImpl.java new file mode 100644 index 0000000000000..1e6d8c83034a1 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/LicenseProfileImpl.java @@ -0,0 +1,228 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridcompute.fluent.models.LicenseProfileInner; +import com.azure.resourcemanager.hybridcompute.models.EsuEligibility; +import com.azure.resourcemanager.hybridcompute.models.EsuKey; +import com.azure.resourcemanager.hybridcompute.models.EsuKeyState; +import com.azure.resourcemanager.hybridcompute.models.EsuServerType; +import com.azure.resourcemanager.hybridcompute.models.LicenseProfile; +import com.azure.resourcemanager.hybridcompute.models.LicenseProfileUpdate; +import com.azure.resourcemanager.hybridcompute.models.ProvisioningState; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class LicenseProfileImpl implements LicenseProfile, LicenseProfile.Definition, LicenseProfile.Update { + private LicenseProfileInner innerObject; + + private final com.azure.resourcemanager.hybridcompute.HybridComputeManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String assignedLicense() { + return this.innerModel().assignedLicense(); + } + + public EsuServerType serverType() { + return this.innerModel().serverType(); + } + + public EsuEligibility esuEligibility() { + return this.innerModel().esuEligibility(); + } + + public EsuKeyState esuKeyState() { + return this.innerModel().esuKeyState(); + } + + public String assignedLicenseImmutableId() { + return this.innerModel().assignedLicenseImmutableId(); + } + + public List esuKeys() { + List inner = this.innerModel().esuKeys(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public LicenseProfileInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hybridcompute.HybridComputeManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String machineName; + + private LicenseProfileUpdate updateParameters; + + public LicenseProfileImpl withExistingMachine(String resourceGroupName, String machineName) { + this.resourceGroupName = resourceGroupName; + this.machineName = machineName; + return this; + } + + public LicenseProfile create() { + this.innerObject = + serviceManager + .serviceClient() + .getLicenseProfiles() + .createOrUpdate(resourceGroupName, machineName, this.innerModel(), Context.NONE); + return this; + } + + public LicenseProfile create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getLicenseProfiles() + .createOrUpdate(resourceGroupName, machineName, this.innerModel(), context); + return this; + } + + LicenseProfileImpl(com.azure.resourcemanager.hybridcompute.HybridComputeManager serviceManager) { + this.innerObject = new LicenseProfileInner(); + this.serviceManager = serviceManager; + } + + public LicenseProfileImpl update() { + this.updateParameters = new LicenseProfileUpdate(); + return this; + } + + public LicenseProfile apply() { + this.innerObject = + serviceManager + .serviceClient() + .getLicenseProfiles() + .update(resourceGroupName, machineName, updateParameters, Context.NONE); + return this; + } + + public LicenseProfile apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getLicenseProfiles() + .update(resourceGroupName, machineName, updateParameters, context); + return this; + } + + LicenseProfileImpl( + LicenseProfileInner innerObject, com.azure.resourcemanager.hybridcompute.HybridComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.machineName = Utils.getValueFromIdByName(innerObject.id(), "machines"); + } + + public LicenseProfile refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getLicenseProfiles() + .getWithResponse(resourceGroupName, machineName, Context.NONE) + .getValue(); + return this; + } + + public LicenseProfile refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getLicenseProfiles() + .getWithResponse(resourceGroupName, machineName, context) + .getValue(); + return this; + } + + public LicenseProfileImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public LicenseProfileImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public LicenseProfileImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public LicenseProfileImpl withAssignedLicense(String assignedLicense) { + if (isInCreateMode()) { + this.innerModel().withAssignedLicense(assignedLicense); + return this; + } else { + this.updateParameters.withAssignedLicense(assignedLicense); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/LicenseProfileMachineInstanceViewEsuPropertiesImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/LicenseProfileMachineInstanceViewEsuPropertiesImpl.java new file mode 100644 index 0000000000000..dcde12fc19c38 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/LicenseProfileMachineInstanceViewEsuPropertiesImpl.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.hybridcompute.implementation; + +import com.azure.resourcemanager.hybridcompute.fluent.models.LicenseInner; +import com.azure.resourcemanager.hybridcompute.fluent.models.LicenseProfileMachineInstanceViewEsuPropertiesInner; +import com.azure.resourcemanager.hybridcompute.models.EsuEligibility; +import com.azure.resourcemanager.hybridcompute.models.EsuKey; +import com.azure.resourcemanager.hybridcompute.models.EsuKeyState; +import com.azure.resourcemanager.hybridcompute.models.EsuServerType; +import com.azure.resourcemanager.hybridcompute.models.License; +import com.azure.resourcemanager.hybridcompute.models.LicenseAssignmentState; +import com.azure.resourcemanager.hybridcompute.models.LicenseProfileMachineInstanceViewEsuProperties; +import java.util.Collections; +import java.util.List; + +public final class LicenseProfileMachineInstanceViewEsuPropertiesImpl + implements LicenseProfileMachineInstanceViewEsuProperties { + private LicenseProfileMachineInstanceViewEsuPropertiesInner innerObject; + + private final com.azure.resourcemanager.hybridcompute.HybridComputeManager serviceManager; + + LicenseProfileMachineInstanceViewEsuPropertiesImpl( + LicenseProfileMachineInstanceViewEsuPropertiesInner innerObject, + com.azure.resourcemanager.hybridcompute.HybridComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String assignedLicenseImmutableId() { + return this.innerModel().assignedLicenseImmutableId(); + } + + public List esuKeys() { + List inner = this.innerModel().esuKeys(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public EsuServerType serverType() { + return this.innerModel().serverType(); + } + + public EsuEligibility esuEligibility() { + return this.innerModel().esuEligibility(); + } + + public EsuKeyState esuKeyState() { + return this.innerModel().esuKeyState(); + } + + public License assignedLicense() { + LicenseInner inner = this.innerModel().assignedLicense(); + if (inner != null) { + return new LicenseImpl(inner, this.manager()); + } else { + return null; + } + } + + public LicenseAssignmentState licenseAssignmentState() { + return this.innerModel().licenseAssignmentState(); + } + + public LicenseProfileMachineInstanceViewEsuPropertiesInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hybridcompute.HybridComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/LicenseProfileMachineInstanceViewImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/LicenseProfileMachineInstanceViewImpl.java new file mode 100644 index 0000000000000..ee5c6599952bc --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/LicenseProfileMachineInstanceViewImpl.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.hybridcompute.implementation; + +import com.azure.resourcemanager.hybridcompute.fluent.models.LicenseProfileMachineInstanceViewEsuPropertiesInner; +import com.azure.resourcemanager.hybridcompute.fluent.models.LicenseProfileMachineInstanceViewInner; +import com.azure.resourcemanager.hybridcompute.models.LicenseProfileMachineInstanceView; +import com.azure.resourcemanager.hybridcompute.models.LicenseProfileMachineInstanceViewEsuProperties; + +public final class LicenseProfileMachineInstanceViewImpl implements LicenseProfileMachineInstanceView { + private LicenseProfileMachineInstanceViewInner innerObject; + + private final com.azure.resourcemanager.hybridcompute.HybridComputeManager serviceManager; + + LicenseProfileMachineInstanceViewImpl( + LicenseProfileMachineInstanceViewInner innerObject, + com.azure.resourcemanager.hybridcompute.HybridComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public LicenseProfileMachineInstanceViewEsuProperties esuProfile() { + LicenseProfileMachineInstanceViewEsuPropertiesInner inner = this.innerModel().esuProfile(); + if (inner != null) { + return new LicenseProfileMachineInstanceViewEsuPropertiesImpl(inner, this.manager()); + } else { + return null; + } + } + + public LicenseProfileMachineInstanceViewInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hybridcompute.HybridComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/LicenseProfilesClientImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/LicenseProfilesClientImpl.java new file mode 100644 index 0000000000000..467c893cb0cb9 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/LicenseProfilesClientImpl.java @@ -0,0 +1,1331 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.hybridcompute.fluent.LicenseProfilesClient; +import com.azure.resourcemanager.hybridcompute.fluent.models.LicenseProfileInner; +import com.azure.resourcemanager.hybridcompute.models.LicenseProfileUpdate; +import com.azure.resourcemanager.hybridcompute.models.LicenseProfilesListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in LicenseProfilesClient. */ +public final class LicenseProfilesClientImpl implements LicenseProfilesClient { + /** The proxy service used to perform REST calls. */ + private final LicenseProfilesService service; + + /** The service client containing this operation class. */ + private final HybridComputeManagementClientImpl client; + + /** + * Initializes an instance of LicenseProfilesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LicenseProfilesClientImpl(HybridComputeManagementClientImpl client) { + this.service = + RestProxy.create(LicenseProfilesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HybridComputeManagementClientLicenseProfiles to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HybridComputeManagem") + public interface LicenseProfilesService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/licenseProfiles/{licenseProfileName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("machineName") String machineName, + @PathParam("licenseProfileName") String licenseProfileName, + @BodyParam("application/json") LicenseProfileInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/licenseProfiles/{licenseProfileName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("machineName") String machineName, + @PathParam("licenseProfileName") String licenseProfileName, + @BodyParam("application/json") LicenseProfileUpdate parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/licenseProfiles/{licenseProfileName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("machineName") String machineName, + @PathParam("licenseProfileName") String licenseProfileName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/licenseProfiles/{licenseProfileName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("machineName") String machineName, + @PathParam("licenseProfileName") String licenseProfileName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/licenseProfiles") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("machineName") String machineName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * The operation to create or update a license profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param parameters Parameters supplied to the Create license profile operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a license profile in a hybrid machine along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String machineName, LicenseProfileInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (machineName == null) { + return Mono.error(new IllegalArgumentException("Parameter machineName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String licenseProfileName = "default"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + machineName, + licenseProfileName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to create or update a license profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param parameters Parameters supplied to the Create license profile operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a license profile in a hybrid machine along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String machineName, LicenseProfileInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (machineName == null) { + return Mono.error(new IllegalArgumentException("Parameter machineName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String licenseProfileName = "default"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + machineName, + licenseProfileName, + parameters, + accept, + context); + } + + /** + * The operation to create or update a license profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param parameters Parameters supplied to the Create license profile operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of describes a license profile in a hybrid machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LicenseProfileInner> beginCreateOrUpdateAsync( + String resourceGroupName, String machineName, LicenseProfileInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, machineName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + LicenseProfileInner.class, + LicenseProfileInner.class, + this.client.getContext()); + } + + /** + * The operation to create or update a license profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param parameters Parameters supplied to the Create license profile operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of describes a license profile in a hybrid machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LicenseProfileInner> beginCreateOrUpdateAsync( + String resourceGroupName, String machineName, LicenseProfileInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, machineName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), LicenseProfileInner.class, LicenseProfileInner.class, context); + } + + /** + * The operation to create or update a license profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param parameters Parameters supplied to the Create license profile operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes a license profile in a hybrid machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LicenseProfileInner> beginCreateOrUpdate( + String resourceGroupName, String machineName, LicenseProfileInner parameters) { + return this.beginCreateOrUpdateAsync(resourceGroupName, machineName, parameters).getSyncPoller(); + } + + /** + * The operation to create or update a license profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param parameters Parameters supplied to the Create license profile operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes a license profile in a hybrid machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LicenseProfileInner> beginCreateOrUpdate( + String resourceGroupName, String machineName, LicenseProfileInner parameters, Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, machineName, parameters, context).getSyncPoller(); + } + + /** + * The operation to create or update a license profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param parameters Parameters supplied to the Create license profile operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a license profile in a hybrid machine on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String machineName, LicenseProfileInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, machineName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to create or update a license profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param parameters Parameters supplied to the Create license profile operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a license profile in a hybrid machine on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String machineName, LicenseProfileInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, machineName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to create or update a license profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param parameters Parameters supplied to the Create license profile operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a license profile in a hybrid machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LicenseProfileInner createOrUpdate( + String resourceGroupName, String machineName, LicenseProfileInner parameters) { + return createOrUpdateAsync(resourceGroupName, machineName, parameters).block(); + } + + /** + * The operation to create or update a license profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param parameters Parameters supplied to the Create license profile operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a license profile in a hybrid machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LicenseProfileInner createOrUpdate( + String resourceGroupName, String machineName, LicenseProfileInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, machineName, parameters, context).block(); + } + + /** + * The operation to update a license profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param parameters Parameters supplied to the Update license profile operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a license profile in a hybrid machine along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String machineName, LicenseProfileUpdate parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (machineName == null) { + return Mono.error(new IllegalArgumentException("Parameter machineName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String licenseProfileName = "default"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + machineName, + licenseProfileName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to update a license profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param parameters Parameters supplied to the Update license profile operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a license profile in a hybrid machine along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String machineName, LicenseProfileUpdate parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (machineName == null) { + return Mono.error(new IllegalArgumentException("Parameter machineName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String licenseProfileName = "default"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + machineName, + licenseProfileName, + parameters, + accept, + context); + } + + /** + * The operation to update a license profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param parameters Parameters supplied to the Update license profile operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of describes a license profile in a hybrid machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LicenseProfileInner> beginUpdateAsync( + String resourceGroupName, String machineName, LicenseProfileUpdate parameters) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, machineName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + LicenseProfileInner.class, + LicenseProfileInner.class, + this.client.getContext()); + } + + /** + * The operation to update a license profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param parameters Parameters supplied to the Update license profile operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of describes a license profile in a hybrid machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LicenseProfileInner> beginUpdateAsync( + String resourceGroupName, String machineName, LicenseProfileUpdate parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, machineName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), LicenseProfileInner.class, LicenseProfileInner.class, context); + } + + /** + * The operation to update a license profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param parameters Parameters supplied to the Update license profile operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes a license profile in a hybrid machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LicenseProfileInner> beginUpdate( + String resourceGroupName, String machineName, LicenseProfileUpdate parameters) { + return this.beginUpdateAsync(resourceGroupName, machineName, parameters).getSyncPoller(); + } + + /** + * The operation to update a license profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param parameters Parameters supplied to the Update license profile operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes a license profile in a hybrid machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LicenseProfileInner> beginUpdate( + String resourceGroupName, String machineName, LicenseProfileUpdate parameters, Context context) { + return this.beginUpdateAsync(resourceGroupName, machineName, parameters, context).getSyncPoller(); + } + + /** + * The operation to update a license profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param parameters Parameters supplied to the Update license profile operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a license profile in a hybrid machine on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String machineName, LicenseProfileUpdate parameters) { + return beginUpdateAsync(resourceGroupName, machineName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to update a license profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param parameters Parameters supplied to the Update license profile operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a license profile in a hybrid machine on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String machineName, LicenseProfileUpdate parameters, Context context) { + return beginUpdateAsync(resourceGroupName, machineName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to update a license profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param parameters Parameters supplied to the Update license profile operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a license profile in a hybrid machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LicenseProfileInner update(String resourceGroupName, String machineName, LicenseProfileUpdate parameters) { + return updateAsync(resourceGroupName, machineName, parameters).block(); + } + + /** + * The operation to update a license profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param parameters Parameters supplied to the Update license profile operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a license profile in a hybrid machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LicenseProfileInner update( + String resourceGroupName, String machineName, LicenseProfileUpdate parameters, Context context) { + return updateAsync(resourceGroupName, machineName, parameters, context).block(); + } + + /** + * Retrieves information about the view of a license profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a license profile in a hybrid machine along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String machineName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (machineName == null) { + return Mono.error(new IllegalArgumentException("Parameter machineName is required and cannot be null.")); + } + final String licenseProfileName = "default"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + machineName, + licenseProfileName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves information about the view of a license profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a license profile in a hybrid machine along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String machineName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (machineName == null) { + return Mono.error(new IllegalArgumentException("Parameter machineName is required and cannot be null.")); + } + final String licenseProfileName = "default"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + machineName, + licenseProfileName, + accept, + context); + } + + /** + * Retrieves information about the view of a license profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a license profile in a hybrid machine on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String machineName) { + return getWithResponseAsync(resourceGroupName, machineName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieves information about the view of a license profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a license profile in a hybrid machine along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String machineName, Context context) { + return getWithResponseAsync(resourceGroupName, machineName, context).block(); + } + + /** + * Retrieves information about the view of a license profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a license profile in a hybrid machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LicenseProfileInner get(String resourceGroupName, String machineName) { + return getWithResponse(resourceGroupName, machineName, Context.NONE).getValue(); + } + + /** + * The operation to delete a license profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String machineName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (machineName == null) { + return Mono.error(new IllegalArgumentException("Parameter machineName is required and cannot be null.")); + } + final String licenseProfileName = "default"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + machineName, + licenseProfileName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to delete a license profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String machineName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (machineName == null) { + return Mono.error(new IllegalArgumentException("Parameter machineName is required and cannot be null.")); + } + final String licenseProfileName = "default"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + machineName, + licenseProfileName, + accept, + context); + } + + /** + * The operation to delete a license profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String machineName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, machineName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * The operation to delete a license profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String machineName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, machineName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * The operation to delete a license profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String machineName) { + return this.beginDeleteAsync(resourceGroupName, machineName).getSyncPoller(); + } + + /** + * The operation to delete a license profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String machineName, Context context) { + return this.beginDeleteAsync(resourceGroupName, machineName, context).getSyncPoller(); + } + + /** + * The operation to delete a license profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String machineName) { + return beginDeleteAsync(resourceGroupName, machineName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to delete a license profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String machineName, Context context) { + return beginDeleteAsync(resourceGroupName, machineName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to delete a license profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String machineName) { + deleteAsync(resourceGroupName, machineName).block(); + } + + /** + * The operation to delete a license profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String machineName, Context context) { + deleteAsync(resourceGroupName, machineName, context).block(); + } + + /** + * The operation to get all license profiles of a non-Azure machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List hybrid machine license profile operation response along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String machineName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (machineName == null) { + return Mono.error(new IllegalArgumentException("Parameter machineName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + machineName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to get all license profiles of a non-Azure machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List hybrid machine license profile operation response along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String machineName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (machineName == null) { + return Mono.error(new IllegalArgumentException("Parameter machineName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + machineName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * The operation to get all license profiles of a non-Azure machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List hybrid machine license profile operation response as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String machineName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, machineName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * The operation to get all license profiles of a non-Azure machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List hybrid machine license profile operation response as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String machineName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, machineName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * The operation to get all license profiles of a non-Azure machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List hybrid machine license profile operation response as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String machineName) { + return new PagedIterable<>(listAsync(resourceGroupName, machineName)); + } + + /** + * The operation to get all license profiles of a non-Azure machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List hybrid machine license profile operation response as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String machineName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, machineName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List hybrid machine license profile operation response along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List hybrid machine license profile operation response along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/LicenseProfilesImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/LicenseProfilesImpl.java new file mode 100644 index 0000000000000..626a27ec223a5 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/LicenseProfilesImpl.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybridcompute.fluent.LicenseProfilesClient; +import com.azure.resourcemanager.hybridcompute.fluent.models.LicenseProfileInner; +import com.azure.resourcemanager.hybridcompute.models.LicenseProfile; +import com.azure.resourcemanager.hybridcompute.models.LicenseProfiles; + +public final class LicenseProfilesImpl implements LicenseProfiles { + private static final ClientLogger LOGGER = new ClientLogger(LicenseProfilesImpl.class); + + private final LicenseProfilesClient innerClient; + + private final com.azure.resourcemanager.hybridcompute.HybridComputeManager serviceManager; + + public LicenseProfilesImpl( + LicenseProfilesClient innerClient, + com.azure.resourcemanager.hybridcompute.HybridComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String machineName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, machineName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new LicenseProfileImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public LicenseProfile get(String resourceGroupName, String machineName) { + LicenseProfileInner inner = this.serviceClient().get(resourceGroupName, machineName); + if (inner != null) { + return new LicenseProfileImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String machineName) { + this.serviceClient().delete(resourceGroupName, machineName); + } + + public void delete(String resourceGroupName, String machineName, Context context) { + this.serviceClient().delete(resourceGroupName, machineName, context); + } + + public PagedIterable list(String resourceGroupName, String machineName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, machineName); + return Utils.mapPage(inner, inner1 -> new LicenseProfileImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String machineName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, machineName, context); + return Utils.mapPage(inner, inner1 -> new LicenseProfileImpl(inner1, this.manager())); + } + + public LicenseProfile getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String machineName = Utils.getValueFromIdByName(id, "machines"); + if (machineName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'machines'.", id))); + } + return this.getWithResponse(resourceGroupName, machineName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String machineName = Utils.getValueFromIdByName(id, "machines"); + if (machineName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'machines'.", id))); + } + return this.getWithResponse(resourceGroupName, machineName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String machineName = Utils.getValueFromIdByName(id, "machines"); + if (machineName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'machines'.", id))); + } + this.delete(resourceGroupName, machineName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String machineName = Utils.getValueFromIdByName(id, "machines"); + if (machineName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'machines'.", id))); + } + this.delete(resourceGroupName, machineName, context); + } + + private LicenseProfilesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.hybridcompute.HybridComputeManager manager() { + return this.serviceManager; + } + + public LicenseProfileImpl define() { + return new LicenseProfileImpl(this.manager()); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/LicensesClientImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/LicensesClientImpl.java new file mode 100644 index 0000000000000..c050e879857b4 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/LicensesClientImpl.java @@ -0,0 +1,1754 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.hybridcompute.fluent.LicensesClient; +import com.azure.resourcemanager.hybridcompute.fluent.models.LicenseInner; +import com.azure.resourcemanager.hybridcompute.models.LicenseUpdate; +import com.azure.resourcemanager.hybridcompute.models.LicensesListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in LicensesClient. */ +public final class LicensesClientImpl implements LicensesClient { + /** The proxy service used to perform REST calls. */ + private final LicensesService service; + + /** The service client containing this operation class. */ + private final HybridComputeManagementClientImpl client; + + /** + * Initializes an instance of LicensesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LicensesClientImpl(HybridComputeManagementClientImpl client) { + this.service = RestProxy.create(LicensesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HybridComputeManagementClientLicenses to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HybridComputeManagem") + public interface LicensesService { + @Headers({"Content-Type: application/json"}) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/validateLicense") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> validateLicense( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") LicenseInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/licenses/{licenseName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("licenseName") String licenseName, + @BodyParam("application/json") LicenseInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/licenses/{licenseName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("licenseName") String licenseName, + @BodyParam("application/json") LicenseUpdate parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/licenses/{licenseName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("licenseName") String licenseName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/licenses/{licenseName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("licenseName") String licenseName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/licenses") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/licenses") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * The operation to validate a license. + * + * @param parameters Parameters supplied to the license validation operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a license in a hybrid machine along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> validateLicenseWithResponseAsync(LicenseInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .validateLicense( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to validate a license. + * + * @param parameters Parameters supplied to the license validation operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a license in a hybrid machine along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> validateLicenseWithResponseAsync( + LicenseInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .validateLicense( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * The operation to validate a license. + * + * @param parameters Parameters supplied to the license validation operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of describes a license in a hybrid machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LicenseInner> beginValidateLicenseAsync(LicenseInner parameters) { + Mono>> mono = validateLicenseWithResponseAsync(parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), LicenseInner.class, LicenseInner.class, this.client.getContext()); + } + + /** + * The operation to validate a license. + * + * @param parameters Parameters supplied to the license validation operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of describes a license in a hybrid machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LicenseInner> beginValidateLicenseAsync( + LicenseInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = validateLicenseWithResponseAsync(parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), LicenseInner.class, LicenseInner.class, context); + } + + /** + * The operation to validate a license. + * + * @param parameters Parameters supplied to the license validation operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes a license in a hybrid machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LicenseInner> beginValidateLicense(LicenseInner parameters) { + return this.beginValidateLicenseAsync(parameters).getSyncPoller(); + } + + /** + * The operation to validate a license. + * + * @param parameters Parameters supplied to the license validation operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes a license in a hybrid machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LicenseInner> beginValidateLicense( + LicenseInner parameters, Context context) { + return this.beginValidateLicenseAsync(parameters, context).getSyncPoller(); + } + + /** + * The operation to validate a license. + * + * @param parameters Parameters supplied to the license validation operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a license in a hybrid machine on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono validateLicenseAsync(LicenseInner parameters) { + return beginValidateLicenseAsync(parameters).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to validate a license. + * + * @param parameters Parameters supplied to the license validation operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a license in a hybrid machine on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono validateLicenseAsync(LicenseInner parameters, Context context) { + return beginValidateLicenseAsync(parameters, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to validate a license. + * + * @param parameters Parameters supplied to the license validation operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a license in a hybrid machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LicenseInner validateLicense(LicenseInner parameters) { + return validateLicenseAsync(parameters).block(); + } + + /** + * The operation to validate a license. + * + * @param parameters Parameters supplied to the license validation operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a license in a hybrid machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LicenseInner validateLicense(LicenseInner parameters, Context context) { + return validateLicenseAsync(parameters, context).block(); + } + + /** + * The operation to create or update a license. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param licenseName The name of the license. + * @param parameters Parameters supplied to the Create license operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a license in a hybrid machine along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String licenseName, LicenseInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (licenseName == null) { + return Mono.error(new IllegalArgumentException("Parameter licenseName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + licenseName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to create or update a license. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param licenseName The name of the license. + * @param parameters Parameters supplied to the Create license operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a license in a hybrid machine along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String licenseName, LicenseInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (licenseName == null) { + return Mono.error(new IllegalArgumentException("Parameter licenseName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + licenseName, + parameters, + accept, + context); + } + + /** + * The operation to create or update a license. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param licenseName The name of the license. + * @param parameters Parameters supplied to the Create license operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of describes a license in a hybrid machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LicenseInner> beginCreateOrUpdateAsync( + String resourceGroupName, String licenseName, LicenseInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, licenseName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), LicenseInner.class, LicenseInner.class, this.client.getContext()); + } + + /** + * The operation to create or update a license. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param licenseName The name of the license. + * @param parameters Parameters supplied to the Create license operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of describes a license in a hybrid machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LicenseInner> beginCreateOrUpdateAsync( + String resourceGroupName, String licenseName, LicenseInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, licenseName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), LicenseInner.class, LicenseInner.class, context); + } + + /** + * The operation to create or update a license. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param licenseName The name of the license. + * @param parameters Parameters supplied to the Create license operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes a license in a hybrid machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LicenseInner> beginCreateOrUpdate( + String resourceGroupName, String licenseName, LicenseInner parameters) { + return this.beginCreateOrUpdateAsync(resourceGroupName, licenseName, parameters).getSyncPoller(); + } + + /** + * The operation to create or update a license. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param licenseName The name of the license. + * @param parameters Parameters supplied to the Create license operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes a license in a hybrid machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LicenseInner> beginCreateOrUpdate( + String resourceGroupName, String licenseName, LicenseInner parameters, Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, licenseName, parameters, context).getSyncPoller(); + } + + /** + * The operation to create or update a license. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param licenseName The name of the license. + * @param parameters Parameters supplied to the Create license operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a license in a hybrid machine on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String licenseName, LicenseInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, licenseName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to create or update a license. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param licenseName The name of the license. + * @param parameters Parameters supplied to the Create license operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a license in a hybrid machine on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String licenseName, LicenseInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, licenseName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to create or update a license. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param licenseName The name of the license. + * @param parameters Parameters supplied to the Create license operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a license in a hybrid machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LicenseInner createOrUpdate(String resourceGroupName, String licenseName, LicenseInner parameters) { + return createOrUpdateAsync(resourceGroupName, licenseName, parameters).block(); + } + + /** + * The operation to create or update a license. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param licenseName The name of the license. + * @param parameters Parameters supplied to the Create license operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a license in a hybrid machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LicenseInner createOrUpdate( + String resourceGroupName, String licenseName, LicenseInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, licenseName, parameters, context).block(); + } + + /** + * The operation to update a license. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param licenseName The name of the license. + * @param parameters Parameters supplied to the Update license operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a license in a hybrid machine along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String licenseName, LicenseUpdate parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (licenseName == null) { + return Mono.error(new IllegalArgumentException("Parameter licenseName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + licenseName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to update a license. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param licenseName The name of the license. + * @param parameters Parameters supplied to the Update license operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a license in a hybrid machine along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String licenseName, LicenseUpdate parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (licenseName == null) { + return Mono.error(new IllegalArgumentException("Parameter licenseName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + licenseName, + parameters, + accept, + context); + } + + /** + * The operation to update a license. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param licenseName The name of the license. + * @param parameters Parameters supplied to the Update license operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of describes a license in a hybrid machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LicenseInner> beginUpdateAsync( + String resourceGroupName, String licenseName, LicenseUpdate parameters) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, licenseName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), LicenseInner.class, LicenseInner.class, this.client.getContext()); + } + + /** + * The operation to update a license. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param licenseName The name of the license. + * @param parameters Parameters supplied to the Update license operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of describes a license in a hybrid machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LicenseInner> beginUpdateAsync( + String resourceGroupName, String licenseName, LicenseUpdate parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, licenseName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), LicenseInner.class, LicenseInner.class, context); + } + + /** + * The operation to update a license. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param licenseName The name of the license. + * @param parameters Parameters supplied to the Update license operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes a license in a hybrid machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LicenseInner> beginUpdate( + String resourceGroupName, String licenseName, LicenseUpdate parameters) { + return this.beginUpdateAsync(resourceGroupName, licenseName, parameters).getSyncPoller(); + } + + /** + * The operation to update a license. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param licenseName The name of the license. + * @param parameters Parameters supplied to the Update license operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes a license in a hybrid machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LicenseInner> beginUpdate( + String resourceGroupName, String licenseName, LicenseUpdate parameters, Context context) { + return this.beginUpdateAsync(resourceGroupName, licenseName, parameters, context).getSyncPoller(); + } + + /** + * The operation to update a license. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param licenseName The name of the license. + * @param parameters Parameters supplied to the Update license operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a license in a hybrid machine on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String licenseName, LicenseUpdate parameters) { + return beginUpdateAsync(resourceGroupName, licenseName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to update a license. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param licenseName The name of the license. + * @param parameters Parameters supplied to the Update license operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a license in a hybrid machine on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String licenseName, LicenseUpdate parameters, Context context) { + return beginUpdateAsync(resourceGroupName, licenseName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to update a license. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param licenseName The name of the license. + * @param parameters Parameters supplied to the Update license operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a license in a hybrid machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LicenseInner update(String resourceGroupName, String licenseName, LicenseUpdate parameters) { + return updateAsync(resourceGroupName, licenseName, parameters).block(); + } + + /** + * The operation to update a license. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param licenseName The name of the license. + * @param parameters Parameters supplied to the Update license operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a license in a hybrid machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LicenseInner update( + String resourceGroupName, String licenseName, LicenseUpdate parameters, Context context) { + return updateAsync(resourceGroupName, licenseName, parameters, context).block(); + } + + /** + * Retrieves information about the view of a license. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param licenseName The name of the license. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a license in a hybrid machine along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String licenseName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (licenseName == null) { + return Mono.error(new IllegalArgumentException("Parameter licenseName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + licenseName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves information about the view of a license. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param licenseName The name of the license. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a license in a hybrid machine along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String licenseName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (licenseName == null) { + return Mono.error(new IllegalArgumentException("Parameter licenseName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + licenseName, + accept, + context); + } + + /** + * Retrieves information about the view of a license. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param licenseName The name of the license. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a license in a hybrid machine on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String licenseName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, licenseName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieves information about the view of a license. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param licenseName The name of the license. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a license in a hybrid machine along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String licenseName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, licenseName, context).block(); + } + + /** + * Retrieves information about the view of a license. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param licenseName The name of the license. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a license in a hybrid machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LicenseInner getByResourceGroup(String resourceGroupName, String licenseName) { + return getByResourceGroupWithResponse(resourceGroupName, licenseName, Context.NONE).getValue(); + } + + /** + * The operation to delete a license. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param licenseName The name of the license. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String licenseName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (licenseName == null) { + return Mono.error(new IllegalArgumentException("Parameter licenseName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + licenseName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to delete a license. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param licenseName The name of the license. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String licenseName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (licenseName == null) { + return Mono.error(new IllegalArgumentException("Parameter licenseName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + licenseName, + accept, + context); + } + + /** + * The operation to delete a license. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param licenseName The name of the license. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String licenseName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, licenseName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * The operation to delete a license. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param licenseName The name of the license. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String licenseName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, licenseName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * The operation to delete a license. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param licenseName The name of the license. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String licenseName) { + return this.beginDeleteAsync(resourceGroupName, licenseName).getSyncPoller(); + } + + /** + * The operation to delete a license. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param licenseName The name of the license. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String licenseName, Context context) { + return this.beginDeleteAsync(resourceGroupName, licenseName, context).getSyncPoller(); + } + + /** + * The operation to delete a license. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param licenseName The name of the license. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String licenseName) { + return beginDeleteAsync(resourceGroupName, licenseName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to delete a license. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param licenseName The name of the license. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String licenseName, Context context) { + return beginDeleteAsync(resourceGroupName, licenseName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to delete a license. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param licenseName The name of the license. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String licenseName) { + deleteAsync(resourceGroupName, licenseName).block(); + } + + /** + * The operation to delete a license. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param licenseName The name of the license. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String licenseName, Context context) { + deleteAsync(resourceGroupName, licenseName, context).block(); + } + + /** + * The operation to get all licenses of a non-Azure machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List license operation response along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to get all licenses of a non-Azure machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List license operation response along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * The operation to get all licenses of a non-Azure machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List license operation response as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * The operation to get all licenses of a non-Azure machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List license operation response as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * The operation to get all licenses of a non-Azure machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List license operation response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * The operation to get all licenses of a non-Azure machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List license operation response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * The operation to get all licenses of a non-Azure machine. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List license operation response along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to get all licenses of a non-Azure machine. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List license operation response along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * The operation to get all licenses of a non-Azure machine. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List license operation response as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * The operation to get all licenses of a non-Azure machine. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List license operation response as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * The operation to get all licenses of a non-Azure machine. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List license operation response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * The operation to get all licenses of a non-Azure machine. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List license operation response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List license operation response along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List license operation response along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List license operation response along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List license operation response along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/LicensesImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/LicensesImpl.java new file mode 100644 index 0000000000000..95c7d78f8e84d --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/LicensesImpl.java @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybridcompute.fluent.LicensesClient; +import com.azure.resourcemanager.hybridcompute.fluent.models.LicenseInner; +import com.azure.resourcemanager.hybridcompute.models.License; +import com.azure.resourcemanager.hybridcompute.models.Licenses; + +public final class LicensesImpl implements Licenses { + private static final ClientLogger LOGGER = new ClientLogger(LicensesImpl.class); + + private final LicensesClient innerClient; + + private final com.azure.resourcemanager.hybridcompute.HybridComputeManager serviceManager; + + public LicensesImpl( + LicensesClient innerClient, com.azure.resourcemanager.hybridcompute.HybridComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public License validateLicense(LicenseInner parameters) { + LicenseInner inner = this.serviceClient().validateLicense(parameters); + if (inner != null) { + return new LicenseImpl(inner, this.manager()); + } else { + return null; + } + } + + public License validateLicense(LicenseInner parameters, Context context) { + LicenseInner inner = this.serviceClient().validateLicense(parameters, context); + if (inner != null) { + return new LicenseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String licenseName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, licenseName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new LicenseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public License getByResourceGroup(String resourceGroupName, String licenseName) { + LicenseInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, licenseName); + if (inner != null) { + return new LicenseImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String licenseName) { + this.serviceClient().delete(resourceGroupName, licenseName); + } + + public void delete(String resourceGroupName, String licenseName, Context context) { + this.serviceClient().delete(resourceGroupName, licenseName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new LicenseImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new LicenseImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new LicenseImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new LicenseImpl(inner1, this.manager())); + } + + public License getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String licenseName = Utils.getValueFromIdByName(id, "licenses"); + if (licenseName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'licenses'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, licenseName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String licenseName = Utils.getValueFromIdByName(id, "licenses"); + if (licenseName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'licenses'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, licenseName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String licenseName = Utils.getValueFromIdByName(id, "licenses"); + if (licenseName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'licenses'.", id))); + } + this.delete(resourceGroupName, licenseName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String licenseName = Utils.getValueFromIdByName(id, "licenses"); + if (licenseName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'licenses'.", id))); + } + this.delete(resourceGroupName, licenseName, context); + } + + private LicensesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.hybridcompute.HybridComputeManager manager() { + return this.serviceManager; + } + + public LicenseImpl define(String name) { + return new LicenseImpl(name, this.manager()); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachineAssessPatchesResultImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachineAssessPatchesResultImpl.java new file mode 100644 index 0000000000000..53e7608b79138 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachineAssessPatchesResultImpl.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.hybridcompute.implementation; + +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.hybridcompute.fluent.models.MachineAssessPatchesResultInner; +import com.azure.resourcemanager.hybridcompute.models.AvailablePatchCountByClassification; +import com.azure.resourcemanager.hybridcompute.models.MachineAssessPatchesResult; +import com.azure.resourcemanager.hybridcompute.models.OsType; +import com.azure.resourcemanager.hybridcompute.models.PatchOperationStartedBy; +import com.azure.resourcemanager.hybridcompute.models.PatchOperationStatus; +import com.azure.resourcemanager.hybridcompute.models.PatchServiceUsed; +import java.time.OffsetDateTime; + +public final class MachineAssessPatchesResultImpl implements MachineAssessPatchesResult { + private MachineAssessPatchesResultInner innerObject; + + private final com.azure.resourcemanager.hybridcompute.HybridComputeManager serviceManager; + + MachineAssessPatchesResultImpl( + MachineAssessPatchesResultInner innerObject, + com.azure.resourcemanager.hybridcompute.HybridComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public PatchOperationStatus status() { + return this.innerModel().status(); + } + + public String assessmentActivityId() { + return this.innerModel().assessmentActivityId(); + } + + public Boolean rebootPending() { + return this.innerModel().rebootPending(); + } + + public AvailablePatchCountByClassification availablePatchCountByClassification() { + return this.innerModel().availablePatchCountByClassification(); + } + + public OffsetDateTime startDateTime() { + return this.innerModel().startDateTime(); + } + + public OffsetDateTime lastModifiedDateTime() { + return this.innerModel().lastModifiedDateTime(); + } + + public PatchOperationStartedBy startedBy() { + return this.innerModel().startedBy(); + } + + public PatchServiceUsed patchServiceUsed() { + return this.innerModel().patchServiceUsed(); + } + + public OsType osType() { + return this.innerModel().osType(); + } + + public ManagementError errorDetails() { + return this.innerModel().errorDetails(); + } + + public MachineAssessPatchesResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hybridcompute.HybridComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachineExtensionImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachineExtensionImpl.java index d73a366c2728e..cb20c674fd655 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachineExtensionImpl.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachineExtensionImpl.java @@ -11,7 +11,6 @@ import com.azure.resourcemanager.hybridcompute.models.MachineExtension; import com.azure.resourcemanager.hybridcompute.models.MachineExtensionProperties; import com.azure.resourcemanager.hybridcompute.models.MachineExtensionUpdate; -import com.azure.resourcemanager.hybridcompute.models.MachineExtensionUpdateProperties; import java.util.Collections; import java.util.Map; @@ -190,8 +189,43 @@ public MachineExtensionImpl withProperties(MachineExtensionProperties properties return this; } - public MachineExtensionImpl withProperties(MachineExtensionUpdateProperties properties) { - this.updateExtensionParameters.withProperties(properties); + public MachineExtensionImpl withForceUpdateTag(String forceUpdateTag) { + this.updateExtensionParameters.withForceUpdateTag(forceUpdateTag); + return this; + } + + public MachineExtensionImpl withPublisher(String publisher) { + this.updateExtensionParameters.withPublisher(publisher); + return this; + } + + public MachineExtensionImpl withType(String type) { + this.updateExtensionParameters.withType(type); + return this; + } + + public MachineExtensionImpl withTypeHandlerVersion(String typeHandlerVersion) { + this.updateExtensionParameters.withTypeHandlerVersion(typeHandlerVersion); + return this; + } + + public MachineExtensionImpl withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { + this.updateExtensionParameters.withEnableAutomaticUpgrade(enableAutomaticUpgrade); + return this; + } + + public MachineExtensionImpl withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { + this.updateExtensionParameters.withAutoUpgradeMinorVersion(autoUpgradeMinorVersion); + return this; + } + + public MachineExtensionImpl withSettings(Map settings) { + this.updateExtensionParameters.withSettings(settings); + return this; + } + + public MachineExtensionImpl withProtectedSettings(Map protectedSettings) { + this.updateExtensionParameters.withProtectedSettings(protectedSettings); return this; } diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachineExtensionsClientImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachineExtensionsClientImpl.java index 0c8a209060cdf..6571532cfcadc 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachineExtensionsClientImpl.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachineExtensionsClientImpl.java @@ -68,8 +68,7 @@ public final class MachineExtensionsClientImpl implements MachineExtensionsClien public interface MachineExtensionsService { @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute" - + "/machines/{machineName}/extensions/{extensionName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> createOrUpdate( @@ -85,8 +84,7 @@ Mono>> createOrUpdate( @Headers({"Content-Type: application/json"}) @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute" - + "/machines/{machineName}/extensions/{extensionName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> update( @@ -102,8 +100,7 @@ Mono>> update( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute" - + "/machines/{machineName}/extensions/{extensionName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> delete( @@ -118,8 +115,7 @@ Mono>> delete( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute" - + "/machines/{machineName}/extensions/{extensionName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( @@ -134,8 +130,7 @@ Mono> get( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute" - + "/machines/{machineName}/extensions") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list( diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachineImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachineImpl.java index f1e216d83e41c..ce0e63ee69248 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachineImpl.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachineImpl.java @@ -5,12 +5,30 @@ package com.azure.resourcemanager.hybridcompute.implementation; import com.azure.core.management.SystemData; +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.hybridcompute.fluent.models.LicenseProfileMachineInstanceViewInner; +import com.azure.resourcemanager.hybridcompute.fluent.models.MachineExtensionInner; import com.azure.resourcemanager.hybridcompute.fluent.models.MachineInner; +import com.azure.resourcemanager.hybridcompute.fluent.models.NetworkProfileInner; +import com.azure.resourcemanager.hybridcompute.models.AgentConfiguration; +import com.azure.resourcemanager.hybridcompute.models.AgentUpgrade; +import com.azure.resourcemanager.hybridcompute.models.ArcKindEnum; +import com.azure.resourcemanager.hybridcompute.models.CloudMetadata; import com.azure.resourcemanager.hybridcompute.models.Identity; +import com.azure.resourcemanager.hybridcompute.models.LicenseProfileMachineInstanceView; +import com.azure.resourcemanager.hybridcompute.models.LocationData; import com.azure.resourcemanager.hybridcompute.models.Machine; -import com.azure.resourcemanager.hybridcompute.models.MachineProperties; +import com.azure.resourcemanager.hybridcompute.models.MachineExtension; +import com.azure.resourcemanager.hybridcompute.models.MachineExtensionInstanceView; +import com.azure.resourcemanager.hybridcompute.models.NetworkProfile; +import com.azure.resourcemanager.hybridcompute.models.OSProfile; +import com.azure.resourcemanager.hybridcompute.models.ServiceStatuses; +import com.azure.resourcemanager.hybridcompute.models.StatusTypes; +import java.time.OffsetDateTime; import java.util.Collections; +import java.util.List; import java.util.Map; +import java.util.stream.Collectors; public final class MachineImpl implements Machine { private MachineInner innerObject; @@ -47,18 +65,177 @@ public Map tags() { } } - public MachineProperties properties() { - return this.innerModel().properties(); + public List resources() { + List inner = this.innerModel().resources(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new MachineExtensionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } } public Identity identity() { return this.innerModel().identity(); } + public ArcKindEnum kind() { + return this.innerModel().kind(); + } + public SystemData systemData() { return this.innerModel().systemData(); } + public LocationData locationData() { + return this.innerModel().locationData(); + } + + public AgentConfiguration agentConfiguration() { + return this.innerModel().agentConfiguration(); + } + + public ServiceStatuses serviceStatuses() { + return this.innerModel().serviceStatuses(); + } + + public CloudMetadata cloudMetadata() { + return this.innerModel().cloudMetadata(); + } + + public AgentUpgrade agentUpgrade() { + return this.innerModel().agentUpgrade(); + } + + public OSProfile osProfile() { + return this.innerModel().osProfile(); + } + + public LicenseProfileMachineInstanceView licenseProfile() { + LicenseProfileMachineInstanceViewInner inner = this.innerModel().licenseProfile(); + if (inner != null) { + return new LicenseProfileMachineInstanceViewImpl(inner, this.manager()); + } else { + return null; + } + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public StatusTypes status() { + return this.innerModel().status(); + } + + public OffsetDateTime lastStatusChange() { + return this.innerModel().lastStatusChange(); + } + + public List errorDetails() { + List inner = this.innerModel().errorDetails(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String agentVersion() { + return this.innerModel().agentVersion(); + } + + public String vmId() { + return this.innerModel().vmId(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public String machineFqdn() { + return this.innerModel().machineFqdn(); + } + + public String clientPublicKey() { + return this.innerModel().clientPublicKey(); + } + + public String osName() { + return this.innerModel().osName(); + } + + public String osVersion() { + return this.innerModel().osVersion(); + } + + public String osType() { + return this.innerModel().osType(); + } + + public String vmUuid() { + return this.innerModel().vmUuid(); + } + + public List extensions() { + List inner = this.innerModel().extensions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String osSku() { + return this.innerModel().osSku(); + } + + public String domainName() { + return this.innerModel().domainName(); + } + + public String adFqdn() { + return this.innerModel().adFqdn(); + } + + public String dnsFqdn() { + return this.innerModel().dnsFqdn(); + } + + public String privateLinkScopeResourceId() { + return this.innerModel().privateLinkScopeResourceId(); + } + + public String parentClusterResourceId() { + return this.innerModel().parentClusterResourceId(); + } + + public String mssqlDiscovered() { + return this.innerModel().mssqlDiscovered(); + } + + public Map detectedProperties() { + Map inner = this.innerModel().detectedProperties(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public NetworkProfile networkProfile() { + NetworkProfileInner inner = this.innerModel().networkProfile(); + if (inner != null) { + return new NetworkProfileImpl(inner, this.manager()); + } else { + return null; + } + } + public MachineInner innerModel() { return this.innerObject; } diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachineInstallPatchesResultImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachineInstallPatchesResultImpl.java new file mode 100644 index 0000000000000..a7673348af132 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachineInstallPatchesResultImpl.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.implementation; + +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.hybridcompute.fluent.models.MachineInstallPatchesResultInner; +import com.azure.resourcemanager.hybridcompute.models.MachineInstallPatchesResult; +import com.azure.resourcemanager.hybridcompute.models.OsType; +import com.azure.resourcemanager.hybridcompute.models.PatchOperationStartedBy; +import com.azure.resourcemanager.hybridcompute.models.PatchOperationStatus; +import com.azure.resourcemanager.hybridcompute.models.PatchServiceUsed; +import com.azure.resourcemanager.hybridcompute.models.VMGuestPatchRebootStatus; +import java.time.OffsetDateTime; + +public final class MachineInstallPatchesResultImpl implements MachineInstallPatchesResult { + private MachineInstallPatchesResultInner innerObject; + + private final com.azure.resourcemanager.hybridcompute.HybridComputeManager serviceManager; + + MachineInstallPatchesResultImpl( + MachineInstallPatchesResultInner innerObject, + com.azure.resourcemanager.hybridcompute.HybridComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public PatchOperationStatus status() { + return this.innerModel().status(); + } + + public String installationActivityId() { + return this.innerModel().installationActivityId(); + } + + public VMGuestPatchRebootStatus rebootStatus() { + return this.innerModel().rebootStatus(); + } + + public Boolean maintenanceWindowExceeded() { + return this.innerModel().maintenanceWindowExceeded(); + } + + public Integer excludedPatchCount() { + return this.innerModel().excludedPatchCount(); + } + + public Integer notSelectedPatchCount() { + return this.innerModel().notSelectedPatchCount(); + } + + public Integer pendingPatchCount() { + return this.innerModel().pendingPatchCount(); + } + + public Integer installedPatchCount() { + return this.innerModel().installedPatchCount(); + } + + public Integer failedPatchCount() { + return this.innerModel().failedPatchCount(); + } + + public OffsetDateTime startDateTime() { + return this.innerModel().startDateTime(); + } + + public OffsetDateTime lastModifiedDateTime() { + return this.innerModel().lastModifiedDateTime(); + } + + public PatchOperationStartedBy startedBy() { + return this.innerModel().startedBy(); + } + + public PatchServiceUsed patchServiceUsed() { + return this.innerModel().patchServiceUsed(); + } + + public OsType osType() { + return this.innerModel().osType(); + } + + public ManagementError errorDetails() { + return this.innerModel().errorDetails(); + } + + public MachineInstallPatchesResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hybridcompute.HybridComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachinePropertiesImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachinePropertiesImpl.java new file mode 100644 index 0000000000000..5346dcd0fb759 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachinePropertiesImpl.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.implementation; + +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.hybridcompute.fluent.models.LicenseProfileMachineInstanceViewInner; +import com.azure.resourcemanager.hybridcompute.fluent.models.MachinePropertiesInner; +import com.azure.resourcemanager.hybridcompute.fluent.models.NetworkProfileInner; +import com.azure.resourcemanager.hybridcompute.models.AgentConfiguration; +import com.azure.resourcemanager.hybridcompute.models.AgentUpgrade; +import com.azure.resourcemanager.hybridcompute.models.CloudMetadata; +import com.azure.resourcemanager.hybridcompute.models.LicenseProfileMachineInstanceView; +import com.azure.resourcemanager.hybridcompute.models.LocationData; +import com.azure.resourcemanager.hybridcompute.models.MachineExtensionInstanceView; +import com.azure.resourcemanager.hybridcompute.models.MachineProperties; +import com.azure.resourcemanager.hybridcompute.models.NetworkProfile; +import com.azure.resourcemanager.hybridcompute.models.OSProfile; +import com.azure.resourcemanager.hybridcompute.models.ServiceStatuses; +import com.azure.resourcemanager.hybridcompute.models.StatusTypes; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class MachinePropertiesImpl implements MachineProperties { + private MachinePropertiesInner innerObject; + + private final com.azure.resourcemanager.hybridcompute.HybridComputeManager serviceManager; + + MachinePropertiesImpl( + MachinePropertiesInner innerObject, + com.azure.resourcemanager.hybridcompute.HybridComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public LocationData locationData() { + return this.innerModel().locationData(); + } + + public AgentConfiguration agentConfiguration() { + return this.innerModel().agentConfiguration(); + } + + public ServiceStatuses serviceStatuses() { + return this.innerModel().serviceStatuses(); + } + + public CloudMetadata cloudMetadata() { + return this.innerModel().cloudMetadata(); + } + + public AgentUpgrade agentUpgrade() { + return this.innerModel().agentUpgrade(); + } + + public OSProfile osProfile() { + return this.innerModel().osProfile(); + } + + public LicenseProfileMachineInstanceView licenseProfile() { + LicenseProfileMachineInstanceViewInner inner = this.innerModel().licenseProfile(); + if (inner != null) { + return new LicenseProfileMachineInstanceViewImpl(inner, this.manager()); + } else { + return null; + } + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public StatusTypes status() { + return this.innerModel().status(); + } + + public OffsetDateTime lastStatusChange() { + return this.innerModel().lastStatusChange(); + } + + public List errorDetails() { + List inner = this.innerModel().errorDetails(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String agentVersion() { + return this.innerModel().agentVersion(); + } + + public String vmId() { + return this.innerModel().vmId(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public String machineFqdn() { + return this.innerModel().machineFqdn(); + } + + public String clientPublicKey() { + return this.innerModel().clientPublicKey(); + } + + public String osName() { + return this.innerModel().osName(); + } + + public String osVersion() { + return this.innerModel().osVersion(); + } + + public String osType() { + return this.innerModel().osType(); + } + + public String vmUuid() { + return this.innerModel().vmUuid(); + } + + public List extensions() { + List inner = this.innerModel().extensions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String osSku() { + return this.innerModel().osSku(); + } + + public String domainName() { + return this.innerModel().domainName(); + } + + public String adFqdn() { + return this.innerModel().adFqdn(); + } + + public String dnsFqdn() { + return this.innerModel().dnsFqdn(); + } + + public String privateLinkScopeResourceId() { + return this.innerModel().privateLinkScopeResourceId(); + } + + public String parentClusterResourceId() { + return this.innerModel().parentClusterResourceId(); + } + + public String mssqlDiscovered() { + return this.innerModel().mssqlDiscovered(); + } + + public Map detectedProperties() { + Map inner = this.innerModel().detectedProperties(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public NetworkProfile networkProfile() { + NetworkProfileInner inner = this.innerModel().networkProfile(); + if (inner != null) { + return new NetworkProfileImpl(inner, this.manager()); + } else { + return null; + } + } + + public MachinePropertiesInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hybridcompute.HybridComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachineRunCommandImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachineRunCommandImpl.java new file mode 100644 index 0000000000000..5c9d8b8a9158d --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachineRunCommandImpl.java @@ -0,0 +1,307 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridcompute.fluent.models.MachineRunCommandInner; +import com.azure.resourcemanager.hybridcompute.models.MachineRunCommand; +import com.azure.resourcemanager.hybridcompute.models.MachineRunCommandInstanceView; +import com.azure.resourcemanager.hybridcompute.models.MachineRunCommandScriptSource; +import com.azure.resourcemanager.hybridcompute.models.MachineRunCommandUpdate; +import com.azure.resourcemanager.hybridcompute.models.RunCommandInputParameter; +import com.azure.resourcemanager.hybridcompute.models.RunCommandManagedIdentity; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class MachineRunCommandImpl + implements MachineRunCommand, MachineRunCommand.Definition, MachineRunCommand.Update { + private MachineRunCommandInner innerObject; + + private final com.azure.resourcemanager.hybridcompute.HybridComputeManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public MachineRunCommandScriptSource source() { + return this.innerModel().source(); + } + + public List parameters() { + List inner = this.innerModel().parameters(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List protectedParameters() { + List inner = this.innerModel().protectedParameters(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Boolean asyncExecution() { + return this.innerModel().asyncExecution(); + } + + public String runAsUser() { + return this.innerModel().runAsUser(); + } + + public String runAsPassword() { + return this.innerModel().runAsPassword(); + } + + public Integer timeoutInSeconds() { + return this.innerModel().timeoutInSeconds(); + } + + public String outputBlobUri() { + return this.innerModel().outputBlobUri(); + } + + public String errorBlobUri() { + return this.innerModel().errorBlobUri(); + } + + public RunCommandManagedIdentity outputBlobManagedIdentity() { + return this.innerModel().outputBlobManagedIdentity(); + } + + public RunCommandManagedIdentity errorBlobManagedIdentity() { + return this.innerModel().errorBlobManagedIdentity(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public MachineRunCommandInstanceView instanceView() { + return this.innerModel().instanceView(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public MachineRunCommandInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hybridcompute.HybridComputeManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String machineName; + + private String runCommandName; + + private MachineRunCommandUpdate updateRunCommandProperties; + + public MachineRunCommandImpl withExistingMachine(String resourceGroupName, String machineName) { + this.resourceGroupName = resourceGroupName; + this.machineName = machineName; + return this; + } + + public MachineRunCommand create() { + this.innerObject = + serviceManager + .serviceClient() + .getMachineRunCommands() + .createOrUpdate(resourceGroupName, machineName, runCommandName, this.innerModel(), Context.NONE); + return this; + } + + public MachineRunCommand create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getMachineRunCommands() + .createOrUpdate(resourceGroupName, machineName, runCommandName, this.innerModel(), context); + return this; + } + + MachineRunCommandImpl(String name, com.azure.resourcemanager.hybridcompute.HybridComputeManager serviceManager) { + this.innerObject = new MachineRunCommandInner(); + this.serviceManager = serviceManager; + this.runCommandName = name; + } + + public MachineRunCommandImpl update() { + this.updateRunCommandProperties = new MachineRunCommandUpdate(); + return this; + } + + public MachineRunCommand apply() { + this.innerObject = + serviceManager + .serviceClient() + .getMachineRunCommands() + .update(resourceGroupName, machineName, runCommandName, updateRunCommandProperties, Context.NONE); + return this; + } + + public MachineRunCommand apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getMachineRunCommands() + .update(resourceGroupName, machineName, runCommandName, updateRunCommandProperties, context); + return this; + } + + MachineRunCommandImpl( + MachineRunCommandInner innerObject, + com.azure.resourcemanager.hybridcompute.HybridComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.machineName = Utils.getValueFromIdByName(innerObject.id(), "machines"); + this.runCommandName = Utils.getValueFromIdByName(innerObject.id(), "runCommands"); + } + + public MachineRunCommand refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getMachineRunCommands() + .getWithResponse(resourceGroupName, machineName, runCommandName, Context.NONE) + .getValue(); + return this; + } + + public MachineRunCommand refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getMachineRunCommands() + .getWithResponse(resourceGroupName, machineName, runCommandName, context) + .getValue(); + return this; + } + + public MachineRunCommandImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public MachineRunCommandImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public MachineRunCommandImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateRunCommandProperties.withTags(tags); + return this; + } + } + + public MachineRunCommandImpl withSource(MachineRunCommandScriptSource source) { + this.innerModel().withSource(source); + return this; + } + + public MachineRunCommandImpl withParameters(List parameters) { + this.innerModel().withParameters(parameters); + return this; + } + + public MachineRunCommandImpl withProtectedParameters(List protectedParameters) { + this.innerModel().withProtectedParameters(protectedParameters); + return this; + } + + public MachineRunCommandImpl withAsyncExecution(Boolean asyncExecution) { + this.innerModel().withAsyncExecution(asyncExecution); + return this; + } + + public MachineRunCommandImpl withRunAsUser(String runAsUser) { + this.innerModel().withRunAsUser(runAsUser); + return this; + } + + public MachineRunCommandImpl withRunAsPassword(String runAsPassword) { + this.innerModel().withRunAsPassword(runAsPassword); + return this; + } + + public MachineRunCommandImpl withTimeoutInSeconds(Integer timeoutInSeconds) { + this.innerModel().withTimeoutInSeconds(timeoutInSeconds); + return this; + } + + public MachineRunCommandImpl withOutputBlobUri(String outputBlobUri) { + this.innerModel().withOutputBlobUri(outputBlobUri); + return this; + } + + public MachineRunCommandImpl withErrorBlobUri(String errorBlobUri) { + this.innerModel().withErrorBlobUri(errorBlobUri); + return this; + } + + public MachineRunCommandImpl withOutputBlobManagedIdentity(RunCommandManagedIdentity outputBlobManagedIdentity) { + this.innerModel().withOutputBlobManagedIdentity(outputBlobManagedIdentity); + return this; + } + + public MachineRunCommandImpl withErrorBlobManagedIdentity(RunCommandManagedIdentity errorBlobManagedIdentity) { + this.innerModel().withErrorBlobManagedIdentity(errorBlobManagedIdentity); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachineRunCommandsClientImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachineRunCommandsClientImpl.java new file mode 100644 index 0000000000000..0eb89fa3fb414 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachineRunCommandsClientImpl.java @@ -0,0 +1,1508 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.hybridcompute.fluent.MachineRunCommandsClient; +import com.azure.resourcemanager.hybridcompute.fluent.models.MachineRunCommandInner; +import com.azure.resourcemanager.hybridcompute.models.MachineRunCommandUpdate; +import com.azure.resourcemanager.hybridcompute.models.MachineRunCommandsListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in MachineRunCommandsClient. */ +public final class MachineRunCommandsClientImpl implements MachineRunCommandsClient { + /** The proxy service used to perform REST calls. */ + private final MachineRunCommandsService service; + + /** The service client containing this operation class. */ + private final HybridComputeManagementClientImpl client; + + /** + * Initializes an instance of MachineRunCommandsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + MachineRunCommandsClientImpl(HybridComputeManagementClientImpl client) { + this.service = + RestProxy.create(MachineRunCommandsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HybridComputeManagementClientMachineRunCommands to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HybridComputeManagem") + public interface MachineRunCommandsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("machineName") String machineName, + @PathParam("runCommandName") String runCommandName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") MachineRunCommandInner runCommandProperties, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("machineName") String machineName, + @PathParam("runCommandName") String runCommandName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") MachineRunCommandUpdate runCommandProperties, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("machineName") String machineName, + @PathParam("runCommandName") String runCommandName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("machineName") String machineName, + @PathParam("runCommandName") String runCommandName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("machineName") String machineName, + @QueryParam("$expand") String expand, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * The operation to create or update a run command. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param runCommandName The name of the run command. + * @param runCommandProperties Parameters supplied to the Create Run Command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Run Command along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String machineName, + String runCommandName, + MachineRunCommandInner runCommandProperties) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (machineName == null) { + return Mono.error(new IllegalArgumentException("Parameter machineName is required and cannot be null.")); + } + if (runCommandName == null) { + return Mono.error(new IllegalArgumentException("Parameter runCommandName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (runCommandProperties == null) { + return Mono + .error(new IllegalArgumentException("Parameter runCommandProperties is required and cannot be null.")); + } else { + runCommandProperties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + machineName, + runCommandName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + runCommandProperties, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to create or update a run command. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param runCommandName The name of the run command. + * @param runCommandProperties Parameters supplied to the Create Run Command. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Run Command along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String machineName, + String runCommandName, + MachineRunCommandInner runCommandProperties, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (machineName == null) { + return Mono.error(new IllegalArgumentException("Parameter machineName is required and cannot be null.")); + } + if (runCommandName == null) { + return Mono.error(new IllegalArgumentException("Parameter runCommandName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (runCommandProperties == null) { + return Mono + .error(new IllegalArgumentException("Parameter runCommandProperties is required and cannot be null.")); + } else { + runCommandProperties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + machineName, + runCommandName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + runCommandProperties, + accept, + context); + } + + /** + * The operation to create or update a run command. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param runCommandName The name of the run command. + * @param runCommandProperties Parameters supplied to the Create Run Command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of describes a Run Command. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MachineRunCommandInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String machineName, + String runCommandName, + MachineRunCommandInner runCommandProperties) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, machineName, runCommandName, runCommandProperties); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + MachineRunCommandInner.class, + MachineRunCommandInner.class, + this.client.getContext()); + } + + /** + * The operation to create or update a run command. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param runCommandName The name of the run command. + * @param runCommandProperties Parameters supplied to the Create Run Command. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of describes a Run Command. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MachineRunCommandInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String machineName, + String runCommandName, + MachineRunCommandInner runCommandProperties, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, machineName, runCommandName, runCommandProperties, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + MachineRunCommandInner.class, + MachineRunCommandInner.class, + context); + } + + /** + * The operation to create or update a run command. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param runCommandName The name of the run command. + * @param runCommandProperties Parameters supplied to the Create Run Command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes a Run Command. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MachineRunCommandInner> beginCreateOrUpdate( + String resourceGroupName, + String machineName, + String runCommandName, + MachineRunCommandInner runCommandProperties) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, machineName, runCommandName, runCommandProperties) + .getSyncPoller(); + } + + /** + * The operation to create or update a run command. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param runCommandName The name of the run command. + * @param runCommandProperties Parameters supplied to the Create Run Command. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes a Run Command. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MachineRunCommandInner> beginCreateOrUpdate( + String resourceGroupName, + String machineName, + String runCommandName, + MachineRunCommandInner runCommandProperties, + Context context) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, machineName, runCommandName, runCommandProperties, context) + .getSyncPoller(); + } + + /** + * The operation to create or update a run command. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param runCommandName The name of the run command. + * @param runCommandProperties Parameters supplied to the Create Run Command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Run Command on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String machineName, + String runCommandName, + MachineRunCommandInner runCommandProperties) { + return beginCreateOrUpdateAsync(resourceGroupName, machineName, runCommandName, runCommandProperties) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to create or update a run command. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param runCommandName The name of the run command. + * @param runCommandProperties Parameters supplied to the Create Run Command. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Run Command on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String machineName, + String runCommandName, + MachineRunCommandInner runCommandProperties, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, machineName, runCommandName, runCommandProperties, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to create or update a run command. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param runCommandName The name of the run command. + * @param runCommandProperties Parameters supplied to the Create Run Command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Run Command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MachineRunCommandInner createOrUpdate( + String resourceGroupName, + String machineName, + String runCommandName, + MachineRunCommandInner runCommandProperties) { + return createOrUpdateAsync(resourceGroupName, machineName, runCommandName, runCommandProperties).block(); + } + + /** + * The operation to create or update a run command. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param runCommandName The name of the run command. + * @param runCommandProperties Parameters supplied to the Create Run Command. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Run Command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MachineRunCommandInner createOrUpdate( + String resourceGroupName, + String machineName, + String runCommandName, + MachineRunCommandInner runCommandProperties, + Context context) { + return createOrUpdateAsync(resourceGroupName, machineName, runCommandName, runCommandProperties, context) + .block(); + } + + /** + * The operation to update the run command. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param runCommandName The name of the run command. + * @param runCommandProperties Parameters supplied to the Create Run Command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Run Command along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String machineName, + String runCommandName, + MachineRunCommandUpdate runCommandProperties) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (machineName == null) { + return Mono.error(new IllegalArgumentException("Parameter machineName is required and cannot be null.")); + } + if (runCommandName == null) { + return Mono.error(new IllegalArgumentException("Parameter runCommandName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (runCommandProperties == null) { + return Mono + .error(new IllegalArgumentException("Parameter runCommandProperties is required and cannot be null.")); + } else { + runCommandProperties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + machineName, + runCommandName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + runCommandProperties, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to update the run command. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param runCommandName The name of the run command. + * @param runCommandProperties Parameters supplied to the Create Run Command. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Run Command along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String machineName, + String runCommandName, + MachineRunCommandUpdate runCommandProperties, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (machineName == null) { + return Mono.error(new IllegalArgumentException("Parameter machineName is required and cannot be null.")); + } + if (runCommandName == null) { + return Mono.error(new IllegalArgumentException("Parameter runCommandName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (runCommandProperties == null) { + return Mono + .error(new IllegalArgumentException("Parameter runCommandProperties is required and cannot be null.")); + } else { + runCommandProperties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + machineName, + runCommandName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + runCommandProperties, + accept, + context); + } + + /** + * The operation to update the run command. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param runCommandName The name of the run command. + * @param runCommandProperties Parameters supplied to the Create Run Command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of describes a Run Command. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MachineRunCommandInner> beginUpdateAsync( + String resourceGroupName, + String machineName, + String runCommandName, + MachineRunCommandUpdate runCommandProperties) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, machineName, runCommandName, runCommandProperties); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + MachineRunCommandInner.class, + MachineRunCommandInner.class, + this.client.getContext()); + } + + /** + * The operation to update the run command. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param runCommandName The name of the run command. + * @param runCommandProperties Parameters supplied to the Create Run Command. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of describes a Run Command. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MachineRunCommandInner> beginUpdateAsync( + String resourceGroupName, + String machineName, + String runCommandName, + MachineRunCommandUpdate runCommandProperties, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, machineName, runCommandName, runCommandProperties, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + MachineRunCommandInner.class, + MachineRunCommandInner.class, + context); + } + + /** + * The operation to update the run command. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param runCommandName The name of the run command. + * @param runCommandProperties Parameters supplied to the Create Run Command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes a Run Command. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MachineRunCommandInner> beginUpdate( + String resourceGroupName, + String machineName, + String runCommandName, + MachineRunCommandUpdate runCommandProperties) { + return this + .beginUpdateAsync(resourceGroupName, machineName, runCommandName, runCommandProperties) + .getSyncPoller(); + } + + /** + * The operation to update the run command. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param runCommandName The name of the run command. + * @param runCommandProperties Parameters supplied to the Create Run Command. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes a Run Command. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MachineRunCommandInner> beginUpdate( + String resourceGroupName, + String machineName, + String runCommandName, + MachineRunCommandUpdate runCommandProperties, + Context context) { + return this + .beginUpdateAsync(resourceGroupName, machineName, runCommandName, runCommandProperties, context) + .getSyncPoller(); + } + + /** + * The operation to update the run command. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param runCommandName The name of the run command. + * @param runCommandProperties Parameters supplied to the Create Run Command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Run Command on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String machineName, + String runCommandName, + MachineRunCommandUpdate runCommandProperties) { + return beginUpdateAsync(resourceGroupName, machineName, runCommandName, runCommandProperties) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to update the run command. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param runCommandName The name of the run command. + * @param runCommandProperties Parameters supplied to the Create Run Command. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Run Command on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String machineName, + String runCommandName, + MachineRunCommandUpdate runCommandProperties, + Context context) { + return beginUpdateAsync(resourceGroupName, machineName, runCommandName, runCommandProperties, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to update the run command. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param runCommandName The name of the run command. + * @param runCommandProperties Parameters supplied to the Create Run Command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Run Command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MachineRunCommandInner update( + String resourceGroupName, + String machineName, + String runCommandName, + MachineRunCommandUpdate runCommandProperties) { + return updateAsync(resourceGroupName, machineName, runCommandName, runCommandProperties).block(); + } + + /** + * The operation to update the run command. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param runCommandName The name of the run command. + * @param runCommandProperties Parameters supplied to the Create Run Command. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Run Command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MachineRunCommandInner update( + String resourceGroupName, + String machineName, + String runCommandName, + MachineRunCommandUpdate runCommandProperties, + Context context) { + return updateAsync(resourceGroupName, machineName, runCommandName, runCommandProperties, context).block(); + } + + /** + * The operation to delete a run command. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param runCommandName The name of the run command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String machineName, String runCommandName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (machineName == null) { + return Mono.error(new IllegalArgumentException("Parameter machineName is required and cannot be null.")); + } + if (runCommandName == null) { + return Mono.error(new IllegalArgumentException("Parameter runCommandName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + machineName, + runCommandName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to delete a run command. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param runCommandName The name of the run command. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String machineName, String runCommandName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (machineName == null) { + return Mono.error(new IllegalArgumentException("Parameter machineName is required and cannot be null.")); + } + if (runCommandName == null) { + return Mono.error(new IllegalArgumentException("Parameter runCommandName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + machineName, + runCommandName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * The operation to delete a run command. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param runCommandName The name of the run command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String machineName, String runCommandName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, machineName, runCommandName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * The operation to delete a run command. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param runCommandName The name of the run command. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String machineName, String runCommandName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, machineName, runCommandName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * The operation to delete a run command. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param runCommandName The name of the run command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String machineName, String runCommandName) { + return this.beginDeleteAsync(resourceGroupName, machineName, runCommandName).getSyncPoller(); + } + + /** + * The operation to delete a run command. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param runCommandName The name of the run command. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String machineName, String runCommandName, Context context) { + return this.beginDeleteAsync(resourceGroupName, machineName, runCommandName, context).getSyncPoller(); + } + + /** + * The operation to delete a run command. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param runCommandName The name of the run command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String machineName, String runCommandName) { + return beginDeleteAsync(resourceGroupName, machineName, runCommandName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to delete a run command. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param runCommandName The name of the run command. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String machineName, String runCommandName, Context context) { + return beginDeleteAsync(resourceGroupName, machineName, runCommandName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to delete a run command. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param runCommandName The name of the run command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String machineName, String runCommandName) { + deleteAsync(resourceGroupName, machineName, runCommandName).block(); + } + + /** + * The operation to delete a run command. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param runCommandName The name of the run command. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String machineName, String runCommandName, Context context) { + deleteAsync(resourceGroupName, machineName, runCommandName, context).block(); + } + + /** + * The operation to get a run command. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param runCommandName The name of the run command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Run Command along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String machineName, String runCommandName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (machineName == null) { + return Mono.error(new IllegalArgumentException("Parameter machineName is required and cannot be null.")); + } + if (runCommandName == null) { + return Mono.error(new IllegalArgumentException("Parameter runCommandName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + machineName, + runCommandName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to get a run command. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param runCommandName The name of the run command. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Run Command along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String machineName, String runCommandName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (machineName == null) { + return Mono.error(new IllegalArgumentException("Parameter machineName is required and cannot be null.")); + } + if (runCommandName == null) { + return Mono.error(new IllegalArgumentException("Parameter runCommandName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + machineName, + runCommandName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * The operation to get a run command. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param runCommandName The name of the run command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Run Command on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String machineName, String runCommandName) { + return getWithResponseAsync(resourceGroupName, machineName, runCommandName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * The operation to get a run command. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param runCommandName The name of the run command. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Run Command along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String machineName, String runCommandName, Context context) { + return getWithResponseAsync(resourceGroupName, machineName, runCommandName, context).block(); + } + + /** + * The operation to get a run command. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param runCommandName The name of the run command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Run Command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MachineRunCommandInner get(String resourceGroupName, String machineName, String runCommandName) { + return getWithResponse(resourceGroupName, machineName, runCommandName, Context.NONE).getValue(); + } + + /** + * The operation to get all the run commands of a non-Azure machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param expand The expand expression to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the Run Commands List Result along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String machineName, String expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (machineName == null) { + return Mono.error(new IllegalArgumentException("Parameter machineName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + machineName, + expand, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to get all the run commands of a non-Azure machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the Run Commands List Result along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String machineName, String expand, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (machineName == null) { + return Mono.error(new IllegalArgumentException("Parameter machineName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + machineName, + expand, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * The operation to get all the run commands of a non-Azure machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param expand The expand expression to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the Run Commands List Result as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String machineName, String expand) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, machineName, expand), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * The operation to get all the run commands of a non-Azure machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the Run Commands List Result as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String machineName) { + final String expand = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, machineName, expand), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * The operation to get all the run commands of a non-Azure machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the Run Commands List Result as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String machineName, String expand, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, machineName, expand, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * The operation to get all the run commands of a non-Azure machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the Run Commands List Result as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String machineName) { + final String expand = null; + return new PagedIterable<>(listAsync(resourceGroupName, machineName, expand)); + } + + /** + * The operation to get all the run commands of a non-Azure machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the Run Commands List Result as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String machineName, String expand, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, machineName, expand, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the Run Commands List Result along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the Run Commands List Result along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachineRunCommandsImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachineRunCommandsImpl.java new file mode 100644 index 0000000000000..67dc1bb385c48 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachineRunCommandsImpl.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybridcompute.fluent.MachineRunCommandsClient; +import com.azure.resourcemanager.hybridcompute.fluent.models.MachineRunCommandInner; +import com.azure.resourcemanager.hybridcompute.models.MachineRunCommand; +import com.azure.resourcemanager.hybridcompute.models.MachineRunCommands; + +public final class MachineRunCommandsImpl implements MachineRunCommands { + private static final ClientLogger LOGGER = new ClientLogger(MachineRunCommandsImpl.class); + + private final MachineRunCommandsClient innerClient; + + private final com.azure.resourcemanager.hybridcompute.HybridComputeManager serviceManager; + + public MachineRunCommandsImpl( + MachineRunCommandsClient innerClient, + com.azure.resourcemanager.hybridcompute.HybridComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete(String resourceGroupName, String machineName, String runCommandName) { + this.serviceClient().delete(resourceGroupName, machineName, runCommandName); + } + + public void delete(String resourceGroupName, String machineName, String runCommandName, Context context) { + this.serviceClient().delete(resourceGroupName, machineName, runCommandName, context); + } + + public Response getWithResponse( + String resourceGroupName, String machineName, String runCommandName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, machineName, runCommandName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new MachineRunCommandImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public MachineRunCommand get(String resourceGroupName, String machineName, String runCommandName) { + MachineRunCommandInner inner = this.serviceClient().get(resourceGroupName, machineName, runCommandName); + if (inner != null) { + return new MachineRunCommandImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String machineName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, machineName); + return Utils.mapPage(inner, inner1 -> new MachineRunCommandImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String machineName, String expand, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, machineName, expand, context); + return Utils.mapPage(inner, inner1 -> new MachineRunCommandImpl(inner1, this.manager())); + } + + public MachineRunCommand getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String machineName = Utils.getValueFromIdByName(id, "machines"); + if (machineName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'machines'.", id))); + } + String runCommandName = Utils.getValueFromIdByName(id, "runCommands"); + if (runCommandName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'runCommands'.", id))); + } + return this.getWithResponse(resourceGroupName, machineName, runCommandName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String machineName = Utils.getValueFromIdByName(id, "machines"); + if (machineName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'machines'.", id))); + } + String runCommandName = Utils.getValueFromIdByName(id, "runCommands"); + if (runCommandName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'runCommands'.", id))); + } + return this.getWithResponse(resourceGroupName, machineName, runCommandName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String machineName = Utils.getValueFromIdByName(id, "machines"); + if (machineName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'machines'.", id))); + } + String runCommandName = Utils.getValueFromIdByName(id, "runCommands"); + if (runCommandName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'runCommands'.", id))); + } + this.delete(resourceGroupName, machineName, runCommandName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String machineName = Utils.getValueFromIdByName(id, "machines"); + if (machineName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'machines'.", id))); + } + String runCommandName = Utils.getValueFromIdByName(id, "runCommands"); + if (runCommandName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'runCommands'.", id))); + } + this.delete(resourceGroupName, machineName, runCommandName, context); + } + + private MachineRunCommandsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.hybridcompute.HybridComputeManager manager() { + return this.serviceManager; + } + + public MachineRunCommandImpl define(String name) { + return new MachineRunCommandImpl(name, this.manager()); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachinesClientImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachinesClientImpl.java index e6567b29de31f..7604ab370835f 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachinesClientImpl.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachinesClientImpl.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.hybridcompute.implementation; +import com.azure.core.annotation.BodyParam; import com.azure.core.annotation.Delete; import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; @@ -12,6 +13,7 @@ import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -24,12 +26,20 @@ import com.azure.core.http.rest.Response; import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.hybridcompute.fluent.MachinesClient; +import com.azure.resourcemanager.hybridcompute.fluent.models.MachineAssessPatchesResultInner; import com.azure.resourcemanager.hybridcompute.fluent.models.MachineInner; +import com.azure.resourcemanager.hybridcompute.fluent.models.MachineInstallPatchesResultInner; import com.azure.resourcemanager.hybridcompute.models.InstanceViewTypes; +import com.azure.resourcemanager.hybridcompute.models.MachineInstallPatchesParameters; import com.azure.resourcemanager.hybridcompute.models.MachineListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in MachinesClient. */ @@ -59,8 +69,7 @@ public final class MachinesClientImpl implements MachinesClient { public interface MachinesService { @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute" - + "/machines/{machineName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}") @ExpectedResponses({200, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> delete( @@ -74,8 +83,7 @@ Mono> delete( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute" - + "/machines/{machineName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getByResourceGroup( @@ -88,10 +96,38 @@ Mono> getByResourceGroup( @HeaderParam("Accept") String accept, Context context); + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/assessPatches") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> assessPatches( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("name") String name, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/installPatches") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> installPatches( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("name") String name, + @BodyParam("application/json") MachineInstallPatchesParameters installPatchesInput, + @HeaderParam("Accept") String accept, + Context context); + @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute" - + "/machines") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroup( @@ -99,6 +135,7 @@ Mono> listByResourceGroup( @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context); @@ -135,7 +172,7 @@ Mono> listBySubscriptionNext( } /** - * The operation to remove a hybrid machine identity in Azure. + * The operation to delete a hybrid machine. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param machineName The name of the hybrid machine. @@ -182,7 +219,7 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S } /** - * The operation to remove a hybrid machine identity in Azure. + * The operation to delete a hybrid machine. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param machineName The name of the hybrid machine. @@ -228,7 +265,7 @@ private Mono> deleteWithResponseAsync( } /** - * The operation to remove a hybrid machine identity in Azure. + * The operation to delete a hybrid machine. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param machineName The name of the hybrid machine. @@ -243,7 +280,7 @@ private Mono deleteAsync(String resourceGroupName, String machineName) { } /** - * The operation to remove a hybrid machine identity in Azure. + * The operation to delete a hybrid machine. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param machineName The name of the hybrid machine. @@ -259,7 +296,7 @@ public Response deleteWithResponse(String resourceGroupName, String machin } /** - * The operation to remove a hybrid machine identity in Azure. + * The operation to delete a hybrid machine. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param machineName The name of the hybrid machine. @@ -421,11 +458,540 @@ public MachineInner getByResourceGroup(String resourceGroupName, String machineN return getByResourceGroupWithResponse(resourceGroupName, machineName, expand, Context.NONE).getValue(); } + /** + * The operation to assess patches on a hybrid machine identity in Azure. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the properties of an AssessPatches result along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> assessPatchesWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .assessPatches( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + name, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to assess patches on a hybrid machine identity in Azure. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the properties of an AssessPatches result along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> assessPatchesWithResponseAsync( + String resourceGroupName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .assessPatches( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + name, + accept, + context); + } + + /** + * The operation to assess patches on a hybrid machine identity in Azure. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of describes the properties of an AssessPatches result. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MachineAssessPatchesResultInner> + beginAssessPatchesAsync(String resourceGroupName, String name) { + Mono>> mono = assessPatchesWithResponseAsync(resourceGroupName, name); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + MachineAssessPatchesResultInner.class, + MachineAssessPatchesResultInner.class, + this.client.getContext()); + } + + /** + * The operation to assess patches on a hybrid machine identity in Azure. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of describes the properties of an AssessPatches result. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MachineAssessPatchesResultInner> + beginAssessPatchesAsync(String resourceGroupName, String name, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = assessPatchesWithResponseAsync(resourceGroupName, name, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + MachineAssessPatchesResultInner.class, + MachineAssessPatchesResultInner.class, + context); + } + + /** + * The operation to assess patches on a hybrid machine identity in Azure. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes the properties of an AssessPatches result. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MachineAssessPatchesResultInner> beginAssessPatches( + String resourceGroupName, String name) { + return this.beginAssessPatchesAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * The operation to assess patches on a hybrid machine identity in Azure. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes the properties of an AssessPatches result. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MachineAssessPatchesResultInner> beginAssessPatches( + String resourceGroupName, String name, Context context) { + return this.beginAssessPatchesAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * The operation to assess patches on a hybrid machine identity in Azure. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the properties of an AssessPatches result on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono assessPatchesAsync(String resourceGroupName, String name) { + return beginAssessPatchesAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to assess patches on a hybrid machine identity in Azure. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the properties of an AssessPatches result on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono assessPatchesAsync( + String resourceGroupName, String name, Context context) { + return beginAssessPatchesAsync(resourceGroupName, name, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to assess patches on a hybrid machine identity in Azure. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the properties of an AssessPatches result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MachineAssessPatchesResultInner assessPatches(String resourceGroupName, String name) { + return assessPatchesAsync(resourceGroupName, name).block(); + } + + /** + * The operation to assess patches on a hybrid machine identity in Azure. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the properties of an AssessPatches result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MachineAssessPatchesResultInner assessPatches(String resourceGroupName, String name, Context context) { + return assessPatchesAsync(resourceGroupName, name, context).block(); + } + + /** + * The operation to install patches on a hybrid machine identity in Azure. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @param installPatchesInput Input for InstallPatches as directly received by the API. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result summary of an installation operation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> installPatchesWithResponseAsync( + String resourceGroupName, String name, MachineInstallPatchesParameters installPatchesInput) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (installPatchesInput == null) { + return Mono + .error(new IllegalArgumentException("Parameter installPatchesInput is required and cannot be null.")); + } else { + installPatchesInput.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .installPatches( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + name, + installPatchesInput, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to install patches on a hybrid machine identity in Azure. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @param installPatchesInput Input for InstallPatches as directly received by the API. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result summary of an installation operation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> installPatchesWithResponseAsync( + String resourceGroupName, String name, MachineInstallPatchesParameters installPatchesInput, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (installPatchesInput == null) { + return Mono + .error(new IllegalArgumentException("Parameter installPatchesInput is required and cannot be null.")); + } else { + installPatchesInput.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .installPatches( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + name, + installPatchesInput, + accept, + context); + } + + /** + * The operation to install patches on a hybrid machine identity in Azure. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @param installPatchesInput Input for InstallPatches as directly received by the API. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the result summary of an installation operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MachineInstallPatchesResultInner> + beginInstallPatchesAsync( + String resourceGroupName, String name, MachineInstallPatchesParameters installPatchesInput) { + Mono>> mono = + installPatchesWithResponseAsync(resourceGroupName, name, installPatchesInput); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + MachineInstallPatchesResultInner.class, + MachineInstallPatchesResultInner.class, + this.client.getContext()); + } + + /** + * The operation to install patches on a hybrid machine identity in Azure. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @param installPatchesInput Input for InstallPatches as directly received by the API. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the result summary of an installation operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MachineInstallPatchesResultInner> + beginInstallPatchesAsync( + String resourceGroupName, + String name, + MachineInstallPatchesParameters installPatchesInput, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + installPatchesWithResponseAsync(resourceGroupName, name, installPatchesInput, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + MachineInstallPatchesResultInner.class, + MachineInstallPatchesResultInner.class, + context); + } + + /** + * The operation to install patches on a hybrid machine identity in Azure. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @param installPatchesInput Input for InstallPatches as directly received by the API. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the result summary of an installation operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MachineInstallPatchesResultInner> + beginInstallPatches( + String resourceGroupName, String name, MachineInstallPatchesParameters installPatchesInput) { + return this.beginInstallPatchesAsync(resourceGroupName, name, installPatchesInput).getSyncPoller(); + } + + /** + * The operation to install patches on a hybrid machine identity in Azure. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @param installPatchesInput Input for InstallPatches as directly received by the API. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the result summary of an installation operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MachineInstallPatchesResultInner> + beginInstallPatches( + String resourceGroupName, + String name, + MachineInstallPatchesParameters installPatchesInput, + Context context) { + return this.beginInstallPatchesAsync(resourceGroupName, name, installPatchesInput, context).getSyncPoller(); + } + + /** + * The operation to install patches on a hybrid machine identity in Azure. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @param installPatchesInput Input for InstallPatches as directly received by the API. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result summary of an installation operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono installPatchesAsync( + String resourceGroupName, String name, MachineInstallPatchesParameters installPatchesInput) { + return beginInstallPatchesAsync(resourceGroupName, name, installPatchesInput) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to install patches on a hybrid machine identity in Azure. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @param installPatchesInput Input for InstallPatches as directly received by the API. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result summary of an installation operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono installPatchesAsync( + String resourceGroupName, String name, MachineInstallPatchesParameters installPatchesInput, Context context) { + return beginInstallPatchesAsync(resourceGroupName, name, installPatchesInput, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to install patches on a hybrid machine identity in Azure. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @param installPatchesInput Input for InstallPatches as directly received by the API. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result summary of an installation operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MachineInstallPatchesResultInner installPatches( + String resourceGroupName, String name, MachineInstallPatchesParameters installPatchesInput) { + return installPatchesAsync(resourceGroupName, name, installPatchesInput).block(); + } + + /** + * The operation to install patches on a hybrid machine identity in Azure. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @param installPatchesInput Input for InstallPatches as directly received by the API. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result summary of an installation operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MachineInstallPatchesResultInner installPatches( + String resourceGroupName, String name, MachineInstallPatchesParameters installPatchesInput, Context context) { + return installPatchesAsync(resourceGroupName, name, installPatchesInput, context).block(); + } + /** * Lists all the hybrid machines in the specified resource group. Use the nextLink property in the response to get * the next page of hybrid machines. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param expand Expands referenced resources. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -433,7 +999,8 @@ public MachineInner getByResourceGroup(String resourceGroupName, String machineN * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, String expand) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -460,6 +1027,7 @@ private Mono> listByResourceGroupSinglePageAsync(Str this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + expand, accept, context)) .>map( @@ -479,6 +1047,7 @@ private Mono> listByResourceGroupSinglePageAsync(Str * the next page of hybrid machines. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param expand Expands referenced resources. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -488,7 +1057,7 @@ private Mono> listByResourceGroupSinglePageAsync(Str */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { + String resourceGroupName, String expand, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -513,6 +1082,7 @@ private Mono> listByResourceGroupSinglePageAsync( this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + expand, accept, context) .map( @@ -526,6 +1096,24 @@ private Mono> listByResourceGroupSinglePageAsync( null)); } + /** + * Lists all the hybrid machines in the specified resource group. Use the nextLink property in the response to get + * the next page of hybrid machines. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List hybrid machine operation response as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, String expand) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, expand), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + /** * Lists all the hybrid machines in the specified resource group. Use the nextLink property in the response to get * the next page of hybrid machines. @@ -538,8 +1126,9 @@ private Mono> listByResourceGroupSinglePageAsync( */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + final String expand = null; return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), + () -> listByResourceGroupSinglePageAsync(resourceGroupName, expand), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } @@ -548,6 +1137,7 @@ private PagedFlux listByResourceGroupAsync(String resourceGroupNam * the next page of hybrid machines. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param expand Expands referenced resources. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -555,9 +1145,9 @@ private PagedFlux listByResourceGroupAsync(String resourceGroupNam * @return the List hybrid machine operation response as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + private PagedFlux listByResourceGroupAsync(String resourceGroupName, String expand, Context context) { return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + () -> listByResourceGroupSinglePageAsync(resourceGroupName, expand, context), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); } @@ -573,7 +1163,8 @@ private PagedFlux listByResourceGroupAsync(String resourceGroupNam */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + final String expand = null; + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, expand)); } /** @@ -581,6 +1172,7 @@ public PagedIterable listByResourceGroup(String resourceGroupName) * the next page of hybrid machines. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param expand Expands referenced resources. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -588,8 +1180,8 @@ public PagedIterable listByResourceGroup(String resourceGroupName) * @return the List hybrid machine operation response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + public PagedIterable listByResourceGroup(String resourceGroupName, String expand, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, expand, context)); } /** diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachinesImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachinesImpl.java index 8eb136c67096f..5bfdaab1a37b9 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachinesImpl.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachinesImpl.java @@ -10,9 +10,14 @@ import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.hybridcompute.fluent.MachinesClient; +import com.azure.resourcemanager.hybridcompute.fluent.models.MachineAssessPatchesResultInner; import com.azure.resourcemanager.hybridcompute.fluent.models.MachineInner; +import com.azure.resourcemanager.hybridcompute.fluent.models.MachineInstallPatchesResultInner; import com.azure.resourcemanager.hybridcompute.models.InstanceViewTypes; import com.azure.resourcemanager.hybridcompute.models.Machine; +import com.azure.resourcemanager.hybridcompute.models.MachineAssessPatchesResult; +import com.azure.resourcemanager.hybridcompute.models.MachineInstallPatchesParameters; +import com.azure.resourcemanager.hybridcompute.models.MachineInstallPatchesResult; import com.azure.resourcemanager.hybridcompute.models.Machines; public final class MachinesImpl implements Machines { @@ -61,13 +66,54 @@ public Machine getByResourceGroup(String resourceGroupName, String machineName) } } + public MachineAssessPatchesResult assessPatches(String resourceGroupName, String name) { + MachineAssessPatchesResultInner inner = this.serviceClient().assessPatches(resourceGroupName, name); + if (inner != null) { + return new MachineAssessPatchesResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public MachineAssessPatchesResult assessPatches(String resourceGroupName, String name, Context context) { + MachineAssessPatchesResultInner inner = this.serviceClient().assessPatches(resourceGroupName, name, context); + if (inner != null) { + return new MachineAssessPatchesResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public MachineInstallPatchesResult installPatches( + String resourceGroupName, String name, MachineInstallPatchesParameters installPatchesInput) { + MachineInstallPatchesResultInner inner = + this.serviceClient().installPatches(resourceGroupName, name, installPatchesInput); + if (inner != null) { + return new MachineInstallPatchesResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public MachineInstallPatchesResult installPatches( + String resourceGroupName, String name, MachineInstallPatchesParameters installPatchesInput, Context context) { + MachineInstallPatchesResultInner inner = + this.serviceClient().installPatches(resourceGroupName, name, installPatchesInput, context); + if (inner != null) { + return new MachineInstallPatchesResultImpl(inner, this.manager()); + } else { + return null; + } + } + public PagedIterable listByResourceGroup(String resourceGroupName) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); return Utils.mapPage(inner, inner1 -> new MachineImpl(inner1, this.manager())); } - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + public PagedIterable listByResourceGroup(String resourceGroupName, String expand, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, expand, context); return Utils.mapPage(inner, inner1 -> new MachineImpl(inner1, this.manager())); } diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/NetworkProfileImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/NetworkProfileImpl.java new file mode 100644 index 0000000000000..8ae7c8220cd14 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/NetworkProfileImpl.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.hybridcompute.implementation; + +import com.azure.resourcemanager.hybridcompute.fluent.models.NetworkProfileInner; +import com.azure.resourcemanager.hybridcompute.models.NetworkInterface; +import com.azure.resourcemanager.hybridcompute.models.NetworkProfile; +import java.util.Collections; +import java.util.List; + +public final class NetworkProfileImpl implements NetworkProfile { + private NetworkProfileInner innerObject; + + private final com.azure.resourcemanager.hybridcompute.HybridComputeManager serviceManager; + + NetworkProfileImpl( + NetworkProfileInner innerObject, com.azure.resourcemanager.hybridcompute.HybridComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List networkInterfaces() { + List inner = this.innerModel().networkInterfaces(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public NetworkProfileInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hybridcompute.HybridComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/NetworkProfilesClientImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/NetworkProfilesClientImpl.java new file mode 100644 index 0000000000000..9c688a13acd62 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/NetworkProfilesClientImpl.java @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.hybridcompute.fluent.NetworkProfilesClient; +import com.azure.resourcemanager.hybridcompute.fluent.models.NetworkProfileInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in NetworkProfilesClient. */ +public final class NetworkProfilesClientImpl implements NetworkProfilesClient { + /** The proxy service used to perform REST calls. */ + private final NetworkProfilesService service; + + /** The service client containing this operation class. */ + private final HybridComputeManagementClientImpl client; + + /** + * Initializes an instance of NetworkProfilesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NetworkProfilesClientImpl(HybridComputeManagementClientImpl client) { + this.service = + RestProxy.create(NetworkProfilesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HybridComputeManagementClientNetworkProfiles to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HybridComputeManagem") + public interface NetworkProfilesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/networkProfile") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("machineName") String machineName, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * The operation to get network information of hybrid machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the network information on this machine along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String machineName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (machineName == null) { + return Mono.error(new IllegalArgumentException("Parameter machineName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + machineName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to get network information of hybrid machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the network information on this machine along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String machineName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (machineName == null) { + return Mono.error(new IllegalArgumentException("Parameter machineName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + machineName, + accept, + context); + } + + /** + * The operation to get network information of hybrid machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the network information on this machine on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String machineName) { + return getWithResponseAsync(resourceGroupName, machineName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * The operation to get network information of hybrid machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the network information on this machine along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String machineName, Context context) { + return getWithResponseAsync(resourceGroupName, machineName, context).block(); + } + + /** + * The operation to get network information of hybrid machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the network information on this machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkProfileInner get(String resourceGroupName, String machineName) { + return getWithResponse(resourceGroupName, machineName, Context.NONE).getValue(); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/NetworkProfilesImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/NetworkProfilesImpl.java new file mode 100644 index 0000000000000..3ed703f3f3929 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/NetworkProfilesImpl.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybridcompute.fluent.NetworkProfilesClient; +import com.azure.resourcemanager.hybridcompute.fluent.models.NetworkProfileInner; +import com.azure.resourcemanager.hybridcompute.models.NetworkProfile; +import com.azure.resourcemanager.hybridcompute.models.NetworkProfiles; + +public final class NetworkProfilesImpl implements NetworkProfiles { + private static final ClientLogger LOGGER = new ClientLogger(NetworkProfilesImpl.class); + + private final NetworkProfilesClient innerClient; + + private final com.azure.resourcemanager.hybridcompute.HybridComputeManager serviceManager; + + public NetworkProfilesImpl( + NetworkProfilesClient innerClient, + com.azure.resourcemanager.hybridcompute.HybridComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String machineName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, machineName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NetworkProfileImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public NetworkProfile get(String resourceGroupName, String machineName) { + NetworkProfileInner inner = this.serviceClient().get(resourceGroupName, machineName); + if (inner != null) { + return new NetworkProfileImpl(inner, this.manager()); + } else { + return null; + } + } + + private NetworkProfilesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.hybridcompute.HybridComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/OperationValueImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/OperationValueImpl.java index df3cc1e8dd4f5..323ba788ca213 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/OperationValueImpl.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/OperationValueImpl.java @@ -31,6 +31,10 @@ public OperationValueDisplay display() { return this.innerModel().display(); } + public Boolean isDataAction() { + return this.innerModel().isDataAction(); + } + public OperationValueInner innerModel() { return this.innerObject; } diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/PrivateEndpointConnectionsClientImpl.java index 9052c56008ca9..6b7ca74b7fef8 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/PrivateEndpointConnectionsClientImpl.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/PrivateEndpointConnectionsClientImpl.java @@ -68,8 +68,7 @@ public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpoi public interface PrivateEndpointConnectionsService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute" - + "/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( @@ -84,8 +83,7 @@ Mono> get( @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute" - + "/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> createOrUpdate( @@ -101,8 +99,7 @@ Mono>> createOrUpdate( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute" - + "/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> delete( @@ -117,8 +114,7 @@ Mono>> delete( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute" - + "/privateLinkScopes/{scopeName}/privateEndpointConnections") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateEndpointConnections") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByPrivateLinkScope( diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/PrivateLinkResourcesClientImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/PrivateLinkResourcesClientImpl.java index a67e079ae649a..c9be40dbf2c75 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/PrivateLinkResourcesClientImpl.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/PrivateLinkResourcesClientImpl.java @@ -59,8 +59,7 @@ public final class PrivateLinkResourcesClientImpl implements PrivateLinkResource public interface PrivateLinkResourcesService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute" - + "/privateLinkScopes/{scopeName}/privateLinkResources") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateLinkResources") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByPrivateLinkScope( @@ -74,8 +73,7 @@ Mono> listByPrivateLinkScope( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute" - + "/privateLinkScopes/{scopeName}/privateLinkResources/{groupName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateLinkResources/{groupName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/PrivateLinkScopesClientImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/PrivateLinkScopesClientImpl.java index a7523de1eaea4..1543133d5dacb 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/PrivateLinkScopesClientImpl.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/PrivateLinkScopesClientImpl.java @@ -80,8 +80,7 @@ Mono> list( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute" - + "/privateLinkScopes") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroup( @@ -94,8 +93,7 @@ Mono> listByResourceGroup( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute" - + "/privateLinkScopes/{scopeName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> delete( @@ -109,8 +107,7 @@ Mono>> delete( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute" - + "/privateLinkScopes/{scopeName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getByResourceGroup( @@ -124,8 +121,7 @@ Mono> getByResourceGroup( @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute" - + "/privateLinkScopes/{scopeName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> createOrUpdate( @@ -140,8 +136,7 @@ Mono> createOrUpdate( @Headers({"Content-Type: application/json"}) @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute" - + "/privateLinkScopes/{scopeName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> updateTags( @@ -156,8 +151,7 @@ Mono> updateTags( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/privateLinkScopes" - + "/{privateLinkScopeId}") + "/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/privateLinkScopes/{privateLinkScopeId}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getValidationDetails( @@ -171,8 +165,7 @@ Mono> getValidationDetails( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute" - + "/machines/{machineName}/privateLinkScopes/current") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/privateLinkScopes/current") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getValidationDetailsForMachine( diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/ResourceProvidersClientImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/ResourceProvidersClientImpl.java new file mode 100644 index 0000000000000..28a0db812083e --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/ResourceProvidersClientImpl.java @@ -0,0 +1,360 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.hybridcompute.fluent.ResourceProvidersClient; +import com.azure.resourcemanager.hybridcompute.models.MachineExtensionUpgrade; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ResourceProvidersClient. */ +public final class ResourceProvidersClientImpl implements ResourceProvidersClient { + /** The proxy service used to perform REST calls. */ + private final ResourceProvidersService service; + + /** The service client containing this operation class. */ + private final HybridComputeManagementClientImpl client; + + /** + * Initializes an instance of ResourceProvidersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ResourceProvidersClientImpl(HybridComputeManagementClientImpl client) { + this.service = + RestProxy.create(ResourceProvidersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HybridComputeManagementClientResourceProviders to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HybridComputeManagem") + public interface ResourceProvidersService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/upgradeExtensions") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> upgradeExtensions( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("machineName") String machineName, + @BodyParam("application/json") MachineExtensionUpgrade extensionUpgradeParameters, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * The operation to Upgrade Machine Extensions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> upgradeExtensionsWithResponseAsync( + String resourceGroupName, String machineName, MachineExtensionUpgrade extensionUpgradeParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (machineName == null) { + return Mono.error(new IllegalArgumentException("Parameter machineName is required and cannot be null.")); + } + if (extensionUpgradeParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter extensionUpgradeParameters is required and cannot be null.")); + } else { + extensionUpgradeParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .upgradeExtensions( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + machineName, + extensionUpgradeParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to Upgrade Machine Extensions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> upgradeExtensionsWithResponseAsync( + String resourceGroupName, + String machineName, + MachineExtensionUpgrade extensionUpgradeParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (machineName == null) { + return Mono.error(new IllegalArgumentException("Parameter machineName is required and cannot be null.")); + } + if (extensionUpgradeParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter extensionUpgradeParameters is required and cannot be null.")); + } else { + extensionUpgradeParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .upgradeExtensions( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + machineName, + extensionUpgradeParameters, + accept, + context); + } + + /** + * The operation to Upgrade Machine Extensions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginUpgradeExtensionsAsync( + String resourceGroupName, String machineName, MachineExtensionUpgrade extensionUpgradeParameters) { + Mono>> mono = + upgradeExtensionsWithResponseAsync(resourceGroupName, machineName, extensionUpgradeParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * The operation to Upgrade Machine Extensions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginUpgradeExtensionsAsync( + String resourceGroupName, + String machineName, + MachineExtensionUpgrade extensionUpgradeParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + upgradeExtensionsWithResponseAsync(resourceGroupName, machineName, extensionUpgradeParameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * The operation to Upgrade Machine Extensions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginUpgradeExtensions( + String resourceGroupName, String machineName, MachineExtensionUpgrade extensionUpgradeParameters) { + return this + .beginUpgradeExtensionsAsync(resourceGroupName, machineName, extensionUpgradeParameters) + .getSyncPoller(); + } + + /** + * The operation to Upgrade Machine Extensions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginUpgradeExtensions( + String resourceGroupName, + String machineName, + MachineExtensionUpgrade extensionUpgradeParameters, + Context context) { + return this + .beginUpgradeExtensionsAsync(resourceGroupName, machineName, extensionUpgradeParameters, context) + .getSyncPoller(); + } + + /** + * The operation to Upgrade Machine Extensions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono upgradeExtensionsAsync( + String resourceGroupName, String machineName, MachineExtensionUpgrade extensionUpgradeParameters) { + return beginUpgradeExtensionsAsync(resourceGroupName, machineName, extensionUpgradeParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to Upgrade Machine Extensions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono upgradeExtensionsAsync( + String resourceGroupName, + String machineName, + MachineExtensionUpgrade extensionUpgradeParameters, + Context context) { + return beginUpgradeExtensionsAsync(resourceGroupName, machineName, extensionUpgradeParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to Upgrade Machine Extensions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void upgradeExtensions( + String resourceGroupName, String machineName, MachineExtensionUpgrade extensionUpgradeParameters) { + upgradeExtensionsAsync(resourceGroupName, machineName, extensionUpgradeParameters).block(); + } + + /** + * The operation to Upgrade Machine Extensions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void upgradeExtensions( + String resourceGroupName, + String machineName, + MachineExtensionUpgrade extensionUpgradeParameters, + Context context) { + upgradeExtensionsAsync(resourceGroupName, machineName, extensionUpgradeParameters, context).block(); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/ResourceProvidersImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/ResourceProvidersImpl.java new file mode 100644 index 0000000000000..cea28dc9778fd --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/ResourceProvidersImpl.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.implementation; + +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybridcompute.fluent.ResourceProvidersClient; +import com.azure.resourcemanager.hybridcompute.models.MachineExtensionUpgrade; +import com.azure.resourcemanager.hybridcompute.models.ResourceProviders; + +public final class ResourceProvidersImpl implements ResourceProviders { + private static final ClientLogger LOGGER = new ClientLogger(ResourceProvidersImpl.class); + + private final ResourceProvidersClient innerClient; + + private final com.azure.resourcemanager.hybridcompute.HybridComputeManager serviceManager; + + public ResourceProvidersImpl( + ResourceProvidersClient innerClient, + com.azure.resourcemanager.hybridcompute.HybridComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void upgradeExtensions( + String resourceGroupName, String machineName, MachineExtensionUpgrade extensionUpgradeParameters) { + this.serviceClient().upgradeExtensions(resourceGroupName, machineName, extensionUpgradeParameters); + } + + public void upgradeExtensions( + String resourceGroupName, + String machineName, + MachineExtensionUpgrade extensionUpgradeParameters, + Context context) { + this.serviceClient().upgradeExtensions(resourceGroupName, machineName, extensionUpgradeParameters, context); + } + + private ResourceProvidersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.hybridcompute.HybridComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/AgentConfiguration.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/AgentConfiguration.java new file mode 100644 index 0000000000000..ac3b543a3ed29 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/AgentConfiguration.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Configurable properties that the user can set locally via the azcmagent config command, or remotely via ARM. */ +@Immutable +public final class AgentConfiguration { + /* + * Specifies the URL of the proxy to be used. + */ + @JsonProperty(value = "proxyUrl", access = JsonProperty.Access.WRITE_ONLY) + private String proxyUrl; + + /* + * Specifies the list of ports that the agent will be able to listen on. + */ + @JsonProperty(value = "incomingConnectionsPorts", access = JsonProperty.Access.WRITE_ONLY) + private List incomingConnectionsPorts; + + /* + * Array of extensions that are allowed to be installed or updated. + */ + @JsonProperty(value = "extensionsAllowList", access = JsonProperty.Access.WRITE_ONLY) + private List extensionsAllowList; + + /* + * Array of extensions that are blocked (cannot be installed or updated) + */ + @JsonProperty(value = "extensionsBlockList", access = JsonProperty.Access.WRITE_ONLY) + private List extensionsBlockList; + + /* + * List of service names which should not use the specified proxy server. + */ + @JsonProperty(value = "proxyBypass", access = JsonProperty.Access.WRITE_ONLY) + private List proxyBypass; + + /* + * Specifies whether the extension service is enabled or disabled. + */ + @JsonProperty(value = "extensionsEnabled", access = JsonProperty.Access.WRITE_ONLY) + private String extensionsEnabled; + + /* + * Specified whether the guest configuration service is enabled or disabled. + */ + @JsonProperty(value = "guestConfigurationEnabled", access = JsonProperty.Access.WRITE_ONLY) + private String guestConfigurationEnabled; + + /* + * Name of configuration mode to use. Modes are pre-defined configurations of security controls, extension + * allowlists and guest configuration, maintained by Microsoft. + */ + @JsonProperty(value = "configMode", access = JsonProperty.Access.WRITE_ONLY) + private AgentConfigurationMode configMode; + + /** Creates an instance of AgentConfiguration class. */ + public AgentConfiguration() { + } + + /** + * Get the proxyUrl property: Specifies the URL of the proxy to be used. + * + * @return the proxyUrl value. + */ + public String proxyUrl() { + return this.proxyUrl; + } + + /** + * Get the incomingConnectionsPorts property: Specifies the list of ports that the agent will be able to listen on. + * + * @return the incomingConnectionsPorts value. + */ + public List incomingConnectionsPorts() { + return this.incomingConnectionsPorts; + } + + /** + * Get the extensionsAllowList property: Array of extensions that are allowed to be installed or updated. + * + * @return the extensionsAllowList value. + */ + public List extensionsAllowList() { + return this.extensionsAllowList; + } + + /** + * Get the extensionsBlockList property: Array of extensions that are blocked (cannot be installed or updated). + * + * @return the extensionsBlockList value. + */ + public List extensionsBlockList() { + return this.extensionsBlockList; + } + + /** + * Get the proxyBypass property: List of service names which should not use the specified proxy server. + * + * @return the proxyBypass value. + */ + public List proxyBypass() { + return this.proxyBypass; + } + + /** + * Get the extensionsEnabled property: Specifies whether the extension service is enabled or disabled. + * + * @return the extensionsEnabled value. + */ + public String extensionsEnabled() { + return this.extensionsEnabled; + } + + /** + * Get the guestConfigurationEnabled property: Specified whether the guest configuration service is enabled or + * disabled. + * + * @return the guestConfigurationEnabled value. + */ + public String guestConfigurationEnabled() { + return this.guestConfigurationEnabled; + } + + /** + * Get the configMode property: Name of configuration mode to use. Modes are pre-defined configurations of security + * controls, extension allowlists and guest configuration, maintained by Microsoft. + * + * @return the configMode value. + */ + public AgentConfigurationMode configMode() { + return this.configMode; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (extensionsAllowList() != null) { + extensionsAllowList().forEach(e -> e.validate()); + } + if (extensionsBlockList() != null) { + extensionsBlockList().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/AgentConfigurationMode.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/AgentConfigurationMode.java new file mode 100644 index 0000000000000..5d9bfbdbe5ce2 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/AgentConfigurationMode.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.hybridcompute.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Name of configuration mode to use. Modes are pre-defined configurations of security controls, extension allowlists + * and guest configuration, maintained by Microsoft. + */ +public final class AgentConfigurationMode extends ExpandableStringEnum { + /** Static value full for AgentConfigurationMode. */ + public static final AgentConfigurationMode FULL = fromString("full"); + + /** Static value monitor for AgentConfigurationMode. */ + public static final AgentConfigurationMode MONITOR = fromString("monitor"); + + /** + * Creates a new instance of AgentConfigurationMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AgentConfigurationMode() { + } + + /** + * Creates or finds a AgentConfigurationMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding AgentConfigurationMode. + */ + @JsonCreator + public static AgentConfigurationMode fromString(String name) { + return fromString(name, AgentConfigurationMode.class); + } + + /** + * Gets known AgentConfigurationMode values. + * + * @return known AgentConfigurationMode values. + */ + public static Collection values() { + return values(AgentConfigurationMode.class); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/AgentUpgrade.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/AgentUpgrade.java new file mode 100644 index 0000000000000..e97b7b883450c --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/AgentUpgrade.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The info w.r.t Agent Upgrade. */ +@Fluent +public final class AgentUpgrade { + /* + * Specifies the version info w.r.t AgentUpgrade for the machine. + */ + @JsonProperty(value = "desiredVersion") + private String desiredVersion; + + /* + * The correlation ID passed in from RSM per upgrade. + */ + @JsonProperty(value = "correlationId") + private String correlationId; + + /* + * Specifies if RSM should try to upgrade this machine + */ + @JsonProperty(value = "enableAutomaticUpgrade") + private Boolean enableAutomaticUpgrade; + + /* + * Specifies the version of the last attempt + */ + @JsonProperty(value = "lastAttemptDesiredVersion", access = JsonProperty.Access.WRITE_ONLY) + private String lastAttemptDesiredVersion; + + /* + * Timestamp of last upgrade attempt + */ + @JsonProperty(value = "lastAttemptTimestamp", access = JsonProperty.Access.WRITE_ONLY) + private String lastAttemptTimestamp; + + /* + * Specifies the status of Agent Upgrade. + */ + @JsonProperty(value = "lastAttemptStatus", access = JsonProperty.Access.WRITE_ONLY) + private LastAttemptStatusEnum lastAttemptStatus; + + /* + * Failure message of last upgrade attempt if any. + */ + @JsonProperty(value = "lastAttemptMessage", access = JsonProperty.Access.WRITE_ONLY) + private String lastAttemptMessage; + + /** Creates an instance of AgentUpgrade class. */ + public AgentUpgrade() { + } + + /** + * Get the desiredVersion property: Specifies the version info w.r.t AgentUpgrade for the machine. + * + * @return the desiredVersion value. + */ + public String desiredVersion() { + return this.desiredVersion; + } + + /** + * Set the desiredVersion property: Specifies the version info w.r.t AgentUpgrade for the machine. + * + * @param desiredVersion the desiredVersion value to set. + * @return the AgentUpgrade object itself. + */ + public AgentUpgrade withDesiredVersion(String desiredVersion) { + this.desiredVersion = desiredVersion; + return this; + } + + /** + * Get the correlationId property: The correlation ID passed in from RSM per upgrade. + * + * @return the correlationId value. + */ + public String correlationId() { + return this.correlationId; + } + + /** + * Set the correlationId property: The correlation ID passed in from RSM per upgrade. + * + * @param correlationId the correlationId value to set. + * @return the AgentUpgrade object itself. + */ + public AgentUpgrade withCorrelationId(String correlationId) { + this.correlationId = correlationId; + return this; + } + + /** + * Get the enableAutomaticUpgrade property: Specifies if RSM should try to upgrade this machine. + * + * @return the enableAutomaticUpgrade value. + */ + public Boolean enableAutomaticUpgrade() { + return this.enableAutomaticUpgrade; + } + + /** + * Set the enableAutomaticUpgrade property: Specifies if RSM should try to upgrade this machine. + * + * @param enableAutomaticUpgrade the enableAutomaticUpgrade value to set. + * @return the AgentUpgrade object itself. + */ + public AgentUpgrade withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { + this.enableAutomaticUpgrade = enableAutomaticUpgrade; + return this; + } + + /** + * Get the lastAttemptDesiredVersion property: Specifies the version of the last attempt. + * + * @return the lastAttemptDesiredVersion value. + */ + public String lastAttemptDesiredVersion() { + return this.lastAttemptDesiredVersion; + } + + /** + * Get the lastAttemptTimestamp property: Timestamp of last upgrade attempt. + * + * @return the lastAttemptTimestamp value. + */ + public String lastAttemptTimestamp() { + return this.lastAttemptTimestamp; + } + + /** + * Get the lastAttemptStatus property: Specifies the status of Agent Upgrade. + * + * @return the lastAttemptStatus value. + */ + public LastAttemptStatusEnum lastAttemptStatus() { + return this.lastAttemptStatus; + } + + /** + * Get the lastAttemptMessage property: Failure message of last upgrade attempt if any. + * + * @return the lastAttemptMessage value. + */ + public String lastAttemptMessage() { + return this.lastAttemptMessage; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/AgentVersion.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/AgentVersion.java new file mode 100644 index 0000000000000..9ffee7c7211ff --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/AgentVersion.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.resourcemanager.hybridcompute.fluent.models.AgentVersionInner; + +/** An immutable client-side representation of AgentVersion. */ +public interface AgentVersion { + /** + * Gets the agentVersion property: Represents the agent version. + * + * @return the agentVersion value. + */ + String agentVersion(); + + /** + * Gets the downloadLink property: Represents the download link of specific agent version. + * + * @return the downloadLink value. + */ + String downloadLink(); + + /** + * Gets the osType property: Defines the os type. + * + * @return the osType value. + */ + String osType(); + + /** + * Gets the inner com.azure.resourcemanager.hybridcompute.fluent.models.AgentVersionInner object. + * + * @return the inner object. + */ + AgentVersionInner innerModel(); +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/AgentVersions.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/AgentVersions.java new file mode 100644 index 0000000000000..f5130c9a4caa1 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/AgentVersions.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of AgentVersions. */ +public interface AgentVersions { + /** + * Gets all Agent Versions along with the download link currently present. + * + * @param osType Defines the os type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Agent Versions along with the download link currently present along with {@link Response}. + */ + Response listWithResponse(String osType, Context context); + + /** + * Gets all Agent Versions along with the download link currently present. + * + * @param osType Defines the os type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Agent Versions along with the download link currently present. + */ + AgentVersionsList list(String osType); + + /** + * Gets an Agent Version along with the download link currently present. + * + * @param osType Defines the os type. + * @param version Defines the agent version. To get latest, use latest or else a specific agent version. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Agent Version along with the download link currently present along with {@link Response}. + */ + Response getWithResponse(String osType, String version, Context context); + + /** + * Gets an Agent Version along with the download link currently present. + * + * @param osType Defines the os type. + * @param version Defines the agent version. To get latest, use latest or else a specific agent version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Agent Version along with the download link currently present. + */ + AgentVersion get(String osType, String version); +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/AgentVersionsList.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/AgentVersionsList.java new file mode 100644 index 0000000000000..1fff796c284e8 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/AgentVersionsList.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.hybridcompute.models; + +import com.azure.resourcemanager.hybridcompute.fluent.models.AgentVersionsListInner; +import java.util.List; + +/** An immutable client-side representation of AgentVersionsList. */ +public interface AgentVersionsList { + /** + * Gets the value property: The list of available Agent Versions. + * + * @return the value value. + */ + List value(); + + /** + * Gets the nextLink property: The URI to fetch the next 10 available Agent Versions. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the inner com.azure.resourcemanager.hybridcompute.fluent.models.AgentVersionsListInner object. + * + * @return the inner object. + */ + AgentVersionsListInner innerModel(); +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ArcKindEnum.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ArcKindEnum.java new file mode 100644 index 0000000000000..89f9ce9ba1a3e --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ArcKindEnum.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.hybridcompute.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Indicates which kind of Arc machine placement on-premises, such as HCI, SCVMM or VMware etc. */ +public final class ArcKindEnum extends ExpandableStringEnum { + /** Static value AVS for ArcKindEnum. */ + public static final ArcKindEnum AVS = fromString("AVS"); + + /** Static value HCI for ArcKindEnum. */ + public static final ArcKindEnum HCI = fromString("HCI"); + + /** Static value SCVMM for ArcKindEnum. */ + public static final ArcKindEnum SCVMM = fromString("SCVMM"); + + /** Static value VMware for ArcKindEnum. */ + public static final ArcKindEnum VMWARE = fromString("VMware"); + + /** Static value EPS for ArcKindEnum. */ + public static final ArcKindEnum EPS = fromString("EPS"); + + /** Static value GCP for ArcKindEnum. */ + public static final ArcKindEnum GCP = fromString("GCP"); + + /** Static value AWS for ArcKindEnum. */ + public static final ArcKindEnum AWS = fromString("AWS"); + + /** + * Creates a new instance of ArcKindEnum value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ArcKindEnum() { + } + + /** + * Creates or finds a ArcKindEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding ArcKindEnum. + */ + @JsonCreator + public static ArcKindEnum fromString(String name) { + return fromString(name, ArcKindEnum.class); + } + + /** + * Gets known ArcKindEnum values. + * + * @return known ArcKindEnum values. + */ + public static Collection values() { + return values(ArcKindEnum.class); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/AssessmentModeTypes.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/AssessmentModeTypes.java new file mode 100644 index 0000000000000..8ecd309c1751f --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/AssessmentModeTypes.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Specifies the assessment mode. */ +public final class AssessmentModeTypes extends ExpandableStringEnum { + /** Static value ImageDefault for AssessmentModeTypes. */ + public static final AssessmentModeTypes IMAGE_DEFAULT = fromString("ImageDefault"); + + /** Static value AutomaticByPlatform for AssessmentModeTypes. */ + public static final AssessmentModeTypes AUTOMATIC_BY_PLATFORM = fromString("AutomaticByPlatform"); + + /** + * Creates a new instance of AssessmentModeTypes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AssessmentModeTypes() { + } + + /** + * Creates or finds a AssessmentModeTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding AssessmentModeTypes. + */ + @JsonCreator + public static AssessmentModeTypes fromString(String name) { + return fromString(name, AssessmentModeTypes.class); + } + + /** + * Gets known AssessmentModeTypes values. + * + * @return known AssessmentModeTypes values. + */ + public static Collection values() { + return values(AssessmentModeTypes.class); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/AvailablePatchCountByClassification.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/AvailablePatchCountByClassification.java new file mode 100644 index 0000000000000..5f1fa82df6780 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/AvailablePatchCountByClassification.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Summarization of patches available for installation on the machine by classification. */ +@Immutable +public final class AvailablePatchCountByClassification { + /* + * Number of security patches available for installation. + */ + @JsonProperty(value = "security", access = JsonProperty.Access.WRITE_ONLY) + private Integer security; + + /* + * Number of critical patches available for installation. + */ + @JsonProperty(value = "critical", access = JsonProperty.Access.WRITE_ONLY) + private Integer critical; + + /* + * Number of definition patches available for installation. + */ + @JsonProperty(value = "definition", access = JsonProperty.Access.WRITE_ONLY) + private Integer definition; + + /* + * Number of update Rollup patches available for installation. + */ + @JsonProperty(value = "updateRollup", access = JsonProperty.Access.WRITE_ONLY) + private Integer updateRollup; + + /* + * Number of feature pack patches available for installation. + */ + @JsonProperty(value = "featurePack", access = JsonProperty.Access.WRITE_ONLY) + private Integer featurePack; + + /* + * Number of service pack patches available for installation. + */ + @JsonProperty(value = "servicePack", access = JsonProperty.Access.WRITE_ONLY) + private Integer servicePack; + + /* + * Number of tools patches available for installation. + */ + @JsonProperty(value = "tools", access = JsonProperty.Access.WRITE_ONLY) + private Integer tools; + + /* + * Number of updates category patches available for installation. + */ + @JsonProperty(value = "updates", access = JsonProperty.Access.WRITE_ONLY) + private Integer updates; + + /* + * Number of other patches available for installation. + */ + @JsonProperty(value = "other", access = JsonProperty.Access.WRITE_ONLY) + private Integer other; + + /** Creates an instance of AvailablePatchCountByClassification class. */ + public AvailablePatchCountByClassification() { + } + + /** + * Get the security property: Number of security patches available for installation. + * + * @return the security value. + */ + public Integer security() { + return this.security; + } + + /** + * Get the critical property: Number of critical patches available for installation. + * + * @return the critical value. + */ + public Integer critical() { + return this.critical; + } + + /** + * Get the definition property: Number of definition patches available for installation. + * + * @return the definition value. + */ + public Integer definition() { + return this.definition; + } + + /** + * Get the updateRollup property: Number of update Rollup patches available for installation. + * + * @return the updateRollup value. + */ + public Integer updateRollup() { + return this.updateRollup; + } + + /** + * Get the featurePack property: Number of feature pack patches available for installation. + * + * @return the featurePack value. + */ + public Integer featurePack() { + return this.featurePack; + } + + /** + * Get the servicePack property: Number of service pack patches available for installation. + * + * @return the servicePack value. + */ + public Integer servicePack() { + return this.servicePack; + } + + /** + * Get the tools property: Number of tools patches available for installation. + * + * @return the tools value. + */ + public Integer tools() { + return this.tools; + } + + /** + * Get the updates property: Number of updates category patches available for installation. + * + * @return the updates value. + */ + public Integer updates() { + return this.updates; + } + + /** + * Get the other property: Number of other patches available for installation. + * + * @return the other value. + */ + public Integer other() { + return this.other; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/CloudMetadata.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/CloudMetadata.java new file mode 100644 index 0000000000000..ac65d2743e4fa --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/CloudMetadata.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.hybridcompute.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The metadata of the cloud environment (Azure/GCP/AWS/OCI...). */ +@Immutable +public final class CloudMetadata { + /* + * Specifies the cloud provider (Azure/AWS/GCP...). + */ + @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) + private String provider; + + /** Creates an instance of CloudMetadata class. */ + public CloudMetadata() { + } + + /** + * Get the provider property: Specifies the cloud provider (Azure/AWS/GCP...). + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ConfigurationExtension.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ConfigurationExtension.java new file mode 100644 index 0000000000000..096d36407fd92 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ConfigurationExtension.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes properties that can identify extensions. */ +@Immutable +public final class ConfigurationExtension { + /* + * Publisher of the extension. + */ + @JsonProperty(value = "publisher", access = JsonProperty.Access.WRITE_ONLY) + private String publisher; + + /* + * Type of the extension. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** Creates an instance of ConfigurationExtension class. */ + public ConfigurationExtension() { + } + + /** + * Get the publisher property: Publisher of the extension. + * + * @return the publisher value. + */ + public String publisher() { + return this.publisher; + } + + /** + * Get the type property: Type of the extension. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/EsuEligibility.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/EsuEligibility.java new file mode 100644 index 0000000000000..f2f02889938ba --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/EsuEligibility.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.hybridcompute.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The ESU eligibility. */ +public final class EsuEligibility extends ExpandableStringEnum { + /** Static value Eligible for EsuEligibility. */ + public static final EsuEligibility ELIGIBLE = fromString("Eligible"); + + /** Static value Ineligible for EsuEligibility. */ + public static final EsuEligibility INELIGIBLE = fromString("Ineligible"); + + /** Static value Unknown for EsuEligibility. */ + public static final EsuEligibility UNKNOWN = fromString("Unknown"); + + /** + * Creates a new instance of EsuEligibility value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EsuEligibility() { + } + + /** + * Creates or finds a EsuEligibility from its string representation. + * + * @param name a name to look for. + * @return the corresponding EsuEligibility. + */ + @JsonCreator + public static EsuEligibility fromString(String name) { + return fromString(name, EsuEligibility.class); + } + + /** + * Gets known EsuEligibility values. + * + * @return known EsuEligibility values. + */ + public static Collection values() { + return values(EsuEligibility.class); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/EsuKey.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/EsuKey.java new file mode 100644 index 0000000000000..47f03b619bf82 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/EsuKey.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.hybridcompute.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** ESU key. */ +@Fluent +public final class EsuKey { + /* + * SKU number. + */ + @JsonProperty(value = "sku") + private String sku; + + /* + * The current status of the license profile key. + */ + @JsonProperty(value = "licenseStatus") + private String licenseStatus; + + /** Creates an instance of EsuKey class. */ + public EsuKey() { + } + + /** + * Get the sku property: SKU number. + * + * @return the sku value. + */ + public String sku() { + return this.sku; + } + + /** + * Set the sku property: SKU number. + * + * @param sku the sku value to set. + * @return the EsuKey object itself. + */ + public EsuKey withSku(String sku) { + this.sku = sku; + return this; + } + + /** + * Get the licenseStatus property: The current status of the license profile key. + * + * @return the licenseStatus value. + */ + public String licenseStatus() { + return this.licenseStatus; + } + + /** + * Set the licenseStatus property: The current status of the license profile key. + * + * @param licenseStatus the licenseStatus value to set. + * @return the EsuKey object itself. + */ + public EsuKey withLicenseStatus(String licenseStatus) { + this.licenseStatus = licenseStatus; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/EsuKeyState.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/EsuKeyState.java new file mode 100644 index 0000000000000..fdc7c71b386e9 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/EsuKeyState.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The ESU key state. */ +public final class EsuKeyState extends ExpandableStringEnum { + /** Static value Inactive for EsuKeyState. */ + public static final EsuKeyState INACTIVE = fromString("Inactive"); + + /** Static value Active for EsuKeyState. */ + public static final EsuKeyState ACTIVE = fromString("Active"); + + /** + * Creates a new instance of EsuKeyState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EsuKeyState() { + } + + /** + * Creates or finds a EsuKeyState from its string representation. + * + * @param name a name to look for. + * @return the corresponding EsuKeyState. + */ + @JsonCreator + public static EsuKeyState fromString(String name) { + return fromString(name, EsuKeyState.class); + } + + /** + * Gets known EsuKeyState values. + * + * @return known EsuKeyState values. + */ + public static Collection values() { + return values(EsuKeyState.class); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/EsuServerType.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/EsuServerType.java new file mode 100644 index 0000000000000..183e95c8d56ea --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/EsuServerType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The server types for Esu. */ +public final class EsuServerType extends ExpandableStringEnum { + /** Static value Standard for EsuServerType. */ + public static final EsuServerType STANDARD = fromString("Standard"); + + /** Static value Datacenter for EsuServerType. */ + public static final EsuServerType DATACENTER = fromString("Datacenter"); + + /** + * Creates a new instance of EsuServerType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EsuServerType() { + } + + /** + * Creates or finds a EsuServerType from its string representation. + * + * @param name a name to look for. + * @return the corresponding EsuServerType. + */ + @JsonCreator + public static EsuServerType fromString(String name) { + return fromString(name, EsuServerType.class); + } + + /** + * Gets known EsuServerType values. + * + * @return known EsuServerType values. + */ + public static Collection values() { + return values(EsuServerType.class); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ExecutionState.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ExecutionState.java new file mode 100644 index 0000000000000..b709665f9eb48 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ExecutionState.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.hybridcompute.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Script execution status. */ +public final class ExecutionState extends ExpandableStringEnum { + /** Static value Unknown for ExecutionState. */ + public static final ExecutionState UNKNOWN = fromString("Unknown"); + + /** Static value Pending for ExecutionState. */ + public static final ExecutionState PENDING = fromString("Pending"); + + /** Static value Running for ExecutionState. */ + public static final ExecutionState RUNNING = fromString("Running"); + + /** Static value Failed for ExecutionState. */ + public static final ExecutionState FAILED = fromString("Failed"); + + /** Static value Succeeded for ExecutionState. */ + public static final ExecutionState SUCCEEDED = fromString("Succeeded"); + + /** Static value TimedOut for ExecutionState. */ + public static final ExecutionState TIMED_OUT = fromString("TimedOut"); + + /** Static value Canceled for ExecutionState. */ + public static final ExecutionState CANCELED = fromString("Canceled"); + + /** + * Creates a new instance of ExecutionState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ExecutionState() { + } + + /** + * Creates or finds a ExecutionState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExecutionState. + */ + @JsonCreator + public static ExecutionState fromString(String name) { + return fromString(name, ExecutionState.class); + } + + /** + * Gets known ExecutionState values. + * + * @return known ExecutionState values. + */ + public static Collection values() { + return values(ExecutionState.class); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ExtensionMetadatas.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ExtensionMetadatas.java new file mode 100644 index 0000000000000..9c2700b105289 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ExtensionMetadatas.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ExtensionMetadatas. */ +public interface ExtensionMetadatas { + /** + * Gets an Extension Metadata based on location, publisher, extensionType and version. + * + * @param location The location of the Extension being received. + * @param publisher The publisher of the Extension being received. + * @param extensionType The extensionType of the Extension being received. + * @param version The version of the Extension being received. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Extension Metadata based on location, publisher, extensionType and version along with {@link + * Response}. + */ + Response getWithResponse( + String location, String publisher, String extensionType, String version, Context context); + + /** + * Gets an Extension Metadata based on location, publisher, extensionType and version. + * + * @param location The location of the Extension being received. + * @param publisher The publisher of the Extension being received. + * @param extensionType The extensionType of the Extension being received. + * @param version The version of the Extension being received. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Extension Metadata based on location, publisher, extensionType and version. + */ + ExtensionValue get(String location, String publisher, String extensionType, String version); + + /** + * Gets all Extension versions based on location, publisher, extensionType. + * + * @param location The location of the Extension being received. + * @param publisher The publisher of the Extension being received. + * @param extensionType The extensionType of the Extension being received. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Extension versions based on location, publisher, extensionType as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String location, String publisher, String extensionType); + + /** + * Gets all Extension versions based on location, publisher, extensionType. + * + * @param location The location of the Extension being received. + * @param publisher The publisher of the Extension being received. + * @param extensionType The extensionType of the Extension being received. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Extension versions based on location, publisher, extensionType as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String location, String publisher, String extensionType, Context context); +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ExtensionTargetProperties.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ExtensionTargetProperties.java new file mode 100644 index 0000000000000..a7c0c522490ec --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ExtensionTargetProperties.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.hybridcompute.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the Machine Extension Target Version Properties. */ +@Fluent +public final class ExtensionTargetProperties { + /* + * Properties for the specified Extension to Upgrade. + */ + @JsonProperty(value = "targetVersion") + private String targetVersion; + + /** Creates an instance of ExtensionTargetProperties class. */ + public ExtensionTargetProperties() { + } + + /** + * Get the targetVersion property: Properties for the specified Extension to Upgrade. + * + * @return the targetVersion value. + */ + public String targetVersion() { + return this.targetVersion; + } + + /** + * Set the targetVersion property: Properties for the specified Extension to Upgrade. + * + * @param targetVersion the targetVersion value to set. + * @return the ExtensionTargetProperties object itself. + */ + public ExtensionTargetProperties withTargetVersion(String targetVersion) { + this.targetVersion = targetVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ExtensionValue.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ExtensionValue.java new file mode 100644 index 0000000000000..1538a450b3c18 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ExtensionValue.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.hybridcompute.fluent.models.ExtensionValueInner; + +/** An immutable client-side representation of ExtensionValue. */ +public interface ExtensionValue { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the version property: The version of the Extension being received. + * + * @return the version value. + */ + String version(); + + /** + * Gets the extensionType property: The type of the Extension being received. + * + * @return the extensionType value. + */ + String extensionType(); + + /** + * Gets the publisher property: The publisher of the Extension being received. + * + * @return the publisher value. + */ + String publisher(); + + /** + * Gets the inner com.azure.resourcemanager.hybridcompute.fluent.models.ExtensionValueInner object. + * + * @return the inner object. + */ + ExtensionValueInner innerModel(); +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ExtensionValueListResult.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ExtensionValueListResult.java new file mode 100644 index 0000000000000..c773218ee9aae --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ExtensionValueListResult.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.hybridcompute.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.hybridcompute.fluent.models.ExtensionValueInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List Extension Metadata response. */ +@Immutable +public final class ExtensionValueListResult { + /* + * The list of extension metadata + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** Creates an instance of ExtensionValueListResult class. */ + public ExtensionValueListResult() { + } + + /** + * Get the value property: The list of extension metadata. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ExtensionsResourceStatus.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ExtensionsResourceStatus.java new file mode 100644 index 0000000000000..59e801c157f07 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ExtensionsResourceStatus.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Instance view status. */ +@Fluent +public final class ExtensionsResourceStatus { + /* + * The status code. + */ + @JsonProperty(value = "code") + private String code; + + /* + * The level code. + */ + @JsonProperty(value = "level") + private ExtensionsStatusLevelTypes level; + + /* + * The short localizable label for the status. + */ + @JsonProperty(value = "displayStatus") + private String displayStatus; + + /* + * The detailed status message, including for alerts and error messages. + */ + @JsonProperty(value = "message") + private String message; + + /* + * The time of the status. + */ + @JsonProperty(value = "time") + private OffsetDateTime time; + + /** Creates an instance of ExtensionsResourceStatus class. */ + public ExtensionsResourceStatus() { + } + + /** + * Get the code property: The status code. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Set the code property: The status code. + * + * @param code the code value to set. + * @return the ExtensionsResourceStatus object itself. + */ + public ExtensionsResourceStatus withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the level property: The level code. + * + * @return the level value. + */ + public ExtensionsStatusLevelTypes level() { + return this.level; + } + + /** + * Set the level property: The level code. + * + * @param level the level value to set. + * @return the ExtensionsResourceStatus object itself. + */ + public ExtensionsResourceStatus withLevel(ExtensionsStatusLevelTypes level) { + this.level = level; + return this; + } + + /** + * Get the displayStatus property: The short localizable label for the status. + * + * @return the displayStatus value. + */ + public String displayStatus() { + return this.displayStatus; + } + + /** + * Set the displayStatus property: The short localizable label for the status. + * + * @param displayStatus the displayStatus value to set. + * @return the ExtensionsResourceStatus object itself. + */ + public ExtensionsResourceStatus withDisplayStatus(String displayStatus) { + this.displayStatus = displayStatus; + return this; + } + + /** + * Get the message property: The detailed status message, including for alerts and error messages. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: The detailed status message, including for alerts and error messages. + * + * @param message the message value to set. + * @return the ExtensionsResourceStatus object itself. + */ + public ExtensionsResourceStatus withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the time property: The time of the status. + * + * @return the time value. + */ + public OffsetDateTime time() { + return this.time; + } + + /** + * Set the time property: The time of the status. + * + * @param time the time value to set. + * @return the ExtensionsResourceStatus object itself. + */ + public ExtensionsResourceStatus withTime(OffsetDateTime time) { + this.time = time; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ExtensionsStatusLevelTypes.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ExtensionsStatusLevelTypes.java new file mode 100644 index 0000000000000..8d38d79c524cb --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ExtensionsStatusLevelTypes.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** The level code. */ +public enum ExtensionsStatusLevelTypes { + /** Enum value Info. */ + INFO("Info"), + + /** Enum value Warning. */ + WARNING("Warning"), + + /** Enum value Error. */ + ERROR("Error"); + + /** The actual serialized value for a ExtensionsStatusLevelTypes instance. */ + private final String value; + + ExtensionsStatusLevelTypes(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ExtensionsStatusLevelTypes instance. + * + * @param value the serialized value to parse. + * @return the parsed ExtensionsStatusLevelTypes object, or null if unable to parse. + */ + @JsonCreator + public static ExtensionsStatusLevelTypes fromString(String value) { + if (value == null) { + return null; + } + ExtensionsStatusLevelTypes[] items = ExtensionsStatusLevelTypes.values(); + for (ExtensionsStatusLevelTypes item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/HybridComputePrivateLinkScope.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/HybridComputePrivateLinkScope.java index 6c2e87e2e314a..adfad17518b2e 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/HybridComputePrivateLinkScope.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/HybridComputePrivateLinkScope.java @@ -96,11 +96,13 @@ interface Definition DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { } + /** The HybridComputePrivateLinkScope definition stages. */ interface DefinitionStages { /** The first stage of the HybridComputePrivateLinkScope definition. */ interface Blank extends WithLocation { } + /** The stage of the HybridComputePrivateLinkScope definition allowing to specify location. */ interface WithLocation { /** @@ -119,6 +121,7 @@ interface WithLocation { */ WithResourceGroup withRegion(String location); } + /** The stage of the HybridComputePrivateLinkScope definition allowing to specify parent resource. */ interface WithResourceGroup { /** @@ -129,6 +132,7 @@ interface WithResourceGroup { */ WithCreate withExistingResourceGroup(String resourceGroupName); } + /** * The stage of the HybridComputePrivateLinkScope definition which contains all the minimum required properties * for the resource to be created, but also allows for any other optional properties to be specified. @@ -149,6 +153,7 @@ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithPro */ HybridComputePrivateLinkScope create(Context context); } + /** The stage of the HybridComputePrivateLinkScope definition allowing to specify tags. */ interface WithTags { /** @@ -159,6 +164,7 @@ interface WithTags { */ WithCreate withTags(Map tags); } + /** The stage of the HybridComputePrivateLinkScope definition allowing to specify properties. */ interface WithProperties { /** @@ -170,6 +176,7 @@ interface WithProperties { WithCreate withProperties(HybridComputePrivateLinkScopeProperties properties); } } + /** * Begins update for the HybridComputePrivateLinkScope resource. * @@ -194,6 +201,7 @@ interface Update extends UpdateStages.WithTags { */ HybridComputePrivateLinkScope apply(Context context); } + /** The HybridComputePrivateLinkScope update stages. */ interface UpdateStages { /** The stage of the HybridComputePrivateLinkScope update allowing to specify tags. */ @@ -207,6 +215,7 @@ interface WithTags { Update withTags(Map tags); } } + /** * Refreshes the resource to sync with Azure. * diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/HybridComputePrivateLinkScopeProperties.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/HybridComputePrivateLinkScopeProperties.java index 505090624185d..c21577f80bc21 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/HybridComputePrivateLinkScopeProperties.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/HybridComputePrivateLinkScopeProperties.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; /** Properties that define a Azure Arc PrivateLinkScope resource. */ @Fluent @@ -31,6 +32,12 @@ public final class HybridComputePrivateLinkScopeProperties { @JsonProperty(value = "privateLinkScopeId", access = JsonProperty.Access.WRITE_ONLY) private String privateLinkScopeId; + /* + * The collection of associated Private Endpoint Connections. + */ + @JsonProperty(value = "privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) + private List privateEndpointConnections; + /** Creates an instance of HybridComputePrivateLinkScopeProperties class. */ public HybridComputePrivateLinkScopeProperties() { } @@ -78,11 +85,23 @@ public String privateLinkScopeId() { return this.privateLinkScopeId; } + /** + * Get the privateEndpointConnections property: The collection of associated Private Endpoint Connections. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.privateEndpointConnections; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (privateEndpointConnections() != null) { + privateEndpointConnections().forEach(e -> e.validate()); + } } } diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/HybridIdentityMetadata.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/HybridIdentityMetadata.java new file mode 100644 index 0000000000000..b239047856699 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/HybridIdentityMetadata.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.hybridcompute.fluent.models.HybridIdentityMetadataInner; + +/** An immutable client-side representation of HybridIdentityMetadata. */ +public interface HybridIdentityMetadata { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the vmId property: The unique identifier for the resource. + * + * @return the vmId value. + */ + String vmId(); + + /** + * Gets the publicKey property: The Public Key. + * + * @return the publicKey value. + */ + String publicKey(); + + /** + * Gets the identity property: Identity for the resource. + * + * @return the identity value. + */ + Identity identity(); + + /** + * Gets the inner com.azure.resourcemanager.hybridcompute.fluent.models.HybridIdentityMetadataInner object. + * + * @return the inner object. + */ + HybridIdentityMetadataInner innerModel(); +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/HybridIdentityMetadataList.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/HybridIdentityMetadataList.java new file mode 100644 index 0000000000000..def911a18a08f --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/HybridIdentityMetadataList.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybridcompute.fluent.models.HybridIdentityMetadataInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of HybridIdentityMetadata. */ +@Fluent +public final class HybridIdentityMetadataList { + /* + * Url to follow for getting next page of HybridIdentityMetadata. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /* + * Array of HybridIdentityMetadata + */ + @JsonProperty(value = "value", required = true) + private List value; + + /** Creates an instance of HybridIdentityMetadataList class. */ + public HybridIdentityMetadataList() { + } + + /** + * Get the nextLink property: Url to follow for getting next page of HybridIdentityMetadata. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Url to follow for getting next page of HybridIdentityMetadata. + * + * @param nextLink the nextLink value to set. + * @return the HybridIdentityMetadataList object itself. + */ + public HybridIdentityMetadataList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the value property: Array of HybridIdentityMetadata. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of HybridIdentityMetadata. + * + * @param value the value value to set. + * @return the HybridIdentityMetadataList object itself. + */ + public HybridIdentityMetadataList withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property value in model HybridIdentityMetadataList")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(HybridIdentityMetadataList.class); +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/HybridIdentityMetadatas.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/HybridIdentityMetadatas.java new file mode 100644 index 0000000000000..f73fc930c52da --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/HybridIdentityMetadatas.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of HybridIdentityMetadatas. */ +public interface HybridIdentityMetadatas { + /** + * Gets HybridIdentityMetadata. + * + *

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

Implements HybridIdentityMetadata GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param metadataName Name of the HybridIdentityMetadata. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the HybridIdentityMetadata. + */ + HybridIdentityMetadata get(String resourceGroupName, String machineName, String metadataName); + + /** + * Implements GET HybridIdentityMetadata in a machine. + * + *

Returns the list of HybridIdentityMetadata of the given machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of HybridIdentityMetadata as paginated response with {@link PagedIterable}. + */ + PagedIterable listByMachines(String resourceGroupName, String machineName); + + /** + * Implements GET HybridIdentityMetadata in a machine. + * + *

Returns the list of HybridIdentityMetadata of the given machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of HybridIdentityMetadata as paginated response with {@link PagedIterable}. + */ + PagedIterable listByMachines(String resourceGroupName, String machineName, Context context); +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/Identity.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/Identity.java index cbf5967acc67c..d71f2320eb2c5 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/Identity.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/Identity.java @@ -9,7 +9,7 @@ /** Identity for the resource. */ @Fluent -public class Identity { +public final class Identity { /* * The principal ID of resource identity. */ diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/IpAddress.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/IpAddress.java new file mode 100644 index 0000000000000..8adedcdbb937f --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/IpAddress.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes properties of the IP address. */ +@Fluent +public final class IpAddress { + /* + * Represents the IP Address. + */ + @JsonProperty(value = "address") + private String address; + + /* + * Represents the Ip Address Version. + */ + @JsonProperty(value = "ipAddressVersion") + private String ipAddressVersion; + + /* + * The subnet to which this IP address belongs. + */ + @JsonProperty(value = "subnet", access = JsonProperty.Access.WRITE_ONLY) + private Subnet subnet; + + /** Creates an instance of IpAddress class. */ + public IpAddress() { + } + + /** + * Get the address property: Represents the IP Address. + * + * @return the address value. + */ + public String address() { + return this.address; + } + + /** + * Set the address property: Represents the IP Address. + * + * @param address the address value to set. + * @return the IpAddress object itself. + */ + public IpAddress withAddress(String address) { + this.address = address; + return this; + } + + /** + * Get the ipAddressVersion property: Represents the Ip Address Version. + * + * @return the ipAddressVersion value. + */ + public String ipAddressVersion() { + return this.ipAddressVersion; + } + + /** + * Set the ipAddressVersion property: Represents the Ip Address Version. + * + * @param ipAddressVersion the ipAddressVersion value to set. + * @return the IpAddress object itself. + */ + public IpAddress withIpAddressVersion(String ipAddressVersion) { + this.ipAddressVersion = ipAddressVersion; + return this; + } + + /** + * Get the subnet property: The subnet to which this IP address belongs. + * + * @return the subnet value. + */ + public Subnet subnet() { + return this.subnet; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (subnet() != null) { + subnet().validate(); + } + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LastAttemptStatusEnum.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LastAttemptStatusEnum.java new file mode 100644 index 0000000000000..d111040e7a7a9 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LastAttemptStatusEnum.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Specifies the status of Agent Upgrade. */ +public final class LastAttemptStatusEnum extends ExpandableStringEnum { + /** Static value Success for LastAttemptStatusEnum. */ + public static final LastAttemptStatusEnum SUCCESS = fromString("Success"); + + /** Static value Failed for LastAttemptStatusEnum. */ + public static final LastAttemptStatusEnum FAILED = fromString("Failed"); + + /** + * Creates a new instance of LastAttemptStatusEnum value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LastAttemptStatusEnum() { + } + + /** + * Creates or finds a LastAttemptStatusEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding LastAttemptStatusEnum. + */ + @JsonCreator + public static LastAttemptStatusEnum fromString(String name) { + return fromString(name, LastAttemptStatusEnum.class); + } + + /** + * Gets known LastAttemptStatusEnum values. + * + * @return known LastAttemptStatusEnum values. + */ + public static Collection values() { + return values(LastAttemptStatusEnum.class); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/License.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/License.java new file mode 100644 index 0000000000000..c91593ffd1b68 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/License.java @@ -0,0 +1,354 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridcompute.fluent.models.LicenseInner; +import java.util.Map; + +/** An immutable client-side representation of License. */ +public interface License { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the tenantId property: Describes the tenant id. + * + * @return the tenantId value. + */ + String tenantId(); + + /** + * Gets the licenseType property: The type of the license resource. + * + * @return the licenseType value. + */ + LicenseType licenseType(); + + /** + * Gets the licenseDetails property: Describes the properties of a License. + * + * @return the licenseDetails value. + */ + LicenseDetails licenseDetails(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.hybridcompute.fluent.models.LicenseInner object. + * + * @return the inner object. + */ + LicenseInner innerModel(); + + /** The entirety of the License definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + + /** The License definition stages. */ + interface DefinitionStages { + /** The first stage of the License definition. */ + interface Blank extends WithLocation { + } + + /** The stage of the License definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** The stage of the License definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the License definition which contains all the minimum required properties for the resource to be + * created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithTenantId, + DefinitionStages.WithLicenseType, + DefinitionStages.WithLicenseDetails { + /** + * Executes the create request. + * + * @return the created resource. + */ + License create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + License create(Context context); + } + + /** The stage of the License definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** The stage of the License definition allowing to specify tenantId. */ + interface WithTenantId { + /** + * Specifies the tenantId property: Describes the tenant id.. + * + * @param tenantId Describes the tenant id. + * @return the next definition stage. + */ + WithCreate withTenantId(String tenantId); + } + + /** The stage of the License definition allowing to specify licenseType. */ + interface WithLicenseType { + /** + * Specifies the licenseType property: The type of the license resource.. + * + * @param licenseType The type of the license resource. + * @return the next definition stage. + */ + WithCreate withLicenseType(LicenseType licenseType); + } + + /** The stage of the License definition allowing to specify licenseDetails. */ + interface WithLicenseDetails { + /** + * Specifies the licenseDetails property: Describes the properties of a License.. + * + * @param licenseDetails Describes the properties of a License. + * @return the next definition stage. + */ + WithCreate withLicenseDetails(LicenseDetails licenseDetails); + } + } + + /** + * Begins update for the License resource. + * + * @return the stage of resource update. + */ + License.Update update(); + + /** The template for License update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithLicenseType, + UpdateStages.WithState, + UpdateStages.WithTarget, + UpdateStages.WithEdition, + UpdateStages.WithType, + UpdateStages.WithProcessors { + /** + * Executes the update request. + * + * @return the updated resource. + */ + License apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + License apply(Context context); + } + + /** The License update stages. */ + interface UpdateStages { + /** The stage of the License update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + + /** The stage of the License update allowing to specify licenseType. */ + interface WithLicenseType { + /** + * Specifies the licenseType property: The type of the license resource.. + * + * @param licenseType The type of the license resource. + * @return the next definition stage. + */ + Update withLicenseType(LicenseType licenseType); + } + + /** The stage of the License update allowing to specify state. */ + interface WithState { + /** + * Specifies the state property: Describes the state of the license.. + * + * @param state Describes the state of the license. + * @return the next definition stage. + */ + Update withState(LicenseState state); + } + + /** The stage of the License update allowing to specify target. */ + interface WithTarget { + /** + * Specifies the target property: Describes the license target server.. + * + * @param target Describes the license target server. + * @return the next definition stage. + */ + Update withTarget(LicenseTarget target); + } + + /** The stage of the License update allowing to specify edition. */ + interface WithEdition { + /** + * Specifies the edition property: Describes the edition of the license. The values are either Standard or + * Datacenter.. + * + * @param edition Describes the edition of the license. The values are either Standard or Datacenter. + * @return the next definition stage. + */ + Update withEdition(LicenseEdition edition); + } + + /** The stage of the License update allowing to specify type. */ + interface WithType { + /** + * Specifies the type property: Describes the license core type (pCore or vCore).. + * + * @param type Describes the license core type (pCore or vCore). + * @return the next definition stage. + */ + Update withType(LicenseCoreType type); + } + + /** The stage of the License update allowing to specify processors. */ + interface WithProcessors { + /** + * Specifies the processors property: Describes the number of processors.. + * + * @param processors Describes the number of processors. + * @return the next definition stage. + */ + Update withProcessors(Integer processors); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + License refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + License refresh(Context context); +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicenseAssignmentState.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicenseAssignmentState.java new file mode 100644 index 0000000000000..d34ab4d9f00f4 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicenseAssignmentState.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Describes the license assignment state (Assigned or NotAssigned). */ +public final class LicenseAssignmentState extends ExpandableStringEnum { + /** Static value Assigned for LicenseAssignmentState. */ + public static final LicenseAssignmentState ASSIGNED = fromString("Assigned"); + + /** Static value NotAssigned for LicenseAssignmentState. */ + public static final LicenseAssignmentState NOT_ASSIGNED = fromString("NotAssigned"); + + /** + * Creates a new instance of LicenseAssignmentState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LicenseAssignmentState() { + } + + /** + * Creates or finds a LicenseAssignmentState from its string representation. + * + * @param name a name to look for. + * @return the corresponding LicenseAssignmentState. + */ + @JsonCreator + public static LicenseAssignmentState fromString(String name) { + return fromString(name, LicenseAssignmentState.class); + } + + /** + * Gets known LicenseAssignmentState values. + * + * @return known LicenseAssignmentState values. + */ + public static Collection values() { + return values(LicenseAssignmentState.class); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicenseCoreType.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicenseCoreType.java new file mode 100644 index 0000000000000..d38e2a12f60b7 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicenseCoreType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Describes the license core type (pCore or vCore). */ +public final class LicenseCoreType extends ExpandableStringEnum { + /** Static value pCore for LicenseCoreType. */ + public static final LicenseCoreType P_CORE = fromString("pCore"); + + /** Static value vCore for LicenseCoreType. */ + public static final LicenseCoreType V_CORE = fromString("vCore"); + + /** + * Creates a new instance of LicenseCoreType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LicenseCoreType() { + } + + /** + * Creates or finds a LicenseCoreType from its string representation. + * + * @param name a name to look for. + * @return the corresponding LicenseCoreType. + */ + @JsonCreator + public static LicenseCoreType fromString(String name) { + return fromString(name, LicenseCoreType.class); + } + + /** + * Gets known LicenseCoreType values. + * + * @return known LicenseCoreType values. + */ + public static Collection values() { + return values(LicenseCoreType.class); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicenseDetails.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicenseDetails.java new file mode 100644 index 0000000000000..cc0e57c4c2da8 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicenseDetails.java @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the properties of a License. */ +@Fluent +public final class LicenseDetails { + /* + * Describes the state of the license. + */ + @JsonProperty(value = "state") + private LicenseState state; + + /* + * Describes the license target server. + */ + @JsonProperty(value = "target") + private LicenseTarget target; + + /* + * Describes the edition of the license. The values are either Standard or Datacenter. + */ + @JsonProperty(value = "edition") + private LicenseEdition edition; + + /* + * Describes the license core type (pCore or vCore). + */ + @JsonProperty(value = "type") + private LicenseCoreType type; + + /* + * Describes the number of processors. + */ + @JsonProperty(value = "processors") + private Integer processors; + + /* + * Describes the number of assigned licenses. + */ + @JsonProperty(value = "assignedLicenses", access = JsonProperty.Access.WRITE_ONLY) + private Integer assignedLicenses; + + /* + * Describes the immutable id. + */ + @JsonProperty(value = "immutableId", access = JsonProperty.Access.WRITE_ONLY) + private String immutableId; + + /** Creates an instance of LicenseDetails class. */ + public LicenseDetails() { + } + + /** + * Get the state property: Describes the state of the license. + * + * @return the state value. + */ + public LicenseState state() { + return this.state; + } + + /** + * Set the state property: Describes the state of the license. + * + * @param state the state value to set. + * @return the LicenseDetails object itself. + */ + public LicenseDetails withState(LicenseState state) { + this.state = state; + return this; + } + + /** + * Get the target property: Describes the license target server. + * + * @return the target value. + */ + public LicenseTarget target() { + return this.target; + } + + /** + * Set the target property: Describes the license target server. + * + * @param target the target value to set. + * @return the LicenseDetails object itself. + */ + public LicenseDetails withTarget(LicenseTarget target) { + this.target = target; + return this; + } + + /** + * Get the edition property: Describes the edition of the license. The values are either Standard or Datacenter. + * + * @return the edition value. + */ + public LicenseEdition edition() { + return this.edition; + } + + /** + * Set the edition property: Describes the edition of the license. The values are either Standard or Datacenter. + * + * @param edition the edition value to set. + * @return the LicenseDetails object itself. + */ + public LicenseDetails withEdition(LicenseEdition edition) { + this.edition = edition; + return this; + } + + /** + * Get the type property: Describes the license core type (pCore or vCore). + * + * @return the type value. + */ + public LicenseCoreType type() { + return this.type; + } + + /** + * Set the type property: Describes the license core type (pCore or vCore). + * + * @param type the type value to set. + * @return the LicenseDetails object itself. + */ + public LicenseDetails withType(LicenseCoreType type) { + this.type = type; + return this; + } + + /** + * Get the processors property: Describes the number of processors. + * + * @return the processors value. + */ + public Integer processors() { + return this.processors; + } + + /** + * Set the processors property: Describes the number of processors. + * + * @param processors the processors value to set. + * @return the LicenseDetails object itself. + */ + public LicenseDetails withProcessors(Integer processors) { + this.processors = processors; + return this; + } + + /** + * Get the assignedLicenses property: Describes the number of assigned licenses. + * + * @return the assignedLicenses value. + */ + public Integer assignedLicenses() { + return this.assignedLicenses; + } + + /** + * Get the immutableId property: Describes the immutable id. + * + * @return the immutableId value. + */ + public String immutableId() { + return this.immutableId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicenseEdition.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicenseEdition.java new file mode 100644 index 0000000000000..8e0f5a01d9157 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicenseEdition.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Describes the edition of the license. The values are either Standard or Datacenter. */ +public final class LicenseEdition extends ExpandableStringEnum { + /** Static value Standard for LicenseEdition. */ + public static final LicenseEdition STANDARD = fromString("Standard"); + + /** Static value Datacenter for LicenseEdition. */ + public static final LicenseEdition DATACENTER = fromString("Datacenter"); + + /** + * Creates a new instance of LicenseEdition value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LicenseEdition() { + } + + /** + * Creates or finds a LicenseEdition from its string representation. + * + * @param name a name to look for. + * @return the corresponding LicenseEdition. + */ + @JsonCreator + public static LicenseEdition fromString(String name) { + return fromString(name, LicenseEdition.class); + } + + /** + * Gets known LicenseEdition values. + * + * @return known LicenseEdition values. + */ + public static Collection values() { + return values(LicenseEdition.class); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicenseProfile.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicenseProfile.java new file mode 100644 index 0000000000000..7c61646d70330 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicenseProfile.java @@ -0,0 +1,288 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridcompute.fluent.models.LicenseProfileInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of LicenseProfile. */ +public interface LicenseProfile { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the assignedLicense property: The resource id of the license. + * + * @return the assignedLicense value. + */ + String assignedLicense(); + + /** + * Gets the serverType property: The type of the Esu servers. + * + * @return the serverType value. + */ + EsuServerType serverType(); + + /** + * Gets the esuEligibility property: Indicates the eligibility state of Esu. + * + * @return the esuEligibility value. + */ + EsuEligibility esuEligibility(); + + /** + * Gets the esuKeyState property: Indicates whether there is an ESU Key currently active for the machine. + * + * @return the esuKeyState value. + */ + EsuKeyState esuKeyState(); + + /** + * Gets the assignedLicenseImmutableId property: The guid id of the license. + * + * @return the assignedLicenseImmutableId value. + */ + String assignedLicenseImmutableId(); + + /** + * Gets the esuKeys property: The list of ESU keys. + * + * @return the esuKeys value. + */ + List esuKeys(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.hybridcompute.fluent.models.LicenseProfileInner object. + * + * @return the inner object. + */ + LicenseProfileInner innerModel(); + + /** The entirety of the LicenseProfile definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreate { + } + + /** The LicenseProfile definition stages. */ + interface DefinitionStages { + /** The first stage of the LicenseProfile definition. */ + interface Blank extends WithLocation { + } + + /** The stage of the LicenseProfile definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + + /** The stage of the LicenseProfile definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, machineName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @return the next definition stage. + */ + WithCreate withExistingMachine(String resourceGroupName, String machineName); + } + + /** + * The stage of the LicenseProfile definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithAssignedLicense { + /** + * Executes the create request. + * + * @return the created resource. + */ + LicenseProfile create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + LicenseProfile create(Context context); + } + + /** The stage of the LicenseProfile definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** The stage of the LicenseProfile definition allowing to specify assignedLicense. */ + interface WithAssignedLicense { + /** + * Specifies the assignedLicense property: The resource id of the license.. + * + * @param assignedLicense The resource id of the license. + * @return the next definition stage. + */ + WithCreate withAssignedLicense(String assignedLicense); + } + } + + /** + * Begins update for the LicenseProfile resource. + * + * @return the stage of resource update. + */ + LicenseProfile.Update update(); + + /** The template for LicenseProfile update. */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithAssignedLicense { + /** + * Executes the update request. + * + * @return the updated resource. + */ + LicenseProfile apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + LicenseProfile apply(Context context); + } + + /** The LicenseProfile update stages. */ + interface UpdateStages { + /** The stage of the LicenseProfile update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + + /** The stage of the LicenseProfile update allowing to specify assignedLicense. */ + interface WithAssignedLicense { + /** + * Specifies the assignedLicense property: The resource id of the license.. + * + * @param assignedLicense The resource id of the license. + * @return the next definition stage. + */ + Update withAssignedLicense(String assignedLicense); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + LicenseProfile refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + LicenseProfile refresh(Context context); +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicenseProfileArmEsuPropertiesWithoutAssignedLicense.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicenseProfileArmEsuPropertiesWithoutAssignedLicense.java new file mode 100644 index 0000000000000..a666af5e47215 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicenseProfileArmEsuPropertiesWithoutAssignedLicense.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.hybridcompute.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the properties of a License Profile ARM model. */ +@Immutable +public class LicenseProfileArmEsuPropertiesWithoutAssignedLicense extends LicenseProfileStorageModelEsuProperties { + /* + * The type of the Esu servers. + */ + @JsonProperty(value = "serverType", access = JsonProperty.Access.WRITE_ONLY) + private EsuServerType serverType; + + /* + * Indicates the eligibility state of Esu. + */ + @JsonProperty(value = "esuEligibility", access = JsonProperty.Access.WRITE_ONLY) + private EsuEligibility esuEligibility; + + /* + * Indicates whether there is an ESU Key currently active for the machine. + */ + @JsonProperty(value = "esuKeyState", access = JsonProperty.Access.WRITE_ONLY) + private EsuKeyState esuKeyState; + + /** Creates an instance of LicenseProfileArmEsuPropertiesWithoutAssignedLicense class. */ + public LicenseProfileArmEsuPropertiesWithoutAssignedLicense() { + } + + /** + * Get the serverType property: The type of the Esu servers. + * + * @return the serverType value. + */ + public EsuServerType serverType() { + return this.serverType; + } + + /** + * Get the esuEligibility property: Indicates the eligibility state of Esu. + * + * @return the esuEligibility value. + */ + public EsuEligibility esuEligibility() { + return this.esuEligibility; + } + + /** + * Get the esuKeyState property: Indicates whether there is an ESU Key currently active for the machine. + * + * @return the esuKeyState value. + */ + public EsuKeyState esuKeyState() { + return this.esuKeyState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicenseProfileMachineInstanceView.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicenseProfileMachineInstanceView.java new file mode 100644 index 0000000000000..0b856e51381d1 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicenseProfileMachineInstanceView.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.hybridcompute.models; + +import com.azure.resourcemanager.hybridcompute.fluent.models.LicenseProfileMachineInstanceViewInner; + +/** An immutable client-side representation of LicenseProfileMachineInstanceView. */ +public interface LicenseProfileMachineInstanceView { + /** + * Gets the esuProfile property: Properties for the Machine ESU profile. + * + * @return the esuProfile value. + */ + LicenseProfileMachineInstanceViewEsuProperties esuProfile(); + + /** + * Gets the inner com.azure.resourcemanager.hybridcompute.fluent.models.LicenseProfileMachineInstanceViewInner + * object. + * + * @return the inner object. + */ + LicenseProfileMachineInstanceViewInner innerModel(); +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicenseProfileMachineInstanceViewEsuProperties.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicenseProfileMachineInstanceViewEsuProperties.java new file mode 100644 index 0000000000000..9a76eb39b76c6 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicenseProfileMachineInstanceViewEsuProperties.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.resourcemanager.hybridcompute.fluent.models.LicenseProfileMachineInstanceViewEsuPropertiesInner; +import java.util.List; + +/** An immutable client-side representation of LicenseProfileMachineInstanceViewEsuProperties. */ +public interface LicenseProfileMachineInstanceViewEsuProperties { + /** + * Gets the assignedLicenseImmutableId property: The guid id of the license. + * + * @return the assignedLicenseImmutableId value. + */ + String assignedLicenseImmutableId(); + + /** + * Gets the esuKeys property: The list of ESU keys. + * + * @return the esuKeys value. + */ + List esuKeys(); + + /** + * Gets the serverType property: The type of the Esu servers. + * + * @return the serverType value. + */ + EsuServerType serverType(); + + /** + * Gets the esuEligibility property: Indicates the eligibility state of Esu. + * + * @return the esuEligibility value. + */ + EsuEligibility esuEligibility(); + + /** + * Gets the esuKeyState property: Indicates whether there is an ESU Key currently active for the machine. + * + * @return the esuKeyState value. + */ + EsuKeyState esuKeyState(); + + /** + * Gets the assignedLicense property: The assigned license resource. + * + * @return the assignedLicense value. + */ + License assignedLicense(); + + /** + * Gets the licenseAssignmentState property: Describes the license assignment state (Assigned or NotAssigned). + * + * @return the licenseAssignmentState value. + */ + LicenseAssignmentState licenseAssignmentState(); + + /** + * Gets the inner + * com.azure.resourcemanager.hybridcompute.fluent.models.LicenseProfileMachineInstanceViewEsuPropertiesInner object. + * + * @return the inner object. + */ + LicenseProfileMachineInstanceViewEsuPropertiesInner innerModel(); +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicenseProfileStorageModelEsuProperties.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicenseProfileStorageModelEsuProperties.java new file mode 100644 index 0000000000000..cd5358ee5df2b --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicenseProfileStorageModelEsuProperties.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** License profile storage model for ESU properties. */ +@Immutable +public class LicenseProfileStorageModelEsuProperties { + /* + * The guid id of the license. + */ + @JsonProperty(value = "assignedLicenseImmutableId", access = JsonProperty.Access.WRITE_ONLY) + private String assignedLicenseImmutableId; + + /* + * The list of ESU keys. + */ + @JsonProperty(value = "esuKeys", access = JsonProperty.Access.WRITE_ONLY) + private List esuKeys; + + /** Creates an instance of LicenseProfileStorageModelEsuProperties class. */ + public LicenseProfileStorageModelEsuProperties() { + } + + /** + * Get the assignedLicenseImmutableId property: The guid id of the license. + * + * @return the assignedLicenseImmutableId value. + */ + public String assignedLicenseImmutableId() { + return this.assignedLicenseImmutableId; + } + + /** + * Get the esuKeys property: The list of ESU keys. + * + * @return the esuKeys value. + */ + public List esuKeys() { + return this.esuKeys; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (esuKeys() != null) { + esuKeys().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicenseProfileUpdate.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicenseProfileUpdate.java new file mode 100644 index 0000000000000..1c5ce17a6a25e --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicenseProfileUpdate.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.hybridcompute.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.hybridcompute.fluent.models.LicenseProfileUpdateProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Describes a License Profile Update. */ +@Fluent +public final class LicenseProfileUpdate extends ResourceUpdate { + /* + * Describe the Update properties of a license profile. + */ + @JsonProperty(value = "properties") + private LicenseProfileUpdateProperties innerProperties; + + /** Creates an instance of LicenseProfileUpdate class. */ + public LicenseProfileUpdate() { + } + + /** + * Get the innerProperties property: Describe the Update properties of a license profile. + * + * @return the innerProperties value. + */ + private LicenseProfileUpdateProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public LicenseProfileUpdate withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the assignedLicense property: The resource id of the license. + * + * @return the assignedLicense value. + */ + public String assignedLicense() { + return this.innerProperties() == null ? null : this.innerProperties().assignedLicense(); + } + + /** + * Set the assignedLicense property: The resource id of the license. + * + * @param assignedLicense the assignedLicense value to set. + * @return the LicenseProfileUpdate object itself. + */ + public LicenseProfileUpdate withAssignedLicense(String assignedLicense) { + if (this.innerProperties() == null) { + this.innerProperties = new LicenseProfileUpdateProperties(); + } + this.innerProperties().withAssignedLicense(assignedLicense); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicenseProfiles.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicenseProfiles.java new file mode 100644 index 0000000000000..b701bbad8908c --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicenseProfiles.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of LicenseProfiles. */ +public interface LicenseProfiles { + /** + * Retrieves information about the view of a license profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a license profile in a hybrid machine along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String machineName, Context context); + + /** + * Retrieves information about the view of a license profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a license profile in a hybrid machine. + */ + LicenseProfile get(String resourceGroupName, String machineName); + + /** + * The operation to delete a license profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String machineName); + + /** + * The operation to delete a license profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String machineName, Context context); + + /** + * The operation to get all license profiles of a non-Azure machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List hybrid machine license profile operation response as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String machineName); + + /** + * The operation to get all license profiles of a non-Azure machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List hybrid machine license profile operation response as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String machineName, Context context); + + /** + * Retrieves information about the view of a license profile. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a license profile in a hybrid machine along with {@link Response}. + */ + LicenseProfile getById(String id); + + /** + * Retrieves information about the view of a license profile. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a license profile in a hybrid machine along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * The operation to delete a license profile. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * The operation to delete a license profile. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new LicenseProfile resource. + * + * @return the first stage of the new LicenseProfile definition. + */ + LicenseProfile.DefinitionStages.Blank define(); +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicenseProfilesListResult.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicenseProfilesListResult.java new file mode 100644 index 0000000000000..57da067ae9445 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicenseProfilesListResult.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybridcompute.fluent.models.LicenseProfileInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List hybrid machine license profile operation response. */ +@Fluent +public final class LicenseProfilesListResult { + /* + * The list of license profiles. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The URI to fetch the next page of Machines. Call ListNext() with this URI to fetch the next page of license + * profile. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of LicenseProfilesListResult class. */ + public LicenseProfilesListResult() { + } + + /** + * Get the value property: The list of license profiles. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of license profiles. + * + * @param value the value value to set. + * @return the LicenseProfilesListResult object itself. + */ + public LicenseProfilesListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI to fetch the next page of Machines. Call ListNext() with this URI to fetch the + * next page of license profile. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI to fetch the next page of Machines. Call ListNext() with this URI to fetch the + * next page of license profile. + * + * @param nextLink the nextLink value to set. + * @return the LicenseProfilesListResult object itself. + */ + public LicenseProfilesListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model LicenseProfilesListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(LicenseProfilesListResult.class); +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicenseState.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicenseState.java new file mode 100644 index 0000000000000..40b333cbc81ad --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicenseState.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Describes the state of the license. */ +public final class LicenseState extends ExpandableStringEnum { + /** Static value Activated for LicenseState. */ + public static final LicenseState ACTIVATED = fromString("Activated"); + + /** Static value Deactivated for LicenseState. */ + public static final LicenseState DEACTIVATED = fromString("Deactivated"); + + /** + * Creates a new instance of LicenseState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LicenseState() { + } + + /** + * Creates or finds a LicenseState from its string representation. + * + * @param name a name to look for. + * @return the corresponding LicenseState. + */ + @JsonCreator + public static LicenseState fromString(String name) { + return fromString(name, LicenseState.class); + } + + /** + * Gets known LicenseState values. + * + * @return known LicenseState values. + */ + public static Collection values() { + return values(LicenseState.class); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicenseTarget.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicenseTarget.java new file mode 100644 index 0000000000000..3fec11e455589 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicenseTarget.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Describes the license target server. */ +public final class LicenseTarget extends ExpandableStringEnum { + /** Static value Windows Server 2012 for LicenseTarget. */ + public static final LicenseTarget WINDOWS_SERVER_2012 = fromString("Windows Server 2012"); + + /** Static value Windows Server 2012 R2 for LicenseTarget. */ + public static final LicenseTarget WINDOWS_SERVER_2012_R2 = fromString("Windows Server 2012 R2"); + + /** + * Creates a new instance of LicenseTarget value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LicenseTarget() { + } + + /** + * Creates or finds a LicenseTarget from its string representation. + * + * @param name a name to look for. + * @return the corresponding LicenseTarget. + */ + @JsonCreator + public static LicenseTarget fromString(String name) { + return fromString(name, LicenseTarget.class); + } + + /** + * Gets known LicenseTarget values. + * + * @return known LicenseTarget values. + */ + public static Collection values() { + return values(LicenseTarget.class); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicenseType.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicenseType.java new file mode 100644 index 0000000000000..200c5173db76e --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicenseType.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.hybridcompute.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The type of the license resource. */ +public final class LicenseType extends ExpandableStringEnum { + /** Static value ESU for LicenseType. */ + public static final LicenseType ESU = fromString("ESU"); + + /** + * Creates a new instance of LicenseType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LicenseType() { + } + + /** + * Creates or finds a LicenseType from its string representation. + * + * @param name a name to look for. + * @return the corresponding LicenseType. + */ + @JsonCreator + public static LicenseType fromString(String name) { + return fromString(name, LicenseType.class); + } + + /** + * Gets known LicenseType values. + * + * @return known LicenseType values. + */ + public static Collection values() { + return values(LicenseType.class); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicenseUpdate.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicenseUpdate.java new file mode 100644 index 0000000000000..7938ccc151bda --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicenseUpdate.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.hybridcompute.fluent.models.LicenseUpdateProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Describes a License Update. */ +@Fluent +public final class LicenseUpdate extends ResourceUpdate { + /* + * License Update properties + */ + @JsonProperty(value = "properties") + private LicenseUpdateProperties innerProperties; + + /** Creates an instance of LicenseUpdate class. */ + public LicenseUpdate() { + } + + /** + * Get the innerProperties property: License Update properties. + * + * @return the innerProperties value. + */ + private LicenseUpdateProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public LicenseUpdate withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the licenseType property: The type of the license resource. + * + * @return the licenseType value. + */ + public LicenseType licenseType() { + return this.innerProperties() == null ? null : this.innerProperties().licenseType(); + } + + /** + * Set the licenseType property: The type of the license resource. + * + * @param licenseType the licenseType value to set. + * @return the LicenseUpdate object itself. + */ + public LicenseUpdate withLicenseType(LicenseType licenseType) { + if (this.innerProperties() == null) { + this.innerProperties = new LicenseUpdateProperties(); + } + this.innerProperties().withLicenseType(licenseType); + return this; + } + + /** + * Get the state property: Describes the state of the license. + * + * @return the state value. + */ + public LicenseState state() { + return this.innerProperties() == null ? null : this.innerProperties().state(); + } + + /** + * Set the state property: Describes the state of the license. + * + * @param state the state value to set. + * @return the LicenseUpdate object itself. + */ + public LicenseUpdate withState(LicenseState state) { + if (this.innerProperties() == null) { + this.innerProperties = new LicenseUpdateProperties(); + } + this.innerProperties().withState(state); + return this; + } + + /** + * Get the target property: Describes the license target server. + * + * @return the target value. + */ + public LicenseTarget target() { + return this.innerProperties() == null ? null : this.innerProperties().target(); + } + + /** + * Set the target property: Describes the license target server. + * + * @param target the target value to set. + * @return the LicenseUpdate object itself. + */ + public LicenseUpdate withTarget(LicenseTarget target) { + if (this.innerProperties() == null) { + this.innerProperties = new LicenseUpdateProperties(); + } + this.innerProperties().withTarget(target); + return this; + } + + /** + * Get the edition property: Describes the edition of the license. The values are either Standard or Datacenter. + * + * @return the edition value. + */ + public LicenseEdition edition() { + return this.innerProperties() == null ? null : this.innerProperties().edition(); + } + + /** + * Set the edition property: Describes the edition of the license. The values are either Standard or Datacenter. + * + * @param edition the edition value to set. + * @return the LicenseUpdate object itself. + */ + public LicenseUpdate withEdition(LicenseEdition edition) { + if (this.innerProperties() == null) { + this.innerProperties = new LicenseUpdateProperties(); + } + this.innerProperties().withEdition(edition); + return this; + } + + /** + * Get the type property: Describes the license core type (pCore or vCore). + * + * @return the type value. + */ + public LicenseCoreType type() { + return this.innerProperties() == null ? null : this.innerProperties().type(); + } + + /** + * Set the type property: Describes the license core type (pCore or vCore). + * + * @param type the type value to set. + * @return the LicenseUpdate object itself. + */ + public LicenseUpdate withType(LicenseCoreType type) { + if (this.innerProperties() == null) { + this.innerProperties = new LicenseUpdateProperties(); + } + this.innerProperties().withType(type); + return this; + } + + /** + * Get the processors property: Describes the number of processors. + * + * @return the processors value. + */ + public Integer processors() { + return this.innerProperties() == null ? null : this.innerProperties().processors(); + } + + /** + * Set the processors property: Describes the number of processors. + * + * @param processors the processors value to set. + * @return the LicenseUpdate object itself. + */ + public LicenseUpdate withProcessors(Integer processors) { + if (this.innerProperties() == null) { + this.innerProperties = new LicenseUpdateProperties(); + } + this.innerProperties().withProcessors(processors); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/Licenses.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/Licenses.java new file mode 100644 index 0000000000000..86e28ecacf561 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/Licenses.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridcompute.fluent.models.LicenseInner; + +/** Resource collection API of Licenses. */ +public interface Licenses { + /** + * The operation to validate a license. + * + * @param parameters Parameters supplied to the license validation operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a license in a hybrid machine. + */ + License validateLicense(LicenseInner parameters); + + /** + * The operation to validate a license. + * + * @param parameters Parameters supplied to the license validation operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a license in a hybrid machine. + */ + License validateLicense(LicenseInner parameters, Context context); + + /** + * Retrieves information about the view of a license. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param licenseName The name of the license. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a license in a hybrid machine along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String licenseName, Context context); + + /** + * Retrieves information about the view of a license. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param licenseName The name of the license. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a license in a hybrid machine. + */ + License getByResourceGroup(String resourceGroupName, String licenseName); + + /** + * The operation to delete a license. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param licenseName The name of the license. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String licenseName); + + /** + * The operation to delete a license. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param licenseName The name of the license. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String licenseName, Context context); + + /** + * The operation to get all licenses of a non-Azure machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List license operation response as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * The operation to get all licenses of a non-Azure machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List license operation response as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * The operation to get all licenses of a non-Azure machine. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List license operation response as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * The operation to get all licenses of a non-Azure machine. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List license operation response as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Retrieves information about the view of a license. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a license in a hybrid machine along with {@link Response}. + */ + License getById(String id); + + /** + * Retrieves information about the view of a license. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a license in a hybrid machine along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * The operation to delete a license. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * The operation to delete a license. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new License resource. + * + * @param name resource name. + * @return the first stage of the new License definition. + */ + License.DefinitionStages.Blank define(String name); +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicensesListResult.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicensesListResult.java new file mode 100644 index 0000000000000..7f122d043c4e2 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LicensesListResult.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybridcompute.fluent.models.LicenseInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List license operation response. */ +@Fluent +public final class LicensesListResult { + /* + * The list of licenses. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The URI to fetch the next page of Machines. Call ListNext() with this URI to fetch the next page of license + * profile. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of LicensesListResult class. */ + public LicensesListResult() { + } + + /** + * Get the value property: The list of licenses. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of licenses. + * + * @param value the value value to set. + * @return the LicensesListResult object itself. + */ + public LicensesListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI to fetch the next page of Machines. Call ListNext() with this URI to fetch the + * next page of license profile. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI to fetch the next page of Machines. Call ListNext() with this URI to fetch the + * next page of license profile. + * + * @param nextLink the nextLink value to set. + * @return the LicensesListResult object itself. + */ + public LicensesListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model LicensesListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(LicensesListResult.class); +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LinuxParameters.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LinuxParameters.java new file mode 100644 index 0000000000000..5cf429e78b18b --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LinuxParameters.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Input for InstallPatches on a Linux VM, as directly received by the API. */ +@Fluent +public final class LinuxParameters { + /* + * The update classifications to select when installing patches for Linux. + */ + @JsonProperty(value = "classificationsToInclude") + private List classificationsToInclude; + + /* + * packages to include in the patch operation. Format: packageName_packageVersion + */ + @JsonProperty(value = "packageNameMasksToInclude") + private List packageNameMasksToInclude; + + /* + * packages to exclude in the patch operation. Format: packageName_packageVersion + */ + @JsonProperty(value = "packageNameMasksToExclude") + private List packageNameMasksToExclude; + + /** Creates an instance of LinuxParameters class. */ + public LinuxParameters() { + } + + /** + * Get the classificationsToInclude property: The update classifications to select when installing patches for + * Linux. + * + * @return the classificationsToInclude value. + */ + public List classificationsToInclude() { + return this.classificationsToInclude; + } + + /** + * Set the classificationsToInclude property: The update classifications to select when installing patches for + * Linux. + * + * @param classificationsToInclude the classificationsToInclude value to set. + * @return the LinuxParameters object itself. + */ + public LinuxParameters withClassificationsToInclude( + List classificationsToInclude) { + this.classificationsToInclude = classificationsToInclude; + return this; + } + + /** + * Get the packageNameMasksToInclude property: packages to include in the patch operation. Format: + * packageName_packageVersion. + * + * @return the packageNameMasksToInclude value. + */ + public List packageNameMasksToInclude() { + return this.packageNameMasksToInclude; + } + + /** + * Set the packageNameMasksToInclude property: packages to include in the patch operation. Format: + * packageName_packageVersion. + * + * @param packageNameMasksToInclude the packageNameMasksToInclude value to set. + * @return the LinuxParameters object itself. + */ + public LinuxParameters withPackageNameMasksToInclude(List packageNameMasksToInclude) { + this.packageNameMasksToInclude = packageNameMasksToInclude; + return this; + } + + /** + * Get the packageNameMasksToExclude property: packages to exclude in the patch operation. Format: + * packageName_packageVersion. + * + * @return the packageNameMasksToExclude value. + */ + public List packageNameMasksToExclude() { + return this.packageNameMasksToExclude; + } + + /** + * Set the packageNameMasksToExclude property: packages to exclude in the patch operation. Format: + * packageName_packageVersion. + * + * @param packageNameMasksToExclude the packageNameMasksToExclude value to set. + * @return the LinuxParameters object itself. + */ + public LinuxParameters withPackageNameMasksToExclude(List packageNameMasksToExclude) { + this.packageNameMasksToExclude = packageNameMasksToExclude; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/Machine.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/Machine.java index 4d18ab209beb8..dfc1f367ee197 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/Machine.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/Machine.java @@ -5,7 +5,10 @@ package com.azure.resourcemanager.hybridcompute.models; import com.azure.core.management.SystemData; +import com.azure.core.management.exception.ManagementError; import com.azure.resourcemanager.hybridcompute.fluent.models.MachineInner; +import java.time.OffsetDateTime; +import java.util.List; import java.util.Map; /** An immutable client-side representation of Machine. */ @@ -46,11 +49,11 @@ public interface Machine { Map tags(); /** - * Gets the properties property: Hybrid Compute Machine properties. + * Gets the resources property: The list of extensions affiliated to the machine. * - * @return the properties value. + * @return the resources value. */ - MachineProperties properties(); + List resources(); /** * Gets the identity property: Identity for the resource. @@ -60,12 +63,234 @@ public interface Machine { Identity identity(); /** - * Gets the systemData property: The system meta data relating to this resource. + * Gets the kind property: Indicates which kind of Arc machine placement on-premises, such as HCI, SCVMM or VMware + * etc. + * + * @return the kind value. + */ + ArcKindEnum kind(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ SystemData systemData(); + /** + * Gets the locationData property: Metadata pertaining to the geographic location of the resource. + * + * @return the locationData value. + */ + LocationData locationData(); + + /** + * Gets the agentConfiguration property: Configurable properties that the user can set locally via the azcmagent + * config command, or remotely via ARM. + * + * @return the agentConfiguration value. + */ + AgentConfiguration agentConfiguration(); + + /** + * Gets the serviceStatuses property: Statuses of dependent services that are reported back to ARM. + * + * @return the serviceStatuses value. + */ + ServiceStatuses serviceStatuses(); + + /** + * Gets the cloudMetadata property: The metadata of the cloud environment (Azure/GCP/AWS/OCI...). + * + * @return the cloudMetadata value. + */ + CloudMetadata cloudMetadata(); + + /** + * Gets the agentUpgrade property: The info of the machine w.r.t Agent Upgrade. + * + * @return the agentUpgrade value. + */ + AgentUpgrade agentUpgrade(); + + /** + * Gets the osProfile property: Specifies the operating system settings for the hybrid machine. + * + * @return the osProfile value. + */ + OSProfile osProfile(); + + /** + * Gets the licenseProfile property: Specifies the ESU related properties for a machine. + * + * @return the licenseProfile value. + */ + LicenseProfileMachineInstanceView licenseProfile(); + + /** + * Gets the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the status property: The status of the hybrid machine agent. + * + * @return the status value. + */ + StatusTypes status(); + + /** + * Gets the lastStatusChange property: The time of the last status change. + * + * @return the lastStatusChange value. + */ + OffsetDateTime lastStatusChange(); + + /** + * Gets the errorDetails property: Details about the error state. + * + * @return the errorDetails value. + */ + List errorDetails(); + + /** + * Gets the agentVersion property: The hybrid machine agent full version. + * + * @return the agentVersion value. + */ + String agentVersion(); + + /** + * Gets the vmId property: Specifies the hybrid machine unique ID. + * + * @return the vmId value. + */ + String vmId(); + + /** + * Gets the displayName property: Specifies the hybrid machine display name. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the machineFqdn property: Specifies the hybrid machine FQDN. + * + * @return the machineFqdn value. + */ + String machineFqdn(); + + /** + * Gets the clientPublicKey property: Public Key that the client provides to be used during initial resource + * onboarding. + * + * @return the clientPublicKey value. + */ + String clientPublicKey(); + + /** + * Gets the osName property: The Operating System running on the hybrid machine. + * + * @return the osName value. + */ + String osName(); + + /** + * Gets the osVersion property: The version of Operating System running on the hybrid machine. + * + * @return the osVersion value. + */ + String osVersion(); + + /** + * Gets the osType property: The type of Operating System (windows/linux). + * + * @return the osType value. + */ + String osType(); + + /** + * Gets the vmUuid property: Specifies the Arc Machine's unique SMBIOS ID. + * + * @return the vmUuid value. + */ + String vmUuid(); + + /** + * Gets the extensions property: Machine Extensions information (deprecated field). + * + * @return the extensions value. + */ + List extensions(); + + /** + * Gets the osSku property: Specifies the Operating System product SKU. + * + * @return the osSku value. + */ + String osSku(); + + /** + * Gets the domainName property: Specifies the Windows domain name. + * + * @return the domainName value. + */ + String domainName(); + + /** + * Gets the adFqdn property: Specifies the AD fully qualified display name. + * + * @return the adFqdn value. + */ + String adFqdn(); + + /** + * Gets the dnsFqdn property: Specifies the DNS fully qualified display name. + * + * @return the dnsFqdn value. + */ + String dnsFqdn(); + + /** + * Gets the privateLinkScopeResourceId property: The resource id of the private link scope this machine is assigned + * to, if any. + * + * @return the privateLinkScopeResourceId value. + */ + String privateLinkScopeResourceId(); + + /** + * Gets the parentClusterResourceId property: The resource id of the parent cluster (Azure HCI) this machine is + * assigned to, if any. + * + * @return the parentClusterResourceId value. + */ + String parentClusterResourceId(); + + /** + * Gets the mssqlDiscovered property: Specifies whether any MS SQL instance is discovered on the machine. + * + * @return the mssqlDiscovered value. + */ + String mssqlDiscovered(); + + /** + * Gets the detectedProperties property: Detected properties from the machine. + * + * @return the detectedProperties value. + */ + Map detectedProperties(); + + /** + * Gets the networkProfile property: Information about the network the machine is on. + * + * @return the networkProfile value. + */ + NetworkProfile networkProfile(); + /** * Gets the inner com.azure.resourcemanager.hybridcompute.fluent.models.MachineInner object. * diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineAssessPatchesResult.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineAssessPatchesResult.java new file mode 100644 index 0000000000000..da2398a48f5e5 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineAssessPatchesResult.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.hybridcompute.fluent.models.MachineAssessPatchesResultInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of MachineAssessPatchesResult. */ +public interface MachineAssessPatchesResult { + /** + * Gets the status property: The overall success or failure status of the operation. It remains "InProgress" until + * the operation completes. At that point it will become "Unknown", "Failed", "Succeeded", or + * "CompletedWithWarnings.". + * + * @return the status value. + */ + PatchOperationStatus status(); + + /** + * Gets the assessmentActivityId property: The activity ID of the operation that produced this result. + * + * @return the assessmentActivityId value. + */ + String assessmentActivityId(); + + /** + * Gets the rebootPending property: The overall reboot status of the VM. It will be true when partially installed + * patches require a reboot to complete installation but the reboot has not yet occurred. + * + * @return the rebootPending value. + */ + Boolean rebootPending(); + + /** + * Gets the availablePatchCountByClassification property: Summarization of patches available for installation on the + * machine by classification. + * + * @return the availablePatchCountByClassification value. + */ + AvailablePatchCountByClassification availablePatchCountByClassification(); + + /** + * Gets the startDateTime property: The UTC timestamp when the operation began. + * + * @return the startDateTime value. + */ + OffsetDateTime startDateTime(); + + /** + * Gets the lastModifiedDateTime property: The UTC timestamp when the operation finished. + * + * @return the lastModifiedDateTime value. + */ + OffsetDateTime lastModifiedDateTime(); + + /** + * Gets the startedBy property: Indicates if operation was triggered by user or by platform. + * + * @return the startedBy value. + */ + PatchOperationStartedBy startedBy(); + + /** + * Gets the patchServiceUsed property: Specifies the patch service used for the operation. + * + * @return the patchServiceUsed value. + */ + PatchServiceUsed patchServiceUsed(); + + /** + * Gets the osType property: The operating system type of the machine. + * + * @return the osType value. + */ + OsType osType(); + + /** + * Gets the errorDetails property: The errors that were encountered during execution of the operation. The details + * array contains the list of them. + * + * @return the errorDetails value. + */ + ManagementError errorDetails(); + + /** + * Gets the inner com.azure.resourcemanager.hybridcompute.fluent.models.MachineAssessPatchesResultInner object. + * + * @return the inner object. + */ + MachineAssessPatchesResultInner innerModel(); +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtension.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtension.java index f6f0ffd27e979..3394180622dbe 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtension.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtension.java @@ -55,7 +55,7 @@ public interface MachineExtension { MachineExtensionProperties properties(); /** - * Gets the systemData property: The system meta data relating to this resource. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ @@ -96,11 +96,13 @@ interface Definition DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } + /** The MachineExtension definition stages. */ interface DefinitionStages { /** The first stage of the MachineExtension definition. */ interface Blank extends WithLocation { } + /** The stage of the MachineExtension definition allowing to specify location. */ interface WithLocation { /** @@ -119,6 +121,7 @@ interface WithLocation { */ WithParentResource withRegion(String location); } + /** The stage of the MachineExtension definition allowing to specify parent resource. */ interface WithParentResource { /** @@ -130,6 +133,7 @@ interface WithParentResource { */ WithCreate withExistingMachine(String resourceGroupName, String machineName); } + /** * The stage of the MachineExtension definition which contains all the minimum required properties for the * resource to be created, but also allows for any other optional properties to be specified. @@ -150,6 +154,7 @@ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithPro */ MachineExtension create(Context context); } + /** The stage of the MachineExtension definition allowing to specify tags. */ interface WithTags { /** @@ -160,6 +165,7 @@ interface WithTags { */ WithCreate withTags(Map tags); } + /** The stage of the MachineExtension definition allowing to specify properties. */ interface WithProperties { /** @@ -171,6 +177,7 @@ interface WithProperties { WithCreate withProperties(MachineExtensionProperties properties); } } + /** * Begins update for the MachineExtension resource. * @@ -179,7 +186,16 @@ interface WithProperties { MachineExtension.Update update(); /** The template for MachineExtension update. */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties { + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithForceUpdateTag, + UpdateStages.WithPublisher, + UpdateStages.WithType, + UpdateStages.WithTypeHandlerVersion, + UpdateStages.WithEnableAutomaticUpgrade, + UpdateStages.WithAutoUpgradeMinorVersion, + UpdateStages.WithSettings, + UpdateStages.WithProtectedSettings { /** * Executes the update request. * @@ -195,6 +211,7 @@ interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties { */ MachineExtension apply(Context context); } + /** The MachineExtension update stages. */ interface UpdateStages { /** The stage of the MachineExtension update allowing to specify tags. */ @@ -207,17 +224,106 @@ interface WithTags { */ Update withTags(Map tags); } - /** The stage of the MachineExtension update allowing to specify properties. */ - interface WithProperties { + + /** The stage of the MachineExtension update allowing to specify forceUpdateTag. */ + interface WithForceUpdateTag { /** - * Specifies the properties property: Describes Machine Extension Update Properties.. + * Specifies the forceUpdateTag property: How the extension handler should be forced to update even if the + * extension configuration has not changed.. * - * @param properties Describes Machine Extension Update Properties. + * @param forceUpdateTag How the extension handler should be forced to update even if the extension + * configuration has not changed. * @return the next definition stage. */ - Update withProperties(MachineExtensionUpdateProperties properties); + Update withForceUpdateTag(String forceUpdateTag); + } + + /** The stage of the MachineExtension update allowing to specify publisher. */ + interface WithPublisher { + /** + * Specifies the publisher property: The name of the extension handler publisher.. + * + * @param publisher The name of the extension handler publisher. + * @return the next definition stage. + */ + Update withPublisher(String publisher); + } + + /** The stage of the MachineExtension update allowing to specify type. */ + interface WithType { + /** + * Specifies the type property: Specifies the type of the extension; an example is "CustomScriptExtension".. + * + * @param type Specifies the type of the extension; an example is "CustomScriptExtension". + * @return the next definition stage. + */ + Update withType(String type); + } + + /** The stage of the MachineExtension update allowing to specify typeHandlerVersion. */ + interface WithTypeHandlerVersion { + /** + * Specifies the typeHandlerVersion property: Specifies the version of the script handler.. + * + * @param typeHandlerVersion Specifies the version of the script handler. + * @return the next definition stage. + */ + Update withTypeHandlerVersion(String typeHandlerVersion); + } + + /** The stage of the MachineExtension update allowing to specify enableAutomaticUpgrade. */ + interface WithEnableAutomaticUpgrade { + /** + * Specifies the enableAutomaticUpgrade property: Indicates whether the extension should be automatically + * upgraded by the platform if there is a newer version available.. + * + * @param enableAutomaticUpgrade Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version available. + * @return the next definition stage. + */ + Update withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade); + } + + /** The stage of the MachineExtension update allowing to specify autoUpgradeMinorVersion. */ + interface WithAutoUpgradeMinorVersion { + /** + * Specifies the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor + * version if one is available at deployment time. Once deployed, however, the extension will not upgrade + * minor versions unless redeployed, even with this property set to true.. + * + * @param autoUpgradeMinorVersion Indicates whether the extension should use a newer minor version if one is + * available at deployment time. Once deployed, however, the extension will not upgrade minor versions + * unless redeployed, even with this property set to true. + * @return the next definition stage. + */ + Update withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion); + } + + /** The stage of the MachineExtension update allowing to specify settings. */ + interface WithSettings { + /** + * Specifies the settings property: Json formatted public settings for the extension.. + * + * @param settings Json formatted public settings for the extension. + * @return the next definition stage. + */ + Update withSettings(Map settings); + } + + /** The stage of the MachineExtension update allowing to specify protectedSettings. */ + interface WithProtectedSettings { + /** + * Specifies the protectedSettings property: The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all.. + * + * @param protectedSettings The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + * @return the next definition stage. + */ + Update withProtectedSettings(Map protectedSettings); } } + /** * Refreshes the resource to sync with Azure. * diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtensionProperties.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtensionProperties.java index 454bea5796e04..ccd2204fff541 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtensionProperties.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtensionProperties.java @@ -5,7 +5,9 @@ package com.azure.resourcemanager.hybridcompute.models; import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; /** Describes the properties of a Machine Extension. */ @Fluent @@ -34,6 +36,13 @@ public final class MachineExtensionProperties { @JsonProperty(value = "typeHandlerVersion") private String typeHandlerVersion; + /* + * Indicates whether the extension should be automatically upgraded by the platform if there is a newer version + * available. + */ + @JsonProperty(value = "enableAutomaticUpgrade") + private Boolean enableAutomaticUpgrade; + /* * Indicates whether the extension should use a newer minor version if one is available at deployment time. Once * deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set @@ -46,14 +55,16 @@ public final class MachineExtensionProperties { * Json formatted public settings for the extension. */ @JsonProperty(value = "settings") - private Object settings; + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map settings; /* * The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at * all. */ @JsonProperty(value = "protectedSettings") - private Object protectedSettings; + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map protectedSettings; /* * The provisioning state, which only appears in the response. @@ -153,6 +164,28 @@ public MachineExtensionProperties withTypeHandlerVersion(String typeHandlerVersi return this; } + /** + * Get the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version available. + * + * @return the enableAutomaticUpgrade value. + */ + public Boolean enableAutomaticUpgrade() { + return this.enableAutomaticUpgrade; + } + + /** + * Set the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version available. + * + * @param enableAutomaticUpgrade the enableAutomaticUpgrade value to set. + * @return the MachineExtensionProperties object itself. + */ + public MachineExtensionProperties withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { + this.enableAutomaticUpgrade = enableAutomaticUpgrade; + return this; + } + /** * Get the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless @@ -182,7 +215,7 @@ public MachineExtensionProperties withAutoUpgradeMinorVersion(Boolean autoUpgrad * * @return the settings value. */ - public Object settings() { + public Map settings() { return this.settings; } @@ -192,7 +225,7 @@ public Object settings() { * @param settings the settings value to set. * @return the MachineExtensionProperties object itself. */ - public MachineExtensionProperties withSettings(Object settings) { + public MachineExtensionProperties withSettings(Map settings) { this.settings = settings; return this; } @@ -203,7 +236,7 @@ public MachineExtensionProperties withSettings(Object settings) { * * @return the protectedSettings value. */ - public Object protectedSettings() { + public Map protectedSettings() { return this.protectedSettings; } @@ -214,7 +247,7 @@ public Object protectedSettings() { * @param protectedSettings the protectedSettings value to set. * @return the MachineExtensionProperties object itself. */ - public MachineExtensionProperties withProtectedSettings(Object protectedSettings) { + public MachineExtensionProperties withProtectedSettings(Map protectedSettings) { this.protectedSettings = protectedSettings; return this; } diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtensionUpdate.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtensionUpdate.java index 9cb5254f457b3..3931bb1c5bfba 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtensionUpdate.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtensionUpdate.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.hybridcompute.models; import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.hybridcompute.fluent.models.MachineExtensionUpdateProperties; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; @@ -15,36 +16,219 @@ public final class MachineExtensionUpdate extends ResourceUpdate { * Describes Machine Extension Update Properties. */ @JsonProperty(value = "properties") - private MachineExtensionUpdateProperties properties; + private MachineExtensionUpdateProperties innerProperties; /** Creates an instance of MachineExtensionUpdate class. */ public MachineExtensionUpdate() { } /** - * Get the properties property: Describes Machine Extension Update Properties. + * Get the innerProperties property: Describes Machine Extension Update Properties. * - * @return the properties value. + * @return the innerProperties value. */ - public MachineExtensionUpdateProperties properties() { - return this.properties; + private MachineExtensionUpdateProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public MachineExtensionUpdate withTags(Map tags) { + super.withTags(tags); + return this; } /** - * Set the properties property: Describes Machine Extension Update Properties. + * Get the forceUpdateTag property: How the extension handler should be forced to update even if the extension + * configuration has not changed. * - * @param properties the properties value to set. + * @return the forceUpdateTag value. + */ + public String forceUpdateTag() { + return this.innerProperties() == null ? null : this.innerProperties().forceUpdateTag(); + } + + /** + * Set the forceUpdateTag property: How the extension handler should be forced to update even if the extension + * configuration has not changed. + * + * @param forceUpdateTag the forceUpdateTag value to set. * @return the MachineExtensionUpdate object itself. */ - public MachineExtensionUpdate withProperties(MachineExtensionUpdateProperties properties) { - this.properties = properties; + public MachineExtensionUpdate withForceUpdateTag(String forceUpdateTag) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineExtensionUpdateProperties(); + } + this.innerProperties().withForceUpdateTag(forceUpdateTag); return this; } - /** {@inheritDoc} */ - @Override - public MachineExtensionUpdate withTags(Map tags) { - super.withTags(tags); + /** + * Get the publisher property: The name of the extension handler publisher. + * + * @return the publisher value. + */ + public String publisher() { + return this.innerProperties() == null ? null : this.innerProperties().publisher(); + } + + /** + * Set the publisher property: The name of the extension handler publisher. + * + * @param publisher the publisher value to set. + * @return the MachineExtensionUpdate object itself. + */ + public MachineExtensionUpdate withPublisher(String publisher) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineExtensionUpdateProperties(); + } + this.innerProperties().withPublisher(publisher); + return this; + } + + /** + * Get the type property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @return the type value. + */ + public String type() { + return this.innerProperties() == null ? null : this.innerProperties().type(); + } + + /** + * Set the type property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @param type the type value to set. + * @return the MachineExtensionUpdate object itself. + */ + public MachineExtensionUpdate withType(String type) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineExtensionUpdateProperties(); + } + this.innerProperties().withType(type); + return this; + } + + /** + * Get the typeHandlerVersion property: Specifies the version of the script handler. + * + * @return the typeHandlerVersion value. + */ + public String typeHandlerVersion() { + return this.innerProperties() == null ? null : this.innerProperties().typeHandlerVersion(); + } + + /** + * Set the typeHandlerVersion property: Specifies the version of the script handler. + * + * @param typeHandlerVersion the typeHandlerVersion value to set. + * @return the MachineExtensionUpdate object itself. + */ + public MachineExtensionUpdate withTypeHandlerVersion(String typeHandlerVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineExtensionUpdateProperties(); + } + this.innerProperties().withTypeHandlerVersion(typeHandlerVersion); + return this; + } + + /** + * Get the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version available. + * + * @return the enableAutomaticUpgrade value. + */ + public Boolean enableAutomaticUpgrade() { + return this.innerProperties() == null ? null : this.innerProperties().enableAutomaticUpgrade(); + } + + /** + * Set the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version available. + * + * @param enableAutomaticUpgrade the enableAutomaticUpgrade value to set. + * @return the MachineExtensionUpdate object itself. + */ + public MachineExtensionUpdate withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineExtensionUpdateProperties(); + } + this.innerProperties().withEnableAutomaticUpgrade(enableAutomaticUpgrade); + return this; + } + + /** + * Get the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless + * redeployed, even with this property set to true. + * + * @return the autoUpgradeMinorVersion value. + */ + public Boolean autoUpgradeMinorVersion() { + return this.innerProperties() == null ? null : this.innerProperties().autoUpgradeMinorVersion(); + } + + /** + * Set the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless + * redeployed, even with this property set to true. + * + * @param autoUpgradeMinorVersion the autoUpgradeMinorVersion value to set. + * @return the MachineExtensionUpdate object itself. + */ + public MachineExtensionUpdate withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineExtensionUpdateProperties(); + } + this.innerProperties().withAutoUpgradeMinorVersion(autoUpgradeMinorVersion); + return this; + } + + /** + * Get the settings property: Json formatted public settings for the extension. + * + * @return the settings value. + */ + public Map settings() { + return this.innerProperties() == null ? null : this.innerProperties().settings(); + } + + /** + * Set the settings property: Json formatted public settings for the extension. + * + * @param settings the settings value to set. + * @return the MachineExtensionUpdate object itself. + */ + public MachineExtensionUpdate withSettings(Map settings) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineExtensionUpdateProperties(); + } + this.innerProperties().withSettings(settings); + return this; + } + + /** + * Get the protectedSettings property: The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + * + * @return the protectedSettings value. + */ + public Map protectedSettings() { + return this.innerProperties() == null ? null : this.innerProperties().protectedSettings(); + } + + /** + * Set the protectedSettings property: The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + * + * @param protectedSettings the protectedSettings value to set. + * @return the MachineExtensionUpdate object itself. + */ + public MachineExtensionUpdate withProtectedSettings(Map protectedSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineExtensionUpdateProperties(); + } + this.innerProperties().withProtectedSettings(protectedSettings); return this; } @@ -56,8 +240,8 @@ public MachineExtensionUpdate withTags(Map tags) { @Override public void validate() { super.validate(); - if (properties() != null) { - properties().validate(); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtensionUpgrade.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtensionUpgrade.java new file mode 100644 index 0000000000000..e6948cd70ddcc --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtensionUpgrade.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Describes the Machine Extension Upgrade Properties. */ +@Fluent +public final class MachineExtensionUpgrade { + /* + * Describes the Extension Target Properties. + */ + @JsonProperty(value = "extensionTargets") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map extensionTargets; + + /** Creates an instance of MachineExtensionUpgrade class. */ + public MachineExtensionUpgrade() { + } + + /** + * Get the extensionTargets property: Describes the Extension Target Properties. + * + * @return the extensionTargets value. + */ + public Map extensionTargets() { + return this.extensionTargets; + } + + /** + * Set the extensionTargets property: Describes the Extension Target Properties. + * + * @param extensionTargets the extensionTargets value to set. + * @return the MachineExtensionUpgrade object itself. + */ + public MachineExtensionUpgrade withExtensionTargets(Map extensionTargets) { + this.extensionTargets = extensionTargets; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (extensionTargets() != null) { + extensionTargets() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineInstallPatchesParameters.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineInstallPatchesParameters.java new file mode 100644 index 0000000000000..d61063c4e9b94 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineInstallPatchesParameters.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.hybridcompute.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input for InstallPatches as directly received by the API. */ +@Fluent +public final class MachineInstallPatchesParameters { + /* + * Specifies the maximum amount of time that the operation will run. It must be an ISO 8601-compliant duration + * string such as PT4H (4 hours) + */ + @JsonProperty(value = "maximumDuration", required = true) + private String maximumDuration; + + /* + * Defines when it is acceptable to reboot a VM during a software update operation. + */ + @JsonProperty(value = "rebootSetting", required = true) + private VMGuestPatchRebootSetting rebootSetting; + + /* + * Input for InstallPatches on a Windows VM, as directly received by the API + */ + @JsonProperty(value = "windowsParameters") + private WindowsParameters windowsParameters; + + /* + * Input for InstallPatches on a Linux VM, as directly received by the API + */ + @JsonProperty(value = "linuxParameters") + private LinuxParameters linuxParameters; + + /** Creates an instance of MachineInstallPatchesParameters class. */ + public MachineInstallPatchesParameters() { + } + + /** + * Get the maximumDuration property: Specifies the maximum amount of time that the operation will run. It must be an + * ISO 8601-compliant duration string such as PT4H (4 hours). + * + * @return the maximumDuration value. + */ + public String maximumDuration() { + return this.maximumDuration; + } + + /** + * Set the maximumDuration property: Specifies the maximum amount of time that the operation will run. It must be an + * ISO 8601-compliant duration string such as PT4H (4 hours). + * + * @param maximumDuration the maximumDuration value to set. + * @return the MachineInstallPatchesParameters object itself. + */ + public MachineInstallPatchesParameters withMaximumDuration(String maximumDuration) { + this.maximumDuration = maximumDuration; + return this; + } + + /** + * Get the rebootSetting property: Defines when it is acceptable to reboot a VM during a software update operation. + * + * @return the rebootSetting value. + */ + public VMGuestPatchRebootSetting rebootSetting() { + return this.rebootSetting; + } + + /** + * Set the rebootSetting property: Defines when it is acceptable to reboot a VM during a software update operation. + * + * @param rebootSetting the rebootSetting value to set. + * @return the MachineInstallPatchesParameters object itself. + */ + public MachineInstallPatchesParameters withRebootSetting(VMGuestPatchRebootSetting rebootSetting) { + this.rebootSetting = rebootSetting; + return this; + } + + /** + * Get the windowsParameters property: Input for InstallPatches on a Windows VM, as directly received by the API. + * + * @return the windowsParameters value. + */ + public WindowsParameters windowsParameters() { + return this.windowsParameters; + } + + /** + * Set the windowsParameters property: Input for InstallPatches on a Windows VM, as directly received by the API. + * + * @param windowsParameters the windowsParameters value to set. + * @return the MachineInstallPatchesParameters object itself. + */ + public MachineInstallPatchesParameters withWindowsParameters(WindowsParameters windowsParameters) { + this.windowsParameters = windowsParameters; + return this; + } + + /** + * Get the linuxParameters property: Input for InstallPatches on a Linux VM, as directly received by the API. + * + * @return the linuxParameters value. + */ + public LinuxParameters linuxParameters() { + return this.linuxParameters; + } + + /** + * Set the linuxParameters property: Input for InstallPatches on a Linux VM, as directly received by the API. + * + * @param linuxParameters the linuxParameters value to set. + * @return the MachineInstallPatchesParameters object itself. + */ + public MachineInstallPatchesParameters withLinuxParameters(LinuxParameters linuxParameters) { + this.linuxParameters = linuxParameters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (maximumDuration() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property maximumDuration in model MachineInstallPatchesParameters")); + } + if (rebootSetting() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property rebootSetting in model MachineInstallPatchesParameters")); + } + if (windowsParameters() != null) { + windowsParameters().validate(); + } + if (linuxParameters() != null) { + linuxParameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MachineInstallPatchesParameters.class); +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineInstallPatchesResult.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineInstallPatchesResult.java new file mode 100644 index 0000000000000..220f2760923f6 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineInstallPatchesResult.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.hybridcompute.fluent.models.MachineInstallPatchesResultInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of MachineInstallPatchesResult. */ +public interface MachineInstallPatchesResult { + /** + * Gets the status property: The overall success or failure status of the operation. It remains "InProgress" until + * the operation completes. At that point it will become "Failed", "Succeeded", "Unknown" or + * "CompletedWithWarnings.". + * + * @return the status value. + */ + PatchOperationStatus status(); + + /** + * Gets the installationActivityId property: The activity ID of the operation that produced this result. + * + * @return the installationActivityId value. + */ + String installationActivityId(); + + /** + * Gets the rebootStatus property: The reboot state of the VM following completion of the operation. + * + * @return the rebootStatus value. + */ + VMGuestPatchRebootStatus rebootStatus(); + + /** + * Gets the maintenanceWindowExceeded property: Whether the operation ran out of time before it completed all its + * intended actions. + * + * @return the maintenanceWindowExceeded value. + */ + Boolean maintenanceWindowExceeded(); + + /** + * Gets the excludedPatchCount property: The number of patches that were not installed due to the user blocking + * their installation. + * + * @return the excludedPatchCount value. + */ + Integer excludedPatchCount(); + + /** + * Gets the notSelectedPatchCount property: The number of patches that were detected as available for install, but + * did not meet the operation's criteria. + * + * @return the notSelectedPatchCount value. + */ + Integer notSelectedPatchCount(); + + /** + * Gets the pendingPatchCount property: The number of patches that were identified as meeting the installation + * criteria, but were not able to be installed. Typically this happens when maintenanceWindowExceeded == true. + * + * @return the pendingPatchCount value. + */ + Integer pendingPatchCount(); + + /** + * Gets the installedPatchCount property: The number of patches successfully installed. + * + * @return the installedPatchCount value. + */ + Integer installedPatchCount(); + + /** + * Gets the failedPatchCount property: The number of patches that could not be installed due to some issue. See + * errors for details. + * + * @return the failedPatchCount value. + */ + Integer failedPatchCount(); + + /** + * Gets the startDateTime property: The UTC timestamp when the operation began. + * + * @return the startDateTime value. + */ + OffsetDateTime startDateTime(); + + /** + * Gets the lastModifiedDateTime property: The UTC timestamp when the operation finished. + * + * @return the lastModifiedDateTime value. + */ + OffsetDateTime lastModifiedDateTime(); + + /** + * Gets the startedBy property: Indicates if operation was triggered by user or by platform. + * + * @return the startedBy value. + */ + PatchOperationStartedBy startedBy(); + + /** + * Gets the patchServiceUsed property: Specifies the patch service used for the operation. + * + * @return the patchServiceUsed value. + */ + PatchServiceUsed patchServiceUsed(); + + /** + * Gets the osType property: The operating system type of the machine. + * + * @return the osType value. + */ + OsType osType(); + + /** + * Gets the errorDetails property: The errors that were encountered during execution of the operation. The details + * array contains the list of them. + * + * @return the errorDetails value. + */ + ManagementError errorDetails(); + + /** + * Gets the inner com.azure.resourcemanager.hybridcompute.fluent.models.MachineInstallPatchesResultInner object. + * + * @return the inner object. + */ + MachineInstallPatchesResultInner innerModel(); +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineProperties.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineProperties.java index 44b66c12f682a..1ae7d4f535f8f 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineProperties.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineProperties.java @@ -4,438 +4,232 @@ package com.azure.resourcemanager.hybridcompute.models; -import com.azure.core.annotation.Fluent; import com.azure.core.management.exception.ManagementError; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.resourcemanager.hybridcompute.fluent.models.MachinePropertiesInner; import java.time.OffsetDateTime; import java.util.List; import java.util.Map; -/** Describes the properties of a hybrid machine. */ -@Fluent -public final class MachineProperties { - /* - * Metadata pertaining to the geographic location of the resource. - */ - @JsonProperty(value = "locationData") - private LocationData locationData; - - /* - * Specifies the operating system settings for the hybrid machine. - */ - @JsonProperty(value = "osProfile", access = JsonProperty.Access.WRITE_ONLY) - private OSProfile osProfile; - - /* - * The provisioning state, which only appears in the response. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /* - * The status of the hybrid machine agent. - */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) - private StatusTypes status; - - /* - * The time of the last status change. - */ - @JsonProperty(value = "lastStatusChange", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastStatusChange; - - /* - * Details about the error state. - */ - @JsonProperty(value = "errorDetails", access = JsonProperty.Access.WRITE_ONLY) - private List errorDetails; - - /* - * The hybrid machine agent full version. - */ - @JsonProperty(value = "agentVersion", access = JsonProperty.Access.WRITE_ONLY) - private String agentVersion; - - /* - * Specifies the hybrid machine unique ID. - */ - @JsonProperty(value = "vmId") - private String vmId; - - /* - * Specifies the hybrid machine display name. - */ - @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) - private String displayName; - - /* - * Specifies the hybrid machine FQDN. - */ - @JsonProperty(value = "machineFqdn", access = JsonProperty.Access.WRITE_ONLY) - private String machineFqdn; - - /* - * Public Key that the client provides to be used during initial resource onboarding - */ - @JsonProperty(value = "clientPublicKey") - private String clientPublicKey; - - /* - * The Operating System running on the hybrid machine. - */ - @JsonProperty(value = "osName", access = JsonProperty.Access.WRITE_ONLY) - private String osName; - - /* - * The version of Operating System running on the hybrid machine. - */ - @JsonProperty(value = "osVersion", access = JsonProperty.Access.WRITE_ONLY) - private String osVersion; - - /* - * Specifies the Arc Machine's unique SMBIOS ID - */ - @JsonProperty(value = "vmUuid", access = JsonProperty.Access.WRITE_ONLY) - private String vmUuid; - - /* - * Machine Extensions information - */ - @JsonProperty(value = "extensions") - private List extensions; - - /* - * Specifies the Operating System product SKU. - */ - @JsonProperty(value = "osSku", access = JsonProperty.Access.WRITE_ONLY) - private String osSku; - - /* - * Specifies the Windows domain name. - */ - @JsonProperty(value = "domainName", access = JsonProperty.Access.WRITE_ONLY) - private String domainName; - - /* - * Specifies the AD fully qualified display name. - */ - @JsonProperty(value = "adFqdn", access = JsonProperty.Access.WRITE_ONLY) - private String adFqdn; - - /* - * Specifies the DNS fully qualified display name. +/** An immutable client-side representation of MachineProperties. */ +public interface MachineProperties { + /** + * Gets the locationData property: Metadata pertaining to the geographic location of the resource. + * + * @return the locationData value. */ - @JsonProperty(value = "dnsFqdn", access = JsonProperty.Access.WRITE_ONLY) - private String dnsFqdn; + LocationData locationData(); - /* - * The resource id of the private link scope this machine is assigned to, if any. + /** + * Gets the agentConfiguration property: Configurable properties that the user can set locally via the azcmagent + * config command, or remotely via ARM. + * + * @return the agentConfiguration value. */ - @JsonProperty(value = "privateLinkScopeResourceId") - private String privateLinkScopeResourceId; + AgentConfiguration agentConfiguration(); - /* - * The resource id of the parent cluster (Azure HCI) this machine is assigned to, if any. + /** + * Gets the serviceStatuses property: Statuses of dependent services that are reported back to ARM. + * + * @return the serviceStatuses value. */ - @JsonProperty(value = "parentClusterResourceId") - private String parentClusterResourceId; + ServiceStatuses serviceStatuses(); - /* - * Detected properties from the machine. + /** + * Gets the cloudMetadata property: The metadata of the cloud environment (Azure/GCP/AWS/OCI...). + * + * @return the cloudMetadata value. */ - @JsonProperty(value = "detectedProperties", access = JsonProperty.Access.WRITE_ONLY) - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map detectedProperties; - - /** Creates an instance of MachineProperties class. */ - public MachineProperties() { - } + CloudMetadata cloudMetadata(); /** - * Get the locationData property: Metadata pertaining to the geographic location of the resource. + * Gets the agentUpgrade property: The info of the machine w.r.t Agent Upgrade. * - * @return the locationData value. + * @return the agentUpgrade value. */ - public LocationData locationData() { - return this.locationData; - } + AgentUpgrade agentUpgrade(); /** - * Set the locationData property: Metadata pertaining to the geographic location of the resource. + * Gets the osProfile property: Specifies the operating system settings for the hybrid machine. * - * @param locationData the locationData value to set. - * @return the MachineProperties object itself. + * @return the osProfile value. */ - public MachineProperties withLocationData(LocationData locationData) { - this.locationData = locationData; - return this; - } + OSProfile osProfile(); /** - * Get the osProfile property: Specifies the operating system settings for the hybrid machine. + * Gets the licenseProfile property: Specifies the ESU related properties for a machine. * - * @return the osProfile value. + * @return the licenseProfile value. */ - public OSProfile osProfile() { - return this.osProfile; - } + LicenseProfileMachineInstanceView licenseProfile(); /** - * Get the provisioningState property: The provisioning state, which only appears in the response. + * Gets the provisioningState property: The provisioning state, which only appears in the response. * * @return the provisioningState value. */ - public String provisioningState() { - return this.provisioningState; - } + String provisioningState(); /** - * Get the status property: The status of the hybrid machine agent. + * Gets the status property: The status of the hybrid machine agent. * * @return the status value. */ - public StatusTypes status() { - return this.status; - } + StatusTypes status(); /** - * Get the lastStatusChange property: The time of the last status change. + * Gets the lastStatusChange property: The time of the last status change. * * @return the lastStatusChange value. */ - public OffsetDateTime lastStatusChange() { - return this.lastStatusChange; - } + OffsetDateTime lastStatusChange(); /** - * Get the errorDetails property: Details about the error state. + * Gets the errorDetails property: Details about the error state. * * @return the errorDetails value. */ - public List errorDetails() { - return this.errorDetails; - } + List errorDetails(); /** - * Get the agentVersion property: The hybrid machine agent full version. + * Gets the agentVersion property: The hybrid machine agent full version. * * @return the agentVersion value. */ - public String agentVersion() { - return this.agentVersion; - } + String agentVersion(); /** - * Get the vmId property: Specifies the hybrid machine unique ID. + * Gets the vmId property: Specifies the hybrid machine unique ID. * * @return the vmId value. */ - public String vmId() { - return this.vmId; - } - - /** - * Set the vmId property: Specifies the hybrid machine unique ID. - * - * @param vmId the vmId value to set. - * @return the MachineProperties object itself. - */ - public MachineProperties withVmId(String vmId) { - this.vmId = vmId; - return this; - } + String vmId(); /** - * Get the displayName property: Specifies the hybrid machine display name. + * Gets the displayName property: Specifies the hybrid machine display name. * * @return the displayName value. */ - public String displayName() { - return this.displayName; - } + String displayName(); /** - * Get the machineFqdn property: Specifies the hybrid machine FQDN. + * Gets the machineFqdn property: Specifies the hybrid machine FQDN. * * @return the machineFqdn value. */ - public String machineFqdn() { - return this.machineFqdn; - } + String machineFqdn(); /** - * Get the clientPublicKey property: Public Key that the client provides to be used during initial resource + * Gets the clientPublicKey property: Public Key that the client provides to be used during initial resource * onboarding. * * @return the clientPublicKey value. */ - public String clientPublicKey() { - return this.clientPublicKey; - } + String clientPublicKey(); /** - * Set the clientPublicKey property: Public Key that the client provides to be used during initial resource - * onboarding. - * - * @param clientPublicKey the clientPublicKey value to set. - * @return the MachineProperties object itself. - */ - public MachineProperties withClientPublicKey(String clientPublicKey) { - this.clientPublicKey = clientPublicKey; - return this; - } - - /** - * Get the osName property: The Operating System running on the hybrid machine. + * Gets the osName property: The Operating System running on the hybrid machine. * * @return the osName value. */ - public String osName() { - return this.osName; - } + String osName(); /** - * Get the osVersion property: The version of Operating System running on the hybrid machine. + * Gets the osVersion property: The version of Operating System running on the hybrid machine. * * @return the osVersion value. */ - public String osVersion() { - return this.osVersion; - } + String osVersion(); /** - * Get the vmUuid property: Specifies the Arc Machine's unique SMBIOS ID. + * Gets the osType property: The type of Operating System (windows/linux). * - * @return the vmUuid value. + * @return the osType value. */ - public String vmUuid() { - return this.vmUuid; - } + String osType(); /** - * Get the extensions property: Machine Extensions information. + * Gets the vmUuid property: Specifies the Arc Machine's unique SMBIOS ID. * - * @return the extensions value. + * @return the vmUuid value. */ - public List extensions() { - return this.extensions; - } + String vmUuid(); /** - * Set the extensions property: Machine Extensions information. + * Gets the extensions property: Machine Extensions information (deprecated field). * - * @param extensions the extensions value to set. - * @return the MachineProperties object itself. + * @return the extensions value. */ - public MachineProperties withExtensions(List extensions) { - this.extensions = extensions; - return this; - } + List extensions(); /** - * Get the osSku property: Specifies the Operating System product SKU. + * Gets the osSku property: Specifies the Operating System product SKU. * * @return the osSku value. */ - public String osSku() { - return this.osSku; - } + String osSku(); /** - * Get the domainName property: Specifies the Windows domain name. + * Gets the domainName property: Specifies the Windows domain name. * * @return the domainName value. */ - public String domainName() { - return this.domainName; - } + String domainName(); /** - * Get the adFqdn property: Specifies the AD fully qualified display name. + * Gets the adFqdn property: Specifies the AD fully qualified display name. * * @return the adFqdn value. */ - public String adFqdn() { - return this.adFqdn; - } + String adFqdn(); /** - * Get the dnsFqdn property: Specifies the DNS fully qualified display name. + * Gets the dnsFqdn property: Specifies the DNS fully qualified display name. * * @return the dnsFqdn value. */ - public String dnsFqdn() { - return this.dnsFqdn; - } + String dnsFqdn(); /** - * Get the privateLinkScopeResourceId property: The resource id of the private link scope this machine is assigned + * Gets the privateLinkScopeResourceId property: The resource id of the private link scope this machine is assigned * to, if any. * * @return the privateLinkScopeResourceId value. */ - public String privateLinkScopeResourceId() { - return this.privateLinkScopeResourceId; - } + String privateLinkScopeResourceId(); /** - * Set the privateLinkScopeResourceId property: The resource id of the private link scope this machine is assigned - * to, if any. + * Gets the parentClusterResourceId property: The resource id of the parent cluster (Azure HCI) this machine is + * assigned to, if any. * - * @param privateLinkScopeResourceId the privateLinkScopeResourceId value to set. - * @return the MachineProperties object itself. + * @return the parentClusterResourceId value. */ - public MachineProperties withPrivateLinkScopeResourceId(String privateLinkScopeResourceId) { - this.privateLinkScopeResourceId = privateLinkScopeResourceId; - return this; - } + String parentClusterResourceId(); /** - * Get the parentClusterResourceId property: The resource id of the parent cluster (Azure HCI) this machine is - * assigned to, if any. + * Gets the mssqlDiscovered property: Specifies whether any MS SQL instance is discovered on the machine. * - * @return the parentClusterResourceId value. + * @return the mssqlDiscovered value. */ - public String parentClusterResourceId() { - return this.parentClusterResourceId; - } + String mssqlDiscovered(); /** - * Set the parentClusterResourceId property: The resource id of the parent cluster (Azure HCI) this machine is - * assigned to, if any. + * Gets the detectedProperties property: Detected properties from the machine. * - * @param parentClusterResourceId the parentClusterResourceId value to set. - * @return the MachineProperties object itself. + * @return the detectedProperties value. */ - public MachineProperties withParentClusterResourceId(String parentClusterResourceId) { - this.parentClusterResourceId = parentClusterResourceId; - return this; - } + Map detectedProperties(); /** - * Get the detectedProperties property: Detected properties from the machine. + * Gets the networkProfile property: Information about the network the machine is on. * - * @return the detectedProperties value. + * @return the networkProfile value. */ - public Map detectedProperties() { - return this.detectedProperties; - } + NetworkProfile networkProfile(); /** - * Validates the instance. + * Gets the inner com.azure.resourcemanager.hybridcompute.fluent.models.MachinePropertiesInner object. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the inner object. */ - public void validate() { - if (locationData() != null) { - locationData().validate(); - } - if (osProfile() != null) { - osProfile().validate(); - } - if (extensions() != null) { - extensions().forEach(e -> e.validate()); - } - } + MachinePropertiesInner innerModel(); } diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineRunCommand.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineRunCommand.java new file mode 100644 index 0000000000000..f967feecc519f --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineRunCommand.java @@ -0,0 +1,483 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridcompute.fluent.models.MachineRunCommandInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of MachineRunCommand. */ +public interface MachineRunCommand { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the source property: The source of the run command script. + * + * @return the source value. + */ + MachineRunCommandScriptSource source(); + + /** + * Gets the parameters property: The parameters used by the script. + * + * @return the parameters value. + */ + List parameters(); + + /** + * Gets the protectedParameters property: The parameters used by the script. + * + * @return the protectedParameters value. + */ + List protectedParameters(); + + /** + * Gets the asyncExecution property: Optional. If set to true, provisioning will complete as soon as script starts + * and will not wait for script to complete. + * + * @return the asyncExecution value. + */ + Boolean asyncExecution(); + + /** + * Gets the runAsUser property: Specifies the user account on the machine when executing the run command. + * + * @return the runAsUser value. + */ + String runAsUser(); + + /** + * Gets the runAsPassword property: Specifies the user account password on the machine when executing the run + * command. + * + * @return the runAsPassword value. + */ + String runAsPassword(); + + /** + * Gets the timeoutInSeconds property: The timeout in seconds to execute the run command. + * + * @return the timeoutInSeconds value. + */ + Integer timeoutInSeconds(); + + /** + * Gets the outputBlobUri property: Specifies the Azure storage blob where script output stream will be uploaded. + * Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the + * blob. Refer outputBlobManagedIdentity parameter. + * + * @return the outputBlobUri value. + */ + String outputBlobUri(); + + /** + * Gets the errorBlobUri property: Specifies the Azure storage blob where script error stream will be uploaded. Use + * a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. + * Refer errorBlobManagedIdentity parameter. + * + * @return the errorBlobUri value. + */ + String errorBlobUri(); + + /** + * Gets the outputBlobManagedIdentity property: User-assigned managed identity that has access to outputBlobUri + * storage blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been given + * access to blob's container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned + * identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer + * https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. + * + * @return the outputBlobManagedIdentity value. + */ + RunCommandManagedIdentity outputBlobManagedIdentity(); + + /** + * Gets the errorBlobManagedIdentity property: User-assigned managed identity that has access to errorBlobUri + * storage blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been given + * access to blob's container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned + * identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer + * https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. + * + * @return the errorBlobManagedIdentity value. + */ + RunCommandManagedIdentity errorBlobManagedIdentity(); + + /** + * Gets the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the instanceView property: The machine run command instance view. + * + * @return the instanceView value. + */ + MachineRunCommandInstanceView instanceView(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.hybridcompute.fluent.models.MachineRunCommandInner object. + * + * @return the inner object. + */ + MachineRunCommandInner innerModel(); + + /** The entirety of the MachineRunCommand definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreate { + } + + /** The MachineRunCommand definition stages. */ + interface DefinitionStages { + /** The first stage of the MachineRunCommand definition. */ + interface Blank extends WithLocation { + } + + /** The stage of the MachineRunCommand definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + + /** The stage of the MachineRunCommand definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, machineName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @return the next definition stage. + */ + WithCreate withExistingMachine(String resourceGroupName, String machineName); + } + + /** + * The stage of the MachineRunCommand definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithSource, + DefinitionStages.WithParameters, + DefinitionStages.WithProtectedParameters, + DefinitionStages.WithAsyncExecution, + DefinitionStages.WithRunAsUser, + DefinitionStages.WithRunAsPassword, + DefinitionStages.WithTimeoutInSeconds, + DefinitionStages.WithOutputBlobUri, + DefinitionStages.WithErrorBlobUri, + DefinitionStages.WithOutputBlobManagedIdentity, + DefinitionStages.WithErrorBlobManagedIdentity { + /** + * Executes the create request. + * + * @return the created resource. + */ + MachineRunCommand create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + MachineRunCommand create(Context context); + } + + /** The stage of the MachineRunCommand definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** The stage of the MachineRunCommand definition allowing to specify source. */ + interface WithSource { + /** + * Specifies the source property: The source of the run command script.. + * + * @param source The source of the run command script. + * @return the next definition stage. + */ + WithCreate withSource(MachineRunCommandScriptSource source); + } + + /** The stage of the MachineRunCommand definition allowing to specify parameters. */ + interface WithParameters { + /** + * Specifies the parameters property: The parameters used by the script.. + * + * @param parameters The parameters used by the script. + * @return the next definition stage. + */ + WithCreate withParameters(List parameters); + } + + /** The stage of the MachineRunCommand definition allowing to specify protectedParameters. */ + interface WithProtectedParameters { + /** + * Specifies the protectedParameters property: The parameters used by the script.. + * + * @param protectedParameters The parameters used by the script. + * @return the next definition stage. + */ + WithCreate withProtectedParameters(List protectedParameters); + } + + /** The stage of the MachineRunCommand definition allowing to specify asyncExecution. */ + interface WithAsyncExecution { + /** + * Specifies the asyncExecution property: Optional. If set to true, provisioning will complete as soon as + * script starts and will not wait for script to complete.. + * + * @param asyncExecution Optional. If set to true, provisioning will complete as soon as script starts and + * will not wait for script to complete. + * @return the next definition stage. + */ + WithCreate withAsyncExecution(Boolean asyncExecution); + } + + /** The stage of the MachineRunCommand definition allowing to specify runAsUser. */ + interface WithRunAsUser { + /** + * Specifies the runAsUser property: Specifies the user account on the machine when executing the run + * command.. + * + * @param runAsUser Specifies the user account on the machine when executing the run command. + * @return the next definition stage. + */ + WithCreate withRunAsUser(String runAsUser); + } + + /** The stage of the MachineRunCommand definition allowing to specify runAsPassword. */ + interface WithRunAsPassword { + /** + * Specifies the runAsPassword property: Specifies the user account password on the machine when executing + * the run command.. + * + * @param runAsPassword Specifies the user account password on the machine when executing the run command. + * @return the next definition stage. + */ + WithCreate withRunAsPassword(String runAsPassword); + } + + /** The stage of the MachineRunCommand definition allowing to specify timeoutInSeconds. */ + interface WithTimeoutInSeconds { + /** + * Specifies the timeoutInSeconds property: The timeout in seconds to execute the run command.. + * + * @param timeoutInSeconds The timeout in seconds to execute the run command. + * @return the next definition stage. + */ + WithCreate withTimeoutInSeconds(Integer timeoutInSeconds); + } + + /** The stage of the MachineRunCommand definition allowing to specify outputBlobUri. */ + interface WithOutputBlobUri { + /** + * Specifies the outputBlobUri property: Specifies the Azure storage blob where script output stream will be + * uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM + * access to the blob. Refer outputBlobManagedIdentity parameter. . + * + * @param outputBlobUri Specifies the Azure storage blob where script output stream will be uploaded. Use a + * SAS URI with read, append, create, write access OR use managed identity to provide the VM access to + * the blob. Refer outputBlobManagedIdentity parameter. + * @return the next definition stage. + */ + WithCreate withOutputBlobUri(String outputBlobUri); + } + + /** The stage of the MachineRunCommand definition allowing to specify errorBlobUri. */ + interface WithErrorBlobUri { + /** + * Specifies the errorBlobUri property: Specifies the Azure storage blob where script error stream will be + * uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM + * access to the blob. Refer errorBlobManagedIdentity parameter.. + * + * @param errorBlobUri Specifies the Azure storage blob where script error stream will be uploaded. Use a + * SAS URI with read, append, create, write access OR use managed identity to provide the VM access to + * the blob. Refer errorBlobManagedIdentity parameter. + * @return the next definition stage. + */ + WithCreate withErrorBlobUri(String errorBlobUri); + } + + /** The stage of the MachineRunCommand definition allowing to specify outputBlobManagedIdentity. */ + interface WithOutputBlobManagedIdentity { + /** + * Specifies the outputBlobManagedIdentity property: User-assigned managed identity that has access to + * outputBlobUri storage blob. Use an empty object in case of system-assigned identity. Make sure managed + * identity has been given access to blob's container with 'Storage Blob Data Contributor' role assignment. + * In case of user-assigned identity, make sure you add it under VM's identity. For more info on managed + * identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged . + * + * @param outputBlobManagedIdentity User-assigned managed identity that has access to outputBlobUri storage + * blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been + * given access to blob's container with 'Storage Blob Data Contributor' role assignment. In case of + * user-assigned identity, make sure you add it under VM's identity. For more info on managed identity + * and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. + * @return the next definition stage. + */ + WithCreate withOutputBlobManagedIdentity(RunCommandManagedIdentity outputBlobManagedIdentity); + } + + /** The stage of the MachineRunCommand definition allowing to specify errorBlobManagedIdentity. */ + interface WithErrorBlobManagedIdentity { + /** + * Specifies the errorBlobManagedIdentity property: User-assigned managed identity that has access to + * errorBlobUri storage blob. Use an empty object in case of system-assigned identity. Make sure managed + * identity has been given access to blob's container with 'Storage Blob Data Contributor' role assignment. + * In case of user-assigned identity, make sure you add it under VM's identity. For more info on managed + * identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged . + * + * @param errorBlobManagedIdentity User-assigned managed identity that has access to errorBlobUri storage + * blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been + * given access to blob's container with 'Storage Blob Data Contributor' role assignment. In case of + * user-assigned identity, make sure you add it under VM's identity. For more info on managed identity + * and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. + * @return the next definition stage. + */ + WithCreate withErrorBlobManagedIdentity(RunCommandManagedIdentity errorBlobManagedIdentity); + } + } + + /** + * Begins update for the MachineRunCommand resource. + * + * @return the stage of resource update. + */ + MachineRunCommand.Update update(); + + /** The template for MachineRunCommand update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + MachineRunCommand apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + MachineRunCommand apply(Context context); + } + + /** The MachineRunCommand update stages. */ + interface UpdateStages { + /** The stage of the MachineRunCommand update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + MachineRunCommand refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + MachineRunCommand refresh(Context context); +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineRunCommandInstanceView.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineRunCommandInstanceView.java new file mode 100644 index 0000000000000..f158baaaf4123 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineRunCommandInstanceView.java @@ -0,0 +1,237 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** The instance view of a machine run command. */ +@Fluent +public final class MachineRunCommandInstanceView { + /* + * Script execution status. + */ + @JsonProperty(value = "executionState") + private ExecutionState executionState; + + /* + * Communicate script configuration errors or execution messages. + */ + @JsonProperty(value = "executionMessage") + private String executionMessage; + + /* + * Exit code returned from script execution. + */ + @JsonProperty(value = "exitCode") + private Integer exitCode; + + /* + * Script output stream. + */ + @JsonProperty(value = "output") + private String output; + + /* + * Script error stream. + */ + @JsonProperty(value = "error") + private String error; + + /* + * Script start time. + */ + @JsonProperty(value = "startTime") + private OffsetDateTime startTime; + + /* + * Script end time. + */ + @JsonProperty(value = "endTime") + private OffsetDateTime endTime; + + /* + * The status information. + */ + @JsonProperty(value = "statuses") + private List statuses; + + /** Creates an instance of MachineRunCommandInstanceView class. */ + public MachineRunCommandInstanceView() { + } + + /** + * Get the executionState property: Script execution status. + * + * @return the executionState value. + */ + public ExecutionState executionState() { + return this.executionState; + } + + /** + * Set the executionState property: Script execution status. + * + * @param executionState the executionState value to set. + * @return the MachineRunCommandInstanceView object itself. + */ + public MachineRunCommandInstanceView withExecutionState(ExecutionState executionState) { + this.executionState = executionState; + return this; + } + + /** + * Get the executionMessage property: Communicate script configuration errors or execution messages. + * + * @return the executionMessage value. + */ + public String executionMessage() { + return this.executionMessage; + } + + /** + * Set the executionMessage property: Communicate script configuration errors or execution messages. + * + * @param executionMessage the executionMessage value to set. + * @return the MachineRunCommandInstanceView object itself. + */ + public MachineRunCommandInstanceView withExecutionMessage(String executionMessage) { + this.executionMessage = executionMessage; + return this; + } + + /** + * Get the exitCode property: Exit code returned from script execution. + * + * @return the exitCode value. + */ + public Integer exitCode() { + return this.exitCode; + } + + /** + * Set the exitCode property: Exit code returned from script execution. + * + * @param exitCode the exitCode value to set. + * @return the MachineRunCommandInstanceView object itself. + */ + public MachineRunCommandInstanceView withExitCode(Integer exitCode) { + this.exitCode = exitCode; + return this; + } + + /** + * Get the output property: Script output stream. + * + * @return the output value. + */ + public String output() { + return this.output; + } + + /** + * Set the output property: Script output stream. + * + * @param output the output value to set. + * @return the MachineRunCommandInstanceView object itself. + */ + public MachineRunCommandInstanceView withOutput(String output) { + this.output = output; + return this; + } + + /** + * Get the error property: Script error stream. + * + * @return the error value. + */ + public String error() { + return this.error; + } + + /** + * Set the error property: Script error stream. + * + * @param error the error value to set. + * @return the MachineRunCommandInstanceView object itself. + */ + public MachineRunCommandInstanceView withError(String error) { + this.error = error; + return this; + } + + /** + * Get the startTime property: Script start time. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime property: Script start time. + * + * @param startTime the startTime value to set. + * @return the MachineRunCommandInstanceView object itself. + */ + public MachineRunCommandInstanceView withStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the endTime property: Script end time. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Set the endTime property: Script end time. + * + * @param endTime the endTime value to set. + * @return the MachineRunCommandInstanceView object itself. + */ + public MachineRunCommandInstanceView withEndTime(OffsetDateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get the statuses property: The status information. + * + * @return the statuses value. + */ + public List statuses() { + return this.statuses; + } + + /** + * Set the statuses property: The status information. + * + * @param statuses the statuses value to set. + * @return the MachineRunCommandInstanceView object itself. + */ + public MachineRunCommandInstanceView withStatuses(List statuses) { + this.statuses = statuses; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (statuses() != null) { + statuses().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineRunCommandScriptSource.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineRunCommandScriptSource.java new file mode 100644 index 0000000000000..8a52712085647 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineRunCommandScriptSource.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the script sources for run command. Use only one of script, scriptUri, commandId. */ +@Fluent +public final class MachineRunCommandScriptSource { + /* + * Specifies the script content to be executed on the machine. + */ + @JsonProperty(value = "script") + private String script; + + /* + * Specifies the script download location. It can be either SAS URI of an Azure storage blob with read access or + * public URI. + */ + @JsonProperty(value = "scriptUri") + private String scriptUri; + + /* + * Specifies the commandId of predefined built-in script. + */ + @JsonProperty(value = "commandId") + private String commandId; + + /* + * User-assigned managed identity that has access to scriptUri in case of Azure storage blob. Use an empty object + * in case of system-assigned identity. Make sure the Azure storage blob exists, and managed identity has been + * given access to blob's container with 'Storage Blob Data Reader' role assignment. In case of user-assigned + * identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer + * https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. + */ + @JsonProperty(value = "scriptUriManagedIdentity") + private RunCommandManagedIdentity scriptUriManagedIdentity; + + /** Creates an instance of MachineRunCommandScriptSource class. */ + public MachineRunCommandScriptSource() { + } + + /** + * Get the script property: Specifies the script content to be executed on the machine. + * + * @return the script value. + */ + public String script() { + return this.script; + } + + /** + * Set the script property: Specifies the script content to be executed on the machine. + * + * @param script the script value to set. + * @return the MachineRunCommandScriptSource object itself. + */ + public MachineRunCommandScriptSource withScript(String script) { + this.script = script; + return this; + } + + /** + * Get the scriptUri property: Specifies the script download location. It can be either SAS URI of an Azure storage + * blob with read access or public URI. + * + * @return the scriptUri value. + */ + public String scriptUri() { + return this.scriptUri; + } + + /** + * Set the scriptUri property: Specifies the script download location. It can be either SAS URI of an Azure storage + * blob with read access or public URI. + * + * @param scriptUri the scriptUri value to set. + * @return the MachineRunCommandScriptSource object itself. + */ + public MachineRunCommandScriptSource withScriptUri(String scriptUri) { + this.scriptUri = scriptUri; + return this; + } + + /** + * Get the commandId property: Specifies the commandId of predefined built-in script. + * + * @return the commandId value. + */ + public String commandId() { + return this.commandId; + } + + /** + * Set the commandId property: Specifies the commandId of predefined built-in script. + * + * @param commandId the commandId value to set. + * @return the MachineRunCommandScriptSource object itself. + */ + public MachineRunCommandScriptSource withCommandId(String commandId) { + this.commandId = commandId; + return this; + } + + /** + * Get the scriptUriManagedIdentity property: User-assigned managed identity that has access to scriptUri in case of + * Azure storage blob. Use an empty object in case of system-assigned identity. Make sure the Azure storage blob + * exists, and managed identity has been given access to blob's container with 'Storage Blob Data Reader' role + * assignment. In case of user-assigned identity, make sure you add it under VM's identity. For more info on managed + * identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. + * + * @return the scriptUriManagedIdentity value. + */ + public RunCommandManagedIdentity scriptUriManagedIdentity() { + return this.scriptUriManagedIdentity; + } + + /** + * Set the scriptUriManagedIdentity property: User-assigned managed identity that has access to scriptUri in case of + * Azure storage blob. Use an empty object in case of system-assigned identity. Make sure the Azure storage blob + * exists, and managed identity has been given access to blob's container with 'Storage Blob Data Reader' role + * assignment. In case of user-assigned identity, make sure you add it under VM's identity. For more info on managed + * identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. + * + * @param scriptUriManagedIdentity the scriptUriManagedIdentity value to set. + * @return the MachineRunCommandScriptSource object itself. + */ + public MachineRunCommandScriptSource withScriptUriManagedIdentity( + RunCommandManagedIdentity scriptUriManagedIdentity) { + this.scriptUriManagedIdentity = scriptUriManagedIdentity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (scriptUriManagedIdentity() != null) { + scriptUriManagedIdentity().validate(); + } + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineRunCommandUpdate.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineRunCommandUpdate.java new file mode 100644 index 0000000000000..fbe3138d7088a --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineRunCommandUpdate.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.hybridcompute.models; + +import com.azure.core.annotation.Fluent; +import java.util.Map; + +/** Describes a Machine Extension Update. */ +@Fluent +public final class MachineRunCommandUpdate extends ResourceUpdate { + /** Creates an instance of MachineRunCommandUpdate class. */ + public MachineRunCommandUpdate() { + } + + /** {@inheritDoc} */ + @Override + public MachineRunCommandUpdate withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineRunCommands.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineRunCommands.java new file mode 100644 index 0000000000000..cc61fb9ba82c0 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineRunCommands.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of MachineRunCommands. */ +public interface MachineRunCommands { + /** + * The operation to delete a run command. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param runCommandName The name of the run command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String machineName, String runCommandName); + + /** + * The operation to delete a run command. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param runCommandName The name of the run command. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String machineName, String runCommandName, Context context); + + /** + * The operation to get a run command. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param runCommandName The name of the run command. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Run Command along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String machineName, String runCommandName, Context context); + + /** + * The operation to get a run command. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param runCommandName The name of the run command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Run Command. + */ + MachineRunCommand get(String resourceGroupName, String machineName, String runCommandName); + + /** + * The operation to get all the run commands of a non-Azure machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the Run Commands List Result as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String machineName); + + /** + * The operation to get all the run commands of a non-Azure machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the Run Commands List Result as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String machineName, String expand, Context context); + + /** + * The operation to get a run command. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Run Command along with {@link Response}. + */ + MachineRunCommand getById(String id); + + /** + * The operation to get a run command. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Run Command along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * The operation to delete a run command. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * The operation to delete a run command. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new MachineRunCommand resource. + * + * @param name resource name. + * @return the first stage of the new MachineRunCommand definition. + */ + MachineRunCommand.DefinitionStages.Blank define(String name); +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineRunCommandsListResult.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineRunCommandsListResult.java new file mode 100644 index 0000000000000..b0d0eaacd0537 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineRunCommandsListResult.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.hybridcompute.fluent.models.MachineRunCommandInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes the Run Commands List Result. */ +@Fluent +public final class MachineRunCommandsListResult { + /* + * The list of run commands + */ + @JsonProperty(value = "value") + private List value; + + /* + * The uri to fetch the next page of run commands. Call ListNext() with this to fetch the next page of run + * commands. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of MachineRunCommandsListResult class. */ + public MachineRunCommandsListResult() { + } + + /** + * Get the value property: The list of run commands. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of run commands. + * + * @param value the value value to set. + * @return the MachineRunCommandsListResult object itself. + */ + public MachineRunCommandsListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The uri to fetch the next page of run commands. Call ListNext() with this to fetch the + * next page of run commands. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The uri to fetch the next page of run commands. Call ListNext() with this to fetch the + * next page of run commands. + * + * @param nextLink the nextLink value to set. + * @return the MachineRunCommandsListResult object itself. + */ + public MachineRunCommandsListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineUpdate.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineUpdate.java index 74d60c9cac345..f7bff12719a77 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineUpdate.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineUpdate.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.hybridcompute.models; import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.hybridcompute.fluent.models.MachineUpdateProperties; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; @@ -17,11 +18,17 @@ public final class MachineUpdate extends ResourceUpdate { @JsonProperty(value = "identity") private Identity identity; + /* + * Indicates which kind of Arc machine placement on-premises, such as HCI, SCVMM or VMware etc. + */ + @JsonProperty(value = "kind") + private ArcKindEnum kind; + /* * Hybrid Compute Machine properties */ @JsonProperty(value = "properties") - private MachineUpdateProperties properties; + private MachineUpdateProperties innerProperties; /** Creates an instance of MachineUpdate class. */ public MachineUpdate() { @@ -48,25 +55,36 @@ public MachineUpdate withIdentity(Identity identity) { } /** - * Get the properties property: Hybrid Compute Machine properties. + * Get the kind property: Indicates which kind of Arc machine placement on-premises, such as HCI, SCVMM or VMware + * etc. * - * @return the properties value. + * @return the kind value. */ - public MachineUpdateProperties properties() { - return this.properties; + public ArcKindEnum kind() { + return this.kind; } /** - * Set the properties property: Hybrid Compute Machine properties. + * Set the kind property: Indicates which kind of Arc machine placement on-premises, such as HCI, SCVMM or VMware + * etc. * - * @param properties the properties value to set. + * @param kind the kind value to set. * @return the MachineUpdate object itself. */ - public MachineUpdate withProperties(MachineUpdateProperties properties) { - this.properties = properties; + public MachineUpdate withKind(ArcKindEnum kind) { + this.kind = kind; return this; } + /** + * Get the innerProperties property: Hybrid Compute Machine properties. + * + * @return the innerProperties value. + */ + private MachineUpdateProperties innerProperties() { + return this.innerProperties; + } + /** {@inheritDoc} */ @Override public MachineUpdate withTags(Map tags) { @@ -74,6 +92,148 @@ public MachineUpdate withTags(Map tags) { return this; } + /** + * Get the locationData property: Metadata pertaining to the geographic location of the resource. + * + * @return the locationData value. + */ + public LocationData locationData() { + return this.innerProperties() == null ? null : this.innerProperties().locationData(); + } + + /** + * Set the locationData property: Metadata pertaining to the geographic location of the resource. + * + * @param locationData the locationData value to set. + * @return the MachineUpdate object itself. + */ + public MachineUpdate withLocationData(LocationData locationData) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineUpdateProperties(); + } + this.innerProperties().withLocationData(locationData); + return this; + } + + /** + * Get the osProfile property: Specifies the operating system settings for the hybrid machine. + * + * @return the osProfile value. + */ + public OSProfile osProfile() { + return this.innerProperties() == null ? null : this.innerProperties().osProfile(); + } + + /** + * Set the osProfile property: Specifies the operating system settings for the hybrid machine. + * + * @param osProfile the osProfile value to set. + * @return the MachineUpdate object itself. + */ + public MachineUpdate withOsProfile(OSProfile osProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineUpdateProperties(); + } + this.innerProperties().withOsProfile(osProfile); + return this; + } + + /** + * Get the cloudMetadata property: The metadata of the cloud environment (Azure/GCP/AWS/OCI...). + * + * @return the cloudMetadata value. + */ + public CloudMetadata cloudMetadata() { + return this.innerProperties() == null ? null : this.innerProperties().cloudMetadata(); + } + + /** + * Set the cloudMetadata property: The metadata of the cloud environment (Azure/GCP/AWS/OCI...). + * + * @param cloudMetadata the cloudMetadata value to set. + * @return the MachineUpdate object itself. + */ + public MachineUpdate withCloudMetadata(CloudMetadata cloudMetadata) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineUpdateProperties(); + } + this.innerProperties().withCloudMetadata(cloudMetadata); + return this; + } + + /** + * Get the agentUpgrade property: The info of the machine w.r.t Agent Upgrade. + * + * @return the agentUpgrade value. + */ + public AgentUpgrade agentUpgrade() { + return this.innerProperties() == null ? null : this.innerProperties().agentUpgrade(); + } + + /** + * Set the agentUpgrade property: The info of the machine w.r.t Agent Upgrade. + * + * @param agentUpgrade the agentUpgrade value to set. + * @return the MachineUpdate object itself. + */ + public MachineUpdate withAgentUpgrade(AgentUpgrade agentUpgrade) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineUpdateProperties(); + } + this.innerProperties().withAgentUpgrade(agentUpgrade); + return this; + } + + /** + * Get the parentClusterResourceId property: The resource id of the parent cluster (Azure HCI) this machine is + * assigned to, if any. + * + * @return the parentClusterResourceId value. + */ + public String parentClusterResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().parentClusterResourceId(); + } + + /** + * Set the parentClusterResourceId property: The resource id of the parent cluster (Azure HCI) this machine is + * assigned to, if any. + * + * @param parentClusterResourceId the parentClusterResourceId value to set. + * @return the MachineUpdate object itself. + */ + public MachineUpdate withParentClusterResourceId(String parentClusterResourceId) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineUpdateProperties(); + } + this.innerProperties().withParentClusterResourceId(parentClusterResourceId); + return this; + } + + /** + * Get the privateLinkScopeResourceId property: The resource id of the private link scope this machine is assigned + * to, if any. + * + * @return the privateLinkScopeResourceId value. + */ + public String privateLinkScopeResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().privateLinkScopeResourceId(); + } + + /** + * Set the privateLinkScopeResourceId property: The resource id of the private link scope this machine is assigned + * to, if any. + * + * @param privateLinkScopeResourceId the privateLinkScopeResourceId value to set. + * @return the MachineUpdate object itself. + */ + public MachineUpdate withPrivateLinkScopeResourceId(String privateLinkScopeResourceId) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineUpdateProperties(); + } + this.innerProperties().withPrivateLinkScopeResourceId(privateLinkScopeResourceId); + return this; + } + /** * Validates the instance. * @@ -85,8 +245,8 @@ public void validate() { if (identity() != null) { identity().validate(); } - if (properties() != null) { - properties().validate(); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/Machines.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/Machines.java index ff4f81343e525..f18538717e4af 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/Machines.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/Machines.java @@ -11,7 +11,7 @@ /** Resource collection API of Machines. */ public interface Machines { /** - * The operation to remove a hybrid machine identity in Azure. + * The operation to delete a hybrid machine. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param machineName The name of the hybrid machine. @@ -24,7 +24,7 @@ public interface Machines { Response deleteByResourceGroupWithResponse(String resourceGroupName, String machineName, Context context); /** - * The operation to remove a hybrid machine identity in Azure. + * The operation to delete a hybrid machine. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param machineName The name of the hybrid machine. @@ -61,6 +61,60 @@ Response getByResourceGroupWithResponse( */ Machine getByResourceGroup(String resourceGroupName, String machineName); + /** + * The operation to assess patches on a hybrid machine identity in Azure. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the properties of an AssessPatches result. + */ + MachineAssessPatchesResult assessPatches(String resourceGroupName, String name); + + /** + * The operation to assess patches on a hybrid machine identity in Azure. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the properties of an AssessPatches result. + */ + MachineAssessPatchesResult assessPatches(String resourceGroupName, String name, Context context); + + /** + * The operation to install patches on a hybrid machine identity in Azure. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @param installPatchesInput Input for InstallPatches as directly received by the API. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result summary of an installation operation. + */ + MachineInstallPatchesResult installPatches( + String resourceGroupName, String name, MachineInstallPatchesParameters installPatchesInput); + + /** + * The operation to install patches on a hybrid machine identity in Azure. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @param installPatchesInput Input for InstallPatches as directly received by the API. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result summary of an installation operation. + */ + MachineInstallPatchesResult installPatches( + String resourceGroupName, String name, MachineInstallPatchesParameters installPatchesInput, Context context); + /** * Lists all the hybrid machines in the specified resource group. Use the nextLink property in the response to get * the next page of hybrid machines. @@ -78,13 +132,14 @@ Response getByResourceGroupWithResponse( * the next page of hybrid machines. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param expand Expands referenced resources. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the List hybrid machine operation response as paginated response with {@link PagedIterable}. */ - PagedIterable listByResourceGroup(String resourceGroupName, Context context); + PagedIterable listByResourceGroup(String resourceGroupName, String expand, Context context); /** * Lists all the hybrid machines in the specified subscription. Use the nextLink property in the response to get the diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/NetworkInterface.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/NetworkInterface.java new file mode 100644 index 0000000000000..45ca31d40b88d --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/NetworkInterface.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a network interface. */ +@Fluent +public final class NetworkInterface { + /* + * The list of IP addresses in this interface. + */ + @JsonProperty(value = "ipAddresses") + private List ipAddresses; + + /** Creates an instance of NetworkInterface class. */ + public NetworkInterface() { + } + + /** + * Get the ipAddresses property: The list of IP addresses in this interface. + * + * @return the ipAddresses value. + */ + public List ipAddresses() { + return this.ipAddresses; + } + + /** + * Set the ipAddresses property: The list of IP addresses in this interface. + * + * @param ipAddresses the ipAddresses value to set. + * @return the NetworkInterface object itself. + */ + public NetworkInterface withIpAddresses(List ipAddresses) { + this.ipAddresses = ipAddresses; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ipAddresses() != null) { + ipAddresses().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/NetworkProfile.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/NetworkProfile.java new file mode 100644 index 0000000000000..d930f090cb4d2 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/NetworkProfile.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.hybridcompute.models; + +import com.azure.resourcemanager.hybridcompute.fluent.models.NetworkProfileInner; +import java.util.List; + +/** An immutable client-side representation of NetworkProfile. */ +public interface NetworkProfile { + /** + * Gets the networkInterfaces property: The list of network interfaces. + * + * @return the networkInterfaces value. + */ + List networkInterfaces(); + + /** + * Gets the inner com.azure.resourcemanager.hybridcompute.fluent.models.NetworkProfileInner object. + * + * @return the inner object. + */ + NetworkProfileInner innerModel(); +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/NetworkProfiles.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/NetworkProfiles.java new file mode 100644 index 0000000000000..5528756cb9302 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/NetworkProfiles.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.hybridcompute.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of NetworkProfiles. */ +public interface NetworkProfiles { + /** + * The operation to get network information of hybrid machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the network information on this machine along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String machineName, Context context); + + /** + * The operation to get network information of hybrid machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the network information on this machine. + */ + NetworkProfile get(String resourceGroupName, String machineName); +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/OSProfile.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/OSProfile.java index d56ede1bf09d3..13fc8f1552b92 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/OSProfile.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/OSProfile.java @@ -4,11 +4,11 @@ package com.azure.resourcemanager.hybridcompute.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; /** Specifies the operating system settings for the hybrid machine. */ -@Immutable +@Fluent public final class OSProfile { /* * Specifies the host OS name of the hybrid machine. @@ -16,6 +16,18 @@ public final class OSProfile { @JsonProperty(value = "computerName", access = JsonProperty.Access.WRITE_ONLY) private String computerName; + /* + * Specifies the windows configuration for update management. + */ + @JsonProperty(value = "windowsConfiguration") + private OSProfileWindowsConfiguration windowsConfiguration; + + /* + * Specifies the linux configuration for update management. + */ + @JsonProperty(value = "linuxConfiguration") + private OSProfileLinuxConfiguration linuxConfiguration; + /** Creates an instance of OSProfile class. */ public OSProfile() { } @@ -29,11 +41,57 @@ public String computerName() { return this.computerName; } + /** + * Get the windowsConfiguration property: Specifies the windows configuration for update management. + * + * @return the windowsConfiguration value. + */ + public OSProfileWindowsConfiguration windowsConfiguration() { + return this.windowsConfiguration; + } + + /** + * Set the windowsConfiguration property: Specifies the windows configuration for update management. + * + * @param windowsConfiguration the windowsConfiguration value to set. + * @return the OSProfile object itself. + */ + public OSProfile withWindowsConfiguration(OSProfileWindowsConfiguration windowsConfiguration) { + this.windowsConfiguration = windowsConfiguration; + return this; + } + + /** + * Get the linuxConfiguration property: Specifies the linux configuration for update management. + * + * @return the linuxConfiguration value. + */ + public OSProfileLinuxConfiguration linuxConfiguration() { + return this.linuxConfiguration; + } + + /** + * Set the linuxConfiguration property: Specifies the linux configuration for update management. + * + * @param linuxConfiguration the linuxConfiguration value to set. + * @return the OSProfile object itself. + */ + public OSProfile withLinuxConfiguration(OSProfileLinuxConfiguration linuxConfiguration) { + this.linuxConfiguration = linuxConfiguration; + return this; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (windowsConfiguration() != null) { + windowsConfiguration().validate(); + } + if (linuxConfiguration() != null) { + linuxConfiguration().validate(); + } } } diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/OSProfileLinuxConfiguration.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/OSProfileLinuxConfiguration.java new file mode 100644 index 0000000000000..a0e71ea90fa39 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/OSProfileLinuxConfiguration.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.hybridcompute.fluent.models.PatchSettings; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Specifies the linux configuration for update management. */ +@Fluent +public final class OSProfileLinuxConfiguration { + /* + * Specifies the patch settings. + */ + @JsonProperty(value = "patchSettings") + private PatchSettings innerPatchSettings; + + /** Creates an instance of OSProfileLinuxConfiguration class. */ + public OSProfileLinuxConfiguration() { + } + + /** + * Get the innerPatchSettings property: Specifies the patch settings. + * + * @return the innerPatchSettings value. + */ + private PatchSettings innerPatchSettings() { + return this.innerPatchSettings; + } + + /** + * Get the assessmentMode property: Specifies the assessment mode. + * + * @return the assessmentMode value. + */ + public AssessmentModeTypes assessmentMode() { + return this.innerPatchSettings() == null ? null : this.innerPatchSettings().assessmentMode(); + } + + /** + * Set the assessmentMode property: Specifies the assessment mode. + * + * @param assessmentMode the assessmentMode value to set. + * @return the OSProfileLinuxConfiguration object itself. + */ + public OSProfileLinuxConfiguration withAssessmentMode(AssessmentModeTypes assessmentMode) { + if (this.innerPatchSettings() == null) { + this.innerPatchSettings = new PatchSettings(); + } + this.innerPatchSettings().withAssessmentMode(assessmentMode); + return this; + } + + /** + * Get the patchMode property: Specifies the patch mode. + * + * @return the patchMode value. + */ + public PatchModeTypes patchMode() { + return this.innerPatchSettings() == null ? null : this.innerPatchSettings().patchMode(); + } + + /** + * Set the patchMode property: Specifies the patch mode. + * + * @param patchMode the patchMode value to set. + * @return the OSProfileLinuxConfiguration object itself. + */ + public OSProfileLinuxConfiguration withPatchMode(PatchModeTypes patchMode) { + if (this.innerPatchSettings() == null) { + this.innerPatchSettings = new PatchSettings(); + } + this.innerPatchSettings().withPatchMode(patchMode); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerPatchSettings() != null) { + innerPatchSettings().validate(); + } + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/OSProfileWindowsConfiguration.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/OSProfileWindowsConfiguration.java new file mode 100644 index 0000000000000..94a0146e8bb70 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/OSProfileWindowsConfiguration.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.hybridcompute.fluent.models.PatchSettings; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Specifies the windows configuration for update management. */ +@Fluent +public final class OSProfileWindowsConfiguration { + /* + * Specifies the patch settings. + */ + @JsonProperty(value = "patchSettings") + private PatchSettings innerPatchSettings; + + /** Creates an instance of OSProfileWindowsConfiguration class. */ + public OSProfileWindowsConfiguration() { + } + + /** + * Get the innerPatchSettings property: Specifies the patch settings. + * + * @return the innerPatchSettings value. + */ + private PatchSettings innerPatchSettings() { + return this.innerPatchSettings; + } + + /** + * Get the assessmentMode property: Specifies the assessment mode. + * + * @return the assessmentMode value. + */ + public AssessmentModeTypes assessmentMode() { + return this.innerPatchSettings() == null ? null : this.innerPatchSettings().assessmentMode(); + } + + /** + * Set the assessmentMode property: Specifies the assessment mode. + * + * @param assessmentMode the assessmentMode value to set. + * @return the OSProfileWindowsConfiguration object itself. + */ + public OSProfileWindowsConfiguration withAssessmentMode(AssessmentModeTypes assessmentMode) { + if (this.innerPatchSettings() == null) { + this.innerPatchSettings = new PatchSettings(); + } + this.innerPatchSettings().withAssessmentMode(assessmentMode); + return this; + } + + /** + * Get the patchMode property: Specifies the patch mode. + * + * @return the patchMode value. + */ + public PatchModeTypes patchMode() { + return this.innerPatchSettings() == null ? null : this.innerPatchSettings().patchMode(); + } + + /** + * Set the patchMode property: Specifies the patch mode. + * + * @param patchMode the patchMode value to set. + * @return the OSProfileWindowsConfiguration object itself. + */ + public OSProfileWindowsConfiguration withPatchMode(PatchModeTypes patchMode) { + if (this.innerPatchSettings() == null) { + this.innerPatchSettings = new PatchSettings(); + } + this.innerPatchSettings().withPatchMode(patchMode); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerPatchSettings() != null) { + innerPatchSettings().validate(); + } + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/OperationValue.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/OperationValue.java index 55fd882ca6eff..d9d9443f385b6 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/OperationValue.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/OperationValue.java @@ -29,6 +29,13 @@ public interface OperationValue { */ OperationValueDisplay display(); + /** + * Gets the isDataAction property: This property indicates if the operation is an action or a data action. + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + /** * Gets the inner com.azure.resourcemanager.hybridcompute.fluent.models.OperationValueInner object. * diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/OsType.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/OsType.java new file mode 100644 index 0000000000000..c882c66f7d7bf --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/OsType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The operating system type of the machine. */ +public final class OsType extends ExpandableStringEnum { + /** Static value Windows for OsType. */ + public static final OsType WINDOWS = fromString("Windows"); + + /** Static value Linux for OsType. */ + public static final OsType LINUX = fromString("Linux"); + + /** + * Creates a new instance of OsType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public OsType() { + } + + /** + * Creates or finds a OsType from its string representation. + * + * @param name a name to look for. + * @return the corresponding OsType. + */ + @JsonCreator + public static OsType fromString(String name) { + return fromString(name, OsType.class); + } + + /** + * Gets known OsType values. + * + * @return known OsType values. + */ + public static Collection values() { + return values(OsType.class); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PatchModeTypes.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PatchModeTypes.java new file mode 100644 index 0000000000000..92b9381bf0bf7 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PatchModeTypes.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.hybridcompute.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Specifies the patch mode. */ +public final class PatchModeTypes extends ExpandableStringEnum { + /** Static value ImageDefault for PatchModeTypes. */ + public static final PatchModeTypes IMAGE_DEFAULT = fromString("ImageDefault"); + + /** Static value AutomaticByPlatform for PatchModeTypes. */ + public static final PatchModeTypes AUTOMATIC_BY_PLATFORM = fromString("AutomaticByPlatform"); + + /** Static value AutomaticByOS for PatchModeTypes. */ + public static final PatchModeTypes AUTOMATIC_BY_OS = fromString("AutomaticByOS"); + + /** Static value Manual for PatchModeTypes. */ + public static final PatchModeTypes MANUAL = fromString("Manual"); + + /** + * Creates a new instance of PatchModeTypes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PatchModeTypes() { + } + + /** + * Creates or finds a PatchModeTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding PatchModeTypes. + */ + @JsonCreator + public static PatchModeTypes fromString(String name) { + return fromString(name, PatchModeTypes.class); + } + + /** + * Gets known PatchModeTypes values. + * + * @return known PatchModeTypes values. + */ + public static Collection values() { + return values(PatchModeTypes.class); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PatchOperationStartedBy.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PatchOperationStartedBy.java new file mode 100644 index 0000000000000..25911b9fe57c4 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PatchOperationStartedBy.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Indicates if operation was triggered by user or by platform. */ +public final class PatchOperationStartedBy extends ExpandableStringEnum { + /** Static value User for PatchOperationStartedBy. */ + public static final PatchOperationStartedBy USER = fromString("User"); + + /** Static value Platform for PatchOperationStartedBy. */ + public static final PatchOperationStartedBy PLATFORM = fromString("Platform"); + + /** + * Creates a new instance of PatchOperationStartedBy value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PatchOperationStartedBy() { + } + + /** + * Creates or finds a PatchOperationStartedBy from its string representation. + * + * @param name a name to look for. + * @return the corresponding PatchOperationStartedBy. + */ + @JsonCreator + public static PatchOperationStartedBy fromString(String name) { + return fromString(name, PatchOperationStartedBy.class); + } + + /** + * Gets known PatchOperationStartedBy values. + * + * @return known PatchOperationStartedBy values. + */ + public static Collection values() { + return values(PatchOperationStartedBy.class); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PatchOperationStatus.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PatchOperationStatus.java new file mode 100644 index 0000000000000..c8c37833b61d2 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PatchOperationStatus.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * The overall success or failure status of the operation. It remains "InProgress" until the operation completes. At + * that point it will become "Unknown", "Failed", "Succeeded", or "CompletedWithWarnings.". + */ +public final class PatchOperationStatus extends ExpandableStringEnum { + /** Static value Unknown for PatchOperationStatus. */ + public static final PatchOperationStatus UNKNOWN = fromString("Unknown"); + + /** Static value InProgress for PatchOperationStatus. */ + public static final PatchOperationStatus IN_PROGRESS = fromString("InProgress"); + + /** Static value Failed for PatchOperationStatus. */ + public static final PatchOperationStatus FAILED = fromString("Failed"); + + /** Static value Succeeded for PatchOperationStatus. */ + public static final PatchOperationStatus SUCCEEDED = fromString("Succeeded"); + + /** Static value CompletedWithWarnings for PatchOperationStatus. */ + public static final PatchOperationStatus COMPLETED_WITH_WARNINGS = fromString("CompletedWithWarnings"); + + /** + * Creates a new instance of PatchOperationStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PatchOperationStatus() { + } + + /** + * Creates or finds a PatchOperationStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding PatchOperationStatus. + */ + @JsonCreator + public static PatchOperationStatus fromString(String name) { + return fromString(name, PatchOperationStatus.class); + } + + /** + * Gets known PatchOperationStatus values. + * + * @return known PatchOperationStatus values. + */ + public static Collection values() { + return values(PatchOperationStatus.class); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PatchServiceUsed.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PatchServiceUsed.java new file mode 100644 index 0000000000000..1f16c4548268e --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PatchServiceUsed.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Specifies the patch service used for the operation. */ +public final class PatchServiceUsed extends ExpandableStringEnum { + /** Static value Unknown for PatchServiceUsed. */ + public static final PatchServiceUsed UNKNOWN = fromString("Unknown"); + + /** Static value WU for PatchServiceUsed. */ + public static final PatchServiceUsed WU = fromString("WU"); + + /** Static value WU_WSUS for PatchServiceUsed. */ + public static final PatchServiceUsed WU_WSUS = fromString("WU_WSUS"); + + /** Static value YUM for PatchServiceUsed. */ + public static final PatchServiceUsed YUM = fromString("YUM"); + + /** Static value APT for PatchServiceUsed. */ + public static final PatchServiceUsed APT = fromString("APT"); + + /** Static value Zypper for PatchServiceUsed. */ + public static final PatchServiceUsed ZYPPER = fromString("Zypper"); + + /** + * Creates a new instance of PatchServiceUsed value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PatchServiceUsed() { + } + + /** + * Creates or finds a PatchServiceUsed from its string representation. + * + * @param name a name to look for. + * @return the corresponding PatchServiceUsed. + */ + @JsonCreator + public static PatchServiceUsed fromString(String name) { + return fromString(name, PatchServiceUsed.class); + } + + /** + * Gets known PatchServiceUsed values. + * + * @return known PatchServiceUsed values. + */ + public static Collection values() { + return values(PatchServiceUsed.class); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateEndpointConnection.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateEndpointConnection.java index 70f2cd3c227c0..e181dd6115563 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateEndpointConnection.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateEndpointConnection.java @@ -39,7 +39,7 @@ public interface PrivateEndpointConnection { PrivateEndpointConnectionProperties properties(); /** - * Gets the systemData property: The system meta data relating to this resource. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ @@ -63,11 +63,13 @@ public interface PrivateEndpointConnection { interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } + /** The PrivateEndpointConnection definition stages. */ interface DefinitionStages { /** The first stage of the PrivateEndpointConnection definition. */ interface Blank extends WithParentResource { } + /** The stage of the PrivateEndpointConnection definition allowing to specify parent resource. */ interface WithParentResource { /** @@ -79,6 +81,7 @@ interface WithParentResource { */ WithCreate withExistingPrivateLinkScope(String resourceGroupName, String scopeName); } + /** * The stage of the PrivateEndpointConnection definition which contains all the minimum required properties for * the resource to be created, but also allows for any other optional properties to be specified. @@ -99,6 +102,7 @@ interface WithCreate extends DefinitionStages.WithProperties { */ PrivateEndpointConnection create(Context context); } + /** The stage of the PrivateEndpointConnection definition allowing to specify properties. */ interface WithProperties { /** @@ -110,6 +114,7 @@ interface WithProperties { WithCreate withProperties(PrivateEndpointConnectionProperties properties); } } + /** * Begins update for the PrivateEndpointConnection resource. * @@ -134,6 +139,7 @@ interface Update extends UpdateStages.WithProperties { */ PrivateEndpointConnection apply(Context context); } + /** The PrivateEndpointConnection update stages. */ interface UpdateStages { /** The stage of the PrivateEndpointConnection update allowing to specify properties. */ @@ -147,6 +153,7 @@ interface WithProperties { Update withProperties(PrivateEndpointConnectionProperties properties); } } + /** * Refreshes the resource to sync with Azure. * diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateEndpointConnectionDataModel.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateEndpointConnectionDataModel.java new file mode 100644 index 0000000000000..3c6a86dfefaf3 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateEndpointConnectionDataModel.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Data Model for a Private Endpoint Connection associated with a Private Link Scope. */ +@Fluent +public final class PrivateEndpointConnectionDataModel { + /* + * The ARM Resource Id of the Private Endpoint. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * The Name of the Private Endpoint. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Azure resource type + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * The Private Endpoint Connection properties. + */ + @JsonProperty(value = "properties") + private PrivateEndpointConnectionProperties properties; + + /** Creates an instance of PrivateEndpointConnectionDataModel class. */ + public PrivateEndpointConnectionDataModel() { + } + + /** + * Get the id property: The ARM Resource Id of the Private Endpoint. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: The Name of the Private Endpoint. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: Azure resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the properties property: The Private Endpoint Connection properties. + * + * @return the properties value. + */ + public PrivateEndpointConnectionProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The Private Endpoint Connection properties. + * + * @param properties the properties value to set. + * @return the PrivateEndpointConnectionDataModel object itself. + */ + public PrivateEndpointConnectionDataModel withProperties(PrivateEndpointConnectionProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateEndpointConnectionProperties.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateEndpointConnectionProperties.java index b87dd7aa666e5..b274d8abd3673 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateEndpointConnectionProperties.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateEndpointConnectionProperties.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; /** Properties of a private endpoint connection. */ @Fluent @@ -28,6 +29,12 @@ public final class PrivateEndpointConnectionProperties { @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private String provisioningState; + /* + * List of group IDs. + */ + @JsonProperty(value = "groupIds", access = JsonProperty.Access.WRITE_ONLY) + private List groupIds; + /** Creates an instance of PrivateEndpointConnectionProperties class. */ public PrivateEndpointConnectionProperties() { } @@ -82,6 +89,15 @@ public String provisioningState() { return this.provisioningState; } + /** + * Get the groupIds property: List of group IDs. + * + * @return the groupIds value. + */ + public List groupIds() { + return this.groupIds; + } + /** * Validates the instance. * diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateLinkResource.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateLinkResource.java index 08854540c62b5..4cc8d1e89a25f 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateLinkResource.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateLinkResource.java @@ -38,7 +38,7 @@ public interface PrivateLinkResource { PrivateLinkResourceProperties properties(); /** - * Gets the systemData property: The system meta data relating to this resource. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ProvisioningState.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ProvisioningState.java new file mode 100644 index 0000000000000..0c8d088b67809 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ProvisioningState.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The provisioning state, which only appears in the response. */ +public final class ProvisioningState extends ExpandableStringEnum { + /** Static value Creating for ProvisioningState. */ + public static final ProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for ProvisioningState. */ + public static final ProvisioningState UPDATING = fromString("Updating"); + + /** Static value Deleting for ProvisioningState. */ + public static final ProvisioningState DELETING = fromString("Deleting"); + + /** Static value Succeeded for ProvisioningState. */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ProvisioningState. */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** Static value Accepted for ProvisioningState. */ + public static final ProvisioningState ACCEPTED = fromString("Accepted"); + + /** Static value Canceled for ProvisioningState. */ + public static final ProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Deleted for ProvisioningState. */ + public static final ProvisioningState DELETED = fromString("Deleted"); + + /** + * Creates a new instance of ProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProvisioningState() { + } + + /** + * Creates or finds a ProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProvisioningState. + */ + @JsonCreator + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** + * Gets known ProvisioningState values. + * + * @return known ProvisioningState values. + */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ResourceProviders.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ResourceProviders.java new file mode 100644 index 0000000000000..03fb8081c7387 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ResourceProviders.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.hybridcompute.models; + +import com.azure.core.util.Context; + +/** Resource collection API of ResourceProviders. */ +public interface ResourceProviders { + /** + * The operation to Upgrade Machine Extensions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void upgradeExtensions( + String resourceGroupName, String machineName, MachineExtensionUpgrade extensionUpgradeParameters); + + /** + * The operation to Upgrade Machine Extensions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void upgradeExtensions( + String resourceGroupName, + String machineName, + MachineExtensionUpgrade extensionUpgradeParameters, + Context context); +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/RunCommandInputParameter.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/RunCommandInputParameter.java new file mode 100644 index 0000000000000..bfbb886f621f6 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/RunCommandInputParameter.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the properties of a run command parameter. */ +@Fluent +public final class RunCommandInputParameter { + /* + * The run command parameter name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The run command parameter value. + */ + @JsonProperty(value = "value", required = true) + private String value; + + /** Creates an instance of RunCommandInputParameter class. */ + public RunCommandInputParameter() { + } + + /** + * Get the name property: The run command parameter name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The run command parameter name. + * + * @param name the name value to set. + * @return the RunCommandInputParameter object itself. + */ + public RunCommandInputParameter withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value property: The run command parameter value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The run command parameter value. + * + * @param value the value value to set. + * @return the RunCommandInputParameter object itself. + */ + public RunCommandInputParameter withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model RunCommandInputParameter")); + } + if (value() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model RunCommandInputParameter")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RunCommandInputParameter.class); +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/RunCommandManagedIdentity.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/RunCommandManagedIdentity.java new file mode 100644 index 0000000000000..7a72b9c982c8b --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/RunCommandManagedIdentity.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains clientId or objectId (use only one, not both) of a user-assigned managed identity that has access to storage + * blob used in Run Command. Use an empty RunCommandManagedIdentity object in case of system-assigned identity. Make + * sure the Azure storage blob exists in case of scriptUri, and managed identity has been given access to blob's + * container with 'Storage Blob Data Reader' role assignment with scriptUri blob and 'Storage Blob Data Contributor' for + * Append blobs(outputBlobUri, errorBlobUri). In case of user assigned identity, make sure you add it under VM's + * identity. For more info on managed identity and Run Command, refer https://aka.ms/ManagedIdentity and + * https://aka.ms/RunCommandManaged. + */ +@Fluent +public final class RunCommandManagedIdentity { + /* + * Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. + */ + @JsonProperty(value = "clientId") + private String clientId; + + /* + * Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. + */ + @JsonProperty(value = "objectId") + private String objectId; + + /** Creates an instance of RunCommandManagedIdentity class. */ + public RunCommandManagedIdentity() { + } + + /** + * Get the clientId property: Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be + * used if this is provided. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Set the clientId property: Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be + * used if this is provided. + * + * @param clientId the clientId value to set. + * @return the RunCommandManagedIdentity object itself. + */ + public RunCommandManagedIdentity withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get the objectId property: Object Id (GUID value) of the user-assigned managed identity. ClientId should not be + * used if this is provided. + * + * @return the objectId value. + */ + public String objectId() { + return this.objectId; + } + + /** + * Set the objectId property: Object Id (GUID value) of the user-assigned managed identity. ClientId should not be + * used if this is provided. + * + * @param objectId the objectId value to set. + * @return the RunCommandManagedIdentity object itself. + */ + public RunCommandManagedIdentity withObjectId(String objectId) { + this.objectId = objectId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ServiceStatus.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ServiceStatus.java new file mode 100644 index 0000000000000..3542d05c0dd80 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ServiceStatus.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.hybridcompute.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the status and behavior of a service. */ +@Fluent +public final class ServiceStatus { + /* + * The current status of the service. + */ + @JsonProperty(value = "status") + private String status; + + /* + * The behavior of the service when the Arc-enabled machine starts up. + */ + @JsonProperty(value = "startupType") + private String startupType; + + /** Creates an instance of ServiceStatus class. */ + public ServiceStatus() { + } + + /** + * Get the status property: The current status of the service. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Set the status property: The current status of the service. + * + * @param status the status value to set. + * @return the ServiceStatus object itself. + */ + public ServiceStatus withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the startupType property: The behavior of the service when the Arc-enabled machine starts up. + * + * @return the startupType value. + */ + public String startupType() { + return this.startupType; + } + + /** + * Set the startupType property: The behavior of the service when the Arc-enabled machine starts up. + * + * @param startupType the startupType value to set. + * @return the ServiceStatus object itself. + */ + public ServiceStatus withStartupType(String startupType) { + this.startupType = startupType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ServiceStatuses.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ServiceStatuses.java new file mode 100644 index 0000000000000..5506fa84ce22e --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ServiceStatuses.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Reports the state and behavior of dependent services. */ +@Fluent +public final class ServiceStatuses { + /* + * The state of the extension service on the Arc-enabled machine. + */ + @JsonProperty(value = "extensionService") + private ServiceStatus extensionService; + + /* + * The state of the guest configuration service on the Arc-enabled machine. + */ + @JsonProperty(value = "guestConfigurationService") + private ServiceStatus guestConfigurationService; + + /** Creates an instance of ServiceStatuses class. */ + public ServiceStatuses() { + } + + /** + * Get the extensionService property: The state of the extension service on the Arc-enabled machine. + * + * @return the extensionService value. + */ + public ServiceStatus extensionService() { + return this.extensionService; + } + + /** + * Set the extensionService property: The state of the extension service on the Arc-enabled machine. + * + * @param extensionService the extensionService value to set. + * @return the ServiceStatuses object itself. + */ + public ServiceStatuses withExtensionService(ServiceStatus extensionService) { + this.extensionService = extensionService; + return this; + } + + /** + * Get the guestConfigurationService property: The state of the guest configuration service on the Arc-enabled + * machine. + * + * @return the guestConfigurationService value. + */ + public ServiceStatus guestConfigurationService() { + return this.guestConfigurationService; + } + + /** + * Set the guestConfigurationService property: The state of the guest configuration service on the Arc-enabled + * machine. + * + * @param guestConfigurationService the guestConfigurationService value to set. + * @return the ServiceStatuses object itself. + */ + public ServiceStatuses withGuestConfigurationService(ServiceStatus guestConfigurationService) { + this.guestConfigurationService = guestConfigurationService; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (extensionService() != null) { + extensionService().validate(); + } + if (guestConfigurationService() != null) { + guestConfigurationService().validate(); + } + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/Subnet.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/Subnet.java new file mode 100644 index 0000000000000..2e0e669052807 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/Subnet.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.hybridcompute.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the subnet. */ +@Fluent +public final class Subnet { + /* + * Represents address prefix. + */ + @JsonProperty(value = "addressPrefix") + private String addressPrefix; + + /** Creates an instance of Subnet class. */ + public Subnet() { + } + + /** + * Get the addressPrefix property: Represents address prefix. + * + * @return the addressPrefix value. + */ + public String addressPrefix() { + return this.addressPrefix; + } + + /** + * Set the addressPrefix property: Represents address prefix. + * + * @param addressPrefix the addressPrefix value to set. + * @return the Subnet object itself. + */ + public Subnet withAddressPrefix(String addressPrefix) { + this.addressPrefix = addressPrefix; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/VMGuestPatchClassificationLinux.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/VMGuestPatchClassificationLinux.java new file mode 100644 index 0000000000000..9cc2af6eafbf9 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/VMGuestPatchClassificationLinux.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.hybridcompute.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VMGuestPatchClassificationLinux. */ +public final class VMGuestPatchClassificationLinux extends ExpandableStringEnum { + /** Static value Critical for VMGuestPatchClassificationLinux. */ + public static final VMGuestPatchClassificationLinux CRITICAL = fromString("Critical"); + + /** Static value Security for VMGuestPatchClassificationLinux. */ + public static final VMGuestPatchClassificationLinux SECURITY = fromString("Security"); + + /** Static value Other for VMGuestPatchClassificationLinux. */ + public static final VMGuestPatchClassificationLinux OTHER = fromString("Other"); + + /** + * Creates a new instance of VMGuestPatchClassificationLinux value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VMGuestPatchClassificationLinux() { + } + + /** + * Creates or finds a VMGuestPatchClassificationLinux from its string representation. + * + * @param name a name to look for. + * @return the corresponding VMGuestPatchClassificationLinux. + */ + @JsonCreator + public static VMGuestPatchClassificationLinux fromString(String name) { + return fromString(name, VMGuestPatchClassificationLinux.class); + } + + /** + * Gets known VMGuestPatchClassificationLinux values. + * + * @return known VMGuestPatchClassificationLinux values. + */ + public static Collection values() { + return values(VMGuestPatchClassificationLinux.class); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/VMGuestPatchClassificationWindows.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/VMGuestPatchClassificationWindows.java new file mode 100644 index 0000000000000..b3048d00a037e --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/VMGuestPatchClassificationWindows.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VMGuestPatchClassificationWindows. */ +public final class VMGuestPatchClassificationWindows extends ExpandableStringEnum { + /** Static value Critical for VMGuestPatchClassificationWindows. */ + public static final VMGuestPatchClassificationWindows CRITICAL = fromString("Critical"); + + /** Static value Security for VMGuestPatchClassificationWindows. */ + public static final VMGuestPatchClassificationWindows SECURITY = fromString("Security"); + + /** Static value UpdateRollUp for VMGuestPatchClassificationWindows. */ + public static final VMGuestPatchClassificationWindows UPDATE_ROLL_UP = fromString("UpdateRollUp"); + + /** Static value FeaturePack for VMGuestPatchClassificationWindows. */ + public static final VMGuestPatchClassificationWindows FEATURE_PACK = fromString("FeaturePack"); + + /** Static value ServicePack for VMGuestPatchClassificationWindows. */ + public static final VMGuestPatchClassificationWindows SERVICE_PACK = fromString("ServicePack"); + + /** Static value Definition for VMGuestPatchClassificationWindows. */ + public static final VMGuestPatchClassificationWindows DEFINITION = fromString("Definition"); + + /** Static value Tools for VMGuestPatchClassificationWindows. */ + public static final VMGuestPatchClassificationWindows TOOLS = fromString("Tools"); + + /** Static value Updates for VMGuestPatchClassificationWindows. */ + public static final VMGuestPatchClassificationWindows UPDATES = fromString("Updates"); + + /** + * Creates a new instance of VMGuestPatchClassificationWindows value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VMGuestPatchClassificationWindows() { + } + + /** + * Creates or finds a VMGuestPatchClassificationWindows from its string representation. + * + * @param name a name to look for. + * @return the corresponding VMGuestPatchClassificationWindows. + */ + @JsonCreator + public static VMGuestPatchClassificationWindows fromString(String name) { + return fromString(name, VMGuestPatchClassificationWindows.class); + } + + /** + * Gets known VMGuestPatchClassificationWindows values. + * + * @return known VMGuestPatchClassificationWindows values. + */ + public static Collection values() { + return values(VMGuestPatchClassificationWindows.class); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/VMGuestPatchRebootSetting.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/VMGuestPatchRebootSetting.java new file mode 100644 index 0000000000000..e4e9a50a1cab6 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/VMGuestPatchRebootSetting.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.hybridcompute.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines when it is acceptable to reboot a VM during a software update operation. */ +public final class VMGuestPatchRebootSetting extends ExpandableStringEnum { + /** Static value IfRequired for VMGuestPatchRebootSetting. */ + public static final VMGuestPatchRebootSetting IF_REQUIRED = fromString("IfRequired"); + + /** Static value Never for VMGuestPatchRebootSetting. */ + public static final VMGuestPatchRebootSetting NEVER = fromString("Never"); + + /** Static value Always for VMGuestPatchRebootSetting. */ + public static final VMGuestPatchRebootSetting ALWAYS = fromString("Always"); + + /** + * Creates a new instance of VMGuestPatchRebootSetting value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VMGuestPatchRebootSetting() { + } + + /** + * Creates or finds a VMGuestPatchRebootSetting from its string representation. + * + * @param name a name to look for. + * @return the corresponding VMGuestPatchRebootSetting. + */ + @JsonCreator + public static VMGuestPatchRebootSetting fromString(String name) { + return fromString(name, VMGuestPatchRebootSetting.class); + } + + /** + * Gets known VMGuestPatchRebootSetting values. + * + * @return known VMGuestPatchRebootSetting values. + */ + public static Collection values() { + return values(VMGuestPatchRebootSetting.class); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/VMGuestPatchRebootStatus.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/VMGuestPatchRebootStatus.java new file mode 100644 index 0000000000000..4908e8a44c1d5 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/VMGuestPatchRebootStatus.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The reboot state of the VM following completion of the operation. */ +public final class VMGuestPatchRebootStatus extends ExpandableStringEnum { + /** Static value Unknown for VMGuestPatchRebootStatus. */ + public static final VMGuestPatchRebootStatus UNKNOWN = fromString("Unknown"); + + /** Static value NotNeeded for VMGuestPatchRebootStatus. */ + public static final VMGuestPatchRebootStatus NOT_NEEDED = fromString("NotNeeded"); + + /** Static value Required for VMGuestPatchRebootStatus. */ + public static final VMGuestPatchRebootStatus REQUIRED = fromString("Required"); + + /** Static value Started for VMGuestPatchRebootStatus. */ + public static final VMGuestPatchRebootStatus STARTED = fromString("Started"); + + /** Static value Failed for VMGuestPatchRebootStatus. */ + public static final VMGuestPatchRebootStatus FAILED = fromString("Failed"); + + /** Static value Completed for VMGuestPatchRebootStatus. */ + public static final VMGuestPatchRebootStatus COMPLETED = fromString("Completed"); + + /** + * Creates a new instance of VMGuestPatchRebootStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VMGuestPatchRebootStatus() { + } + + /** + * Creates or finds a VMGuestPatchRebootStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding VMGuestPatchRebootStatus. + */ + @JsonCreator + public static VMGuestPatchRebootStatus fromString(String name) { + return fromString(name, VMGuestPatchRebootStatus.class); + } + + /** + * Gets known VMGuestPatchRebootStatus values. + * + * @return known VMGuestPatchRebootStatus values. + */ + public static Collection values() { + return values(VMGuestPatchRebootStatus.class); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/WindowsParameters.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/WindowsParameters.java new file mode 100644 index 0000000000000..8554787db6eef --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/WindowsParameters.java @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Input for InstallPatches on a Windows VM, as directly received by the API. */ +@Fluent +public final class WindowsParameters { + /* + * The update classifications to select when installing patches for Windows. + */ + @JsonProperty(value = "classificationsToInclude") + private List classificationsToInclude; + + /* + * Kbs to include in the patch operation + */ + @JsonProperty(value = "kbNumbersToInclude") + private List kbNumbersToInclude; + + /* + * Kbs to exclude in the patch operation + */ + @JsonProperty(value = "kbNumbersToExclude") + private List kbNumbersToExclude; + + /* + * Filters out Kbs that don't have an InstallationRebootBehavior of 'NeverReboots' when this is set to true. + */ + @JsonProperty(value = "excludeKbsRequiringReboot") + private Boolean excludeKbsRequiringReboot; + + /* + * This is used to install patches that were published on or before this given max published date. + */ + @JsonProperty(value = "maxPatchPublishDate") + private OffsetDateTime maxPatchPublishDate; + + /** Creates an instance of WindowsParameters class. */ + public WindowsParameters() { + } + + /** + * Get the classificationsToInclude property: The update classifications to select when installing patches for + * Windows. + * + * @return the classificationsToInclude value. + */ + public List classificationsToInclude() { + return this.classificationsToInclude; + } + + /** + * Set the classificationsToInclude property: The update classifications to select when installing patches for + * Windows. + * + * @param classificationsToInclude the classificationsToInclude value to set. + * @return the WindowsParameters object itself. + */ + public WindowsParameters withClassificationsToInclude( + List classificationsToInclude) { + this.classificationsToInclude = classificationsToInclude; + return this; + } + + /** + * Get the kbNumbersToInclude property: Kbs to include in the patch operation. + * + * @return the kbNumbersToInclude value. + */ + public List kbNumbersToInclude() { + return this.kbNumbersToInclude; + } + + /** + * Set the kbNumbersToInclude property: Kbs to include in the patch operation. + * + * @param kbNumbersToInclude the kbNumbersToInclude value to set. + * @return the WindowsParameters object itself. + */ + public WindowsParameters withKbNumbersToInclude(List kbNumbersToInclude) { + this.kbNumbersToInclude = kbNumbersToInclude; + return this; + } + + /** + * Get the kbNumbersToExclude property: Kbs to exclude in the patch operation. + * + * @return the kbNumbersToExclude value. + */ + public List kbNumbersToExclude() { + return this.kbNumbersToExclude; + } + + /** + * Set the kbNumbersToExclude property: Kbs to exclude in the patch operation. + * + * @param kbNumbersToExclude the kbNumbersToExclude value to set. + * @return the WindowsParameters object itself. + */ + public WindowsParameters withKbNumbersToExclude(List kbNumbersToExclude) { + this.kbNumbersToExclude = kbNumbersToExclude; + return this; + } + + /** + * Get the excludeKbsRequiringReboot property: Filters out Kbs that don't have an InstallationRebootBehavior of + * 'NeverReboots' when this is set to true. + * + * @return the excludeKbsRequiringReboot value. + */ + public Boolean excludeKbsRequiringReboot() { + return this.excludeKbsRequiringReboot; + } + + /** + * Set the excludeKbsRequiringReboot property: Filters out Kbs that don't have an InstallationRebootBehavior of + * 'NeverReboots' when this is set to true. + * + * @param excludeKbsRequiringReboot the excludeKbsRequiringReboot value to set. + * @return the WindowsParameters object itself. + */ + public WindowsParameters withExcludeKbsRequiringReboot(Boolean excludeKbsRequiringReboot) { + this.excludeKbsRequiringReboot = excludeKbsRequiringReboot; + return this; + } + + /** + * Get the maxPatchPublishDate property: This is used to install patches that were published on or before this given + * max published date. + * + * @return the maxPatchPublishDate value. + */ + public OffsetDateTime maxPatchPublishDate() { + return this.maxPatchPublishDate; + } + + /** + * Set the maxPatchPublishDate property: This is used to install patches that were published on or before this given + * max published date. + * + * @param maxPatchPublishDate the maxPatchPublishDate value to set. + * @return the WindowsParameters object itself. + */ + public WindowsParameters withMaxPatchPublishDate(OffsetDateTime maxPatchPublishDate) { + this.maxPatchPublishDate = maxPatchPublishDate; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/AgentVersionGetSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/AgentVersionGetSamples.java new file mode 100644 index 0000000000000..651e5005be1ef --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/AgentVersionGetSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.generated; + +/** Samples for AgentVersion Get. */ +public final class AgentVersionGetSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/AgentVersion_GetLatest.json + */ + /** + * Sample code: GET Agent Versions. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void gETAgentVersions(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager.agentVersions().getWithResponse("myOsType", "1.27", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/AgentVersionListSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/AgentVersionListSamples.java new file mode 100644 index 0000000000000..339154da21e03 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/AgentVersionListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.generated; + +/** Samples for AgentVersion List. */ +public final class AgentVersionListSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/AgentVersions_Get.json + */ + /** + * Sample code: GET Agent Versions. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void gETAgentVersions(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager.agentVersions().listWithResponse("myOsType", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/ExtensionMetadataGetSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/ExtensionMetadataGetSamples.java new file mode 100644 index 0000000000000..62dcf8ca688be --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/ExtensionMetadataGetSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.generated; + +/** Samples for ExtensionMetadata Get. */ +public final class ExtensionMetadataGetSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/extension/ExtensionMetadata_Get.json + */ + /** + * Sample code: GET an extensions metadata. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void gETAnExtensionsMetadata(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager + .extensionMetadatas() + .getWithResponse( + "EastUS", + "microsoft.azure.monitor", + "azuremonitorlinuxagent", + "1.9.1", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/ExtensionMetadataListSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/ExtensionMetadataListSamples.java new file mode 100644 index 0000000000000..2f72f5bc1f93f --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/ExtensionMetadataListSamples.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.hybridcompute.generated; + +/** Samples for ExtensionMetadata List. */ +public final class ExtensionMetadataListSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/extension/ExtensionMetadata_List.json + */ + /** + * Sample code: GET a list of extensions. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void gETAListOfExtensions(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager + .extensionMetadatas() + .list("EastUS", "microsoft.azure.monitor", "azuremonitorlinuxagent", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/HybridIdentityMetadataGetSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/HybridIdentityMetadataGetSamples.java new file mode 100644 index 0000000000000..decd55b02f723 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/HybridIdentityMetadataGetSamples.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.hybridcompute.generated; + +/** Samples for HybridIdentityMetadata Get. */ +public final class HybridIdentityMetadataGetSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/HybridIdentityMetadata_Get.json + */ + /** + * Sample code: GetHybridIdentityMetadata. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void getHybridIdentityMetadata(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager + .hybridIdentityMetadatas() + .getWithResponse("testrg", "ContosoVm", "default", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/HybridIdentityMetadataListByMachinesSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/HybridIdentityMetadataListByMachinesSamples.java new file mode 100644 index 0000000000000..a9dfe18c27456 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/HybridIdentityMetadataListByMachinesSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.generated; + +/** Samples for HybridIdentityMetadata ListByMachines. */ +public final class HybridIdentityMetadataListByMachinesSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/HybridIdentityMetadata_ListByVirtualMachines.json + */ + /** + * Sample code: HybridIdentityMetadataListByVirtualMachines. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void hybridIdentityMetadataListByVirtualMachines( + com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager.hybridIdentityMetadatas().listByMachines("testrg", "ContosoVm", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/LicenseProfilesCreateOrUpdateSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/LicenseProfilesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..a2986e049e96b --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/LicenseProfilesCreateOrUpdateSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.generated; + +/** Samples for LicenseProfiles CreateOrUpdate. */ +public final class LicenseProfilesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/licenseProfile/LicenseProfile_CreateOrUpdate.json + */ + /** + * Sample code: Create or Update a License Profile. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void createOrUpdateALicenseProfile( + com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager + .licenseProfiles() + .define() + .withRegion("eastus2euap") + .withExistingMachine("myResourceGroup", "myMachine") + .withAssignedLicense("{LicenseResourceId}") + .create(); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/LicenseProfilesDeleteSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/LicenseProfilesDeleteSamples.java new file mode 100644 index 0000000000000..ec02195a6f64c --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/LicenseProfilesDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.generated; + +/** Samples for LicenseProfiles Delete. */ +public final class LicenseProfilesDeleteSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/licenseProfile/LicenseProfile_Delete.json + */ + /** + * Sample code: Delete a License Profile. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void deleteALicenseProfile(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager.licenseProfiles().delete("myResourceGroup", "myMachine", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/LicenseProfilesGetSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/LicenseProfilesGetSamples.java new file mode 100644 index 0000000000000..c5b72f8f20cae --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/LicenseProfilesGetSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.generated; + +/** Samples for LicenseProfiles Get. */ +public final class LicenseProfilesGetSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/licenseProfile/LicenseProfile_Get.json + */ + /** + * Sample code: Get License Profile. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void getLicenseProfile(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager.licenseProfiles().getWithResponse("myResourceGroup", "myMachine", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/LicenseProfilesListSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/LicenseProfilesListSamples.java new file mode 100644 index 0000000000000..40b45f41055a4 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/LicenseProfilesListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.generated; + +/** Samples for LicenseProfiles List. */ +public final class LicenseProfilesListSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/licenseProfile/LicenseProfile_List.json + */ + /** + * Sample code: List all License Profiles. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void listAllLicenseProfiles(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager.licenseProfiles().list("myResourceGroup", "myMachine", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/LicenseProfilesUpdateSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/LicenseProfilesUpdateSamples.java new file mode 100644 index 0000000000000..c4490a0b5fdea --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/LicenseProfilesUpdateSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.generated; + +import com.azure.resourcemanager.hybridcompute.models.LicenseProfile; + +/** Samples for LicenseProfiles Update. */ +public final class LicenseProfilesUpdateSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/licenseProfile/LicenseProfile_Update.json + */ + /** + * Sample code: Update a License Profile. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void updateALicenseProfile(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + LicenseProfile resource = + manager + .licenseProfiles() + .getWithResponse("myResourceGroup", "myMachine", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withAssignedLicense("{LicenseResourceId}").apply(); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/LicensesCreateOrUpdateSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/LicensesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..bebfd95c24d5c --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/LicensesCreateOrUpdateSamples.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.hybridcompute.generated; + +import com.azure.resourcemanager.hybridcompute.models.LicenseCoreType; +import com.azure.resourcemanager.hybridcompute.models.LicenseDetails; +import com.azure.resourcemanager.hybridcompute.models.LicenseEdition; +import com.azure.resourcemanager.hybridcompute.models.LicenseState; +import com.azure.resourcemanager.hybridcompute.models.LicenseTarget; +import com.azure.resourcemanager.hybridcompute.models.LicenseType; + +/** Samples for Licenses CreateOrUpdate. */ +public final class LicensesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/license/License_CreateOrUpdate.json + */ + /** + * Sample code: Create or Update a License. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void createOrUpdateALicense(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager + .licenses() + .define("{licenseName}") + .withRegion("eastus2euap") + .withExistingResourceGroup("myResourceGroup") + .withLicenseType(LicenseType.ESU) + .withLicenseDetails( + new LicenseDetails() + .withState(LicenseState.ACTIVATED) + .withTarget(LicenseTarget.WINDOWS_SERVER_2012) + .withEdition(LicenseEdition.DATACENTER) + .withType(LicenseCoreType.P_CORE) + .withProcessors(6)) + .create(); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/LicensesDeleteSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/LicensesDeleteSamples.java new file mode 100644 index 0000000000000..78922aab6be7d --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/LicensesDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.generated; + +/** Samples for Licenses Delete. */ +public final class LicensesDeleteSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/license/License_Delete.json + */ + /** + * Sample code: Delete a License. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void deleteALicense(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager.licenses().delete("myResourceGroup", "{licenseName}", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/LicensesGetByResourceGroupSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/LicensesGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..9fd6f54f3b483 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/LicensesGetByResourceGroupSamples.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.hybridcompute.generated; + +/** Samples for Licenses GetByResourceGroup. */ +public final class LicensesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/license/License_Get.json + */ + /** + * Sample code: Get License. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void getLicense(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager + .licenses() + .getByResourceGroupWithResponse("myResourceGroup", "{licenseName}", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/LicensesListByResourceGroupSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/LicensesListByResourceGroupSamples.java new file mode 100644 index 0000000000000..005db32d3ef68 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/LicensesListByResourceGroupSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.generated; + +/** Samples for Licenses ListByResourceGroup. */ +public final class LicensesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/license/License_ListByResourceGroup.json + */ + /** + * Sample code: GET all Machine Extensions. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void gETAllMachineExtensions(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager.licenses().listByResourceGroup("myResourceGroup", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/LicensesListSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/LicensesListSamples.java new file mode 100644 index 0000000000000..c7835cdeeefc2 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/LicensesListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.generated; + +/** Samples for Licenses List. */ +public final class LicensesListSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/license/License_ListBySubscription.json + */ + /** + * Sample code: List Licenses by Subscription. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void listLicensesBySubscription( + com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager.licenses().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/LicensesUpdateSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/LicensesUpdateSamples.java new file mode 100644 index 0000000000000..d6c0d1bddd53c --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/LicensesUpdateSamples.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.hybridcompute.generated; + +import com.azure.resourcemanager.hybridcompute.models.License; +import com.azure.resourcemanager.hybridcompute.models.LicenseCoreType; +import com.azure.resourcemanager.hybridcompute.models.LicenseEdition; +import com.azure.resourcemanager.hybridcompute.models.LicenseState; +import com.azure.resourcemanager.hybridcompute.models.LicenseTarget; +import com.azure.resourcemanager.hybridcompute.models.LicenseType; + +/** Samples for Licenses Update. */ +public final class LicensesUpdateSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/license/License_Update.json + */ + /** + * Sample code: Update a License. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void updateALicense(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + License resource = + manager + .licenses() + .getByResourceGroupWithResponse("myResourceGroup", "{licenseName}", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withLicenseType(LicenseType.ESU) + .withState(LicenseState.ACTIVATED) + .withTarget(LicenseTarget.WINDOWS_SERVER_2012) + .withEdition(LicenseEdition.DATACENTER) + .withType(LicenseCoreType.P_CORE) + .withProcessors(6) + .apply(); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/LicensesValidateLicenseSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/LicensesValidateLicenseSamples.java new file mode 100644 index 0000000000000..e3db48de6ae32 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/LicensesValidateLicenseSamples.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.hybridcompute.generated; + +import com.azure.resourcemanager.hybridcompute.fluent.models.LicenseInner; +import com.azure.resourcemanager.hybridcompute.models.LicenseCoreType; +import com.azure.resourcemanager.hybridcompute.models.LicenseDetails; +import com.azure.resourcemanager.hybridcompute.models.LicenseEdition; +import com.azure.resourcemanager.hybridcompute.models.LicenseState; +import com.azure.resourcemanager.hybridcompute.models.LicenseTarget; +import com.azure.resourcemanager.hybridcompute.models.LicenseType; + +/** Samples for Licenses ValidateLicense. */ +public final class LicensesValidateLicenseSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/license/License_ValidateLicense.json + */ + /** + * Sample code: Validate a License. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void validateALicense(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager + .licenses() + .validateLicense( + new LicenseInner() + .withLocation("eastus2euap") + .withLicenseType(LicenseType.ESU) + .withLicenseDetails( + new LicenseDetails() + .withState(LicenseState.ACTIVATED) + .withTarget(LicenseTarget.WINDOWS_SERVER_2012) + .withEdition(LicenseEdition.DATACENTER) + .withType(LicenseCoreType.P_CORE) + .withProcessors(6)), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsCreateOrUpdateSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsCreateOrUpdateSamples.java index 153bc630c01da..6acd88a73470e 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsCreateOrUpdateSamples.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsCreateOrUpdateSamples.java @@ -4,15 +4,14 @@ package com.azure.resourcemanager.hybridcompute.generated; -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.hybridcompute.models.MachineExtensionProperties; -import java.io.IOException; +import java.util.HashMap; +import java.util.Map; /** Samples for MachineExtensions CreateOrUpdate. */ public final class MachineExtensionsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/PUTExtension.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/extension/Extension_CreateOrUpdate.json */ /** * Sample code: Create or Update a Machine Extension. @@ -20,7 +19,7 @@ public final class MachineExtensionsCreateOrUpdateSamples { * @param manager Entry point to HybridComputeManager. */ public static void createOrUpdateAMachineExtension( - com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) throws IOException { + com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { manager .machineExtensions() .define("CustomScriptExtension") @@ -32,13 +31,21 @@ public static void createOrUpdateAMachineExtension( .withType("CustomScriptExtension") .withTypeHandlerVersion("1.10") .withSettings( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize( - "{\"commandToExecute\":\"powershell.exe -c \\\"Get-Process | Where-Object { $_.CPU -gt" - + " 10000 }\\\"\"}", - Object.class, - SerializerEncoding.JSON))) + mapOf( + "commandToExecute", + "powershell.exe -c \"Get-Process | Where-Object { $_.CPU -gt 10000 }\""))) .create(); } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } } diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsDeleteSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsDeleteSamples.java index b1c172035d44b..1ee02b842c58f 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsDeleteSamples.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsDeleteSamples.java @@ -7,7 +7,7 @@ /** Samples for MachineExtensions Delete. */ public final class MachineExtensionsDeleteSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/DELETEExtension.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/extension/Extension_Delete.json */ /** * Sample code: Delete a Machine Extension. diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsGetSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsGetSamples.java index 416dd1991c20b..b57973905b199 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsGetSamples.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsGetSamples.java @@ -7,7 +7,7 @@ /** Samples for MachineExtensions Get. */ public final class MachineExtensionsGetSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/GETExtension.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/extension/Extension_Get.json */ /** * Sample code: GET Machine Extension. diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsListSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsListSamples.java index c2842b61fa850..049539c97b649 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsListSamples.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsListSamples.java @@ -7,14 +7,15 @@ /** Samples for MachineExtensions List. */ public final class MachineExtensionsListSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/LISTExtension.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/extension/Extension_List.json */ /** - * Sample code: GET all Machine Extensions. + * Sample code: GET all Machine Extensions - List. * * @param manager Entry point to HybridComputeManager. */ - public static void gETAllMachineExtensions(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + public static void gETAllMachineExtensionsList( + com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { manager.machineExtensions().list("myResourceGroup", "myMachine", null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsUpdateSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsUpdateSamples.java index 4f1f52674c6e3..b336e4dcfeee5 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsUpdateSamples.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsUpdateSamples.java @@ -4,16 +4,14 @@ package com.azure.resourcemanager.hybridcompute.generated; -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.hybridcompute.models.MachineExtension; -import com.azure.resourcemanager.hybridcompute.models.MachineExtensionUpdateProperties; -import java.io.IOException; +import java.util.HashMap; +import java.util.Map; /** Samples for MachineExtensions Update. */ public final class MachineExtensionsUpdateSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/UpdateExtension.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/extension/Extension_Update.json */ /** * Sample code: Create or Update a Machine Extension. @@ -21,7 +19,7 @@ public final class MachineExtensionsUpdateSamples { * @param manager Entry point to HybridComputeManager. */ public static void createOrUpdateAMachineExtension( - com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) throws IOException { + com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { MachineExtension resource = manager .machineExtensions() @@ -30,19 +28,24 @@ public static void createOrUpdateAMachineExtension( .getValue(); resource .update() - .withProperties( - new MachineExtensionUpdateProperties() - .withPublisher("Microsoft.Compute") - .withType("CustomScriptExtension") - .withTypeHandlerVersion("1.10") - .withSettings( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize( - "{\"commandToExecute\":\"powershell.exe -c \\\"Get-Process | Where-Object { $_.CPU -lt" - + " 100 }\\\"\"}", - Object.class, - SerializerEncoding.JSON))) + .withPublisher("Microsoft.Compute") + .withType("CustomScriptExtension") + .withTypeHandlerVersion("1.10") + .withEnableAutomaticUpgrade(true) + .withSettings( + mapOf("commandToExecute", "powershell.exe -c \"Get-Process | Where-Object { $_.CPU -lt 100 }\"")) .apply(); } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } } diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineRunCommandsCreateOrUpdateSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineRunCommandsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..bc6e8c0baa656 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineRunCommandsCreateOrUpdateSamples.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.hybridcompute.generated; + +import com.azure.resourcemanager.hybridcompute.models.MachineRunCommandScriptSource; +import com.azure.resourcemanager.hybridcompute.models.RunCommandInputParameter; +import java.util.Arrays; + +/** Samples for MachineRunCommands CreateOrUpdate. */ +public final class MachineRunCommandsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/runCommand/RunCommands_CreateOrUpdate.json + */ + /** + * Sample code: Create or Update a Run Command. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void createOrUpdateARunCommand(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager + .machineRunCommands() + .define("myRunCommand") + .withRegion("eastus2") + .withExistingMachine("myResourceGroup", "myMachine") + .withSource(new MachineRunCommandScriptSource().withScript("Write-Host Hello World!")) + .withParameters( + Arrays + .asList( + new RunCommandInputParameter().withName("param1").withValue("value1"), + new RunCommandInputParameter().withName("param2").withValue("value2"))) + .withAsyncExecution(false) + .withRunAsUser("user1") + .withRunAsPassword("") + .withTimeoutInSeconds(3600) + .withOutputBlobUri( + "https://mystorageaccount.blob.core.windows.net/myscriptoutputcontainer/MyScriptoutput.txt") + .withErrorBlobUri( + "https://mystorageaccount.blob.core.windows.net/mycontainer/MyScriptError.txt?sp=racw&st=2022-10-07T19:40:21Z&se=2022-10-08T03:40:21Z&spr=https&sv=2021-06-08&sr=b&sig=Yh7B%2Fy83olbYBdfsfbUREvd7ol8Dq5EVP3lAO4Kj4xDcN8%3D") + .create(); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineRunCommandsDeleteSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineRunCommandsDeleteSamples.java new file mode 100644 index 0000000000000..25a11ad34e129 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineRunCommandsDeleteSamples.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.hybridcompute.generated; + +/** Samples for MachineRunCommands Delete. */ +public final class MachineRunCommandsDeleteSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/runCommand/RunCommands_Delete.json + */ + /** + * Sample code: Delete a Machine Run Command. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void deleteAMachineRunCommand(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager + .machineRunCommands() + .delete("myResourceGroup", "myMachine", "myRunCommand", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineRunCommandsGetSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineRunCommandsGetSamples.java new file mode 100644 index 0000000000000..19431fada5998 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineRunCommandsGetSamples.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.hybridcompute.generated; + +/** Samples for MachineRunCommands Get. */ +public final class MachineRunCommandsGetSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/runCommand/RunCommands_Get.json + */ + /** + * Sample code: Get a Run Command. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void getARunCommand(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager + .machineRunCommands() + .getWithResponse("myResourceGroup", "myMachine", "myRunCommand", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineRunCommandsListSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineRunCommandsListSamples.java new file mode 100644 index 0000000000000..789a195d93575 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineRunCommandsListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.generated; + +/** Samples for MachineRunCommands List. */ +public final class MachineRunCommandsListSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/runCommand/RunCommands_List.json + */ + /** + * Sample code: GET all Machine Run Commands. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void gETAllMachineRunCommands(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager.machineRunCommands().list("myResourceGroup", "myMachine", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineRunCommandsUpdateSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineRunCommandsUpdateSamples.java new file mode 100644 index 0000000000000..5f45a2d83f2e0 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineRunCommandsUpdateSamples.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.hybridcompute.generated; + +import com.azure.resourcemanager.hybridcompute.models.MachineRunCommand; +import java.util.HashMap; +import java.util.Map; + +/** Samples for MachineRunCommands Update. */ +public final class MachineRunCommandsUpdateSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/runCommand/RunCommands_Update.json + */ + /** + * Sample code: Update a Run Command. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void updateARunCommand(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + MachineRunCommand resource = + manager + .machineRunCommands() + .getWithResponse("myResourceGroup", "myMachine", "myRunCommand", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachinesAssessPatchesSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachinesAssessPatchesSamples.java new file mode 100644 index 0000000000000..1a2db4207dc72 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachinesAssessPatchesSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.generated; + +/** Samples for Machines AssessPatches. */ +public final class MachinesAssessPatchesSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/machine/Machine_AssessPatches.json + */ + /** + * Sample code: Assess patch state of a machine. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void assessPatchStateOfAMachine( + com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager.machines().assessPatches("myResourceGroupName", "myMachineName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachinesDeleteSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachinesDeleteSamples.java index 38e90f672b9ac..517ecb5bff4ff 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachinesDeleteSamples.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachinesDeleteSamples.java @@ -7,7 +7,7 @@ /** Samples for Machines Delete. */ public final class MachinesDeleteSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/Machines_Delete.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/machine/Machines_Delete.json */ /** * Sample code: Delete a Machine. diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachinesGetByResourceGroupSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachinesGetByResourceGroupSamples.java index 216fe91a0e011..47c75fca7738a 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachinesGetByResourceGroupSamples.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachinesGetByResourceGroupSamples.java @@ -4,10 +4,28 @@ package com.azure.resourcemanager.hybridcompute.generated; +import com.azure.resourcemanager.hybridcompute.models.InstanceViewTypes; + /** Samples for Machines GetByResourceGroup. */ public final class MachinesGetByResourceGroupSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/Machines_Get.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/machine/Machines_Get_LicenseProfileInstanceView.json + */ + /** + * Sample code: Get Machine with License Profile Instance View. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void getMachineWithLicenseProfileInstanceView( + com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager + .machines() + .getByResourceGroupWithResponse( + "myResourceGroup", "myMachine", InstanceViewTypes.INSTANCE_VIEW, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/machine/Machines_Get.json */ /** * Sample code: Get Machine. diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachinesInstallPatchesSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachinesInstallPatchesSamples.java new file mode 100644 index 0000000000000..d5885b32d9cd6 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachinesInstallPatchesSamples.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.hybridcompute.generated; + +import com.azure.resourcemanager.hybridcompute.models.MachineInstallPatchesParameters; +import com.azure.resourcemanager.hybridcompute.models.VMGuestPatchClassificationWindows; +import com.azure.resourcemanager.hybridcompute.models.VMGuestPatchRebootSetting; +import com.azure.resourcemanager.hybridcompute.models.WindowsParameters; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** Samples for Machines InstallPatches. */ +public final class MachinesInstallPatchesSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/machine/Machine_InstallPatches.json + */ + /** + * Sample code: Install patch state of a machine. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void installPatchStateOfAMachine( + com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager + .machines() + .installPatches( + "myResourceGroupName", + "myMachineName", + new MachineInstallPatchesParameters() + .withMaximumDuration("PT4H") + .withRebootSetting(VMGuestPatchRebootSetting.IF_REQUIRED) + .withWindowsParameters( + new WindowsParameters() + .withClassificationsToInclude( + Arrays + .asList( + VMGuestPatchClassificationWindows.CRITICAL, + VMGuestPatchClassificationWindows.SECURITY)) + .withMaxPatchPublishDate(OffsetDateTime.parse("2021-08-19T02:36:43.0539904+00:00"))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachinesListByResourceGroupSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachinesListByResourceGroupSamples.java index f360b6dbce48d..87f1b827c16c9 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachinesListByResourceGroupSamples.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachinesListByResourceGroupSamples.java @@ -7,7 +7,7 @@ /** Samples for Machines ListByResourceGroup. */ public final class MachinesListByResourceGroupSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/Machines_ListByResourceGroup.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/machine/Machines_ListByResourceGroup.json */ /** * Sample code: List Machines by resource group. @@ -16,6 +16,6 @@ public final class MachinesListByResourceGroupSamples { */ public static void listMachinesByResourceGroup( com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { - manager.machines().listByResourceGroup("myResourceGroup", com.azure.core.util.Context.NONE); + manager.machines().listByResourceGroup("myResourceGroup", null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachinesListSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachinesListSamples.java index d841661f85f5f..d14b078e24a5d 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachinesListSamples.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachinesListSamples.java @@ -7,7 +7,7 @@ /** Samples for Machines List. */ public final class MachinesListSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/Machines_ListBySubscription.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/machine/Machines_ListBySubscription.json */ /** * Sample code: List Machines by resource group. diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/NetworkProfileGetSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/NetworkProfileGetSamples.java new file mode 100644 index 0000000000000..33c0dbde8428e --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/NetworkProfileGetSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.generated; + +/** Samples for NetworkProfile Get. */ +public final class NetworkProfileGetSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/NetworkProfile_Get.json + */ + /** + * Sample code: GET Network Profile. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void gETNetworkProfile(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager.networkProfiles().getWithResponse("myResourceGroup", "myMachine", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/OperationsListSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/OperationsListSamples.java new file mode 100644 index 0000000000000..da66ca66341d9 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/OperationsListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.generated; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/Operations_List.json + */ + /** + * Sample code: List Hybrid Compute Provider Operations. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void listHybridComputeProviderOperations( + com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java index 66b1497a01f20..c076c34da5040 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java @@ -10,7 +10,7 @@ /** Samples for PrivateEndpointConnections CreateOrUpdate. */ public final class PrivateEndpointConnectionsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/PrivateEndpointConnectionUpdate.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/privateEndpoint/PrivateEndpointConnection_Update.json */ /** * Sample code: Approve or reject a private endpoint connection with a given name. diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsDeleteSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsDeleteSamples.java index a6df55810a3f9..c80ac3548a260 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsDeleteSamples.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsDeleteSamples.java @@ -7,7 +7,7 @@ /** Samples for PrivateEndpointConnections Delete. */ public final class PrivateEndpointConnectionsDeleteSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/PrivateEndpointConnectionDelete.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/privateEndpoint/PrivateEndpointConnection_Delete.json */ /** * Sample code: Deletes a private endpoint connection with a given name. diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsGetSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsGetSamples.java index 543bdb673ce60..2c2ae571e25b4 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsGetSamples.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsGetSamples.java @@ -7,7 +7,7 @@ /** Samples for PrivateEndpointConnections Get. */ public final class PrivateEndpointConnectionsGetSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/PrivateEndpointConnectionGet.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/privateEndpoint/PrivateEndpointConnection_Get.json */ /** * Sample code: Gets private endpoint connection. diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsListByPrivateLinkScopeSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsListByPrivateLinkScopeSamples.java index f8ded908706e3..89e66cd8bf3a5 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsListByPrivateLinkScopeSamples.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsListByPrivateLinkScopeSamples.java @@ -7,7 +7,7 @@ /** Samples for PrivateEndpointConnections ListByPrivateLinkScope. */ public final class PrivateEndpointConnectionsListByPrivateLinkScopeSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/PrivateEndpointConnectionList.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/privateEndpoint/PrivateEndpointConnection_List.json */ /** * Sample code: Gets list of private endpoint connections on a private link scope. diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkResourcesGetSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkResourcesGetSamples.java index 85c142b8fe4e4..a07e3849585de 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkResourcesGetSamples.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkResourcesGetSamples.java @@ -7,7 +7,7 @@ /** Samples for PrivateLinkResources Get. */ public final class PrivateLinkResourcesGetSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/PrivateLinkScopePrivateLinkResourceGet.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/privateLinkScope/PrivateLinkScopePrivateLinkResource_Get.json */ /** * Sample code: Gets private endpoint connection. diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkResourcesListByPrivateLinkScopeSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkResourcesListByPrivateLinkScopeSamples.java index f6b06f55ae03f..19895395f9a83 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkResourcesListByPrivateLinkScopeSamples.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkResourcesListByPrivateLinkScopeSamples.java @@ -7,7 +7,7 @@ /** Samples for PrivateLinkResources ListByPrivateLinkScope. */ public final class PrivateLinkResourcesListByPrivateLinkScopeSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/PrivateLinkScopePrivateLinkResourceListGet.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/privateLinkScope/PrivateLinkScopePrivateLinkResource_ListGet.json */ /** * Sample code: Gets private endpoint connection. diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesCreateOrUpdateSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesCreateOrUpdateSamples.java index ed63b880a03ce..bdda137dda516 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesCreateOrUpdateSamples.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesCreateOrUpdateSamples.java @@ -10,7 +10,7 @@ /** Samples for PrivateLinkScopes CreateOrUpdate. */ public final class PrivateLinkScopesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/PrivateLinkScopesCreate.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/privateLinkScope/PrivateLinkScopes_Create.json */ /** * Sample code: PrivateLinkScopeCreate. @@ -27,7 +27,7 @@ public static void privateLinkScopeCreate(com.azure.resourcemanager.hybridcomput } /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/PrivateLinkScopesUpdate.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/privateLinkScope/PrivateLinkScopes_Update.json */ /** * Sample code: PrivateLinkScopeUpdate. @@ -44,6 +44,7 @@ public static void privateLinkScopeUpdate(com.azure.resourcemanager.hybridcomput .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesDeleteSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesDeleteSamples.java index 152618abf0dc5..c535a33268d9d 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesDeleteSamples.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesDeleteSamples.java @@ -7,7 +7,7 @@ /** Samples for PrivateLinkScopes Delete. */ public final class PrivateLinkScopesDeleteSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/PrivateLinkScopesDelete.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/privateLinkScope/PrivateLinkScopes_Delete.json */ /** * Sample code: PrivateLinkScopesDelete. diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesGetByResourceGroupSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesGetByResourceGroupSamples.java index 9d7668ba127e1..fac781133e2b9 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesGetByResourceGroupSamples.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesGetByResourceGroupSamples.java @@ -7,7 +7,7 @@ /** Samples for PrivateLinkScopes GetByResourceGroup. */ public final class PrivateLinkScopesGetByResourceGroupSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/PrivateLinkScopesGet.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/privateLinkScope/PrivateLinkScopes_Get.json */ /** * Sample code: PrivateLinkScopeGet. diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesGetValidationDetailsForMachineSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesGetValidationDetailsForMachineSamples.java index ef50d70f95de4..497d9016f25e2 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesGetValidationDetailsForMachineSamples.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesGetValidationDetailsForMachineSamples.java @@ -7,7 +7,7 @@ /** Samples for PrivateLinkScopes GetValidationDetailsForMachine. */ public final class PrivateLinkScopesGetValidationDetailsForMachineSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/PrivateLinkScopesGetValidationForMachine.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/privateLinkScope/PrivateLinkScopes_GetValidationForMachine.json */ /** * Sample code: PrivateLinkScopeGet. diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesGetValidationDetailsSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesGetValidationDetailsSamples.java index b197109101def..12e001ab1b413 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesGetValidationDetailsSamples.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesGetValidationDetailsSamples.java @@ -7,7 +7,7 @@ /** Samples for PrivateLinkScopes GetValidationDetails. */ public final class PrivateLinkScopesGetValidationDetailsSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/PrivateLinkScopesGetValidation.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/privateLinkScope/PrivateLinkScopes_GetValidation.json */ /** * Sample code: PrivateLinkScopeGet. diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesListByResourceGroupSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesListByResourceGroupSamples.java index 7156df7a89065..d70b7480ebb21 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesListByResourceGroupSamples.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesListByResourceGroupSamples.java @@ -7,7 +7,7 @@ /** Samples for PrivateLinkScopes ListByResourceGroup. */ public final class PrivateLinkScopesListByResourceGroupSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/PrivateLinkScopesListByResourceGroup.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/privateLinkScope/PrivateLinkScopes_ListByResourceGroup.json */ /** * Sample code: PrivateLinkScopeListByResourceGroup. diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesListSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesListSamples.java index c5cb7770a8781..21378c5ca8467 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesListSamples.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesListSamples.java @@ -7,7 +7,7 @@ /** Samples for PrivateLinkScopes List. */ public final class PrivateLinkScopesListSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/PrivateLinkScopesList.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/privateLinkScope/PrivateLinkScopes_List.json */ /** * Sample code: PrivateLinkScopesList.json. diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesUpdateTagsSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesUpdateTagsSamples.java index 133463cda217d..4ba89a19596d0 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesUpdateTagsSamples.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesUpdateTagsSamples.java @@ -11,7 +11,7 @@ /** Samples for PrivateLinkScopes UpdateTags. */ public final class PrivateLinkScopesUpdateTagsSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/PrivateLinkScopesUpdateTagsOnly.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/privateLinkScope/PrivateLinkScopes_UpdateTagsOnly.json */ /** * Sample code: PrivateLinkScopeUpdateTagsOnly. @@ -29,6 +29,7 @@ public static void privateLinkScopeUpdateTagsOnly( resource.update().withTags(mapOf("Tag1", "Value1", "Tag2", "Value2")).apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/ResourceProviderUpgradeExtensionsSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/ResourceProviderUpgradeExtensionsSamples.java new file mode 100644 index 0000000000000..c0cac76e98cab --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/ResourceProviderUpgradeExtensionsSamples.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.hybridcompute.generated; + +import com.azure.resourcemanager.hybridcompute.models.ExtensionTargetProperties; +import com.azure.resourcemanager.hybridcompute.models.MachineExtensionUpgrade; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ResourceProvider UpgradeExtensions. */ +public final class ResourceProviderUpgradeExtensionsSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/examples/extension/Extensions_Upgrade.json + */ + /** + * Sample code: Upgrade Machine Extensions. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void upgradeMachineExtensions(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager + .resourceProviders() + .upgradeExtensions( + "myResourceGroup", + "myMachine", + new MachineExtensionUpgrade() + .withExtensionTargets( + mapOf( + "Microsoft.Azure.Monitoring", + new ExtensionTargetProperties().withTargetVersion("2.0"), + "Microsoft.Compute.CustomScriptExtension", + new ExtensionTargetProperties().withTargetVersion("1.10"))), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/ConnectionDetailTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/ConnectionDetailTests.java deleted file mode 100644 index d256ccdab5356..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/ConnectionDetailTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridcompute.models.ConnectionDetail; - -public final class ConnectionDetailTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConnectionDetail model = - BinaryData - .fromString( - "{\"id\":\"ocmnyyazttbtwwrq\",\"privateIpAddress\":\"edckzywbiexzfey\",\"linkIdentifier\":\"axibxujw\",\"groupId\":\"qwalmuzyoxaepd\",\"memberName\":\"jancu\"}") - .toObject(ConnectionDetail.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConnectionDetail model = new ConnectionDetail(); - model = BinaryData.fromObject(model).toObject(ConnectionDetail.class); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/HybridComputePrivateLinkScopeInnerTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/HybridComputePrivateLinkScopeInnerTests.java deleted file mode 100644 index 941e9e6e7242c..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/HybridComputePrivateLinkScopeInnerTests.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridcompute.fluent.models.HybridComputePrivateLinkScopeInner; -import com.azure.resourcemanager.hybridcompute.models.HybridComputePrivateLinkScopeProperties; -import com.azure.resourcemanager.hybridcompute.models.PublicNetworkAccessType; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class HybridComputePrivateLinkScopeInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - HybridComputePrivateLinkScopeInner model = - BinaryData - .fromString( - "{\"properties\":{\"publicNetworkAccess\":\"Disabled\",\"provisioningState\":\"kcglhslaz\",\"privateLinkScopeId\":\"yggdtjixh\"},\"location\":\"uofqwe\",\"tags\":{\"bcibvyvdcsitynn\":\"menevfyexfwh\",\"f\":\"amdecte\",\"eypvhezrkg\":\"qsc\",\"sle\":\"hcjrefovgmk\"},\"id\":\"yvxyqjp\",\"name\":\"cattpngjcrcczsq\",\"type\":\"jh\"}") - .toObject(HybridComputePrivateLinkScopeInner.class); - Assertions.assertEquals("uofqwe", model.location()); - Assertions.assertEquals("menevfyexfwh", model.tags().get("bcibvyvdcsitynn")); - Assertions.assertEquals(PublicNetworkAccessType.DISABLED, model.properties().publicNetworkAccess()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HybridComputePrivateLinkScopeInner model = - new HybridComputePrivateLinkScopeInner() - .withLocation("uofqwe") - .withTags( - mapOf("bcibvyvdcsitynn", "menevfyexfwh", "f", "amdecte", "eypvhezrkg", "qsc", "sle", "hcjrefovgmk")) - .withProperties( - new HybridComputePrivateLinkScopeProperties() - .withPublicNetworkAccess(PublicNetworkAccessType.DISABLED)); - model = BinaryData.fromObject(model).toObject(HybridComputePrivateLinkScopeInner.class); - Assertions.assertEquals("uofqwe", model.location()); - Assertions.assertEquals("menevfyexfwh", model.tags().get("bcibvyvdcsitynn")); - Assertions.assertEquals(PublicNetworkAccessType.DISABLED, model.properties().publicNetworkAccess()); - } - - @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/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/HybridComputePrivateLinkScopeListResultTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/HybridComputePrivateLinkScopeListResultTests.java deleted file mode 100644 index 99925c07c2664..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/HybridComputePrivateLinkScopeListResultTests.java +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridcompute.fluent.models.HybridComputePrivateLinkScopeInner; -import com.azure.resourcemanager.hybridcompute.models.HybridComputePrivateLinkScopeListResult; -import com.azure.resourcemanager.hybridcompute.models.HybridComputePrivateLinkScopeProperties; -import com.azure.resourcemanager.hybridcompute.models.PublicNetworkAccessType; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class HybridComputePrivateLinkScopeListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - HybridComputePrivateLinkScopeListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"publicNetworkAccess\":\"Enabled\",\"provisioningState\":\"e\",\"privateLinkScopeId\":\"a\"},\"location\":\"uhrzayvvt\",\"tags\":{\"ftutqxlngxlefgu\":\"dfgiot\",\"qmi\":\"nxkrx\"},\"id\":\"tthzrvqd\",\"name\":\"abhjybi\",\"type\":\"ehoqfbowskan\"},{\"properties\":{\"publicNetworkAccess\":\"Disabled\",\"provisioningState\":\"cuiywgqyw\",\"privateLinkScopeId\":\"drvyn\"},\"location\":\"gpphrcgyn\",\"tags\":{\"vmmcoofs\":\"pec\",\"y\":\"lzevgbmqjqab\",\"wnfnbacf\":\"mivkwlzuvcc\",\"bqqwxrj\":\"onlebxetqgtzxdpn\"},\"id\":\"eallnwsubisnj\",\"name\":\"mpmngnzscxaqwoo\",\"type\":\"hcbonqvpkvlr\"},{\"properties\":{\"publicNetworkAccess\":\"Enabled\",\"provisioningState\":\"seiphe\",\"privateLinkScopeId\":\"lokeyy\"},\"location\":\"nj\",\"tags\":{\"masxazjpqyegu\":\"wtgrhpdjpj\",\"wdslfhotwmcy\":\"lhbxxhejjzzvdud\",\"cftadeh\":\"pwlbjnpg\"},\"id\":\"nltyfsoppusuesnz\",\"name\":\"dejbavo\",\"type\":\"xzdmohctb\"}],\"nextLink\":\"udwxdndnvowguj\"}") - .toObject(HybridComputePrivateLinkScopeListResult.class); - Assertions.assertEquals("uhrzayvvt", model.value().get(0).location()); - Assertions.assertEquals("dfgiot", model.value().get(0).tags().get("ftutqxlngxlefgu")); - Assertions - .assertEquals(PublicNetworkAccessType.ENABLED, model.value().get(0).properties().publicNetworkAccess()); - Assertions.assertEquals("udwxdndnvowguj", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HybridComputePrivateLinkScopeListResult model = - new HybridComputePrivateLinkScopeListResult() - .withValue( - Arrays - .asList( - new HybridComputePrivateLinkScopeInner() - .withLocation("uhrzayvvt") - .withTags(mapOf("ftutqxlngxlefgu", "dfgiot", "qmi", "nxkrx")) - .withProperties( - new HybridComputePrivateLinkScopeProperties() - .withPublicNetworkAccess(PublicNetworkAccessType.ENABLED)), - new HybridComputePrivateLinkScopeInner() - .withLocation("gpphrcgyn") - .withTags( - mapOf( - "vmmcoofs", - "pec", - "y", - "lzevgbmqjqab", - "wnfnbacf", - "mivkwlzuvcc", - "bqqwxrj", - "onlebxetqgtzxdpn")) - .withProperties( - new HybridComputePrivateLinkScopeProperties() - .withPublicNetworkAccess(PublicNetworkAccessType.DISABLED)), - new HybridComputePrivateLinkScopeInner() - .withLocation("nj") - .withTags( - mapOf( - "masxazjpqyegu", - "wtgrhpdjpj", - "wdslfhotwmcy", - "lhbxxhejjzzvdud", - "cftadeh", - "pwlbjnpg")) - .withProperties( - new HybridComputePrivateLinkScopeProperties() - .withPublicNetworkAccess(PublicNetworkAccessType.ENABLED)))) - .withNextLink("udwxdndnvowguj"); - model = BinaryData.fromObject(model).toObject(HybridComputePrivateLinkScopeListResult.class); - Assertions.assertEquals("uhrzayvvt", model.value().get(0).location()); - Assertions.assertEquals("dfgiot", model.value().get(0).tags().get("ftutqxlngxlefgu")); - Assertions - .assertEquals(PublicNetworkAccessType.ENABLED, model.value().get(0).properties().publicNetworkAccess()); - Assertions.assertEquals("udwxdndnvowguj", model.nextLink()); - } - - @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/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/HybridComputePrivateLinkScopePropertiesTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/HybridComputePrivateLinkScopePropertiesTests.java deleted file mode 100644 index fc16fd745b0b3..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/HybridComputePrivateLinkScopePropertiesTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridcompute.models.HybridComputePrivateLinkScopeProperties; -import com.azure.resourcemanager.hybridcompute.models.PublicNetworkAccessType; -import org.junit.jupiter.api.Assertions; - -public final class HybridComputePrivateLinkScopePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - HybridComputePrivateLinkScopeProperties model = - BinaryData - .fromString( - "{\"publicNetworkAccess\":\"Enabled\",\"provisioningState\":\"jvnysounqe\",\"privateLinkScopeId\":\"noae\"}") - .toObject(HybridComputePrivateLinkScopeProperties.class); - Assertions.assertEquals(PublicNetworkAccessType.ENABLED, model.publicNetworkAccess()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HybridComputePrivateLinkScopeProperties model = - new HybridComputePrivateLinkScopeProperties().withPublicNetworkAccess(PublicNetworkAccessType.ENABLED); - model = BinaryData.fromObject(model).toObject(HybridComputePrivateLinkScopeProperties.class); - Assertions.assertEquals(PublicNetworkAccessType.ENABLED, model.publicNetworkAccess()); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/IdentityTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/IdentityTests.java deleted file mode 100644 index a2e3fc674fb3f..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/IdentityTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridcompute.models.Identity; -import com.azure.resourcemanager.hybridcompute.models.ResourceIdentityType; -import org.junit.jupiter.api.Assertions; - -public final class IdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Identity model = - BinaryData - .fromString( - "{\"principalId\":\"scnpqxuhivy\",\"tenantId\":\"iwbybrkxvdumjg\",\"type\":\"SystemAssigned\"}") - .toObject(Identity.class); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Identity model = new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED); - model = BinaryData.fromObject(model).toObject(Identity.class); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.type()); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/LocationDataTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/LocationDataTests.java deleted file mode 100644 index b050b13c6523c..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/LocationDataTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridcompute.models.LocationData; -import org.junit.jupiter.api.Assertions; - -public final class LocationDataTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LocationData model = - BinaryData - .fromString( - "{\"name\":\"ekuksjtx\",\"city\":\"cdm\",\"district\":\"rcryuanzwuxzdxta\",\"countryOrRegion\":\"lhmwhfpmrqobm\"}") - .toObject(LocationData.class); - Assertions.assertEquals("ekuksjtx", model.name()); - Assertions.assertEquals("cdm", model.city()); - Assertions.assertEquals("rcryuanzwuxzdxta", model.district()); - Assertions.assertEquals("lhmwhfpmrqobm", model.countryOrRegion()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LocationData model = - new LocationData() - .withName("ekuksjtx") - .withCity("cdm") - .withDistrict("rcryuanzwuxzdxta") - .withCountryOrRegion("lhmwhfpmrqobm"); - model = BinaryData.fromObject(model).toObject(LocationData.class); - Assertions.assertEquals("ekuksjtx", model.name()); - Assertions.assertEquals("cdm", model.city()); - Assertions.assertEquals("rcryuanzwuxzdxta", model.district()); - Assertions.assertEquals("lhmwhfpmrqobm", model.countryOrRegion()); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionInnerTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionInnerTests.java deleted file mode 100644 index 208af6901063a..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionInnerTests.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridcompute.fluent.models.MachineExtensionInner; -import com.azure.resourcemanager.hybridcompute.models.MachineExtensionInstanceView; -import com.azure.resourcemanager.hybridcompute.models.MachineExtensionProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class MachineExtensionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MachineExtensionInner model = - BinaryData - .fromString( - "{\"properties\":{\"forceUpdateTag\":\"jwyahuxinpmqnja\",\"publisher\":\"ixjsprozvcputeg\",\"type\":\"wmfdatscmdvpjhul\",\"typeHandlerVersion\":\"uvm\",\"autoUpgradeMinorVersion\":true,\"settings\":\"datak\",\"protectedSettings\":\"dataf\",\"provisioningState\":\"iodjp\",\"instanceView\":{\"name\":\"ej\",\"type\":\"vwryoqpso\",\"typeHandlerVersion\":\"ctazakljlahbcryf\"}},\"location\":\"dosyg\",\"tags\":{\"vdphlxaolthqtr\":\"aojakhmsbzjhcrz\",\"gvfcj\":\"qjbpfzfsin\",\"xjtfelluwfzit\":\"wzo\",\"qfpjk\":\"np\"},\"id\":\"lxofpdvhpfxxypin\",\"name\":\"nmayhuybb\",\"type\":\"podepoo\"}") - .toObject(MachineExtensionInner.class); - Assertions.assertEquals("dosyg", model.location()); - Assertions.assertEquals("aojakhmsbzjhcrz", model.tags().get("vdphlxaolthqtr")); - Assertions.assertEquals("jwyahuxinpmqnja", model.properties().forceUpdateTag()); - Assertions.assertEquals("ixjsprozvcputeg", model.properties().publisher()); - Assertions.assertEquals("wmfdatscmdvpjhul", model.properties().type()); - Assertions.assertEquals("uvm", model.properties().typeHandlerVersion()); - Assertions.assertEquals(true, model.properties().autoUpgradeMinorVersion()); - Assertions.assertEquals("ej", model.properties().instanceView().name()); - Assertions.assertEquals("vwryoqpso", model.properties().instanceView().type()); - Assertions.assertEquals("ctazakljlahbcryf", model.properties().instanceView().typeHandlerVersion()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MachineExtensionInner model = - new MachineExtensionInner() - .withLocation("dosyg") - .withTags( - mapOf( - "vdphlxaolthqtr", - "aojakhmsbzjhcrz", - "gvfcj", - "qjbpfzfsin", - "xjtfelluwfzit", - "wzo", - "qfpjk", - "np")) - .withProperties( - new MachineExtensionProperties() - .withForceUpdateTag("jwyahuxinpmqnja") - .withPublisher("ixjsprozvcputeg") - .withType("wmfdatscmdvpjhul") - .withTypeHandlerVersion("uvm") - .withAutoUpgradeMinorVersion(true) - .withSettings("datak") - .withProtectedSettings("dataf") - .withInstanceView( - new MachineExtensionInstanceView() - .withName("ej") - .withType("vwryoqpso") - .withTypeHandlerVersion("ctazakljlahbcryf"))); - model = BinaryData.fromObject(model).toObject(MachineExtensionInner.class); - Assertions.assertEquals("dosyg", model.location()); - Assertions.assertEquals("aojakhmsbzjhcrz", model.tags().get("vdphlxaolthqtr")); - Assertions.assertEquals("jwyahuxinpmqnja", model.properties().forceUpdateTag()); - Assertions.assertEquals("ixjsprozvcputeg", model.properties().publisher()); - Assertions.assertEquals("wmfdatscmdvpjhul", model.properties().type()); - Assertions.assertEquals("uvm", model.properties().typeHandlerVersion()); - Assertions.assertEquals(true, model.properties().autoUpgradeMinorVersion()); - Assertions.assertEquals("ej", model.properties().instanceView().name()); - Assertions.assertEquals("vwryoqpso", model.properties().instanceView().type()); - Assertions.assertEquals("ctazakljlahbcryf", model.properties().instanceView().typeHandlerVersion()); - } - - @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/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionUpdatePropertiesTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionUpdatePropertiesTests.java deleted file mode 100644 index cb4cf2bed193d..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionUpdatePropertiesTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridcompute.models.MachineExtensionUpdateProperties; -import org.junit.jupiter.api.Assertions; - -public final class MachineExtensionUpdatePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MachineExtensionUpdateProperties model = - BinaryData - .fromString( - "{\"forceUpdateTag\":\"gphuticndvka\",\"publisher\":\"wyiftyhxhur\",\"type\":\"ftyxolniw\",\"typeHandlerVersion\":\"cukjf\",\"autoUpgradeMinorVersion\":false,\"settings\":\"dataw\",\"protectedSettings\":\"datalryplwckbasyy\"}") - .toObject(MachineExtensionUpdateProperties.class); - Assertions.assertEquals("gphuticndvka", model.forceUpdateTag()); - Assertions.assertEquals("wyiftyhxhur", model.publisher()); - Assertions.assertEquals("ftyxolniw", model.type()); - Assertions.assertEquals("cukjf", model.typeHandlerVersion()); - Assertions.assertEquals(false, model.autoUpgradeMinorVersion()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MachineExtensionUpdateProperties model = - new MachineExtensionUpdateProperties() - .withForceUpdateTag("gphuticndvka") - .withPublisher("wyiftyhxhur") - .withType("ftyxolniw") - .withTypeHandlerVersion("cukjf") - .withAutoUpgradeMinorVersion(false) - .withSettings("dataw") - .withProtectedSettings("datalryplwckbasyy"); - model = BinaryData.fromObject(model).toObject(MachineExtensionUpdateProperties.class); - Assertions.assertEquals("gphuticndvka", model.forceUpdateTag()); - Assertions.assertEquals("wyiftyhxhur", model.publisher()); - Assertions.assertEquals("ftyxolniw", model.type()); - Assertions.assertEquals("cukjf", model.typeHandlerVersion()); - Assertions.assertEquals(false, model.autoUpgradeMinorVersion()); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionUpdateTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionUpdateTests.java deleted file mode 100644 index ad22030e74b47..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionUpdateTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridcompute.models.MachineExtensionUpdate; -import com.azure.resourcemanager.hybridcompute.models.MachineExtensionUpdateProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class MachineExtensionUpdateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MachineExtensionUpdate model = - BinaryData - .fromString( - "{\"properties\":{\"forceUpdateTag\":\"njbiksqrglssain\",\"publisher\":\"jwnzlljfmp\",\"type\":\"ebvmgxsabkyqd\",\"typeHandlerVersion\":\"jitcjczdzevn\",\"autoUpgradeMinorVersion\":false,\"settings\":\"datawpdappdsbdkv\",\"protectedSettings\":\"datawjfeusnhutjel\"},\"tags\":{\"cdgea\":\"ldhugjzzdatqxh\"}}") - .toObject(MachineExtensionUpdate.class); - Assertions.assertEquals("ldhugjzzdatqxh", model.tags().get("cdgea")); - Assertions.assertEquals("njbiksqrglssain", model.properties().forceUpdateTag()); - Assertions.assertEquals("jwnzlljfmp", model.properties().publisher()); - Assertions.assertEquals("ebvmgxsabkyqd", model.properties().type()); - Assertions.assertEquals("jitcjczdzevn", model.properties().typeHandlerVersion()); - Assertions.assertEquals(false, model.properties().autoUpgradeMinorVersion()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MachineExtensionUpdate model = - new MachineExtensionUpdate() - .withTags(mapOf("cdgea", "ldhugjzzdatqxh")) - .withProperties( - new MachineExtensionUpdateProperties() - .withForceUpdateTag("njbiksqrglssain") - .withPublisher("jwnzlljfmp") - .withType("ebvmgxsabkyqd") - .withTypeHandlerVersion("jitcjczdzevn") - .withAutoUpgradeMinorVersion(false) - .withSettings("datawpdappdsbdkv") - .withProtectedSettings("datawjfeusnhutjel")); - model = BinaryData.fromObject(model).toObject(MachineExtensionUpdate.class); - Assertions.assertEquals("ldhugjzzdatqxh", model.tags().get("cdgea")); - Assertions.assertEquals("njbiksqrglssain", model.properties().forceUpdateTag()); - Assertions.assertEquals("jwnzlljfmp", model.properties().publisher()); - Assertions.assertEquals("ebvmgxsabkyqd", model.properties().type()); - Assertions.assertEquals("jitcjczdzevn", model.properties().typeHandlerVersion()); - Assertions.assertEquals(false, model.properties().autoUpgradeMinorVersion()); - } - - @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/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsCreateOrUpdateMockTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsCreateOrUpdateMockTests.java deleted file mode 100644 index ea9130e996538..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsCreateOrUpdateMockTests.java +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.hybridcompute.HybridComputeManager; -import com.azure.resourcemanager.hybridcompute.models.MachineExtension; -import com.azure.resourcemanager.hybridcompute.models.MachineExtensionInstanceView; -import com.azure.resourcemanager.hybridcompute.models.MachineExtensionProperties; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class MachineExtensionsCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"forceUpdateTag\":\"yq\",\"publisher\":\"ynduha\",\"type\":\"qlkth\",\"typeHandlerVersion\":\"aqolbgycduiertg\",\"autoUpgradeMinorVersion\":false,\"settings\":\"datavaolpsslqlf\",\"protectedSettings\":\"datadnbbglzps\",\"provisioningState\":\"Succeeded\",\"instanceView\":{\"name\":\"mnvdfzn\",\"type\":\"ao\",\"typeHandlerVersion\":\"xzb\"}},\"location\":\"lylpstdb\",\"tags\":{\"nevf\":\"srzdzucerscdn\"},\"id\":\"wjmy\",\"name\":\"tdss\",\"type\":\"s\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HybridComputeManager manager = - HybridComputeManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - MachineExtension response = - manager - .machineExtensions() - .define("u") - .withRegion("asrru") - .withExistingMachine("j", "n") - .withTags( - mapOf( - "bsrfbj", - "hsqfsubcgjbirxbp", - "otftpvjzbexilz", - "dtws", - "qtaruoujmkcjhwq", - "nfqqnvwp", - "ervnaenqpehi", - "tjrybnwjewgdr")) - .withProperties( - new MachineExtensionProperties() - .withForceUpdateTag("krtswbxqz") - .withPublisher("zjf") - .withType("vjfdx") - .withTypeHandlerVersion("vetvt") - .withAutoUpgradeMinorVersion(true) - .withSettings("datatdo") - .withProtectedSettings("datacbxvwvxyslqbh") - .withInstanceView( - new MachineExtensionInstanceView() - .withName("wwwfbkr") - .withType("nsvs") - .withTypeHandlerVersion("johxcrsb"))) - .create(); - - Assertions.assertEquals("lylpstdb", response.location()); - Assertions.assertEquals("srzdzucerscdn", response.tags().get("nevf")); - Assertions.assertEquals("yq", response.properties().forceUpdateTag()); - Assertions.assertEquals("ynduha", response.properties().publisher()); - Assertions.assertEquals("qlkth", response.properties().type()); - Assertions.assertEquals("aqolbgycduiertg", response.properties().typeHandlerVersion()); - Assertions.assertEquals(false, response.properties().autoUpgradeMinorVersion()); - Assertions.assertEquals("mnvdfzn", response.properties().instanceView().name()); - Assertions.assertEquals("ao", response.properties().instanceView().type()); - Assertions.assertEquals("xzb", response.properties().instanceView().typeHandlerVersion()); - } - - @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/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsDeleteMockTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsDeleteMockTests.java deleted file mode 100644 index eca69296e1582..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsDeleteMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.hybridcompute.HybridComputeManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class MachineExtensionsDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HybridComputeManager manager = - HybridComputeManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.machineExtensions().delete("qwgxhniskx", "bkpyc", "klwndnhjdauwhv", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsGetWithResponseMockTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsGetWithResponseMockTests.java deleted file mode 100644 index 10bb9dfd845eb..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsGetWithResponseMockTests.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.hybridcompute.HybridComputeManager; -import com.azure.resourcemanager.hybridcompute.models.MachineExtension; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class MachineExtensionsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"forceUpdateTag\":\"zqlveualupjmkhf\",\"publisher\":\"bbcswsrtjri\",\"type\":\"rbpbewtghfgblcg\",\"typeHandlerVersion\":\"zvlvqhjkbegib\",\"autoUpgradeMinorVersion\":false,\"settings\":\"dataiebwwaloayqcgwrt\",\"protectedSettings\":\"datauzgwyzmhtx\",\"provisioningState\":\"gmtsavjcbpwxqpsr\",\"instanceView\":{\"name\":\"tguvriuhp\",\"type\":\"mdyvxqtayriw\",\"typeHandlerVersion\":\"oyq\"}},\"location\":\"rmcqiby\",\"tags\":{\"e\":\"jvkn\",\"zhpvgqzcjrvxd\":\"qsgzvahapj\",\"vawjvzunlu\":\"zlmwlxkvugfhz\",\"xipeilpjzuaejx\":\"hnnpr\"},\"id\":\"ultskzbbtdz\",\"name\":\"mv\",\"type\":\"ekg\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HybridComputeManager manager = - HybridComputeManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - MachineExtension response = - manager - .machineExtensions() - .getWithResponse("l", "zbtd", "xujznbmpowu", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("rmcqiby", response.location()); - Assertions.assertEquals("jvkn", response.tags().get("e")); - Assertions.assertEquals("zqlveualupjmkhf", response.properties().forceUpdateTag()); - Assertions.assertEquals("bbcswsrtjri", response.properties().publisher()); - Assertions.assertEquals("rbpbewtghfgblcg", response.properties().type()); - Assertions.assertEquals("zvlvqhjkbegib", response.properties().typeHandlerVersion()); - Assertions.assertEquals(false, response.properties().autoUpgradeMinorVersion()); - Assertions.assertEquals("tguvriuhp", response.properties().instanceView().name()); - Assertions.assertEquals("mdyvxqtayriw", response.properties().instanceView().type()); - Assertions.assertEquals("oyq", response.properties().instanceView().typeHandlerVersion()); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsListMockTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsListMockTests.java deleted file mode 100644 index b25bd3dd8a48b..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsListMockTests.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.hybridcompute.HybridComputeManager; -import com.azure.resourcemanager.hybridcompute.models.MachineExtension; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class MachineExtensionsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"forceUpdateTag\":\"kqvkelnsmvbxwyjs\",\"publisher\":\"hhcaal\",\"type\":\"ixisxyawjoy\",\"typeHandlerVersion\":\"cslyjpk\",\"autoUpgradeMinorVersion\":true,\"settings\":\"datayexz\",\"protectedSettings\":\"datalixhnrztfol\",\"provisioningState\":\"nxknalaulp\",\"instanceView\":{\"name\":\"dtpnapnyiropuhp\",\"type\":\"vpgylgqgitxmed\",\"typeHandlerVersion\":\"c\"}},\"location\":\"n\",\"tags\":{\"zhxgktrmgucn\":\"ncw\",\"llwptfdy\":\"pkteo\",\"rhhuaopppcqeqx\":\"pfqbuaceopzf\",\"izpost\":\"lzdahzxctobgbkdm\"},\"id\":\"grcfb\",\"name\":\"nrmfqjhhk\",\"type\":\"bpvjymjhx\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HybridComputeManager manager = - HybridComputeManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.machineExtensions().list("wozuhkf", "bsjyofdx", "uusdttouwa", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("n", response.iterator().next().location()); - Assertions.assertEquals("ncw", response.iterator().next().tags().get("zhxgktrmgucn")); - Assertions.assertEquals("kqvkelnsmvbxwyjs", response.iterator().next().properties().forceUpdateTag()); - Assertions.assertEquals("hhcaal", response.iterator().next().properties().publisher()); - Assertions.assertEquals("ixisxyawjoy", response.iterator().next().properties().type()); - Assertions.assertEquals("cslyjpk", response.iterator().next().properties().typeHandlerVersion()); - Assertions.assertEquals(true, response.iterator().next().properties().autoUpgradeMinorVersion()); - Assertions.assertEquals("dtpnapnyiropuhp", response.iterator().next().properties().instanceView().name()); - Assertions.assertEquals("vpgylgqgitxmed", response.iterator().next().properties().instanceView().type()); - Assertions.assertEquals("c", response.iterator().next().properties().instanceView().typeHandlerVersion()); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsListResultTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsListResultTests.java deleted file mode 100644 index 109208762c9f6..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsListResultTests.java +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridcompute.fluent.models.MachineExtensionInner; -import com.azure.resourcemanager.hybridcompute.models.MachineExtensionProperties; -import com.azure.resourcemanager.hybridcompute.models.MachineExtensionsListResult; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class MachineExtensionsListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MachineExtensionsListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"forceUpdateTag\":\"kzsmodm\",\"publisher\":\"ougpbkwt\",\"type\":\"tduqktapspwgcuer\",\"typeHandlerVersion\":\"mkdo\",\"autoUpgradeMinorVersion\":false,\"settings\":\"datahbmdgbbjfdd\",\"protectedSettings\":\"databmbexppbhtqqro\",\"provisioningState\":\"p\"},\"location\":\"algbquxigjyjg\",\"tags\":{\"fhrtxilnerkujysv\":\"o\",\"fqawrlyxw\":\"eju\",\"xgjvtbv\":\"kcprbnw\",\"uouq\":\"ysszdnrujqguh\"},\"id\":\"prwzwbnguitnwui\",\"name\":\"gazxuf\",\"type\":\"zuckyfi\"},{\"properties\":{\"forceUpdateTag\":\"idf\",\"publisher\":\"wdzuhtymwisd\",\"type\":\"thwxmnteiwaopvkm\",\"typeHandlerVersion\":\"c\",\"autoUpgradeMinorVersion\":false,\"settings\":\"datacufufsrpymz\",\"protectedSettings\":\"datansez\",\"provisioningState\":\"tbzsgfyccs\"},\"location\":\"mdwzjeiachboo\",\"tags\":{\"hzzvypyq\":\"nrosfqpte\",\"z\":\"i\"},\"id\":\"npvswjdkirso\",\"name\":\"dqxhcrmnohjtckwh\",\"type\":\"soifiyipjxsqw\"},{\"properties\":{\"forceUpdateTag\":\"jbznorc\",\"publisher\":\"vsnb\",\"type\":\"qabnmoc\",\"typeHandlerVersion\":\"ysh\",\"autoUpgradeMinorVersion\":false,\"settings\":\"datafblj\",\"protectedSettings\":\"datapbtoqcjmkl\",\"provisioningState\":\"vbqid\"},\"location\":\"jzyulpk\",\"tags\":{\"gqexzlocxs\":\"krlkhbzhfepg\",\"bcsglumma\":\"paierh\",\"xkqpxo\":\"tjaodxobnb\",\"po\":\"ajionpimexgstxg\"},\"id\":\"gmaajrm\",\"name\":\"djwzrlov\",\"type\":\"clwhijcoejctbz\"}],\"nextLink\":\"s\"}") - .toObject(MachineExtensionsListResult.class); - Assertions.assertEquals("algbquxigjyjg", model.value().get(0).location()); - Assertions.assertEquals("o", model.value().get(0).tags().get("fhrtxilnerkujysv")); - Assertions.assertEquals("kzsmodm", model.value().get(0).properties().forceUpdateTag()); - Assertions.assertEquals("ougpbkwt", model.value().get(0).properties().publisher()); - Assertions.assertEquals("tduqktapspwgcuer", model.value().get(0).properties().type()); - Assertions.assertEquals("mkdo", model.value().get(0).properties().typeHandlerVersion()); - Assertions.assertEquals(false, model.value().get(0).properties().autoUpgradeMinorVersion()); - Assertions.assertEquals("s", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MachineExtensionsListResult model = - new MachineExtensionsListResult() - .withValue( - Arrays - .asList( - new MachineExtensionInner() - .withLocation("algbquxigjyjg") - .withTags( - mapOf( - "fhrtxilnerkujysv", - "o", - "fqawrlyxw", - "eju", - "xgjvtbv", - "kcprbnw", - "uouq", - "ysszdnrujqguh")) - .withProperties( - new MachineExtensionProperties() - .withForceUpdateTag("kzsmodm") - .withPublisher("ougpbkwt") - .withType("tduqktapspwgcuer") - .withTypeHandlerVersion("mkdo") - .withAutoUpgradeMinorVersion(false) - .withSettings("datahbmdgbbjfdd") - .withProtectedSettings("databmbexppbhtqqro")), - new MachineExtensionInner() - .withLocation("mdwzjeiachboo") - .withTags(mapOf("hzzvypyq", "nrosfqpte", "z", "i")) - .withProperties( - new MachineExtensionProperties() - .withForceUpdateTag("idf") - .withPublisher("wdzuhtymwisd") - .withType("thwxmnteiwaopvkm") - .withTypeHandlerVersion("c") - .withAutoUpgradeMinorVersion(false) - .withSettings("datacufufsrpymz") - .withProtectedSettings("datansez")), - new MachineExtensionInner() - .withLocation("jzyulpk") - .withTags( - mapOf( - "gqexzlocxs", - "krlkhbzhfepg", - "bcsglumma", - "paierh", - "xkqpxo", - "tjaodxobnb", - "po", - "ajionpimexgstxg")) - .withProperties( - new MachineExtensionProperties() - .withForceUpdateTag("jbznorc") - .withPublisher("vsnb") - .withType("qabnmoc") - .withTypeHandlerVersion("ysh") - .withAutoUpgradeMinorVersion(false) - .withSettings("datafblj") - .withProtectedSettings("datapbtoqcjmkl")))) - .withNextLink("s"); - model = BinaryData.fromObject(model).toObject(MachineExtensionsListResult.class); - Assertions.assertEquals("algbquxigjyjg", model.value().get(0).location()); - Assertions.assertEquals("o", model.value().get(0).tags().get("fhrtxilnerkujysv")); - Assertions.assertEquals("kzsmodm", model.value().get(0).properties().forceUpdateTag()); - Assertions.assertEquals("ougpbkwt", model.value().get(0).properties().publisher()); - Assertions.assertEquals("tduqktapspwgcuer", model.value().get(0).properties().type()); - Assertions.assertEquals("mkdo", model.value().get(0).properties().typeHandlerVersion()); - Assertions.assertEquals(false, model.value().get(0).properties().autoUpgradeMinorVersion()); - Assertions.assertEquals("s", model.nextLink()); - } - - @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/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineUpdatePropertiesTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineUpdatePropertiesTests.java deleted file mode 100644 index da85e3423d8cd..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineUpdatePropertiesTests.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridcompute.models.LocationData; -import com.azure.resourcemanager.hybridcompute.models.MachineUpdateProperties; -import org.junit.jupiter.api.Assertions; - -public final class MachineUpdatePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MachineUpdateProperties model = - BinaryData - .fromString( - "{\"locationData\":{\"name\":\"hdwbavxbniwdjs\",\"city\":\"tsdbpgn\",\"district\":\"txhp\",\"countryOrRegion\":\"bzpfzab\"},\"parentClusterResourceId\":\"cuh\",\"privateLinkScopeResourceId\":\"tcty\"}") - .toObject(MachineUpdateProperties.class); - Assertions.assertEquals("hdwbavxbniwdjs", model.locationData().name()); - Assertions.assertEquals("tsdbpgn", model.locationData().city()); - Assertions.assertEquals("txhp", model.locationData().district()); - Assertions.assertEquals("bzpfzab", model.locationData().countryOrRegion()); - Assertions.assertEquals("cuh", model.parentClusterResourceId()); - Assertions.assertEquals("tcty", model.privateLinkScopeResourceId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MachineUpdateProperties model = - new MachineUpdateProperties() - .withLocationData( - new LocationData() - .withName("hdwbavxbniwdjs") - .withCity("tsdbpgn") - .withDistrict("txhp") - .withCountryOrRegion("bzpfzab")) - .withParentClusterResourceId("cuh") - .withPrivateLinkScopeResourceId("tcty"); - model = BinaryData.fromObject(model).toObject(MachineUpdateProperties.class); - Assertions.assertEquals("hdwbavxbniwdjs", model.locationData().name()); - Assertions.assertEquals("tsdbpgn", model.locationData().city()); - Assertions.assertEquals("txhp", model.locationData().district()); - Assertions.assertEquals("bzpfzab", model.locationData().countryOrRegion()); - Assertions.assertEquals("cuh", model.parentClusterResourceId()); - Assertions.assertEquals("tcty", model.privateLinkScopeResourceId()); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineUpdateTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineUpdateTests.java deleted file mode 100644 index d1f7cc517be41..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineUpdateTests.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridcompute.models.Identity; -import com.azure.resourcemanager.hybridcompute.models.LocationData; -import com.azure.resourcemanager.hybridcompute.models.MachineUpdate; -import com.azure.resourcemanager.hybridcompute.models.MachineUpdateProperties; -import com.azure.resourcemanager.hybridcompute.models.ResourceIdentityType; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class MachineUpdateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MachineUpdate model = - BinaryData - .fromString( - "{\"identity\":{\"principalId\":\"lbbovplw\",\"tenantId\":\"hvgyuguosvmk\",\"type\":\"SystemAssigned\"},\"properties\":{\"locationData\":{\"name\":\"ukkfplgmgs\",\"city\":\"kjz\",\"district\":\"es\",\"countryOrRegion\":\"vlopwiyighx\"},\"parentClusterResourceId\":\"dwzbaiue\",\"privateLinkScopeResourceId\":\"a\"},\"tags\":{\"mtxpsiebtfh\":\"yqupedeojnabckh\",\"htldwk\":\"pesapskrdqmhjj\",\"otogtwrupqs\":\"zxuutkncwscwsvl\",\"cykvceo\":\"vnm\"}}") - .toObject(MachineUpdate.class); - Assertions.assertEquals("yqupedeojnabckh", model.tags().get("mtxpsiebtfh")); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.identity().type()); - Assertions.assertEquals("ukkfplgmgs", model.properties().locationData().name()); - Assertions.assertEquals("kjz", model.properties().locationData().city()); - Assertions.assertEquals("es", model.properties().locationData().district()); - Assertions.assertEquals("vlopwiyighx", model.properties().locationData().countryOrRegion()); - Assertions.assertEquals("dwzbaiue", model.properties().parentClusterResourceId()); - Assertions.assertEquals("a", model.properties().privateLinkScopeResourceId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MachineUpdate model = - new MachineUpdate() - .withTags( - mapOf( - "mtxpsiebtfh", - "yqupedeojnabckh", - "htldwk", - "pesapskrdqmhjj", - "otogtwrupqs", - "zxuutkncwscwsvl", - "cykvceo", - "vnm")) - .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .withProperties( - new MachineUpdateProperties() - .withLocationData( - new LocationData() - .withName("ukkfplgmgs") - .withCity("kjz") - .withDistrict("es") - .withCountryOrRegion("vlopwiyighx")) - .withParentClusterResourceId("dwzbaiue") - .withPrivateLinkScopeResourceId("a")); - model = BinaryData.fromObject(model).toObject(MachineUpdate.class); - Assertions.assertEquals("yqupedeojnabckh", model.tags().get("mtxpsiebtfh")); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.identity().type()); - Assertions.assertEquals("ukkfplgmgs", model.properties().locationData().name()); - Assertions.assertEquals("kjz", model.properties().locationData().city()); - Assertions.assertEquals("es", model.properties().locationData().district()); - Assertions.assertEquals("vlopwiyighx", model.properties().locationData().countryOrRegion()); - Assertions.assertEquals("dwzbaiue", model.properties().parentClusterResourceId()); - Assertions.assertEquals("a", model.properties().privateLinkScopeResourceId()); - } - - @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/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachinesDeleteByResourceGroupWithResponseMockTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachinesDeleteByResourceGroupWithResponseMockTests.java deleted file mode 100644 index afa199a279163..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachinesDeleteByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.hybridcompute.HybridComputeManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class MachinesDeleteByResourceGroupWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HybridComputeManager manager = - HybridComputeManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.machines().deleteByResourceGroupWithResponse("eil", "vnotyfjfcnj", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/OSProfileTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/OSProfileTests.java deleted file mode 100644 index 108f95862b3e8..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/OSProfileTests.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridcompute.models.OSProfile; - -public final class OSProfileTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OSProfile model = BinaryData.fromString("{\"computerName\":\"kknryrtihf\"}").toObject(OSProfile.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OSProfile model = new OSProfile(); - model = BinaryData.fromObject(model).toObject(OSProfile.class); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/OperationListResultTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/OperationListResultTests.java deleted file mode 100644 index ebffd08e48176..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/OperationListResultTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridcompute.models.OperationListResult; - -public final class OperationListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationListResult model = - BinaryData - .fromString( - "{\"value\":[{\"origin\":\"bkbfkgukdkex\",\"name\":\"pofm\",\"display\":{\"operation\":\"c\",\"resource\":\"pg\",\"description\":\"toc\",\"provider\":\"xhvpmoue\"}}]}") - .toObject(OperationListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationListResult model = new OperationListResult(); - model = BinaryData.fromObject(model).toObject(OperationListResult.class); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/OperationValueDisplayTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/OperationValueDisplayTests.java deleted file mode 100644 index b0dfa7418ab90..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/OperationValueDisplayTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridcompute.models.OperationValueDisplay; - -public final class OperationValueDisplayTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationValueDisplay model = - BinaryData - .fromString( - "{\"operation\":\"t\",\"resource\":\"qkwpyeicxmqc\",\"description\":\"q\",\"provider\":\"khixuigdtopbo\"}") - .toObject(OperationValueDisplay.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationValueDisplay model = new OperationValueDisplay(); - model = BinaryData.fromObject(model).toObject(OperationValueDisplay.class); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/OperationValueInnerTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/OperationValueInnerTests.java deleted file mode 100644 index 8cd8d460b6395..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/OperationValueInnerTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridcompute.fluent.models.OperationValueInner; -import com.azure.resourcemanager.hybridcompute.models.OperationValueDisplay; - -public final class OperationValueInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationValueInner model = - BinaryData - .fromString( - "{\"origin\":\"dzxibqeojnxqbzvd\",\"name\":\"t\",\"display\":{\"operation\":\"eic\",\"resource\":\"w\",\"description\":\"zao\",\"provider\":\"uhrhcffcyddgl\"}}") - .toObject(OperationValueInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationValueInner model = new OperationValueInner().withDisplay(new OperationValueDisplay()); - model = BinaryData.fromObject(model).toObject(OperationValueInner.class); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionInnerTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionInnerTests.java deleted file mode 100644 index 6cca0fc8fd5b8..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionInnerTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridcompute.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.hybridcompute.models.PrivateEndpointConnectionProperties; -import com.azure.resourcemanager.hybridcompute.models.PrivateEndpointProperty; -import com.azure.resourcemanager.hybridcompute.models.PrivateLinkServiceConnectionStateProperty; -import org.junit.jupiter.api.Assertions; - -public final class PrivateEndpointConnectionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpointConnectionInner model = - BinaryData - .fromString( - "{\"properties\":{\"privateEndpoint\":{\"id\":\"pbuxwgipwhon\"},\"privateLinkServiceConnectionState\":{\"status\":\"kgshwa\",\"description\":\"kix\",\"actionsRequired\":\"injep\"},\"provisioningState\":\"tmryw\"},\"id\":\"zoqftiyqzrnkcqvy\",\"name\":\"lwh\",\"type\":\"lsicohoqqnwv\"}") - .toObject(PrivateEndpointConnectionInner.class); - Assertions.assertEquals("pbuxwgipwhon", model.properties().privateEndpoint().id()); - Assertions.assertEquals("kgshwa", model.properties().privateLinkServiceConnectionState().status()); - Assertions.assertEquals("kix", model.properties().privateLinkServiceConnectionState().description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpointConnectionInner model = - new PrivateEndpointConnectionInner() - .withProperties( - new PrivateEndpointConnectionProperties() - .withPrivateEndpoint(new PrivateEndpointProperty().withId("pbuxwgipwhon")) - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionStateProperty() - .withStatus("kgshwa") - .withDescription("kix"))); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionInner.class); - Assertions.assertEquals("pbuxwgipwhon", model.properties().privateEndpoint().id()); - Assertions.assertEquals("kgshwa", model.properties().privateLinkServiceConnectionState().status()); - Assertions.assertEquals("kix", model.properties().privateLinkServiceConnectionState().description()); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionListResultTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionListResultTests.java deleted file mode 100644 index ba65b04ee13c6..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionListResultTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridcompute.models.PrivateEndpointConnectionListResult; - -public final class PrivateEndpointConnectionListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpointConnectionListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"bebrjcxerfuwuttt\"},\"id\":\"vjrbirphxepcyvah\",\"name\":\"nljky\",\"type\":\"xjvuujqgidokg\"},{\"properties\":{\"provisioningState\":\"xgvcl\"},\"id\":\"gsncghkjeszz\",\"name\":\"bijhtxfvgxbf\",\"type\":\"mxnehmp\"},{\"properties\":{\"provisioningState\":\"odebfqkkrbmpu\"},\"id\":\"riwflzlfb\",\"name\":\"zpuzycisp\",\"type\":\"qzahmgkbrp\"}],\"nextLink\":\"dhibnuq\"}") - .toObject(PrivateEndpointConnectionListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpointConnectionListResult model = new PrivateEndpointConnectionListResult(); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionListResult.class); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionPropertiesTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionPropertiesTests.java deleted file mode 100644 index 94d93962e3a16..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionPropertiesTests.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridcompute.models.PrivateEndpointConnectionProperties; -import com.azure.resourcemanager.hybridcompute.models.PrivateEndpointProperty; -import com.azure.resourcemanager.hybridcompute.models.PrivateLinkServiceConnectionStateProperty; -import org.junit.jupiter.api.Assertions; - -public final class PrivateEndpointConnectionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpointConnectionProperties model = - BinaryData - .fromString( - "{\"privateEndpoint\":{\"id\":\"avwhheunm\"},\"privateLinkServiceConnectionState\":{\"status\":\"hgyxzkonoc\",\"description\":\"koklya\",\"actionsRequired\":\"conuqszfkbeype\"},\"provisioningState\":\"mjmwvvjektcx\"}") - .toObject(PrivateEndpointConnectionProperties.class); - Assertions.assertEquals("avwhheunm", model.privateEndpoint().id()); - Assertions.assertEquals("hgyxzkonoc", model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("koklya", model.privateLinkServiceConnectionState().description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpointConnectionProperties model = - new PrivateEndpointConnectionProperties() - .withPrivateEndpoint(new PrivateEndpointProperty().withId("avwhheunm")) - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionStateProperty().withStatus("hgyxzkonoc").withDescription("koklya")); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionProperties.class); - Assertions.assertEquals("avwhheunm", model.privateEndpoint().id()); - Assertions.assertEquals("hgyxzkonoc", model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("koklya", model.privateLinkServiceConnectionState().description()); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsCreateOrUpdateMockTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsCreateOrUpdateMockTests.java deleted file mode 100644 index 7efc66f01f7ff..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsCreateOrUpdateMockTests.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.hybridcompute.HybridComputeManager; -import com.azure.resourcemanager.hybridcompute.models.PrivateEndpointConnection; -import com.azure.resourcemanager.hybridcompute.models.PrivateEndpointConnectionProperties; -import com.azure.resourcemanager.hybridcompute.models.PrivateEndpointProperty; -import com.azure.resourcemanager.hybridcompute.models.PrivateLinkServiceConnectionStateProperty; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"privateEndpoint\":{\"id\":\"mxjezwlw\"},\"privateLinkServiceConnectionState\":{\"status\":\"xuqlcvydypat\",\"description\":\"ooaojkniodkooebw\",\"actionsRequired\":\"jhemms\"},\"provisioningState\":\"Succeeded\"},\"id\":\"nfwjlfltkacjvefk\",\"name\":\"lfoakg\",\"type\":\"kfpagao\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HybridComputeManager manager = - HybridComputeManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PrivateEndpointConnection response = - manager - .privateEndpointConnections() - .define("gsexne") - .withExistingPrivateLinkScope("ayffim", "zrtuzq") - .withProperties( - new PrivateEndpointConnectionProperties() - .withPrivateEndpoint(new PrivateEndpointProperty().withId("wnwmewzs")) - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionStateProperty() - .withStatus("ceuzsoibjudpfr") - .withDescription("trthzvaytdwkqbr"))) - .create(); - - Assertions.assertEquals("mxjezwlw", response.properties().privateEndpoint().id()); - Assertions.assertEquals("xuqlcvydypat", response.properties().privateLinkServiceConnectionState().status()); - Assertions - .assertEquals("ooaojkniodkooebw", response.properties().privateLinkServiceConnectionState().description()); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsDeleteMockTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsDeleteMockTests.java deleted file mode 100644 index 989d8d2db0a6d..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsDeleteMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.hybridcompute.HybridComputeManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HybridComputeManager manager = - HybridComputeManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .privateEndpointConnections() - .delete("unygaeqid", "qfatpxllrxcyjm", "a", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java deleted file mode 100644 index f893b9e6f44cb..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.hybridcompute.HybridComputeManager; -import com.azure.resourcemanager.hybridcompute.models.PrivateEndpointConnection; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"privateEndpoint\":{\"id\":\"jhwuaanozjos\"},\"privateLinkServiceConnectionState\":{\"status\":\"youlp\",\"description\":\"rvxaglrvimjwosy\",\"actionsRequired\":\"itc\"},\"provisioningState\":\"fcktqumiekke\"},\"id\":\"ikh\",\"name\":\"yf\",\"type\":\"hdgqggeb\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HybridComputeManager manager = - HybridComputeManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PrivateEndpointConnection response = - manager - .privateEndpointConnections() - .getWithResponse("wczelpci", "elsfeaen", "abfatkl", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("jhwuaanozjos", response.properties().privateEndpoint().id()); - Assertions.assertEquals("youlp", response.properties().privateLinkServiceConnectionState().status()); - Assertions - .assertEquals("rvxaglrvimjwosy", response.properties().privateLinkServiceConnectionState().description()); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsListByPrivateLinkScopeMockTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsListByPrivateLinkScopeMockTests.java deleted file mode 100644 index fa79154ec67f3..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsListByPrivateLinkScopeMockTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.hybridcompute.HybridComputeManager; -import com.azure.resourcemanager.hybridcompute.models.PrivateEndpointConnection; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsListByPrivateLinkScopeMockTests { - @Test - public void testListByPrivateLinkScope() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"privateEndpoint\":{\"id\":\"jsjqbjhhyx\"},\"privateLinkServiceConnectionState\":{\"status\":\"wlycoduhpkxkg\",\"description\":\"mareqnajxqugj\",\"actionsRequired\":\"ycubeddgs\"},\"provisioningState\":\"fwqmzqalkrmn\"},\"id\":\"jpxac\",\"name\":\"qudf\",\"type\":\"byxbaaabjy\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HybridComputeManager manager = - HybridComputeManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.privateEndpointConnections().listByPrivateLinkScope("su", "arm", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("jsjqbjhhyx", response.iterator().next().properties().privateEndpoint().id()); - Assertions - .assertEquals( - "wlycoduhpkxkg", response.iterator().next().properties().privateLinkServiceConnectionState().status()); - Assertions - .assertEquals( - "mareqnajxqugj", - response.iterator().next().properties().privateLinkServiceConnectionState().description()); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointPropertyTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointPropertyTests.java deleted file mode 100644 index 9b6bf32e381df..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointPropertyTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridcompute.models.PrivateEndpointProperty; -import org.junit.jupiter.api.Assertions; - -public final class PrivateEndpointPropertyTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpointProperty model = - BinaryData.fromString("{\"id\":\"nhwlrsffrzpwvl\"}").toObject(PrivateEndpointProperty.class); - Assertions.assertEquals("nhwlrsffrzpwvl", model.id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpointProperty model = new PrivateEndpointProperty().withId("nhwlrsffrzpwvl"); - model = BinaryData.fromObject(model).toObject(PrivateEndpointProperty.class); - Assertions.assertEquals("nhwlrsffrzpwvl", model.id()); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkResourceInnerTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkResourceInnerTests.java deleted file mode 100644 index b2b51e7f1ffff..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkResourceInnerTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridcompute.fluent.models.PrivateLinkResourceInner; -import com.azure.resourcemanager.hybridcompute.models.PrivateLinkResourceProperties; - -public final class PrivateLinkResourceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkResourceInner model = - BinaryData - .fromString( - "{\"properties\":{\"groupId\":\"vfaxkffeiith\",\"requiredMembers\":[\"ez\"],\"requiredZoneNames\":[\"hxmzsbbzoggig\",\"xwburvjxxjns\",\"ydptkoen\",\"ou\"]},\"id\":\"vudwtiukbldng\",\"name\":\"pocipazyxoegu\",\"type\":\"g\"}") - .toObject(PrivateLinkResourceInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkResourceInner model = - new PrivateLinkResourceInner().withProperties(new PrivateLinkResourceProperties()); - model = BinaryData.fromObject(model).toObject(PrivateLinkResourceInner.class); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkResourceListResultTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkResourceListResultTests.java deleted file mode 100644 index f9b77830d39e9..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkResourceListResultTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridcompute.models.PrivateLinkResourceListResult; - -public final class PrivateLinkResourceListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkResourceListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"groupId\":\"stkiiuxhqyud\",\"requiredMembers\":[],\"requiredZoneNames\":[]},\"id\":\"qn\",\"name\":\"poczvyifqrvkdvjs\",\"type\":\"lrmv\"},{\"properties\":{\"groupId\":\"watkpnpulexxb\",\"requiredMembers\":[],\"requiredZoneNames\":[]},\"id\":\"ruwiqzbqjvsov\",\"name\":\"yokacspkw\",\"type\":\"hzdobpxjmflbvvnc\"},{\"properties\":{\"groupId\":\"cciw\",\"requiredMembers\":[],\"requiredZoneNames\":[]},\"id\":\"qkhr\",\"name\":\"ajiwkuo\",\"type\":\"oskg\"},{\"properties\":{\"groupId\":\"uuimjmvxieduug\",\"requiredMembers\":[],\"requiredZoneNames\":[]},\"id\":\"rrfbyaosvexcson\",\"name\":\"clhocohsl\",\"type\":\"ev\"}],\"nextLink\":\"ggzfbu\"}") - .toObject(PrivateLinkResourceListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkResourceListResult model = new PrivateLinkResourceListResult(); - model = BinaryData.fromObject(model).toObject(PrivateLinkResourceListResult.class); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkResourcePropertiesTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkResourcePropertiesTests.java deleted file mode 100644 index 666c08c9cca29..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkResourcePropertiesTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridcompute.models.PrivateLinkResourceProperties; - -public final class PrivateLinkResourcePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkResourceProperties model = - BinaryData - .fromString( - "{\"groupId\":\"piu\",\"requiredMembers\":[\"gevqznty\",\"mrbpizcdrqj\",\"dpydn\",\"yhxdeoejzicwi\"],\"requiredZoneNames\":[\"ttgzfbis\",\"cbkhajdeyeamdph\"]}") - .toObject(PrivateLinkResourceProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkResourceProperties model = new PrivateLinkResourceProperties(); - model = BinaryData.fromObject(model).toObject(PrivateLinkResourceProperties.class); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkResourcesGetWithResponseMockTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkResourcesGetWithResponseMockTests.java deleted file mode 100644 index fbcb7424c0687..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkResourcesGetWithResponseMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.hybridcompute.HybridComputeManager; -import com.azure.resourcemanager.hybridcompute.models.PrivateLinkResource; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PrivateLinkResourcesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"groupId\":\"v\",\"requiredMembers\":[\"piohgwxrtfu\",\"xepxgyqagvrvmn\",\"k\",\"kghimdblxgwimfnj\"],\"requiredZoneNames\":[\"xw\"]},\"id\":\"zk\",\"name\":\"foqreyfkzik\",\"type\":\"jawneaiv\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HybridComputeManager manager = - HybridComputeManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PrivateLinkResource response = - manager - .privateLinkResources() - .getWithResponse("rdvstkwqqtch", "alm", "mtdaa", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkResourcesListByPrivateLinkScopeMockTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkResourcesListByPrivateLinkScopeMockTests.java deleted file mode 100644 index 517504719c630..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkResourcesListByPrivateLinkScopeMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.hybridcompute.HybridComputeManager; -import com.azure.resourcemanager.hybridcompute.models.PrivateLinkResource; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PrivateLinkResourcesListByPrivateLinkScopeMockTests { - @Test - public void testListByPrivateLinkScope() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"groupId\":\"otllxdyhgsyo\",\"requiredMembers\":[\"jlt\",\"tbnnha\",\"oocrkvcikhnv\",\"amqgxqquezikyw\"],\"requiredZoneNames\":[\"kallatmel\",\"uipiccjzk\"]},\"id\":\"v\",\"name\":\"vvcnayr\",\"type\":\"yrnxxmueedn\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HybridComputeManager manager = - HybridComputeManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.privateLinkResources().listByPrivateLinkScope("lwwrl", "dmtnc", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopeValidationDetailsInnerTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopeValidationDetailsInnerTests.java deleted file mode 100644 index 7c38a6decb3d9..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopeValidationDetailsInnerTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridcompute.fluent.models.PrivateLinkScopeValidationDetailsInner; -import com.azure.resourcemanager.hybridcompute.models.ConnectionDetail; -import com.azure.resourcemanager.hybridcompute.models.PublicNetworkAccessType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PrivateLinkScopeValidationDetailsInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkScopeValidationDetailsInner model = - BinaryData - .fromString( - "{\"id\":\"pikad\",\"publicNetworkAccess\":\"Enabled\",\"connectionDetails\":[{\"id\":\"gnbuy\",\"privateIpAddress\":\"ijggmebfsiar\",\"linkIdentifier\":\"trcvpnazzmh\",\"groupId\":\"unmpxttd\",\"memberName\":\"rbnlankxmyskp\"},{\"id\":\"enbtkcxywny\",\"privateIpAddress\":\"rsyn\",\"linkIdentifier\":\"idybyxczf\",\"groupId\":\"haaxdbabphl\",\"memberName\":\"qlfktsths\"}]}") - .toObject(PrivateLinkScopeValidationDetailsInner.class); - Assertions.assertEquals(PublicNetworkAccessType.ENABLED, model.publicNetworkAccess()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkScopeValidationDetailsInner model = - new PrivateLinkScopeValidationDetailsInner() - .withPublicNetworkAccess(PublicNetworkAccessType.ENABLED) - .withConnectionDetails(Arrays.asList(new ConnectionDetail(), new ConnectionDetail())); - model = BinaryData.fromObject(model).toObject(PrivateLinkScopeValidationDetailsInner.class); - Assertions.assertEquals(PublicNetworkAccessType.ENABLED, model.publicNetworkAccess()); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesCreateOrUpdateWithResponseMockTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index 1cdeebaba0aea..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.hybridcompute.HybridComputeManager; -import com.azure.resourcemanager.hybridcompute.models.HybridComputePrivateLinkScope; -import com.azure.resourcemanager.hybridcompute.models.HybridComputePrivateLinkScopeProperties; -import com.azure.resourcemanager.hybridcompute.models.PublicNetworkAccessType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PrivateLinkScopesCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"publicNetworkAccess\":\"Disabled\",\"provisioningState\":\"puvks\",\"privateLinkScopeId\":\"lsa\"},\"location\":\"ynfs\",\"tags\":{\"ntorzihleosjswsr\":\"jphuopxodlqi\",\"qioxi\":\"slyzrpzbchckqq\",\"wyhqmibzyhwits\":\"suiizynkedyat\"},\"id\":\"ypyynpcdpumnzg\",\"name\":\"wznm\",\"type\":\"biknsorgjhxbld\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HybridComputeManager manager = - HybridComputeManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - HybridComputePrivateLinkScope response = - manager - .privateLinkScopes() - .define("novvqfovljxy") - .withRegion("e") - .withExistingResourceGroup("mkcdyhbpkkpwdre") - .withTags(mapOf("jfqka", "arrwlquu")) - .withProperties( - new HybridComputePrivateLinkScopeProperties() - .withPublicNetworkAccess(PublicNetworkAccessType.ENABLED)) - .create(); - - Assertions.assertEquals("ynfs", response.location()); - Assertions.assertEquals("jphuopxodlqi", response.tags().get("ntorzihleosjswsr")); - Assertions.assertEquals(PublicNetworkAccessType.DISABLED, response.properties().publicNetworkAccess()); - } - - @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/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesDeleteMockTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesDeleteMockTests.java deleted file mode 100644 index d06b2fa281af3..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesDeleteMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.hybridcompute.HybridComputeManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PrivateLinkScopesDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HybridComputeManager manager = - HybridComputeManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.privateLinkScopes().delete("fikdowwqu", "v", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesGetByResourceGroupWithResponseMockTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index cb6cff41865ca..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesGetByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.hybridcompute.HybridComputeManager; -import com.azure.resourcemanager.hybridcompute.models.HybridComputePrivateLinkScope; -import com.azure.resourcemanager.hybridcompute.models.PublicNetworkAccessType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PrivateLinkScopesGetByResourceGroupWithResponseMockTests { - @Test - public void testGetByResourceGroupWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"publicNetworkAccess\":\"Enabled\",\"provisioningState\":\"fwdsj\",\"privateLinkScopeId\":\"aljutiiswac\"},\"location\":\"gdkz\",\"tags\":{\"pfuflrw\":\"kfvhqcrailvpn\",\"lxyjr\":\"mh\",\"fcnihgwq\":\"sag\",\"cvkcvqvpkeqdcv\":\"pnedgf\"},\"id\":\"rhvoods\",\"name\":\"tbobz\",\"type\":\"opcjwvnhd\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HybridComputeManager manager = - HybridComputeManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - HybridComputePrivateLinkScope response = - manager - .privateLinkScopes() - .getByResourceGroupWithResponse("zx", "lvithhqzonosgg", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("gdkz", response.location()); - Assertions.assertEquals("kfvhqcrailvpn", response.tags().get("pfuflrw")); - Assertions.assertEquals(PublicNetworkAccessType.ENABLED, response.properties().publicNetworkAccess()); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesGetValidationDetailsForMachineWithResponseMockTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesGetValidationDetailsForMachineWithResponseMockTests.java deleted file mode 100644 index 5701956da46af..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesGetValidationDetailsForMachineWithResponseMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.hybridcompute.HybridComputeManager; -import com.azure.resourcemanager.hybridcompute.models.PrivateLinkScopeValidationDetails; -import com.azure.resourcemanager.hybridcompute.models.PublicNetworkAccessType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PrivateLinkScopesGetValidationDetailsForMachineWithResponseMockTests { - @Test - public void testGetValidationDetailsForMachineWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"id\":\"kpzksmondjmq\",\"publicNetworkAccess\":\"Disabled\",\"connectionDetails\":[{\"id\":\"mg\",\"privateIpAddress\":\"pkwhojvpa\",\"linkIdentifier\":\"gxysmocmbqfqvm\",\"groupId\":\"xozap\",\"memberName\":\"elxprglyatddck\"},{\"id\":\"cuejrjxgci\",\"privateIpAddress\":\"brh\",\"linkIdentifier\":\"xsdqrhzoymibmrqy\",\"groupId\":\"ahwfluszdtmhrk\",\"memberName\":\"fyyvoq\"},{\"id\":\"piexpbtgiw\",\"privateIpAddress\":\"oenwashr\",\"linkIdentifier\":\"tkcnqxwb\",\"groupId\":\"kulpiujwaasi\",\"memberName\":\"i\"},{\"id\":\"byuqerpqlp\",\"privateIpAddress\":\"cciuqgbdbutau\",\"linkIdentifier\":\"btkuwhh\",\"groupId\":\"ykojoxafnndlpic\",\"memberName\":\"o\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HybridComputeManager manager = - HybridComputeManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PrivateLinkScopeValidationDetails response = - manager - .privateLinkScopes() - .getValidationDetailsForMachineWithResponse("kcpwiy", "vqtmnub", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(PublicNetworkAccessType.DISABLED, response.publicNetworkAccess()); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesGetValidationDetailsWithResponseMockTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesGetValidationDetailsWithResponseMockTests.java deleted file mode 100644 index e165c894ae72a..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesGetValidationDetailsWithResponseMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.hybridcompute.HybridComputeManager; -import com.azure.resourcemanager.hybridcompute.models.PrivateLinkScopeValidationDetails; -import com.azure.resourcemanager.hybridcompute.models.PublicNetworkAccessType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PrivateLinkScopesGetValidationDetailsWithResponseMockTests { - @Test - public void testGetValidationDetailsWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"id\":\"wuoegrpk\",\"publicNetworkAccess\":\"Disabled\",\"connectionDetails\":[{\"id\":\"qsluicp\",\"privateIpAddress\":\"gk\",\"linkIdentifier\":\"lvmbmpaxmodfvuef\",\"groupId\":\"sbpfvmwyhr\",\"memberName\":\"uyfta\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HybridComputeManager manager = - HybridComputeManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PrivateLinkScopeValidationDetails response = - manager - .privateLinkScopes() - .getValidationDetailsWithResponse("d", "mgxcxrslpm", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(PublicNetworkAccessType.DISABLED, response.publicNetworkAccess()); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesListByResourceGroupMockTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesListByResourceGroupMockTests.java deleted file mode 100644 index b52ea3c89b252..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesListByResourceGroupMockTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.hybridcompute.HybridComputeManager; -import com.azure.resourcemanager.hybridcompute.models.HybridComputePrivateLinkScope; -import com.azure.resourcemanager.hybridcompute.models.PublicNetworkAccessType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PrivateLinkScopesListByResourceGroupMockTests { - @Test - public void testListByResourceGroup() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"publicNetworkAccess\":\"Disabled\",\"provisioningState\":\"tkoievseotgq\",\"privateLinkScopeId\":\"ltmuwlauwzizx\"},\"location\":\"pgcjefuzmuvp\",\"tags\":{\"morppxebmnzbtbh\":\"d\"},\"id\":\"pglkf\",\"name\":\"ohdneuel\",\"type\":\"phsdyhto\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HybridComputeManager manager = - HybridComputeManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.privateLinkScopes().listByResourceGroup("bxmubyynt", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("pgcjefuzmuvp", response.iterator().next().location()); - Assertions.assertEquals("d", response.iterator().next().tags().get("morppxebmnzbtbh")); - Assertions - .assertEquals( - PublicNetworkAccessType.DISABLED, response.iterator().next().properties().publicNetworkAccess()); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesListMockTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesListMockTests.java deleted file mode 100644 index 3f822ff383a49..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesListMockTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.hybridcompute.HybridComputeManager; -import com.azure.resourcemanager.hybridcompute.models.HybridComputePrivateLinkScope; -import com.azure.resourcemanager.hybridcompute.models.PublicNetworkAccessType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PrivateLinkScopesListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"publicNetworkAccess\":\"Disabled\",\"provisioningState\":\"riofzpyqse\",\"privateLinkScopeId\":\"abnetshh\"},\"location\":\"h\",\"tags\":{\"nkww\":\"lvwiwubmwmbesl\",\"flcxoga\":\"pp\",\"mkqzeqqkdltfzxmh\":\"konzmnsik\",\"gureodkwobdag\":\"v\"},\"id\":\"tibqdxbxwakb\",\"name\":\"gqxndlkzgxhuripl\",\"type\":\"podxunkb\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HybridComputeManager manager = - HybridComputeManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.privateLinkScopes().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("h", response.iterator().next().location()); - Assertions.assertEquals("lvwiwubmwmbesl", response.iterator().next().tags().get("nkww")); - Assertions - .assertEquals( - PublicNetworkAccessType.DISABLED, response.iterator().next().properties().publicNetworkAccess()); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesResourceTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesResourceTests.java deleted file mode 100644 index adc6d5b23050f..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesResourceTests.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridcompute.models.PrivateLinkScopesResource; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class PrivateLinkScopesResourceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkScopesResource model = - BinaryData - .fromString( - "{\"location\":\"pfhyhl\",\"tags\":{\"atuokthfuiu\":\"mopjmc\",\"zydagfuaxbezyiuo\":\"odsfcpkvxodpuozm\"},\"id\":\"ktwh\",\"name\":\"dxwzywqsmbsurexi\",\"type\":\"o\"}") - .toObject(PrivateLinkScopesResource.class); - Assertions.assertEquals("pfhyhl", model.location()); - Assertions.assertEquals("mopjmc", model.tags().get("atuokthfuiu")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkScopesResource model = - new PrivateLinkScopesResource() - .withLocation("pfhyhl") - .withTags(mapOf("atuokthfuiu", "mopjmc", "zydagfuaxbezyiuo", "odsfcpkvxodpuozm")); - model = BinaryData.fromObject(model).toObject(PrivateLinkScopesResource.class); - Assertions.assertEquals("pfhyhl", model.location()); - Assertions.assertEquals("mopjmc", model.tags().get("atuokthfuiu")); - } - - @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/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkServiceConnectionStatePropertyTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkServiceConnectionStatePropertyTests.java deleted file mode 100644 index 11076f01d7a0a..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkServiceConnectionStatePropertyTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridcompute.models.PrivateLinkServiceConnectionStateProperty; -import org.junit.jupiter.api.Assertions; - -public final class PrivateLinkServiceConnectionStatePropertyTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkServiceConnectionStateProperty model = - BinaryData - .fromString("{\"status\":\"dqgbiqylihkaetc\",\"description\":\"tvfcivfsn\",\"actionsRequired\":\"m\"}") - .toObject(PrivateLinkServiceConnectionStateProperty.class); - Assertions.assertEquals("dqgbiqylihkaetc", model.status()); - Assertions.assertEquals("tvfcivfsn", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkServiceConnectionStateProperty model = - new PrivateLinkServiceConnectionStateProperty().withStatus("dqgbiqylihkaetc").withDescription("tvfcivfsn"); - model = BinaryData.fromObject(model).toObject(PrivateLinkServiceConnectionStateProperty.class); - Assertions.assertEquals("dqgbiqylihkaetc", model.status()); - Assertions.assertEquals("tvfcivfsn", model.description()); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/ResourceUpdateTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/ResourceUpdateTests.java deleted file mode 100644 index c5aebe4cd1ef1..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/ResourceUpdateTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridcompute.models.ResourceUpdate; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ResourceUpdateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ResourceUpdate model = - BinaryData - .fromString( - "{\"tags\":{\"phejkotynqgoulz\":\"dhsgcba\",\"gakeqsr\":\"dlikwyqkgfgibma\",\"qqedqytbciqfou\":\"yb\"}}") - .toObject(ResourceUpdate.class); - Assertions.assertEquals("dhsgcba", model.tags().get("phejkotynqgoulz")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ResourceUpdate model = - new ResourceUpdate() - .withTags(mapOf("phejkotynqgoulz", "dhsgcba", "gakeqsr", "dlikwyqkgfgibma", "qqedqytbciqfou", "yb")); - model = BinaryData.fromObject(model).toObject(ResourceUpdate.class); - Assertions.assertEquals("dhsgcba", model.tags().get("phejkotynqgoulz")); - } - - @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/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/TagsResourceTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/TagsResourceTests.java deleted file mode 100644 index 0defee5da8e40..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/TagsResourceTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridcompute.models.TagsResource; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class TagsResourceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TagsResource model = BinaryData.fromString("{\"tags\":{\"s\":\"cfsf\"}}").toObject(TagsResource.class); - Assertions.assertEquals("cfsf", model.tags().get("s")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TagsResource model = new TagsResource().withTags(mapOf("s", "cfsf")); - model = BinaryData.fromObject(model).toObject(TagsResource.class); - Assertions.assertEquals("cfsf", model.tags().get("s")); - } - - @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; - } -}