From 6bd6a672dfde33f681dea8037b455c921fb503f4 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 30 May 2023 15:43:05 +0000 Subject: [PATCH] CodeGen from PR 23732 in Azure/azure-rest-api-specs Merge 22fa227b4e7206f5d64e023cb27d8a9ff37c506e into 389d3c2b3256fa48e3d78e07769907857b215536 --- .../CHANGELOG.md | 4 +- .../README.md | 4 +- .../SAMPLE.md | 577 ++++++- .../pom.xml | 10 +- .../hybridcompute/HybridComputeManager.java | 99 +- .../fluent/AgentVersionsClient.java | 67 + .../fluent/ExtensionMetadatasClient.java | 79 + .../fluent/HybridComputeManagementClient.java | 42 + .../fluent/HybridIdentityMetadatasClient.java | 81 + .../fluent/MachineRunCommandsClient.java | 294 ++++ .../hybridcompute/fluent/MachinesClient.java | 127 +- .../fluent/NetworkProfilesClient.java | 41 + .../fluent/ResourceProvidersClient.java | 81 + .../fluent/models/AgentVersionInner.java | 102 ++ .../fluent/models/AgentVersionsListInner.java | 80 + .../fluent/models/ExtensionValueInner.java | 86 + .../models/ExtensionValueProperties.java | 69 + .../models/HybridIdentityMetadataInner.java | 123 ++ .../HybridIdentityMetadataProperties.java | 95 ++ .../MachineAssessPatchesResultInner.java | 204 +++ .../fluent/models/MachineExtensionInner.java | 257 ++- .../models/MachineExtensionProperties.java | 48 +- .../MachineExtensionUpdateProperties.java | 47 +- .../fluent/models/MachineInner.java | 514 +++++- .../MachineInstallPatchesResultInner.java | 266 +++ .../fluent/models/MachinePropertiesInner.java | 636 +++++++ .../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 + .../HybridComputeManagementClientImpl.java | 86 +- .../HybridIdentityMetadataImpl.java | 59 + .../HybridIdentityMetadatasClientImpl.java | 531 ++++++ .../HybridIdentityMetadatasImpl.java | 75 + .../MachineAssessPatchesResultImpl.java | 76 + .../implementation/MachineExtensionImpl.java | 140 +- .../MachineExtensionsClientImpl.java | 15 +- .../implementation/MachineImpl.java | 172 +- .../MachineInstallPatchesResultImpl.java | 96 ++ .../implementation/MachinePropertiesImpl.java | 180 ++ .../implementation/MachineRunCommandImpl.java | 307 ++++ .../MachineRunCommandsClientImpl.java | 1508 +++++++++++++++++ .../MachineRunCommandsImpl.java | 190 +++ .../implementation/MachinesClientImpl.java | 586 ++++++- .../implementation/MachinesImpl.java | 45 + .../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 + .../models/AssessmentModeTypes.java | 47 + .../AvailablePatchCountByClassification.java | 159 ++ .../hybridcompute/models/CloudMetadata.java | 39 + .../models/ConfigurationExtension.java | 54 + .../models/ExtensionMetadatas.java | 72 + .../models/ExtensionTargetProperties.java | 50 + .../hybridcompute/models/ExtensionValue.java | 67 + .../models/ExtensionValueListResult.java | 44 + ...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/LinuxParameters.java | 110 ++ .../hybridcompute/models/Machine.java | 226 ++- .../models/MachineAssessPatchesResult.java | 94 + .../models/MachineExtension.java | 294 +++- .../models/MachineExtensionUpdate.java | 214 ++- .../models/MachineExtensionUpgrade.java | 63 + .../MachineInstallPatchesParameters.java | 152 ++ .../models/MachineInstallPatchesResult.java | 132 ++ .../models/MachineProperties.java | 381 +---- .../models/MachineRunCommand.java | 464 +++++ .../models/MachineRunCommandInstanceView.java | 79 + .../MachineRunCommandInstanceViewStatus.java | 155 ++ .../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 | 58 +- .../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/PrivateCloudKind.java | 53 + .../models/PrivateEndpointConnection.java | 2 +- .../PrivateEndpointConnectionDataModel.java | 98 ++ .../PrivateEndpointConnectionProperties.java | 16 + .../models/PrivateLinkResource.java | 2 +- .../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 + ...achineExtensionsCreateOrUpdateSamples.java | 39 +- .../MachineExtensionsDeleteSamples.java | 2 +- .../MachineExtensionsGetSamples.java | 2 +- .../MachineExtensionsListSamples.java | 2 +- .../MachineExtensionsUpdateSamples.java | 40 +- ...chineRunCommandsCreateOrUpdateSamples.java | 43 + .../MachineRunCommandsDeleteSamples.java | 22 + .../MachineRunCommandsGetSamples.java | 22 + .../MachineRunCommandsListSamples.java | 20 + .../MachineRunCommandsUpdateSamples.java | 40 + .../MachinesAssessPatchesSamples.java | 21 + .../generated/MachinesDeleteSamples.java | 2 +- .../MachinesGetByResourceGroupSamples.java | 2 +- .../MachinesInstallPatchesSamples.java | 44 + .../MachinesListByResourceGroupSamples.java | 2 +- .../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 | 4 +- .../PrivateLinkScopesDeleteSamples.java | 2 +- ...teLinkScopesGetByResourceGroupSamples.java | 2 +- ...GetValidationDetailsForMachineSamples.java | 2 +- ...LinkScopesGetValidationDetailsSamples.java | 2 +- ...eLinkScopesListByResourceGroupSamples.java | 2 +- .../PrivateLinkScopesListSamples.java | 2 +- .../PrivateLinkScopesUpdateTagsSamples.java | 2 +- ...ourceProviderUpgradeExtensionsSamples.java | 48 + .../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 - 217 files changed, 16931 insertions(+), 3141 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/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/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/MachineAssessPatchesResultInner.java rename sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/{ => fluent}/models/MachineExtensionProperties.java (81%) 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/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/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/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/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/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/MachineRunCommandInstanceViewStatus.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/PrivateCloudKind.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/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/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..bbb13e7282ea9 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-05-30) + +- 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-04. 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..ba9c8d2012920 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-04. 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}) diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/SAMPLE.md b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/SAMPLE.md index d138f23c8c8fb..bad3d215526f6 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/SAMPLE.md +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/SAMPLE.md @@ -1,6 +1,21 @@ # 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) + ## MachineExtensions - [CreateOrUpdate](#machineextensions_createorupdate) @@ -9,13 +24,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 +71,146 @@ - [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-04-25-preview/examples/GETLatestAgentVersion.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-04-25-preview/examples/GETAgentVersions.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-04-25-preview/examples/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-04-25-preview/examples/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-04-25-preview/examples/GetHybridIdentityMetadata.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-04-25-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); + } +} +``` + ### 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-04-25-preview/examples/PUTExtension.json */ /** * Sample code: Create or Update a Machine Extension. @@ -57,27 +218,30 @@ 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") .withRegion("eastus2euap") .withExistingMachine("myResourceGroup", "myMachine") - .withProperties( - new MachineExtensionProperties() - .withPublisher("Microsoft.Compute") - .withType("CustomScriptExtension") - .withTypeHandlerVersion("1.10") - .withSettings( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize( - "{\"commandToExecute\":\"powershell.exe -c \\\"Get-Process | Where-Object { $_.CPU -gt" - + " 10000 }\\\"\"}", - Object.class, - SerializerEncoding.JSON))) + .withPublisher("Microsoft.Compute") + .withTypePropertiesType("CustomScriptExtension") + .withTypeHandlerVersion("1.10") + .withSettings( + mapOf("commandToExecute", "powershell.exe -c \"Get-Process | Where-Object { $_.CPU -gt 10000 }\"")) .create(); } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } } ``` @@ -87,7 +251,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-04-25-preview/examples/DELETEExtension.json */ /** * Sample code: Delete a Machine Extension. @@ -106,7 +270,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-04-25-preview/examples/GETExtension.json */ /** * Sample code: GET Machine Extension. @@ -127,7 +291,7 @@ 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-04-25-preview/examples/LISTExtension.json */ /** * Sample code: GET all Machine Extensions. @@ -143,16 +307,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-04-25-preview/examples/UpdateExtension.json */ /** * Sample code: Create or Update a Machine Extension. @@ -160,7 +322,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 +331,187 @@ 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(); } + + @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-04-25-preview/examples/PutRunCommand.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-04-25-preview/examples/DeleteRunCommand.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-04-25-preview/examples/GetRunCommand.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-04-25-preview/examples/ListRunCommand.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-04-25-preview/examples/UpdateRunCommand.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(); + } + + @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-04-25-preview/examples/MachineAssessPatches.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 +521,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-04-25-preview/examples/Machines_Delete.json */ /** * Sample code: Delete a Machine. @@ -214,7 +542,7 @@ public final class MachinesDeleteSamples { /** 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-04-25-preview/examples/Machines_Get.json */ /** * Sample code: Get Machine. @@ -229,13 +557,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-04-25-preview/examples/MachineInstallPatches.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-04-25-preview/examples/Machines_ListBySubscription.json */ /** * Sample code: List Machines by resource group. @@ -255,7 +626,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-04-25-preview/examples/Machines_ListByResourceGroup.json */ /** * Sample code: List Machines by resource group. @@ -269,6 +640,45 @@ public final class MachinesListByResourceGroupSamples { } ``` +### NetworkProfile_Get + +```java +/** Samples for NetworkProfile Get. */ +public final class NetworkProfileGetSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-04-25-preview/examples/GETNetworkProfile.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-04-25-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); + } +} +``` + ### PrivateEndpointConnections_CreateOrUpdate ```java @@ -278,7 +688,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-04-25-preview/examples/PrivateEndpointConnectionUpdate.json */ /** * Sample code: Approve or reject a private endpoint connection with a given name. @@ -308,7 +718,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-04-25-preview/examples/PrivateEndpointConnectionDelete.json */ /** * Sample code: Deletes a private endpoint connection with a given name. @@ -334,7 +744,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-04-25-preview/examples/PrivateEndpointConnectionGet.json */ /** * Sample code: Gets private endpoint connection. @@ -360,7 +770,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-04-25-preview/examples/PrivateEndpointConnectionList.json */ /** * Sample code: Gets list of private endpoint connections on a private link scope. @@ -382,7 +792,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-04-25-preview/examples/PrivateLinkScopePrivateLinkResourceGet.json */ /** * Sample code: Gets private endpoint connection. @@ -405,7 +815,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-04-25-preview/examples/PrivateLinkScopePrivateLinkResourceListGet.json */ /** * Sample code: Gets private endpoint connection. @@ -430,7 +840,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-04-25-preview/examples/PrivateLinkScopesCreate.json */ /** * Sample code: PrivateLinkScopeCreate. @@ -447,7 +857,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-04-25-preview/examples/PrivateLinkScopesUpdate.json */ /** * Sample code: PrivateLinkScopeUpdate. @@ -483,7 +893,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-04-25-preview/examples/PrivateLinkScopesDelete.json */ /** * Sample code: PrivateLinkScopesDelete. @@ -504,7 +914,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-04-25-preview/examples/PrivateLinkScopesGet.json */ /** * Sample code: PrivateLinkScopeGet. @@ -526,7 +936,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-04-25-preview/examples/PrivateLinkScopesGetValidation.json */ /** * Sample code: PrivateLinkScopeGet. @@ -548,7 +958,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-04-25-preview/examples/PrivateLinkScopesGetValidationForMachine.json */ /** * Sample code: PrivateLinkScopeGet. @@ -570,7 +980,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-04-25-preview/examples/PrivateLinkScopesList.json */ /** * Sample code: PrivateLinkScopesList.json. @@ -589,7 +999,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-04-25-preview/examples/PrivateLinkScopesListByResourceGroup.json */ /** * Sample code: PrivateLinkScopeListByResourceGroup. @@ -613,7 +1023,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-04-25-preview/examples/PrivateLinkScopesUpdateTagsOnly.json */ /** * Sample code: PrivateLinkScopeUpdateTagsOnly. @@ -644,3 +1054,50 @@ public final class PrivateLinkScopesUpdateTagsSamples { } ``` +### 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-04-25-preview/examples/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); + } + + @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/pom.xml b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/pom.xml index 01b9b2f9168d0..b68634db47cad 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-04. https://github.com/Azure/azure-sdk-for-java @@ -38,7 +43,8 @@ UTF-8 - true + 0 + 0 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..36758c2c304c7 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,31 @@ 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.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.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; @@ -50,8 +62,20 @@ public final class HybridComputeManager { 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 +247,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(" (") @@ -304,6 +328,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 +364,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. * 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..c9bdf36f90337 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 @@ -58,6 +58,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 +79,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/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..4bce966e6298c 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. 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/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/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..0dac2a8317fe7 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 @@ -7,7 +7,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; import com.azure.core.management.SystemData; -import com.azure.resourcemanager.hybridcompute.models.MachineExtensionProperties; +import com.azure.resourcemanager.hybridcompute.models.MachineExtensionInstanceView; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; @@ -18,10 +18,10 @@ public final class MachineExtensionInner extends Resource { * Describes Machine Extension Properties. */ @JsonProperty(value = "properties") - private MachineExtensionProperties properties; + private MachineExtensionProperties innerProperties; /* - * 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; @@ -31,27 +31,16 @@ public MachineExtensionInner() { } /** - * Get the properties property: Describes Machine Extension Properties. + * Get the innerProperties property: Describes Machine Extension Properties. * - * @return the properties value. + * @return the innerProperties value. */ - public MachineExtensionProperties properties() { - return this.properties; + private MachineExtensionProperties innerProperties() { + return this.innerProperties; } /** - * Set the properties property: Describes Machine Extension Properties. - * - * @param properties the properties value to set. - * @return the MachineExtensionInner object itself. - */ - public MachineExtensionInner withProperties(MachineExtensionProperties properties) { - this.properties = properties; - return this; - } - - /** - * 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. */ @@ -73,14 +62,240 @@ public MachineExtensionInner withTags(Map tags) { return this; } + /** + * Get the forceUpdateTag property: How the extension handler should be forced to update even if the extension + * configuration has not changed. + * + * @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 MachineExtensionInner object itself. + */ + public MachineExtensionInner withForceUpdateTag(String forceUpdateTag) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineExtensionProperties(); + } + this.innerProperties().withForceUpdateTag(forceUpdateTag); + return this; + } + + /** + * 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 MachineExtensionInner object itself. + */ + public MachineExtensionInner withPublisher(String publisher) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineExtensionProperties(); + } + 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 typePropertiesType() { + 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 MachineExtensionInner object itself. + */ + public MachineExtensionInner withTypePropertiesType(String type) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineExtensionProperties(); + } + 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 MachineExtensionInner object itself. + */ + public MachineExtensionInner withTypeHandlerVersion(String typeHandlerVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineExtensionProperties(); + } + 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 MachineExtensionInner object itself. + */ + public MachineExtensionInner withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineExtensionProperties(); + } + 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 MachineExtensionInner object itself. + */ + public MachineExtensionInner withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineExtensionProperties(); + } + 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 MachineExtensionInner object itself. + */ + public MachineExtensionInner withSettings(Map settings) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineExtensionProperties(); + } + 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 MachineExtensionInner object itself. + */ + public MachineExtensionInner withProtectedSettings(Map protectedSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineExtensionProperties(); + } + this.innerProperties().withProtectedSettings(protectedSettings); + 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 extension instance view. + * + * @return the instanceView value. + */ + public MachineExtensionInstanceView instanceView() { + return this.innerProperties() == null ? null : this.innerProperties().instanceView(); + } + + /** + * Set the instanceView property: The machine extension instance view. + * + * @param instanceView the instanceView value to set. + * @return the MachineExtensionInner object itself. + */ + public MachineExtensionInner withInstanceView(MachineExtensionInstanceView instanceView) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineExtensionProperties(); + } + this.innerProperties().withInstanceView(instanceView); + return this; + } + /** * 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(); } } } 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/fluent/models/MachineExtensionProperties.java similarity index 81% rename from sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtensionProperties.java rename to sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineExtensionProperties.java index 454bea5796e04..3d1f8b5d626af 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/fluent/models/MachineExtensionProperties.java @@ -2,10 +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.MachineExtensionInstanceView; +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 +37,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 +56,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 +165,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 +216,7 @@ public MachineExtensionProperties withAutoUpgradeMinorVersion(Boolean autoUpgrad * * @return the settings value. */ - public Object settings() { + public Map settings() { return this.settings; } @@ -192,7 +226,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 +237,7 @@ public MachineExtensionProperties withSettings(Object settings) { * * @return the protectedSettings value. */ - public Object protectedSettings() { + public Map protectedSettings() { return this.protectedSettings; } @@ -214,7 +248,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/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..a15016f41f4d0 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.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.PrivateCloudKind; +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 VM fabric the instance is an instance of, such as HCI or SCVMM etc. + */ + @JsonProperty(value = "kind") + private PrivateCloudKind 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 VM fabric the instance is an instance of, such as HCI or SCVMM + * etc. + * + * @return the kind value. + */ + public PrivateCloudKind kind() { + return this.kind; + } + + /** + * Set the kind property: Indicates which kind of VM fabric the instance is an instance of, such as HCI or SCVMM + * etc. + * + * @param kind the kind value to set. + * @return the MachineInner object itself. + */ + public MachineInner withKind(PrivateCloudKind 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,453 @@ 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 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..a0e756445f14e --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachinePropertiesInner.java @@ -0,0 +1,636 @@ +// 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; + + /* + * 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 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 (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/HybridComputeManagementClientImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/HybridComputeManagementClientImpl.java index fac37bfdac2bc..1f4dfd1745b98 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,19 @@ 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.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; @@ -137,6 +143,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 +179,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 +285,16 @@ public PrivateEndpointConnectionsClient getPrivateEndpointConnections() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2021-03-25-preview"; + this.apiVersion = "2023-04-25-preview"; this.machines = new MachinesClientImpl(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/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..41a707a762783 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 @@ -9,9 +9,8 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.hybridcompute.fluent.models.MachineExtensionInner; import com.azure.resourcemanager.hybridcompute.models.MachineExtension; -import com.azure.resourcemanager.hybridcompute.models.MachineExtensionProperties; +import com.azure.resourcemanager.hybridcompute.models.MachineExtensionInstanceView; import com.azure.resourcemanager.hybridcompute.models.MachineExtensionUpdate; -import com.azure.resourcemanager.hybridcompute.models.MachineExtensionUpdateProperties; import java.util.Collections; import java.util.Map; @@ -46,14 +45,60 @@ public Map tags() { } } - public MachineExtensionProperties properties() { - return this.innerModel().properties(); - } - public SystemData systemData() { return this.innerModel().systemData(); } + public String forceUpdateTag() { + return this.innerModel().forceUpdateTag(); + } + + public String publisher() { + return this.innerModel().publisher(); + } + + public String typePropertiesType() { + return this.innerModel().typePropertiesType(); + } + + public String typeHandlerVersion() { + return this.innerModel().typeHandlerVersion(); + } + + public Boolean enableAutomaticUpgrade() { + return this.innerModel().enableAutomaticUpgrade(); + } + + public Boolean autoUpgradeMinorVersion() { + return this.innerModel().autoUpgradeMinorVersion(); + } + + public Map settings() { + Map inner = this.innerModel().settings(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Map protectedSettings() { + Map inner = this.innerModel().protectedSettings(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public MachineExtensionInstanceView instanceView() { + return this.innerModel().instanceView(); + } + public Region region() { return Region.fromName(this.regionName()); } @@ -185,13 +230,88 @@ public MachineExtensionImpl withTags(Map tags) { } } - public MachineExtensionImpl withProperties(MachineExtensionProperties properties) { - this.innerModel().withProperties(properties); + public MachineExtensionImpl withForceUpdateTag(String forceUpdateTag) { + if (isInCreateMode()) { + this.innerModel().withForceUpdateTag(forceUpdateTag); + return this; + } else { + this.updateExtensionParameters.withForceUpdateTag(forceUpdateTag); + return this; + } + } + + public MachineExtensionImpl withPublisher(String publisher) { + if (isInCreateMode()) { + this.innerModel().withPublisher(publisher); + return this; + } else { + this.updateExtensionParameters.withPublisher(publisher); + return this; + } + } + + public MachineExtensionImpl withTypePropertiesType(String typePropertiesType) { + this.innerModel().withTypePropertiesType(typePropertiesType); + return this; + } + + public MachineExtensionImpl withTypeHandlerVersion(String typeHandlerVersion) { + if (isInCreateMode()) { + this.innerModel().withTypeHandlerVersion(typeHandlerVersion); + return this; + } else { + this.updateExtensionParameters.withTypeHandlerVersion(typeHandlerVersion); + return this; + } + } + + public MachineExtensionImpl withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { + if (isInCreateMode()) { + this.innerModel().withEnableAutomaticUpgrade(enableAutomaticUpgrade); + return this; + } else { + this.updateExtensionParameters.withEnableAutomaticUpgrade(enableAutomaticUpgrade); + return this; + } + } + + public MachineExtensionImpl withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { + if (isInCreateMode()) { + this.innerModel().withAutoUpgradeMinorVersion(autoUpgradeMinorVersion); + return this; + } else { + this.updateExtensionParameters.withAutoUpgradeMinorVersion(autoUpgradeMinorVersion); + return this; + } + } + + public MachineExtensionImpl withSettings(Map settings) { + if (isInCreateMode()) { + this.innerModel().withSettings(settings); + return this; + } else { + this.updateExtensionParameters.withSettings(settings); + return this; + } + } + + public MachineExtensionImpl withProtectedSettings(Map protectedSettings) { + if (isInCreateMode()) { + this.innerModel().withProtectedSettings(protectedSettings); + return this; + } else { + this.updateExtensionParameters.withProtectedSettings(protectedSettings); + return this; + } + } + + public MachineExtensionImpl withInstanceView(MachineExtensionInstanceView instanceView) { + this.innerModel().withInstanceView(instanceView); return this; } - public MachineExtensionImpl withProperties(MachineExtensionUpdateProperties properties) { - this.updateExtensionParameters.withProperties(properties); + public MachineExtensionImpl withType(String type) { + this.updateExtensionParameters.withType(type); 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..1362489eefc28 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,28 @@ 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.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.CloudMetadata; import com.azure.resourcemanager.hybridcompute.models.Identity; +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.PrivateCloudKind; +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 +63,168 @@ 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 PrivateCloudKind 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 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..5a6782dfb14dc --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachinePropertiesImpl.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.implementation; + +import com.azure.core.management.exception.ManagementError; +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.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 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..fdc044d755e75 --- /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({200, 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..cdd775dc4d897 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( @@ -135,7 +171,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 +218,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 +264,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 +279,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 +295,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,6 +457,534 @@ 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. 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..957dbc619d395 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,6 +66,46 @@ 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())); 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/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/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/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/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..95aba2736ed01 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,227 @@ 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 VM fabric the instance is an instance of, such as HCI or SCVMM + * etc. + * + * @return the kind value. + */ + PrivateCloudKind 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 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..e4ae52de3ecce 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 @@ -48,18 +48,86 @@ public interface MachineExtension { Map tags(); /** - * Gets the properties property: Describes Machine Extension Properties. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the properties value. + * @return the systemData value. */ - MachineExtensionProperties properties(); + SystemData systemData(); /** - * Gets the systemData property: The system meta data relating to this resource. + * Gets the forceUpdateTag property: How the extension handler should be forced to update even if the extension + * configuration has not changed. * - * @return the systemData value. + * @return the forceUpdateTag value. */ - SystemData systemData(); + String forceUpdateTag(); + + /** + * Gets the publisher property: The name of the extension handler publisher. + * + * @return the publisher value. + */ + String publisher(); + + /** + * Gets the typePropertiesType property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @return the typePropertiesType value. + */ + String typePropertiesType(); + + /** + * Gets the typeHandlerVersion property: Specifies the version of the script handler. + * + * @return the typeHandlerVersion value. + */ + String typeHandlerVersion(); + + /** + * Gets 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. + */ + Boolean enableAutomaticUpgrade(); + + /** + * Gets 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. + */ + Boolean autoUpgradeMinorVersion(); + + /** + * Gets the settings property: Json formatted public settings for the extension. + * + * @return the settings value. + */ + Map settings(); + + /** + * Gets the protectedSettings property: The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + * + * @return the protectedSettings value. + */ + Map protectedSettings(); + + /** + * 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 extension instance view. + * + * @return the instanceView value. + */ + MachineExtensionInstanceView instanceView(); /** * Gets the region of the resource. @@ -134,7 +202,17 @@ interface WithParentResource { * 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. */ - interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithProperties { + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithForceUpdateTag, + DefinitionStages.WithPublisher, + DefinitionStages.WithTypePropertiesType, + DefinitionStages.WithTypeHandlerVersion, + DefinitionStages.WithEnableAutomaticUpgrade, + DefinitionStages.WithAutoUpgradeMinorVersion, + DefinitionStages.WithSettings, + DefinitionStages.WithProtectedSettings, + DefinitionStages.WithInstanceView { /** * Executes the create request. * @@ -160,15 +238,106 @@ interface WithTags { */ WithCreate withTags(Map tags); } - /** The stage of the MachineExtension definition allowing to specify properties. */ - interface WithProperties { + /** The stage of the MachineExtension definition allowing to specify forceUpdateTag. */ + interface WithForceUpdateTag { /** - * Specifies the properties property: Describes Machine Extension 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 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. */ - WithCreate withProperties(MachineExtensionProperties properties); + WithCreate withForceUpdateTag(String forceUpdateTag); + } + /** The stage of the MachineExtension definition 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. + */ + WithCreate withPublisher(String publisher); + } + /** The stage of the MachineExtension definition allowing to specify typePropertiesType. */ + interface WithTypePropertiesType { + /** + * Specifies the typePropertiesType property: Specifies the type of the extension; an example is + * "CustomScriptExtension".. + * + * @param typePropertiesType Specifies the type of the extension; an example is "CustomScriptExtension". + * @return the next definition stage. + */ + WithCreate withTypePropertiesType(String typePropertiesType); + } + /** The stage of the MachineExtension definition 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. + */ + WithCreate withTypeHandlerVersion(String typeHandlerVersion); + } + /** The stage of the MachineExtension definition 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. + */ + WithCreate withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade); + } + /** The stage of the MachineExtension definition 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. + */ + WithCreate withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion); + } + /** The stage of the MachineExtension definition 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. + */ + WithCreate withSettings(Map settings); + } + /** The stage of the MachineExtension definition 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. + */ + WithCreate withProtectedSettings(Map protectedSettings); + } + /** The stage of the MachineExtension definition allowing to specify instanceView. */ + interface WithInstanceView { + /** + * Specifies the instanceView property: The machine extension instance view.. + * + * @param instanceView The machine extension instance view. + * @return the next definition stage. + */ + WithCreate withInstanceView(MachineExtensionInstanceView instanceView); } } /** @@ -179,7 +348,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. * @@ -207,15 +385,95 @@ 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 forceUpdateTag property: How the extension handler should be forced to update even if the + * extension configuration has not changed.. + * + * @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 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 properties property: Describes Machine Extension Update Properties.. + * Specifies the protectedSettings property: The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all.. * - * @param properties Describes Machine Extension Update Properties. + * @param protectedSettings The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. * @return the next definition stage. */ - Update withProperties(MachineExtensionUpdateProperties properties); + Update withProtectedSettings(Map protectedSettings); } } /** 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..dcda5891f359b 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,225 @@ 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. - */ - @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. +/** 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 = "privateLinkScopeResourceId") - private String privateLinkScopeResourceId; + LocationData locationData(); - /* - * The resource id of the parent cluster (Azure HCI) 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 = "parentClusterResourceId") - private String parentClusterResourceId; + AgentConfiguration agentConfiguration(); - /* - * Detected properties from the machine. + /** + * Gets the serviceStatuses property: Statuses of dependent services that are reported back to ARM. + * + * @return the serviceStatuses 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() { - } + ServiceStatuses serviceStatuses(); /** - * Get the locationData property: Metadata pertaining to the geographic location of the resource. + * Gets the cloudMetadata property: The metadata of the cloud environment (Azure/GCP/AWS/OCI...). * - * @return the locationData value. + * @return the cloudMetadata value. */ - public LocationData locationData() { - return this.locationData; - } + CloudMetadata cloudMetadata(); /** - * Set 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. * - * @param locationData the locationData value to set. - * @return the MachineProperties object itself. + * @return the agentUpgrade value. */ - public MachineProperties withLocationData(LocationData locationData) { - this.locationData = locationData; - return this; - } + AgentUpgrade agentUpgrade(); /** - * Get the osProfile property: Specifies the operating system settings for the hybrid machine. + * Gets the osProfile property: Specifies the operating system settings for the hybrid machine. * * @return the osProfile value. */ - public OSProfile osProfile() { - return this.osProfile; - } + OSProfile osProfile(); /** - * 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..e4655441b5418 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineRunCommand.java @@ -0,0 +1,464 @@ +// 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..8302b03240ad6 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineRunCommandInstanceView.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.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the Machine Extension Instance View. */ +@Fluent +public final class MachineRunCommandInstanceView { + /* + * The run command name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Instance view status. + */ + @JsonProperty(value = "status") + private MachineRunCommandInstanceViewStatus status; + + /** Creates an instance of MachineRunCommandInstanceView class. */ + public MachineRunCommandInstanceView() { + } + + /** + * Get the name property: The run command name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The run command name. + * + * @param name the name value to set. + * @return the MachineRunCommandInstanceView object itself. + */ + public MachineRunCommandInstanceView withName(String name) { + this.name = name; + return this; + } + + /** + * Get the status property: Instance view status. + * + * @return the status value. + */ + public MachineRunCommandInstanceViewStatus status() { + return this.status; + } + + /** + * Set the status property: Instance view status. + * + * @param status the status value to set. + * @return the MachineRunCommandInstanceView object itself. + */ + public MachineRunCommandInstanceView withStatus(MachineRunCommandInstanceViewStatus status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (status() != null) { + status().validate(); + } + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineRunCommandInstanceViewStatus.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineRunCommandInstanceViewStatus.java new file mode 100644 index 0000000000000..3c2f9b2311d8f --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineRunCommandInstanceViewStatus.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 MachineRunCommandInstanceViewStatus { + /* + * The status code. + */ + @JsonProperty(value = "code") + private String code; + + /* + * The level code. + */ + @JsonProperty(value = "level") + private StatusLevelTypes 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 MachineRunCommandInstanceViewStatus class. */ + public MachineRunCommandInstanceViewStatus() { + } + + /** + * 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 MachineRunCommandInstanceViewStatus object itself. + */ + public MachineRunCommandInstanceViewStatus withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the level property: The level code. + * + * @return the level value. + */ + public StatusLevelTypes level() { + return this.level; + } + + /** + * Set the level property: The level code. + * + * @param level the level value to set. + * @return the MachineRunCommandInstanceViewStatus object itself. + */ + public MachineRunCommandInstanceViewStatus withLevel(StatusLevelTypes 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 MachineRunCommandInstanceViewStatus object itself. + */ + public MachineRunCommandInstanceViewStatus 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 MachineRunCommandInstanceViewStatus object itself. + */ + public MachineRunCommandInstanceViewStatus 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 MachineRunCommandInstanceViewStatus object itself. + */ + public MachineRunCommandInstanceViewStatus 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/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..d77fe7d028083 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 VM fabric the instance is an instance of, such as HCI or SCVMM etc. + */ + @JsonProperty(value = "kind") + private PrivateCloudKind 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 VM fabric the instance is an instance of, such as HCI or SCVMM + * etc. * - * @return the properties value. + * @return the kind value. */ - public MachineUpdateProperties properties() { - return this.properties; + public PrivateCloudKind kind() { + return this.kind; } /** - * Set the properties property: Hybrid Compute Machine properties. + * Set the kind property: Indicates which kind of VM fabric the instance is an instance of, such as HCI or SCVMM + * 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(PrivateCloudKind 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..7b79bd4ed3891 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. 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/PrivateCloudKind.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateCloudKind.java new file mode 100644 index 0000000000000..88099698835c2 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateCloudKind.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; + +/** Indicates which kind of VM fabric the instance is an instance of, such as HCI or SCVMM etc. */ +public final class PrivateCloudKind extends ExpandableStringEnum { + /** Static value AVS for PrivateCloudKind. */ + public static final PrivateCloudKind AVS = fromString("AVS"); + + /** Static value HCI for PrivateCloudKind. */ + public static final PrivateCloudKind HCI = fromString("HCI"); + + /** Static value SCVMM for PrivateCloudKind. */ + public static final PrivateCloudKind SCVMM = fromString("SCVMM"); + + /** Static value VMware for PrivateCloudKind. */ + public static final PrivateCloudKind VMWARE = fromString("VMware"); + + /** + * Creates a new instance of PrivateCloudKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PrivateCloudKind() { + } + + /** + * Creates or finds a PrivateCloudKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding PrivateCloudKind. + */ + @JsonCreator + public static PrivateCloudKind fromString(String name) { + return fromString(name, PrivateCloudKind.class); + } + + /** + * Gets known PrivateCloudKind values. + * + * @return known PrivateCloudKind values. + */ + public static Collection values() { + return values(PrivateCloudKind.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..1e05e2391b4a1 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. */ 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/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..3aa404c2ada21 --- /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-04-25-preview/examples/GETLatestAgentVersion.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..918de3ed9fae4 --- /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-04-25-preview/examples/GETAgentVersions.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..eccd57e71c21a --- /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-04-25-preview/examples/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..9d6b3f543de86 --- /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-04-25-preview/examples/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..6107aa18e2e97 --- /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-04-25-preview/examples/GetHybridIdentityMetadata.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..423a97e405f28 --- /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-04-25-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/MachineExtensionsCreateOrUpdateSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsCreateOrUpdateSamples.java index 153bc630c01da..fa0afcd8e1ee8 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,13 @@ 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-04-25-preview/examples/PUTExtension.json */ /** * Sample code: Create or Update a Machine Extension. @@ -20,25 +18,28 @@ 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") .withRegion("eastus2euap") .withExistingMachine("myResourceGroup", "myMachine") - .withProperties( - new MachineExtensionProperties() - .withPublisher("Microsoft.Compute") - .withType("CustomScriptExtension") - .withTypeHandlerVersion("1.10") - .withSettings( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize( - "{\"commandToExecute\":\"powershell.exe -c \\\"Get-Process | Where-Object { $_.CPU -gt" - + " 10000 }\\\"\"}", - Object.class, - SerializerEncoding.JSON))) + .withPublisher("Microsoft.Compute") + .withTypePropertiesType("CustomScriptExtension") + .withTypeHandlerVersion("1.10") + .withSettings( + mapOf("commandToExecute", "powershell.exe -c \"Get-Process | Where-Object { $_.CPU -gt 10000 }\"")) .create(); } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } } diff --git a/sdk/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..ea455cdc29224 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-04-25-preview/examples/DELETEExtension.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..e5cecc9b329d1 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-04-25-preview/examples/GETExtension.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..abf2b7ef94720 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,7 +7,7 @@ /** 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-04-25-preview/examples/LISTExtension.json */ /** * Sample code: GET all Machine Extensions. 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..b98bf87b45e59 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-04-25-preview/examples/UpdateExtension.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,23 @@ 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(); } + + @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..874f93de2d759 --- /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-04-25-preview/examples/PutRunCommand.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..7921094d28cb9 --- /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-04-25-preview/examples/DeleteRunCommand.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..59ecca17dc8ec --- /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-04-25-preview/examples/GetRunCommand.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..d4bc39a22f4be --- /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-04-25-preview/examples/ListRunCommand.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..40b1d9ec799f8 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineRunCommandsUpdateSamples.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.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-04-25-preview/examples/UpdateRunCommand.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(); + } + + @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..513cf0559e6cc --- /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-04-25-preview/examples/MachineAssessPatches.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..65336f7ae4082 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-04-25-preview/examples/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..14e0f9f0238e8 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 @@ -7,7 +7,7 @@ /** 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-04-25-preview/examples/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..d80f7552decde --- /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-04-25-preview/examples/MachineInstallPatches.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..4289d163c22ec 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-04-25-preview/examples/Machines_ListByResourceGroup.json */ /** * Sample code: List Machines by resource group. 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..062ef341864b8 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-04-25-preview/examples/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..a374353729bd2 --- /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-04-25-preview/examples/GETNetworkProfile.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..c671b6ea61a77 --- /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-04-25-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..fc951ec6e0c41 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-04-25-preview/examples/PrivateEndpointConnectionUpdate.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..ee11a93980240 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-04-25-preview/examples/PrivateEndpointConnectionDelete.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..9eb4043d0e0c3 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-04-25-preview/examples/PrivateEndpointConnectionGet.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..19e69d196a51a 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-04-25-preview/examples/PrivateEndpointConnectionList.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..b5c2703051862 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-04-25-preview/examples/PrivateLinkScopePrivateLinkResourceGet.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..099231b4a713b 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-04-25-preview/examples/PrivateLinkScopePrivateLinkResourceListGet.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..cffa0d2cb0ebf 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-04-25-preview/examples/PrivateLinkScopesCreate.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-04-25-preview/examples/PrivateLinkScopesUpdate.json */ /** * Sample code: PrivateLinkScopeUpdate. 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..ee0fba1374a8c 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-04-25-preview/examples/PrivateLinkScopesDelete.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..f2be3f8b882b0 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-04-25-preview/examples/PrivateLinkScopesGet.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..b1fcfa442b05b 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-04-25-preview/examples/PrivateLinkScopesGetValidationForMachine.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..8cdd4cfb973df 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-04-25-preview/examples/PrivateLinkScopesGetValidation.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..e22302c89183a 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-04-25-preview/examples/PrivateLinkScopesListByResourceGroup.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..3525095583561 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-04-25-preview/examples/PrivateLinkScopesList.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..91d6bf9b15711 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-04-25-preview/examples/PrivateLinkScopesUpdateTagsOnly.json */ /** * Sample code: PrivateLinkScopeUpdateTagsOnly. 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..d674b8bf8f9ba --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/ResourceProviderUpgradeExtensionsSamples.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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-04-25-preview/examples/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); + } + + @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; - } -}