From 14e4f24d0e3fb822a369522f25da64b097a78880 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 4 Mar 2025 07:32:34 +0000 Subject: [PATCH] CodeGen from PR 32419 in Azure/azure-rest-api-specs Merge 24748e87c8f0b834cc7b26f1df1997b3c51377ac into 478602d98c4ff3c754c3b25c724852ccf07bfaef --- eng/versioning/version_client.txt | 1 + pom.xml | 1 + .../CHANGELOG.md | 8 + .../README.md | 102 + .../SAMPLE.md | 1292 ++++++++++ .../pom.xml | 63 + .../generated/ContainerInstanceManager.java | 394 +++ .../fluent/CGProfileOperationsClient.java | 267 +++ .../generated/fluent/CGProfilesClient.java | 75 + .../fluent/ContainerGroupsClient.java | 489 ++++ .../ContainerInstanceManagementClient.java | 104 + .../generated/fluent/ContainersClient.java | 129 + .../generated/fluent/LocationsClient.java | 103 + .../generated/fluent/NGroupsClient.java | 461 ++++ .../generated/fluent/OperationsClient.java | 40 + .../SubnetServiceAssociationLinksClient.java | 86 + .../fluent/models/CachedImagesInner.java | 133 ++ .../fluent/models/CapabilitiesInner.java | 165 ++ .../models/ContainerAttachResponseInner.java | 124 + .../models/ContainerExecResponseInner.java | 121 + .../fluent/models/ContainerGroupInner.java | 670 ++++++ .../models/ContainerGroupProfileInner.java | 675 ++++++ .../ContainerGroupProfileProperties.java | 686 ++++++ .../ContainerGroupPropertiesProperties.java | 685 ++++++ .../fluent/models/ContainerProperties.java | 382 +++ .../DeploymentExtensionSpecProperties.java | 192 ++ .../InitContainerPropertiesDefinition.java | 246 ++ .../models/ListResultContainerGroupInner.java | 664 ++++++ ...ultContainerGroupPropertiesProperties.java | 672 ++++++ .../generated/fluent/models/LogsInner.java | 93 + .../generated/fluent/models/NGroupInner.java | 371 +++ .../fluent/models/NGroupProperties.java | 221 ++ .../fluent/models/OperationInner.java | 194 ++ .../generated/fluent/models/UsageInner.java | 149 ++ .../generated/fluent/models/package-info.java | 9 + .../generated/fluent/package-info.java | 9 + .../CGProfileOperationsClientImpl.java | 1206 ++++++++++ .../CGProfileOperationsImpl.java | 165 ++ .../implementation/CGProfilesClientImpl.java | 479 ++++ .../implementation/CGProfilesImpl.java | 56 + .../implementation/CachedImagesImpl.java | 36 + .../implementation/CapabilitiesImpl.java | 53 + .../ContainerAttachResponseImpl.java | 36 + .../ContainerExecResponseImpl.java | 36 + .../implementation/ContainerGroupImpl.java | 415 ++++ .../ContainerGroupProfileImpl.java | 407 ++++ .../ContainerGroupsClientImpl.java | 2102 +++++++++++++++++ .../implementation/ContainerGroupsImpl.java | 224 ++ ...tainerInstanceManagementClientBuilder.java | 138 ++ ...ContainerInstanceManagementClientImpl.java | 400 ++++ .../implementation/ContainersClientImpl.java | 573 +++++ .../implementation/ContainersImpl.java | 108 + .../ListResultContainerGroupImpl.java | 195 ++ .../implementation/LocationsClientImpl.java | 618 +++++ .../implementation/LocationsImpl.java | 69 + .../generated/implementation/LogsImpl.java | 32 + .../generated/implementation/NGroupImpl.java | 255 ++ .../implementation/NGroupsClientImpl.java | 1969 +++++++++++++++ .../generated/implementation/NGroupsImpl.java | 170 ++ .../implementation/OperationImpl.java | 46 + .../implementation/OperationsClientImpl.java | 235 ++ .../implementation/OperationsImpl.java | 45 + .../implementation/ResourceManagerUtils.java | 195 ++ ...bnetServiceAssociationLinksClientImpl.java | 328 +++ .../SubnetServiceAssociationLinksImpl.java | 40 + .../generated/implementation/UsageImpl.java | 49 + .../implementation/package-info.java | 9 + .../generated/models/ApiEntityReference.java | 95 + .../generated/models/ApplicationGateway.java | 128 + .../ApplicationGatewayBackendAddressPool.java | 95 + .../models/AzureFileShareAccessTier.java | 68 + .../models/AzureFileShareAccessType.java | 57 + .../generated/models/AzureFileVolume.java | 220 ++ .../generated/models/CGProfileOperations.java | 208 ++ ...rofileOperationsCreateOrUpdateHeaders.java | 61 + ...ofileOperationsCreateOrUpdateResponse.java | 40 + .../CGProfileOperationsUpdateHeaders.java | 61 + .../CGProfileOperationsUpdateResponse.java | 40 + .../generated/models/CGProfiles.java | 68 + .../generated/models/CachedImages.java | 33 + .../models/CachedImagesListResult.java | 127 + .../generated/models/Capabilities.java | 61 + .../models/CapabilitiesCapabilities.java | 113 + .../models/CapabilitiesListResult.java | 127 + .../models/ConfidentialComputeProperties.java | 94 + .../generated/models/Container.java | 342 +++ .../models/ContainerAttachResponse.java | 35 + .../generated/models/ContainerExec.java | 95 + .../models/ContainerExecRequest.java | 124 + .../ContainerExecRequestTerminalSize.java | 122 + .../models/ContainerExecResponse.java | 34 + .../generated/models/ContainerGroup.java | 978 ++++++++ .../models/ContainerGroupDiagnostics.java | 96 + .../models/ContainerGroupIdentity.java | 175 ++ .../models/ContainerGroupIpAddressType.java | 51 + .../models/ContainerGroupListResult.java | 128 + .../models/ContainerGroupNetworkProtocol.java | 51 + .../models/ContainerGroupPriority.java | 51 + .../models/ContainerGroupProfile.java | 661 ++++++ .../ContainerGroupProfileListResult.java | 129 + .../models/ContainerGroupProfilePatch.java | 95 + .../models/ContainerGroupProfileStub.java | 224 ++ .../models/ContainerGroupProperties.java | 558 +++++ .../ContainerGroupPropertiesInstanceView.java | 104 + .../ContainerGroupProvisioningState.java | 106 + .../models/ContainerGroupRestartPolicy.java | 59 + .../generated/models/ContainerGroupSku.java | 61 + .../models/ContainerGroupSubnetId.java | 129 + .../generated/models/ContainerGroups.java | 365 +++ .../generated/models/ContainerHttpGet.java | 183 ++ .../ContainerInstanceOperationsOrigin.java | 51 + .../models/ContainerNetworkProtocol.java | 51 + .../generated/models/ContainerPort.java | 122 + .../generated/models/ContainerProbe.java | 267 +++ .../ContainerPropertiesInstanceView.java | 141 ++ .../generated/models/ContainerState.java | 149 ++ .../generated/models/Containers.java | 117 + .../models/DeploymentExtensionSpec.java | 215 ++ .../generated/models/DnsConfiguration.java | 159 ++ .../models/DnsNameLabelReusePolicy.java | 71 + .../generated/models/ElasticProfile.java | 163 ++ ...sticProfileContainerGroupNamingPolicy.java | 101 + ...inerGroupNamingPolicyGuidNamingPolicy.java | 103 + .../models/EncryptionProperties.java | 195 ++ .../generated/models/EnvironmentVariable.java | 185 ++ .../generated/models/Event.java | 165 ++ .../generated/models/FileShare.java | 180 ++ .../generated/models/FileShareProperties.java | 134 ++ .../generated/models/GitRepoVolume.java | 163 ++ .../generated/models/GpuResource.java | 129 + .../generated/models/GpuSku.java | 56 + .../generated/models/HttpHeader.java | 121 + .../models/IdentityAccessControl.java | 121 + .../generated/models/IdentityAccessLevel.java | 56 + .../generated/models/IdentityAcls.java | 127 + .../models/ImageRegistryCredential.java | 241 ++ .../models/InitContainerDefinition.java | 252 ++ ...ainerPropertiesDefinitionInstanceView.java | 145 ++ .../generated/models/IpAddress.java | 257 ++ .../models/ListResultContainerGroup.java | 202 ++ .../ListResultContainerGroupProperties.java | 552 +++++ .../generated/models/LoadBalancer.java | 100 + .../LoadBalancerBackendAddressPool.java | 94 + .../generated/models/Locations.java | 92 + .../generated/models/LogAnalytics.java | 219 ++ .../generated/models/LogAnalyticsLogType.java | 51 + .../generated/models/Logs.java | 26 + .../generated/models/NGroup.java | 536 +++++ .../models/NGroupCGPropertyContainer.java | 125 + .../NGroupCGPropertyContainerProperties.java | 100 + .../models/NGroupCGPropertyVolume.java | 132 ++ .../NGroupContainerGroupProperties.java | 170 ++ .../generated/models/NGroupIdentity.java | 172 ++ .../models/NGroupProvisioningState.java | 76 + .../generated/models/NGroupUpdateMode.java | 51 + .../generated/models/NGroups.java | 269 +++ .../generated/models/NGroupsListResult.java | 127 + .../generated/models/NetworkProfile.java | 130 + .../models/OperatingSystemTypes.java | 51 + .../generated/models/Operation.java | 47 + .../generated/models/OperationDisplay.java | 177 ++ .../generated/models/OperationListResult.java | 127 + .../generated/models/Operations.java | 35 + .../generated/models/PlacementProfile.java | 98 + .../generated/models/Port.java | 122 + .../models/ResourceIdentityType.java | 68 + .../generated/models/ResourceLimits.java | 152 ++ .../generated/models/ResourceRequests.java | 153 ++ .../models/ResourceRequirements.java | 134 ++ .../generated/models/Scheme.java | 51 + .../generated/models/SecretReference.java | 168 ++ ...SecurityContextCapabilitiesDefinition.java | 126 + .../models/SecurityContextDefinition.java | 242 ++ .../generated/models/StorageProfile.java | 98 + .../models/SubnetServiceAssociationLinks.java | 43 + .../generated/models/UpdateProfile.java | 124 + .../UpdateProfileRollingUpdateProfile.java | 193 ++ .../generated/models/Usage.java | 54 + .../generated/models/UsageListResult.java | 87 + .../generated/models/UsageName.java | 97 + .../models/UserAssignedIdentities.java | 99 + .../generated/models/Volume.java | 250 ++ .../generated/models/VolumeMount.java | 163 ++ .../generated/models/package-info.java | 9 + .../generated/package-info.java | 9 + .../src/main/java/module-info.java | 15 + .../proxy-config.json | 1 + .../reflect-config.json | 1 + ...ger-containerinstance-generated.properties | 1 + ...ProfileOperationCreateOrUpdateSamples.java | 232 ++ .../CGProfileOperationDeleteSamples.java | 25 + ...ileOperationGetByResourceGroupSamples.java | 40 + ...leOperationGetByRevisionNumberSamples.java | 26 + ...ofileOperationListAllRevisionsSamples.java | 25 + .../CGProfileOperationUpdateSamples.java | 44 + .../CGProfilesListByResourceGroupSamples.java | 25 + .../generated/CGProfilesListSamples.java | 25 + .../ContainerGroupsCreateOrUpdateSamples.java | 370 +++ .../ContainerGroupsDeleteSamples.java | 25 + ...tainerGroupsGetByResourceGroupSamples.java | 55 + ...ainerGroupsListByResourceGroupSamples.java | 25 + .../generated/ContainerGroupsListSamples.java | 25 + .../ContainerGroupsRestartSamples.java | 25 + .../ContainerGroupsStartSamples.java | 25 + .../generated/ContainerGroupsStopSamples.java | 25 + .../ContainerGroupsUpdateSamples.java | 44 + .../generated/ContainersAttachSamples.java | 25 + .../ContainersExecuteCommandSamples.java | 32 + .../generated/ContainersListLogsSamples.java | 26 + .../LocationListCachedImagesSamples.java | 25 + .../LocationListCapabilitiesSamples.java | 25 + .../generated/LocationListUsageSamples.java | 25 + .../generated/OperationsListSamples.java | 25 + ...etServiceAssociationLinkDeleteSamples.java | 25 + sdk/containerinstance/ci.yml | 46 + sdk/containerinstance/pom.xml | 15 + 216 files changed, 39203 insertions(+) create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/CHANGELOG.md create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/README.md create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/SAMPLE.md create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/pom.xml create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/ContainerInstanceManager.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/CGProfileOperationsClient.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/CGProfilesClient.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/ContainerGroupsClient.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/ContainerInstanceManagementClient.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/ContainersClient.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/LocationsClient.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/NGroupsClient.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/OperationsClient.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/SubnetServiceAssociationLinksClient.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/CachedImagesInner.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/CapabilitiesInner.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerAttachResponseInner.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerExecResponseInner.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerGroupInner.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerGroupProfileInner.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerGroupProfileProperties.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerGroupPropertiesProperties.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerProperties.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/DeploymentExtensionSpecProperties.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/InitContainerPropertiesDefinition.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ListResultContainerGroupInner.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ListResultContainerGroupPropertiesProperties.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/LogsInner.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/NGroupInner.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/NGroupProperties.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/OperationInner.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/UsageInner.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/package-info.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/package-info.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/CGProfileOperationsClientImpl.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/CGProfileOperationsImpl.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/CGProfilesClientImpl.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/CGProfilesImpl.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/CachedImagesImpl.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/CapabilitiesImpl.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerAttachResponseImpl.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerExecResponseImpl.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerGroupImpl.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerGroupProfileImpl.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerGroupsClientImpl.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerGroupsImpl.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerInstanceManagementClientBuilder.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerInstanceManagementClientImpl.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainersClientImpl.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainersImpl.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ListResultContainerGroupImpl.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/LocationsClientImpl.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/LocationsImpl.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/LogsImpl.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/NGroupImpl.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/NGroupsClientImpl.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/NGroupsImpl.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/OperationImpl.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/OperationsClientImpl.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/OperationsImpl.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ResourceManagerUtils.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/SubnetServiceAssociationLinksClientImpl.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/SubnetServiceAssociationLinksImpl.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/UsageImpl.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/package-info.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ApiEntityReference.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ApplicationGateway.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ApplicationGatewayBackendAddressPool.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/AzureFileShareAccessTier.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/AzureFileShareAccessType.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/AzureFileVolume.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/CGProfileOperations.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/CGProfileOperationsCreateOrUpdateHeaders.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/CGProfileOperationsCreateOrUpdateResponse.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/CGProfileOperationsUpdateHeaders.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/CGProfileOperationsUpdateResponse.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/CGProfiles.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/CachedImages.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/CachedImagesListResult.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Capabilities.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/CapabilitiesCapabilities.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/CapabilitiesListResult.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ConfidentialComputeProperties.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Container.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerAttachResponse.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerExec.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerExecRequest.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerExecRequestTerminalSize.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerExecResponse.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroup.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupDiagnostics.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupIdentity.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupIpAddressType.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupListResult.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupNetworkProtocol.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupPriority.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupProfile.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupProfileListResult.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupProfilePatch.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupProfileStub.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupProperties.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupPropertiesInstanceView.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupProvisioningState.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupRestartPolicy.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupSku.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupSubnetId.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroups.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerHttpGet.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerInstanceOperationsOrigin.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerNetworkProtocol.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerPort.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerProbe.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerPropertiesInstanceView.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerState.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Containers.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/DeploymentExtensionSpec.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/DnsConfiguration.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/DnsNameLabelReusePolicy.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ElasticProfile.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ElasticProfileContainerGroupNamingPolicy.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ElasticProfileContainerGroupNamingPolicyGuidNamingPolicy.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/EncryptionProperties.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/EnvironmentVariable.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Event.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/FileShare.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/FileShareProperties.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/GitRepoVolume.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/GpuResource.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/GpuSku.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/HttpHeader.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/IdentityAccessControl.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/IdentityAccessLevel.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/IdentityAcls.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ImageRegistryCredential.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/InitContainerDefinition.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/InitContainerPropertiesDefinitionInstanceView.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/IpAddress.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ListResultContainerGroup.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ListResultContainerGroupProperties.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/LoadBalancer.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/LoadBalancerBackendAddressPool.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Locations.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/LogAnalytics.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/LogAnalyticsLogType.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Logs.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/NGroup.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/NGroupCGPropertyContainer.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/NGroupCGPropertyContainerProperties.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/NGroupCGPropertyVolume.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/NGroupContainerGroupProperties.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/NGroupIdentity.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/NGroupProvisioningState.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/NGroupUpdateMode.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/NGroups.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/NGroupsListResult.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/NetworkProfile.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/OperatingSystemTypes.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Operation.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/OperationDisplay.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/OperationListResult.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Operations.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/PlacementProfile.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Port.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ResourceIdentityType.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ResourceLimits.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ResourceRequests.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ResourceRequirements.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Scheme.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/SecretReference.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/SecurityContextCapabilitiesDefinition.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/SecurityContextDefinition.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/StorageProfile.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/SubnetServiceAssociationLinks.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/UpdateProfile.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/UpdateProfileRollingUpdateProfile.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Usage.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/UsageListResult.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/UsageName.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/UserAssignedIdentities.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Volume.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/VolumeMount.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/package-info.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/package-info.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/module-info.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-containerinstance-generated/proxy-config.json create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-containerinstance-generated/reflect-config.json create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/resources/azure-resourcemanager-containerinstance-generated.properties create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/CGProfileOperationCreateOrUpdateSamples.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/CGProfileOperationDeleteSamples.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/CGProfileOperationGetByResourceGroupSamples.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/CGProfileOperationGetByRevisionNumberSamples.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/CGProfileOperationListAllRevisionsSamples.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/CGProfileOperationUpdateSamples.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/CGProfilesListByResourceGroupSamples.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/CGProfilesListSamples.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsCreateOrUpdateSamples.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsDeleteSamples.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsGetByResourceGroupSamples.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsListByResourceGroupSamples.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsListSamples.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsRestartSamples.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsStartSamples.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsStopSamples.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsUpdateSamples.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainersAttachSamples.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainersExecuteCommandSamples.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainersListLogsSamples.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/LocationListCachedImagesSamples.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/LocationListCapabilitiesSamples.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/LocationListUsageSamples.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/OperationsListSamples.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/SubnetServiceAssociationLinkDeleteSamples.java create mode 100644 sdk/containerinstance/ci.yml create mode 100644 sdk/containerinstance/pom.xml diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 487ef9e02332..069c97165e5f 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -477,6 +477,7 @@ com.azure.resourcemanager:azure-resourcemanager-pineconevectordb;1.0.0-beta.1;1. com.azure.resourcemanager:azure-resourcemanager-impactreporting;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-migration-assessment;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-databasewatcher;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-containerinstance-generated;1.0.0-beta.1;1.0.0-beta.1 com.azure.tools:azure-sdk-archetype;1.0.0;1.2.0-beta.1 com.azure.tools:azure-sdk-build-tool;1.0.0;1.1.0-beta.1 io.clientcore:clientcore-parent;1.0.0-beta.1;1.0.0-beta.2 diff --git a/pom.xml b/pom.xml index 933f70cda255..4dc9287a597d 100644 --- a/pom.xml +++ b/pom.xml @@ -50,6 +50,7 @@ sdk/connectedcache sdk/connectedvmware sdk/consumption + sdk/containerinstance sdk/containerorchestratorruntime sdk/containerregistry sdk/containerservicefleet diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/CHANGELOG.md b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/CHANGELOG.md new file mode 100644 index 000000000000..41bbc872a42a --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/CHANGELOG.md @@ -0,0 +1,8 @@ +# Release History + +## 1.0.0-beta.1 (2025-03-04) + +- Azure Resource Manager ContainerInstance client library for Java. This package contains Microsoft Azure SDK for ContainerInstance Management SDK. Package tag package-preview-2024-11. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +### Features Added + +- Initial release for the azure-resourcemanager-containerinstance-generated Java SDK. diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/README.md b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/README.md new file mode 100644 index 000000000000..a671861048dd --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/README.md @@ -0,0 +1,102 @@ +# Azure Resource Manager ContainerInstance client library for Java + +Azure Resource Manager ContainerInstance client library for Java. + +This package contains Microsoft Azure SDK for ContainerInstance Management SDK. Package tag package-preview-2024-11. 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 + +We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. + +If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. + +Thank you in advance for your collaboration. We really appreciate your time! + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-containerinstance-generated;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-containerinstance-generated + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Include the recommended packages + +Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. + +[Azure Identity][azure_identity] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation. + +### Authentication + +Microsoft Entra ID token authentication relies on the [credential class][azure_identity_credentials] from [Azure Identity][azure_identity] package. + +Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. + +Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: + +```java +AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +ContainerInstanceManager manager = ContainerInstanceManager + .authenticate(credential, profile); +``` + +The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise. + +See [Authentication][authenticate] for more options. + +## Key concepts + +See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. + +## Examples + +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/SAMPLE.md) + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide][cg]. + +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact with any additional questions or comments. + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/identity/azure-identity#credentials +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md +[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/SAMPLE.md b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/SAMPLE.md new file mode 100644 index 000000000000..378cac8e542c --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/SAMPLE.md @@ -0,0 +1,1292 @@ +# Code snippets and samples + + +## CGProfileOperation + +- [CreateOrUpdate](#cgprofileoperation_createorupdate) +- [Delete](#cgprofileoperation_delete) +- [GetByResourceGroup](#cgprofileoperation_getbyresourcegroup) +- [GetByRevisionNumber](#cgprofileoperation_getbyrevisionnumber) +- [ListAllRevisions](#cgprofileoperation_listallrevisions) +- [Update](#cgprofileoperation_update) + +## CGProfiles + +- [List](#cgprofiles_list) +- [ListByResourceGroup](#cgprofiles_listbyresourcegroup) + +## ContainerGroups + +- [CreateOrUpdate](#containergroups_createorupdate) +- [Delete](#containergroups_delete) +- [GetByResourceGroup](#containergroups_getbyresourcegroup) +- [List](#containergroups_list) +- [ListByResourceGroup](#containergroups_listbyresourcegroup) +- [Restart](#containergroups_restart) +- [Start](#containergroups_start) +- [Stop](#containergroups_stop) +- [Update](#containergroups_update) + +## Containers + +- [Attach](#containers_attach) +- [ExecuteCommand](#containers_executecommand) +- [ListLogs](#containers_listlogs) + +## Location + +- [ListCachedImages](#location_listcachedimages) +- [ListCapabilities](#location_listcapabilities) +- [ListUsage](#location_listusage) + +## Operations + +- [List](#operations_list) + +## SubnetServiceAssociationLink + +- [Delete](#subnetserviceassociationlink_delete) +### CGProfileOperation_CreateOrUpdate + +```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.containerinstance.generated.models.AzureFileVolume; +import com.azure.resourcemanager.containerinstance.generated.models.ConfidentialComputeProperties; +import com.azure.resourcemanager.containerinstance.generated.models.Container; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupDiagnostics; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupIpAddressType; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupNetworkProtocol; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupSku; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerPort; +import com.azure.resourcemanager.containerinstance.generated.models.DeploymentExtensionSpec; +import com.azure.resourcemanager.containerinstance.generated.models.EncryptionProperties; +import com.azure.resourcemanager.containerinstance.generated.models.GpuResource; +import com.azure.resourcemanager.containerinstance.generated.models.GpuSku; +import com.azure.resourcemanager.containerinstance.generated.models.IpAddress; +import com.azure.resourcemanager.containerinstance.generated.models.LogAnalytics; +import com.azure.resourcemanager.containerinstance.generated.models.LogAnalyticsLogType; +import com.azure.resourcemanager.containerinstance.generated.models.OperatingSystemTypes; +import com.azure.resourcemanager.containerinstance.generated.models.Port; +import com.azure.resourcemanager.containerinstance.generated.models.ResourceRequests; +import com.azure.resourcemanager.containerinstance.generated.models.ResourceRequirements; +import com.azure.resourcemanager.containerinstance.generated.models.SecurityContextCapabilitiesDefinition; +import com.azure.resourcemanager.containerinstance.generated.models.SecurityContextDefinition; +import com.azure.resourcemanager.containerinstance.generated.models.Volume; +import com.azure.resourcemanager.containerinstance.generated.models.VolumeMount; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for CGProfileOperation CreateOrUpdate. + */ +public final class CGProfileOperationCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * ContainerGroupProfileCreateOrUpdate_CreateConfidential.json + */ + /** + * Sample code: ConfidentialContainerGroupProfile. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void confidentialContainerGroupProfile( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.cGProfileOperations() + .define("demo1") + .withRegion("westeurope") + .withExistingResourceGroup("demo") + .withZones(Arrays.asList("1")) + .withSku(ContainerGroupSku.CONFIDENTIAL) + .withContainers( + Arrays + .asList( + new Container().withName("accdemo") + .withImage("confiimage") + .withCommand(Arrays.asList()) + .withPorts(Arrays.asList(new ContainerPort().withPort(8000))) + .withEnvironmentVariables(Arrays.asList()) + .withResources(new ResourceRequirements() + .withRequests(new ResourceRequests().withMemoryInGB(1.5).withCpu(1.0))) + .withSecurityContext(new SecurityContextDefinition().withPrivileged(false) + .withCapabilities(new SecurityContextCapabilitiesDefinition() + .withAdd(Arrays.asList("CAP_NET_ADMIN")))))) + .withImageRegistryCredentials(Arrays.asList()) + .withIpAddress(new IpAddress() + .withPorts(Arrays.asList(new Port().withProtocol(ContainerGroupNetworkProtocol.TCP).withPort(8000))) + .withType(ContainerGroupIpAddressType.PUBLIC)) + .withOsType(OperatingSystemTypes.LINUX) + .withConfidentialComputeProperties(new ConfidentialComputeProperties().withCcePolicy( + "eyJhbGxvd19hbGwiOiB0cnVlLCAiY29udGFpbmVycyI6IHsibGVuZ3RoIjogMCwgImVsZW1lbnRzIjogbnVsbH19")) + .create(); + } + + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * ContainerGroupProfileCreateOrUpdate_EncryptionProperties.json + */ + /** + * Sample code: ContainerGroupProfileWithEncryptionProperties. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerGroupProfileWithEncryptionProperties( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.cGProfileOperations() + .define("demo1") + .withRegion("eastus2") + .withExistingResourceGroup("demo") + .withZones(Arrays.asList("1")) + .withEncryptionProperties(new EncryptionProperties() + .withVaultBaseUrl("https://testkeyvault.vault.azure.net") + .withKeyName("fakeTokenPlaceholder") + .withKeyVersion("fakeTokenPlaceholder") + .withIdentity( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/container-group-identity")) + .withContainers( + Arrays.asList(new Container().withName("demo1") + .withImage("nginx") + .withCommand(Arrays.asList()) + .withPorts(Arrays.asList(new ContainerPort().withPort(80))) + .withEnvironmentVariables(Arrays.asList()) + .withResources(new ResourceRequirements() + .withRequests(new ResourceRequests().withMemoryInGB(1.5).withCpu(1.0))))) + .withImageRegistryCredentials(Arrays.asList()) + .withIpAddress(new IpAddress() + .withPorts(Arrays.asList(new Port().withProtocol(ContainerGroupNetworkProtocol.TCP).withPort(80))) + .withType(ContainerGroupIpAddressType.PUBLIC)) + .withOsType(OperatingSystemTypes.LINUX) + .create(); + } + + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * ContainerGroupProfileCreateOrUpdate_Extensions.json + */ + /** + * Sample code: ContainerGroupProfileCreateWithExtensions. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerGroupProfileCreateWithExtensions( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) throws IOException { + manager.cGProfileOperations() + .define("demo1") + .withRegion("eastus2") + .withExistingResourceGroup("demo") + .withZones(Arrays.asList("1")) + .withContainers( + Arrays.asList(new Container().withName("demo1") + .withImage("nginx") + .withCommand(Arrays.asList()) + .withPorts(Arrays.asList(new ContainerPort().withPort(80))) + .withEnvironmentVariables(Arrays.asList()) + .withResources(new ResourceRequirements() + .withRequests(new ResourceRequests().withMemoryInGB(1.5).withCpu(1.0))))) + .withExtensions(Arrays.asList( + new DeploymentExtensionSpec().withName("kube-proxy") + .withExtensionType("kube-proxy") + .withVersion("1.0") + .withSettings(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{\"clusterCidr\":\"10.240.0.0/16\",\"kubeVersion\":\"v1.9.10\"}", Object.class, + SerializerEncoding.JSON)) + .withProtectedSettings(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{\"kubeConfig\":\"\"}", Object.class, + SerializerEncoding.JSON)), + new DeploymentExtensionSpec().withName("vk-realtime-metrics") + .withExtensionType("realtime-metrics") + .withVersion("1.0"))) + .withImageRegistryCredentials(Arrays.asList()) + .withIpAddress(new IpAddress() + .withPorts(Arrays.asList(new Port().withProtocol(ContainerGroupNetworkProtocol.TCP).withPort(80))) + .withType(ContainerGroupIpAddressType.PRIVATE)) + .withOsType(OperatingSystemTypes.LINUX) + .create(); + } + + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * ContainerGroupProfilesCreateOrUpdate.json + */ + /** + * Sample code: ContainerGroupProfilesCreateOrUpdate. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerGroupProfilesCreateOrUpdate( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) throws IOException { + manager.cGProfileOperations() + .define("demo1") + .withRegion("west us") + .withExistingResourceGroup("demo") + .withZones(Arrays.asList("1")) + .withContainers(Arrays.asList(new Container().withName("demo1") + .withImage("nginx") + .withCommand(Arrays.asList()) + .withPorts(Arrays.asList(new ContainerPort().withPort(80))) + .withEnvironmentVariables(Arrays.asList()) + .withResources(new ResourceRequirements().withRequests(new ResourceRequests().withMemoryInGB(1.5) + .withCpu(1.0) + .withGpu(new GpuResource().withCount(1).withSku(GpuSku.K80)))) + .withVolumeMounts(Arrays.asList( + new VolumeMount().withName("volume1").withMountPath("/mnt/volume1").withReadOnly(false), + new VolumeMount().withName("volume2").withMountPath("/mnt/volume2").withReadOnly(false), + new VolumeMount().withName("volume3").withMountPath("/mnt/volume3").withReadOnly(true))))) + .withImageRegistryCredentials(Arrays.asList()) + .withIpAddress(new IpAddress() + .withPorts(Arrays.asList(new Port().withProtocol(ContainerGroupNetworkProtocol.TCP).withPort(80))) + .withType(ContainerGroupIpAddressType.PUBLIC)) + .withOsType(OperatingSystemTypes.LINUX) + .withVolumes(Arrays.asList( + new Volume().withName("volume1") + .withAzureFile(new AzureFileVolume().withShareName("shareName") + .withStorageAccountName("accountName") + .withStorageAccountKey("fakeTokenPlaceholder")), + new Volume().withName("volume2") + .withEmptyDir(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)), + new Volume().withName("volume3") + .withSecret(mapOf("secretKey1", "fakeTokenPlaceholder", "secretKey2", "fakeTokenPlaceholder")))) + .withDiagnostics(new ContainerGroupDiagnostics().withLogAnalytics(new LogAnalytics() + .withWorkspaceId("workspaceid") + .withWorkspaceKey("fakeTokenPlaceholder") + .withLogType(LogAnalyticsLogType.CONTAINER_INSIGHTS) + .withMetadata(mapOf("pod-uuid", "test-metadata-value")) + .withWorkspaceResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/microsoft.operationalinsights/workspaces/workspace"))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### CGProfileOperation_Delete + +```java +/** + * Samples for CGProfileOperation Delete. + */ +public final class CGProfileOperationDeleteSamples { + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * ContainerGroupProfilesDelete.json + */ + /** + * Sample code: ContainerGroupProfilesDelete. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerGroupProfilesDelete( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.cGProfileOperations().delete("demo", "demo1", com.azure.core.util.Context.NONE); + } +} +``` + +### CGProfileOperation_GetByResourceGroup + +```java +/** + * Samples for CGProfileOperation GetByResourceGroup. + */ +public final class CGProfileOperationGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * ContainerGroupProfilesGet.json + */ + /** + * Sample code: ContainerGroupProfilesGet_Succeeded. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerGroupProfilesGetSucceeded( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.cGProfileOperations().getByResourceGroupWithResponse("demo", "demo1", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * ContainerGroupProfilesGetPriority.json + */ + /** + * Sample code: ContainerGroupProfilesGetWithPriority. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerGroupProfilesGetWithPriority( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.cGProfileOperations().getByResourceGroupWithResponse("demo", "demo1", com.azure.core.util.Context.NONE); + } +} +``` + +### CGProfileOperation_GetByRevisionNumber + +```java +/** + * Samples for CGProfileOperation GetByRevisionNumber. + */ +public final class CGProfileOperationGetByRevisionNumberSamples { + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * ContainerGroupProfileGetByRevisionNumber.json + */ + /** + * Sample code: ContainerGroupProfileGetByRevisionNumber. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerGroupProfileGetByRevisionNumber( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.cGProfileOperations() + .getByRevisionNumberWithResponse("demo", "demo1", "1", com.azure.core.util.Context.NONE); + } +} +``` + +### CGProfileOperation_ListAllRevisions + +```java +/** + * Samples for CGProfileOperation ListAllRevisions. + */ +public final class CGProfileOperationListAllRevisionsSamples { + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * ContainerGroupProfileListAllRevisions.json + */ + /** + * Sample code: ContainerGroupProfileListAllRevisions. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerGroupProfileListAllRevisions( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.cGProfileOperations().listAllRevisions("demo", "demo1", com.azure.core.util.Context.NONE); + } +} +``` + +### CGProfileOperation_Update + +```java +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupProfile; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for CGProfileOperation Update. + */ +public final class CGProfileOperationUpdateSamples { + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * ContainerGroupProfilesPatch.json + */ + /** + * Sample code: ContainerGroupProfilesPatch. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerGroupProfilesPatch( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + ContainerGroupProfile resource = manager.cGProfileOperations() + .getByResourceGroupWithResponse("demoResource", "demo1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1key", "fakeTokenPlaceholder", "tag2key", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### CGProfiles_List + +```java +/** + * Samples for CGProfiles List. + */ +public final class CGProfilesListSamples { + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * ContainerGroupProfilesList.json + */ + /** + * Sample code: ContainerGroupProfilesList. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerGroupProfilesList( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.cGProfiles().list(com.azure.core.util.Context.NONE); + } +} +``` + +### CGProfiles_ListByResourceGroup + +```java +/** + * Samples for CGProfiles ListByResourceGroup. + */ +public final class CGProfilesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * ContainerGroupProfilesListByResourceGroup.json + */ + /** + * Sample code: ContainerGroupProfilesListByResourceGroup. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerGroupProfilesListByResourceGroup( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.cGProfiles().listByResourceGroup("demo", com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerGroups_CreateOrUpdate + +```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.containerinstance.generated.models.AzureFileVolume; +import com.azure.resourcemanager.containerinstance.generated.models.ConfidentialComputeProperties; +import com.azure.resourcemanager.containerinstance.generated.models.Container; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupDiagnostics; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupIdentity; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupIpAddressType; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupNetworkProtocol; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupPriority; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupRestartPolicy; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupSku; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupSubnetId; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerPort; +import com.azure.resourcemanager.containerinstance.generated.models.DeploymentExtensionSpec; +import com.azure.resourcemanager.containerinstance.generated.models.DnsConfiguration; +import com.azure.resourcemanager.containerinstance.generated.models.DnsNameLabelReusePolicy; +import com.azure.resourcemanager.containerinstance.generated.models.EncryptionProperties; +import com.azure.resourcemanager.containerinstance.generated.models.EnvironmentVariable; +import com.azure.resourcemanager.containerinstance.generated.models.GpuResource; +import com.azure.resourcemanager.containerinstance.generated.models.GpuSku; +import com.azure.resourcemanager.containerinstance.generated.models.ImageRegistryCredential; +import com.azure.resourcemanager.containerinstance.generated.models.IpAddress; +import com.azure.resourcemanager.containerinstance.generated.models.LogAnalytics; +import com.azure.resourcemanager.containerinstance.generated.models.LogAnalyticsLogType; +import com.azure.resourcemanager.containerinstance.generated.models.OperatingSystemTypes; +import com.azure.resourcemanager.containerinstance.generated.models.Port; +import com.azure.resourcemanager.containerinstance.generated.models.ResourceIdentityType; +import com.azure.resourcemanager.containerinstance.generated.models.ResourceRequests; +import com.azure.resourcemanager.containerinstance.generated.models.ResourceRequirements; +import com.azure.resourcemanager.containerinstance.generated.models.SecretReference; +import com.azure.resourcemanager.containerinstance.generated.models.SecurityContextCapabilitiesDefinition; +import com.azure.resourcemanager.containerinstance.generated.models.SecurityContextDefinition; +import com.azure.resourcemanager.containerinstance.generated.models.UserAssignedIdentities; +import com.azure.resourcemanager.containerinstance.generated.models.Volume; +import com.azure.resourcemanager.containerinstance.generated.models.VolumeMount; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ContainerGroups CreateOrUpdate. + */ +public final class ContainerGroupsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * ContainerGroupExtensions.json + */ + /** + * Sample code: ContainerGroupCreateWithExtensions. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerGroupCreateWithExtensions( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) throws IOException { + manager.containerGroups() + .define("demo1") + .withRegion("eastus2") + .withExistingResourceGroup("demo") + .withContainers( + Arrays.asList(new Container().withName("demo1") + .withImage("nginx") + .withCommand(Arrays.asList()) + .withPorts(Arrays.asList(new ContainerPort().withPort(80))) + .withEnvironmentVariables(Arrays.asList()) + .withResources(new ResourceRequirements() + .withRequests(new ResourceRequests().withMemoryInGB(1.5).withCpu(1.0))))) + .withOsType(OperatingSystemTypes.LINUX) + .withImageRegistryCredentials(Arrays.asList()) + .withIpAddress(new IpAddress() + .withPorts(Arrays.asList(new Port().withProtocol(ContainerGroupNetworkProtocol.TCP).withPort(80))) + .withType(ContainerGroupIpAddressType.PRIVATE)) + .withSubnetIds(Arrays.asList(new ContainerGroupSubnetId().withId( + "/subscriptions/00000000-0000-0000-0000-00000000/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-rg-vnet/subnets/test-subnet"))) + .withExtensions(Arrays.asList( + new DeploymentExtensionSpec().withName("kube-proxy") + .withExtensionType("kube-proxy") + .withVersion("1.0") + .withSettings(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{\"clusterCidr\":\"10.240.0.0/16\",\"kubeVersion\":\"v1.9.10\"}", Object.class, + SerializerEncoding.JSON)) + .withProtectedSettings(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{\"kubeConfig\":\"\"}", Object.class, + SerializerEncoding.JSON)), + new DeploymentExtensionSpec().withName("vk-realtime-metrics") + .withExtensionType("realtime-metrics") + .withVersion("1.0"))) + .create(); + } + + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * ContainerGroupEncryptionProperties.json + */ + /** + * Sample code: ContainerGroupWithEncryptionProperties. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerGroupWithEncryptionProperties( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.containerGroups() + .define("demo1") + .withRegion("eastus2") + .withExistingResourceGroup("demo") + .withContainers( + Arrays.asList(new Container().withName("demo1") + .withImage("nginx") + .withCommand(Arrays.asList()) + .withPorts(Arrays.asList(new ContainerPort().withPort(80))) + .withEnvironmentVariables(Arrays.asList()) + .withResources(new ResourceRequirements() + .withRequests(new ResourceRequests().withMemoryInGB(1.5).withCpu(1.0))))) + .withOsType(OperatingSystemTypes.LINUX) + .withIdentity(new ContainerGroupIdentity().withType(ResourceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/container-group-identity", + new UserAssignedIdentities()))) + .withImageRegistryCredentials(Arrays.asList()) + .withIpAddress(new IpAddress() + .withPorts(Arrays.asList(new Port().withProtocol(ContainerGroupNetworkProtocol.TCP).withPort(80))) + .withType(ContainerGroupIpAddressType.PUBLIC)) + .withEncryptionProperties(new EncryptionProperties() + .withVaultBaseUrl("https://testkeyvault.vault.azure.net") + .withKeyName("fakeTokenPlaceholder") + .withKeyVersion("fakeTokenPlaceholder") + .withIdentity( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/container-group-identity")) + .create(); + } + + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * ContainerGroupsCreateOrUpdateSecretReference.json + */ + /** + * Sample code: ContainerGroupsCreateOrUpdateSecretReference. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerGroupsCreateOrUpdateSecretReference( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) throws IOException { + manager.containerGroups() + .define("demo1") + .withRegion("west us") + .withExistingResourceGroup("demo") + .withContainers(Arrays.asList(new Container().withName("demo1") + .withImage("privateRegistryImage") + .withCommand(Arrays.asList()) + .withPorts(Arrays.asList(new ContainerPort().withPort(80))) + .withEnvironmentVariables(Arrays + .asList(new EnvironmentVariable().withName("envSecret").withSecureValueReference("envSecretRef"))) + .withResources(new ResourceRequirements().withRequests(new ResourceRequests().withMemoryInGB(1.5) + .withCpu(1.0) + .withGpu(new GpuResource().withCount(1).withSku(GpuSku.K80)))) + .withVolumeMounts(Arrays.asList( + new VolumeMount().withName("volume1").withMountPath("/mnt/volume1").withReadOnly(false), + new VolumeMount().withName("volume2").withMountPath("/mnt/volume2").withReadOnly(false), + new VolumeMount().withName("volume3").withMountPath("/mnt/volume3").withReadOnly(true))))) + .withOsType(OperatingSystemTypes.LINUX) + .withIdentity(new ContainerGroupIdentity().withType(ResourceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-name", + new UserAssignedIdentities()))) + .withSecretReferences(Arrays.asList(new SecretReference().withName("envSecretRef") + .withIdentity( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-name") + .withSecretReferenceUri("fakeTokenPlaceholder"), + new SecretReference().withName("accountKeyRef") + .withIdentity( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-name") + .withSecretReferenceUri("fakeTokenPlaceholder"), + new SecretReference().withName("volumeSecretRef") + .withIdentity( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-name") + .withSecretReferenceUri("fakeTokenPlaceholder"), + new SecretReference().withName("privateRegistryKeyRef") + .withIdentity( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-name") + .withSecretReferenceUri("fakeTokenPlaceholder"))) + .withImageRegistryCredentials( + Arrays.asList(new ImageRegistryCredential().withServer("demoregistry.azurecr.io") + .withUsername("registryUserName") + .withPasswordReference("fakeTokenPlaceholder"))) + .withIpAddress(new IpAddress() + .withPorts(Arrays.asList(new Port().withProtocol(ContainerGroupNetworkProtocol.TCP).withPort(80))) + .withType(ContainerGroupIpAddressType.PUBLIC) + .withDnsNameLabel("dnsnamelabel1") + .withAutoGeneratedDomainNameLabelScope(DnsNameLabelReusePolicy.UNSECURE)) + .withVolumes(Arrays.asList( + new Volume().withName("volume1") + .withAzureFile(new AzureFileVolume().withShareName("shareName") + .withStorageAccountName("accountName") + .withStorageAccountKeyReference("fakeTokenPlaceholder")), + new Volume().withName("volume2") + .withEmptyDir(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)), + new Volume().withName("volume3") + .withSecret(mapOf("secretKey1", "fakeTokenPlaceholder")) + .withSecretReference(mapOf("secretKey2", "fakeTokenPlaceholder")))) + .withDiagnostics(new ContainerGroupDiagnostics().withLogAnalytics(new LogAnalytics() + .withWorkspaceId("workspaceid") + .withWorkspaceKey("fakeTokenPlaceholder") + .withLogType(LogAnalyticsLogType.CONTAINER_INSIGHTS) + .withMetadata(mapOf("test-key", "fakeTokenPlaceholder")) + .withWorkspaceResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/microsoft.operationalinsights/workspaces/workspace"))) + .withSubnetIds(Arrays.asList(new ContainerGroupSubnetId().withId( + "[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('vnetName'), parameters('subnetName'))]"))) + .withDnsConfig(new DnsConfiguration().withNameServers(Arrays.asList("1.1.1.1")) + .withSearchDomains("cluster.local svc.cluster.local") + .withOptions("ndots:2")) + .create(); + } + + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * ContainerGroupCreateConfidential.json + */ + /** + * Sample code: ConfidentialContainerGroup. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void confidentialContainerGroup( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.containerGroups() + .define("demo1") + .withRegion("westeurope") + .withExistingResourceGroup("demo") + .withContainers( + Arrays + .asList( + new Container().withName("accdemo") + .withImage("confiimage") + .withCommand(Arrays.asList()) + .withPorts(Arrays.asList(new ContainerPort().withPort(8000))) + .withEnvironmentVariables(Arrays.asList()) + .withResources(new ResourceRequirements() + .withRequests(new ResourceRequests().withMemoryInGB(1.5).withCpu(1.0))) + .withSecurityContext(new SecurityContextDefinition().withPrivileged(false) + .withCapabilities(new SecurityContextCapabilitiesDefinition() + .withAdd(Arrays.asList("CAP_NET_ADMIN")))))) + .withOsType(OperatingSystemTypes.LINUX) + .withImageRegistryCredentials(Arrays.asList()) + .withIpAddress(new IpAddress() + .withPorts(Arrays.asList(new Port().withProtocol(ContainerGroupNetworkProtocol.TCP).withPort(8000))) + .withType(ContainerGroupIpAddressType.PUBLIC)) + .withSku(ContainerGroupSku.CONFIDENTIAL) + .withConfidentialComputeProperties(new ConfidentialComputeProperties().withCcePolicy( + "eyJhbGxvd19hbGwiOiB0cnVlLCAiY29udGFpbmVycyI6IHsibGVuZ3RoIjogMCwgImVsZW1lbnRzIjogbnVsbH19")) + .create(); + } + + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * ContainerGroupsCreateOrUpdate.json + */ + /** + * Sample code: ContainerGroupsCreateOrUpdate. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerGroupsCreateOrUpdate( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) throws IOException { + manager.containerGroups() + .define("demo1") + .withRegion("west us") + .withExistingResourceGroup("demo") + .withContainers(Arrays.asList(new Container().withName("demo1") + .withImage("nginx") + .withCommand(Arrays.asList()) + .withPorts(Arrays.asList(new ContainerPort().withPort(80))) + .withEnvironmentVariables(Arrays.asList()) + .withResources(new ResourceRequirements().withRequests(new ResourceRequests().withMemoryInGB(1.5) + .withCpu(1.0) + .withGpu(new GpuResource().withCount(1).withSku(GpuSku.K80)))) + .withVolumeMounts(Arrays.asList( + new VolumeMount().withName("volume1").withMountPath("/mnt/volume1").withReadOnly(false), + new VolumeMount().withName("volume2").withMountPath("/mnt/volume2").withReadOnly(false), + new VolumeMount().withName("volume3").withMountPath("/mnt/volume3").withReadOnly(true))))) + .withOsType(OperatingSystemTypes.LINUX) + .withIdentity(new ContainerGroupIdentity().withType(ResourceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-name", + new UserAssignedIdentities()))) + .withImageRegistryCredentials(Arrays.asList()) + .withIpAddress(new IpAddress() + .withPorts(Arrays.asList(new Port().withProtocol(ContainerGroupNetworkProtocol.TCP).withPort(80))) + .withType(ContainerGroupIpAddressType.PUBLIC) + .withDnsNameLabel("dnsnamelabel1") + .withAutoGeneratedDomainNameLabelScope(DnsNameLabelReusePolicy.UNSECURE)) + .withVolumes(Arrays.asList( + new Volume().withName("volume1") + .withAzureFile(new AzureFileVolume().withShareName("shareName") + .withStorageAccountName("accountName") + .withStorageAccountKey("fakeTokenPlaceholder")), + new Volume().withName("volume2") + .withEmptyDir(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)), + new Volume().withName("volume3") + .withSecret(mapOf("secretKey1", "fakeTokenPlaceholder", "secretKey2", "fakeTokenPlaceholder")))) + .withDiagnostics(new ContainerGroupDiagnostics().withLogAnalytics(new LogAnalytics() + .withWorkspaceId("workspaceid") + .withWorkspaceKey("fakeTokenPlaceholder") + .withLogType(LogAnalyticsLogType.CONTAINER_INSIGHTS) + .withMetadata(mapOf("test-key", "fakeTokenPlaceholder")) + .withWorkspaceResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/microsoft.operationalinsights/workspaces/workspace"))) + .withSubnetIds(Arrays.asList(new ContainerGroupSubnetId().withId( + "[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('vnetName'), parameters('subnetName'))]"))) + .withDnsConfig(new DnsConfiguration().withNameServers(Arrays.asList("1.1.1.1")) + .withSearchDomains("cluster.local svc.cluster.local") + .withOptions("ndots:2")) + .create(); + } + + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * ContainerGroupsCreatePriority.json + */ + /** + * Sample code: ContainerGroupsCreateWithPriority. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerGroupsCreateWithPriority( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.containerGroups() + .define("demo1") + .withRegion("eastus") + .withExistingResourceGroup("demo") + .withContainers( + Arrays.asList(new Container().withName("test-container-001") + .withImage("alpine:latest") + .withCommand(Arrays.asList("/bin/sh", "-c", "sleep 10")) + .withResources(new ResourceRequirements() + .withRequests(new ResourceRequests().withMemoryInGB(1.0).withCpu(1.0))))) + .withOsType(OperatingSystemTypes.LINUX) + .withRestartPolicy(ContainerGroupRestartPolicy.NEVER) + .withSku(ContainerGroupSku.STANDARD) + .withPriority(ContainerGroupPriority.SPOT) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### ContainerGroups_Delete + +```java +/** + * Samples for ContainerGroups Delete. + */ +public final class ContainerGroupsDeleteSamples { + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * ContainerGroupsDelete.json + */ + /** + * Sample code: ContainerGroupsDelete. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void + containerGroupsDelete(com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.containerGroups().delete("demo", "demo1", com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerGroups_GetByResourceGroup + +```java +/** + * Samples for ContainerGroups GetByResourceGroup. + */ +public final class ContainerGroupsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * ContainerGroupsGetPriority.json + */ + /** + * Sample code: ContainerGroupsGetWithPriority. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerGroupsGetWithPriority( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.containerGroups().getByResourceGroupWithResponse("demo", "demo1", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * ContainerGroupsGet_Succeeded.json + */ + /** + * Sample code: ContainerGroupsGet_Succeeded. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerGroupsGetSucceeded( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.containerGroups().getByResourceGroupWithResponse("demo", "demo1", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * ContainerGroupsGet_Failed.json + */ + /** + * Sample code: ContainerGroupsGet_Failed. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerGroupsGetFailed( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.containerGroups().getByResourceGroupWithResponse("demo", "demo1", com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerGroups_List + +```java +/** + * Samples for ContainerGroups List. + */ +public final class ContainerGroupsListSamples { + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * ContainerGroupsList.json + */ + /** + * Sample code: ContainerGroupsList. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void + containerGroupsList(com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.containerGroups().list(com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerGroups_ListByResourceGroup + +```java +/** + * Samples for ContainerGroups ListByResourceGroup. + */ +public final class ContainerGroupsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * ContainerGroupsListByResourceGroup.json + */ + /** + * Sample code: ContainerGroupsListByResourceGroup. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerGroupsListByResourceGroup( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.containerGroups().listByResourceGroup("demo", com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerGroups_Restart + +```java +/** + * Samples for ContainerGroups Restart. + */ +public final class ContainerGroupsRestartSamples { + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * ContainerGroupsRestart.json + */ + /** + * Sample code: ContainerRestart. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void + containerRestart(com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.containerGroups().restart("demo", "demo1", com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerGroups_Start + +```java +/** + * Samples for ContainerGroups Start. + */ +public final class ContainerGroupsStartSamples { + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * ContainerGroupsStart.json + */ + /** + * Sample code: ContainerStart. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void + containerStart(com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.containerGroups().start("demo", "demo1", com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerGroups_Stop + +```java +/** + * Samples for ContainerGroups Stop. + */ +public final class ContainerGroupsStopSamples { + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * ContainerGroupsStop.json + */ + /** + * Sample code: ContainerStop. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void + containerStop(com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.containerGroups().stopWithResponse("demo", "demo1", com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerGroups_Update + +```java +import com.azure.core.management.Resource; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ContainerGroups Update. + */ +public final class ContainerGroupsUpdateSamples { + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * ContainerGroupsUpdate.json + */ + /** + * Sample code: ContainerGroupsUpdate. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void + containerGroupsUpdate(com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.containerGroups() + .updateWithResponse("demoResource", "demo1", + new Resource().withTags(mapOf("tag1key", "fakeTokenPlaceholder", "tag2key", "fakeTokenPlaceholder")), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Containers_Attach + +```java +/** + * Samples for Containers Attach. + */ +public final class ContainersAttachSamples { + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * ContainerAttach.json + */ + /** + * Sample code: ContainerAttach. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void + containerAttach(com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.containers().attachWithResponse("demo", "demo1", "container1", com.azure.core.util.Context.NONE); + } +} +``` + +### Containers_ExecuteCommand + +```java +import com.azure.resourcemanager.containerinstance.generated.models.ContainerExecRequest; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerExecRequestTerminalSize; + +/** + * Samples for Containers ExecuteCommand. + */ +public final class ContainersExecuteCommandSamples { + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * ContainerExec.json + */ + /** + * Sample code: ContainerExec. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void + containerExec(com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.containers() + .executeCommandWithResponse("demo", "demo1", "container1", + new ContainerExecRequest().withCommand("/bin/bash") + .withTerminalSize(new ContainerExecRequestTerminalSize().withRows(12).withCols(12)), + com.azure.core.util.Context.NONE); + } +} +``` + +### Containers_ListLogs + +```java +/** + * Samples for Containers ListLogs. + */ +public final class ContainersListLogsSamples { + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * ContainerListLogs.json + */ + /** + * Sample code: ContainerListLogs. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void + containerListLogs(com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.containers() + .listLogsWithResponse("demo", "demo1", "container1", 10, null, com.azure.core.util.Context.NONE); + } +} +``` + +### Location_ListCachedImages + +```java +/** + * Samples for Location ListCachedImages. + */ +public final class LocationListCachedImagesSamples { + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * CachedImagesList.json + */ + /** + * Sample code: CachedImages. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void + cachedImages(com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.locations().listCachedImages("westcentralus", com.azure.core.util.Context.NONE); + } +} +``` + +### Location_ListCapabilities + +```java +/** + * Samples for Location ListCapabilities. + */ +public final class LocationListCapabilitiesSamples { + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * CapabilitiesList.json + */ + /** + * Sample code: GetCapabilities. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void + getCapabilities(com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.locations().listCapabilities("westus", com.azure.core.util.Context.NONE); + } +} +``` + +### Location_ListUsage + +```java +/** + * Samples for Location ListUsage. + */ +public final class LocationListUsageSamples { + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * ContainerGroupUsage.json + */ + /** + * Sample code: ContainerUsage. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void + containerUsage(com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.locations().listUsage("westcentralus", com.azure.core.util.Context.NONE); + } +} +``` + +### Operations_List + +```java +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * OperationsList.json + */ + /** + * Sample code: OperationsList. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void + operationsList(com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} +``` + +### SubnetServiceAssociationLink_Delete + +```java +/** + * Samples for SubnetServiceAssociationLink Delete. + */ +public final class SubnetServiceAssociationLinkDeleteSamples { + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * SubnetServiceAssociationLinkDelete.json + */ + /** + * Sample code: SubnetServiceAssociationLinkDelete. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void subnetServiceAssociationLinkDelete( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.subnetServiceAssociationLinks().delete("demo", "demo2", "demo3", com.azure.core.util.Context.NONE); + } +} +``` + diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/pom.xml b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/pom.xml new file mode 100644 index 000000000000..2d31d61b6c33 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/pom.xml @@ -0,0 +1,63 @@ + + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-containerinstance-generated + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for ContainerInstance Management + This package contains Microsoft Azure SDK for ContainerInstance Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-preview-2024-11. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + 0 + 0 + true + false + + + + com.azure + azure-core + 1.55.2 + + + com.azure + azure-core-management + 1.16.2 + + + diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/ContainerInstanceManager.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/ContainerInstanceManager.java new file mode 100644 index 000000000000..b7e5d836612a --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/ContainerInstanceManager.java @@ -0,0 +1,394 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated; + +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerinstance.generated.fluent.ContainerInstanceManagementClient; +import com.azure.resourcemanager.containerinstance.generated.implementation.CGProfileOperationsImpl; +import com.azure.resourcemanager.containerinstance.generated.implementation.CGProfilesImpl; +import com.azure.resourcemanager.containerinstance.generated.implementation.ContainerGroupsImpl; +import com.azure.resourcemanager.containerinstance.generated.implementation.ContainerInstanceManagementClientBuilder; +import com.azure.resourcemanager.containerinstance.generated.implementation.ContainersImpl; +import com.azure.resourcemanager.containerinstance.generated.implementation.LocationsImpl; +import com.azure.resourcemanager.containerinstance.generated.implementation.NGroupsImpl; +import com.azure.resourcemanager.containerinstance.generated.implementation.OperationsImpl; +import com.azure.resourcemanager.containerinstance.generated.implementation.SubnetServiceAssociationLinksImpl; +import com.azure.resourcemanager.containerinstance.generated.models.CGProfileOperations; +import com.azure.resourcemanager.containerinstance.generated.models.CGProfiles; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroups; +import com.azure.resourcemanager.containerinstance.generated.models.Containers; +import com.azure.resourcemanager.containerinstance.generated.models.Locations; +import com.azure.resourcemanager.containerinstance.generated.models.NGroups; +import com.azure.resourcemanager.containerinstance.generated.models.Operations; +import com.azure.resourcemanager.containerinstance.generated.models.SubnetServiceAssociationLinks; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.stream.Collectors; + +/** + * Entry point to ContainerInstanceManager. + */ +public final class ContainerInstanceManager { + private ContainerGroups containerGroups; + + private Operations operations; + + private Locations locations; + + private Containers containers; + + private SubnetServiceAssociationLinks subnetServiceAssociationLinks; + + private NGroups nGroups; + + private CGProfiles cGProfiles; + + private CGProfileOperations cGProfileOperations; + + private final ContainerInstanceManagementClient clientObject; + + private ContainerInstanceManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = new ContainerInstanceManagementClientBuilder().pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of ContainerInstance service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the ContainerInstance service API instance. + */ + public static ContainerInstanceManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Creates an instance of ContainerInstance service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the ContainerInstance service API instance. + */ + public static ContainerInstanceManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new ContainerInstanceManager(httpPipeline, profile, null); + } + + /** + * Gets a Configurable instance that can be used to create ContainerInstanceManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new ContainerInstanceManager.Configurable(); + } + + /** + * The Configurable allowing configurations to be set. + */ + public static final class Configurable { + private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + private static final String SDK_VERSION = "version"; + private static final Map PROPERTIES + = CoreUtils.getProperties("azure-resourcemanager-containerinstance-generated.properties"); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); + private RetryPolicy retryPolicy; + private RetryOptions retryOptions; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the retry options for the HTTP pipeline retry policy. + *

+ * This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + * + * @param retryOptions the retry options for the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryOptions(RetryOptions retryOptions) { + this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval + = Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of ContainerInstance service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the ContainerInstance service API instance. + */ + public ContainerInstanceManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); + + StringBuilder userAgentBuilder = new StringBuilder(); + userAgentBuilder.append("azsdk-java") + .append("-") + .append("com.azure.resourcemanager.containerinstance.generated") + .append("/") + .append(clientVersion); + if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { + userAgentBuilder.append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } + if (retryPolicy == null) { + if (retryOptions != null) { + retryPolicy = new RetryPolicy(retryOptions); + } else { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new AddHeadersFromContextPolicy()); + policies.add(new RequestIdPolicy()); + policies.addAll(this.policies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies.add(new BearerTokenAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies.addAll(this.policies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = new HttpPipelineBuilder().httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new ContainerInstanceManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** + * Gets the resource collection API of ContainerGroups. It manages ContainerGroup. + * + * @return Resource collection API of ContainerGroups. + */ + public ContainerGroups containerGroups() { + if (this.containerGroups == null) { + this.containerGroups = new ContainerGroupsImpl(clientObject.getContainerGroups(), this); + } + return containerGroups; + } + + /** + * Gets the resource collection API of Operations. + * + * @return Resource collection API of Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** + * Gets the resource collection API of Locations. + * + * @return Resource collection API of Locations. + */ + public Locations locations() { + if (this.locations == null) { + this.locations = new LocationsImpl(clientObject.getLocations(), this); + } + return locations; + } + + /** + * Gets the resource collection API of Containers. + * + * @return Resource collection API of Containers. + */ + public Containers containers() { + if (this.containers == null) { + this.containers = new ContainersImpl(clientObject.getContainers(), this); + } + return containers; + } + + /** + * Gets the resource collection API of SubnetServiceAssociationLinks. + * + * @return Resource collection API of SubnetServiceAssociationLinks. + */ + public SubnetServiceAssociationLinks subnetServiceAssociationLinks() { + if (this.subnetServiceAssociationLinks == null) { + this.subnetServiceAssociationLinks + = new SubnetServiceAssociationLinksImpl(clientObject.getSubnetServiceAssociationLinks(), this); + } + return subnetServiceAssociationLinks; + } + + /** + * Gets the resource collection API of NGroups. It manages NGroup. + * + * @return Resource collection API of NGroups. + */ + public NGroups nGroups() { + if (this.nGroups == null) { + this.nGroups = new NGroupsImpl(clientObject.getNGroups(), this); + } + return nGroups; + } + + /** + * Gets the resource collection API of CGProfiles. + * + * @return Resource collection API of CGProfiles. + */ + public CGProfiles cGProfiles() { + if (this.cGProfiles == null) { + this.cGProfiles = new CGProfilesImpl(clientObject.getCGProfiles(), this); + } + return cGProfiles; + } + + /** + * Gets the resource collection API of CGProfileOperations. It manages ContainerGroupProfile. + * + * @return Resource collection API of CGProfileOperations. + */ + public CGProfileOperations cGProfileOperations() { + if (this.cGProfileOperations == null) { + this.cGProfileOperations = new CGProfileOperationsImpl(clientObject.getCGProfileOperations(), this); + } + return cGProfileOperations; + } + + /** + * Gets wrapped service client ContainerInstanceManagementClient providing direct access to the underlying + * auto-generated API implementation, based on Azure REST API. + * + * @return Wrapped service client ContainerInstanceManagementClient. + */ + public ContainerInstanceManagementClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/CGProfileOperationsClient.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/CGProfileOperationsClient.java new file mode 100644 index 000000000000..7b6113f393d5 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/CGProfileOperationsClient.java @@ -0,0 +1,267 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.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.containerinstance.generated.fluent.models.ContainerGroupProfileInner; +import com.azure.resourcemanager.containerinstance.generated.models.CGProfileOperationsCreateOrUpdateResponse; +import com.azure.resourcemanager.containerinstance.generated.models.CGProfileOperationsUpdateResponse; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupProfilePatch; + +/** + * An instance of this class provides access to all the operations defined in CGProfileOperationsClient. + */ +public interface CGProfileOperationsClient { + /** + * Create or Update a ContainerGroupProfile + * + * Create a CGProfile if it doesn't exist or update an existing CGProfile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupProfileName ContainerGroupProfile name. + * @param containerGroupProfile The ContainerGroupProfile object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container group profile object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CGProfileOperationsCreateOrUpdateResponse createOrUpdateWithResponse(String resourceGroupName, + String containerGroupProfileName, ContainerGroupProfileInner containerGroupProfile, Context context); + + /** + * Create or Update a ContainerGroupProfile + * + * Create a CGProfile if it doesn't exist or update an existing CGProfile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupProfileName ContainerGroupProfile name. + * @param containerGroupProfile The ContainerGroupProfile object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container group profile object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContainerGroupProfileInner createOrUpdate(String resourceGroupName, String containerGroupProfileName, + ContainerGroupProfileInner containerGroupProfile); + + /** + * Container group profile PATCH REST API. + * + * Update a specified container group profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupProfileName ContainerGroupProfile name. + * @param properties The container group profile properties that need to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container group profile object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CGProfileOperationsUpdateResponse updateWithResponse(String resourceGroupName, String containerGroupProfileName, + ContainerGroupProfilePatch properties, Context context); + + /** + * Container group profile PATCH REST API. + * + * Update a specified container group profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupProfileName ContainerGroupProfile name. + * @param properties The container group profile properties that need to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container group profile object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContainerGroupProfileInner update(String resourceGroupName, String containerGroupProfileName, + ContainerGroupProfilePatch properties); + + /** + * Display information about a specified ContainerGroupProfile. + * + * Get the properties of the specified container group profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupProfileName ContainerGroupProfile name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified container group profile along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, + String containerGroupProfileName, Context context); + + /** + * Display information about a specified ContainerGroupProfile. + * + * Get the properties of the specified container group profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupProfileName ContainerGroupProfile name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified container group profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContainerGroupProfileInner getByResourceGroup(String resourceGroupName, String containerGroupProfileName); + + /** + * Container group profile DELETE REST API. + * + * Deletes a container group profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupProfileName ContainerGroupProfile name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 containerGroupProfileName); + + /** + * Container group profile DELETE REST API. + * + * Deletes a container group profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupProfileName ContainerGroupProfile name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 containerGroupProfileName, + Context context); + + /** + * Container group profile DELETE REST API. + * + * Deletes a container group profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupProfileName ContainerGroupProfile name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 containerGroupProfileName); + + /** + * Container group profile DELETE REST API. + * + * Deletes a container group profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupProfileName ContainerGroupProfile name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 containerGroupProfileName, Context context); + + /** + * Get a list of all the revisions of the specified container group profile in the given subscription and resource + * group. + * + * Get a list of all the revisions of the specified container group profile in the given subscription and resource + * group. This operation returns properties of each revision of the specified container group profile including + * containers, image registry credentials, restart policy, IP address type, OS type volumes, revision number, etc. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupProfileName ContainerGroupProfile name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all the revisions of the specified container group profile in the given subscription and + * resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAllRevisions(String resourceGroupName, + String containerGroupProfileName); + + /** + * Get a list of all the revisions of the specified container group profile in the given subscription and resource + * group. + * + * Get a list of all the revisions of the specified container group profile in the given subscription and resource + * group. This operation returns properties of each revision of the specified container group profile including + * containers, image registry credentials, restart policy, IP address type, OS type volumes, revision number, etc. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupProfileName ContainerGroupProfile name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all the revisions of the specified container group profile in the given subscription and + * resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAllRevisions(String resourceGroupName, + String containerGroupProfileName, Context context); + + /** + * Get the properties of the specified revision of the container group profile. + * + * Gets the properties of the specified revision of the container group profile in the given subscription and + * resource group. The operation returns the properties of container group profile including containers, image + * registry credentials, restart policy, IP address type, OS type, volumes, current revision number, etc. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupProfileName ContainerGroupProfile name. + * @param revisionNumber The revision number of the container group profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified revision of the container group profile in the given subscription and + * resource group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByRevisionNumberWithResponse(String resourceGroupName, + String containerGroupProfileName, String revisionNumber, Context context); + + /** + * Get the properties of the specified revision of the container group profile. + * + * Gets the properties of the specified revision of the container group profile in the given subscription and + * resource group. The operation returns the properties of container group profile including containers, image + * registry credentials, restart policy, IP address type, OS type, volumes, current revision number, etc. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupProfileName ContainerGroupProfile name. + * @param revisionNumber The revision number of the container group profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified revision of the container group profile in the given subscription and + * resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContainerGroupProfileInner getByRevisionNumber(String resourceGroupName, String containerGroupProfileName, + String revisionNumber); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/CGProfilesClient.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/CGProfilesClient.java new file mode 100644 index 000000000000..763c741ed1f0 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/CGProfilesClient.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.containerinstance.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.ContainerGroupProfileInner; + +/** + * An instance of this class provides access to all the operations defined in CGProfilesClient. + */ +public interface CGProfilesClient { + /** + * List container group profiles in a subscription. + * + * Gets a list of all container group profiles under a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all container group profiles under a subscription as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List container group profiles in a subscription. + * + * Gets a list of all container group profiles under a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all container group profiles under a subscription as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List container group profiles in a resource group. + * + * Gets a list of all container group profiles under a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all container group profiles under a resource group as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List container group profiles in a resource group. + * + * Gets a list of all container group profiles under a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all container group profiles under a resource group as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/ContainerGroupsClient.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/ContainerGroupsClient.java new file mode 100644 index 000000000000..a2495e0a8fc6 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/ContainerGroupsClient.java @@ -0,0 +1,489 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.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.Resource; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.ContainerGroupInner; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.ListResultContainerGroupInner; +import java.util.List; + +/** + * An instance of this class provides access to all the operations defined in ContainerGroupsClient. + */ +public interface ContainerGroupsClient { + /** + * Get a list of container groups in the specified subscription. + * + * Get a list of container groups in the specified subscription. This operation returns properties of each container + * group including containers, image registry credentials, restart policy, IP address type, OS type, state, and + * volumes. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of container groups in the specified subscription as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Get a list of container groups in the specified subscription. + * + * Get a list of container groups in the specified subscription. This operation returns properties of each container + * group including containers, image registry credentials, restart policy, IP address type, OS type, state, and + * volumes. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of container groups in the specified subscription as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Get a list of container groups in the specified subscription and resource group. + * + * Get a list of container groups in a specified subscription and resource group. This operation returns properties + * of each container group including containers, image registry credentials, restart policy, IP address type, OS + * type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of container groups in a specified subscription and resource group as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Get a list of container groups in the specified subscription and resource group. + * + * Get a list of container groups in a specified subscription and resource group. This operation returns properties + * of each container group including containers, image registry credentials, restart policy, IP address type, OS + * type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of container groups in a specified subscription and resource group as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get the properties of the specified container group. + * + * Gets the properties of the specified container group in the specified subscription and resource group. The + * operation returns the properties of each container group including containers, image registry credentials, + * restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified container group in the specified subscription and resource group along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String containerGroupName, + Context context); + + /** + * Get the properties of the specified container group. + * + * Gets the properties of the specified container group in the specified subscription and resource group. The + * operation returns the properties of each container group including containers, image registry credentials, + * restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified container group in the specified subscription and resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContainerGroupInner getByResourceGroup(String resourceGroupName, String containerGroupName); + + /** + * Create or update container groups. + * + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a container group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ContainerGroupInner> beginCreateOrUpdate(String resourceGroupName, + String containerGroupName, ContainerGroupInner containerGroup); + + /** + * Create or update container groups. + * + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a container group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ContainerGroupInner> beginCreateOrUpdate(String resourceGroupName, + String containerGroupName, ContainerGroupInner containerGroup, Context context); + + /** + * Create or update container groups. + * + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContainerGroupInner createOrUpdate(String resourceGroupName, String containerGroupName, + ContainerGroupInner containerGroup); + + /** + * Create or update container groups. + * + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContainerGroupInner createOrUpdate(String resourceGroupName, String containerGroupName, + ContainerGroupInner containerGroup, Context context); + + /** + * Update container groups. + * + * Updates container group tags with specified values. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param resource The container group resource with just the tags to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse(String resourceGroupName, String containerGroupName, + Resource resource, Context context); + + /** + * Update container groups. + * + * Updates container group tags with specified values. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param resource The container group resource with just the tags to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContainerGroupInner update(String resourceGroupName, String containerGroupName, Resource resource); + + /** + * Delete the specified container group. + * + * Delete the specified container group in the specified subscription and resource group. The operation does not + * delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a container group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ContainerGroupInner> beginDelete(String resourceGroupName, + String containerGroupName); + + /** + * Delete the specified container group. + * + * Delete the specified container group in the specified subscription and resource group. The operation does not + * delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 a container group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ContainerGroupInner> beginDelete(String resourceGroupName, + String containerGroupName, Context context); + + /** + * Delete the specified container group. + * + * Delete the specified container group in the specified subscription and resource group. The operation does not + * delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContainerGroupInner delete(String resourceGroupName, String containerGroupName); + + /** + * Delete the specified container group. + * + * Delete the specified container group in the specified subscription and resource group. The operation does not + * delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContainerGroupInner delete(String resourceGroupName, String containerGroupName, Context context); + + /** + * Restarts all containers in a container group. + * + * Restarts all containers in a container group in place. If container image has updates, new image will be + * downloaded. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginRestart(String resourceGroupName, String containerGroupName); + + /** + * Restarts all containers in a container group. + * + * Restarts all containers in a container group in place. If container image has updates, new image will be + * downloaded. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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> beginRestart(String resourceGroupName, String containerGroupName, + Context context); + + /** + * Restarts all containers in a container group. + * + * Restarts all containers in a container group in place. If container image has updates, new image will be + * downloaded. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void restart(String resourceGroupName, String containerGroupName); + + /** + * Restarts all containers in a container group. + * + * Restarts all containers in a container group in place. If container image has updates, new image will be + * downloaded. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 restart(String resourceGroupName, String containerGroupName, Context context); + + /** + * Stops all containers in a container group. + * + * Stops all containers in a container group. Compute resources will be deallocated and billing will stop. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response stopWithResponse(String resourceGroupName, String containerGroupName, Context context); + + /** + * Stops all containers in a container group. + * + * Stops all containers in a container group. Compute resources will be deallocated and billing will stop. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void stop(String resourceGroupName, String containerGroupName); + + /** + * Starts all containers in a container group. + * + * Starts all containers in a container group. Compute resources will be allocated and billing will start. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginStart(String resourceGroupName, String containerGroupName); + + /** + * Starts all containers in a container group. + * + * Starts all containers in a container group. Compute resources will be allocated and billing will start. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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> beginStart(String resourceGroupName, String containerGroupName, Context context); + + /** + * Starts all containers in a container group. + * + * Starts all containers in a container group. Compute resources will be allocated and billing will start. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void start(String resourceGroupName, String containerGroupName); + + /** + * Starts all containers in a container group. + * + * Starts all containers in a container group. Compute resources will be allocated and billing will start. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void start(String resourceGroupName, String containerGroupName, Context context); + + /** + * Get all network dependencies for container group. + * + * Gets all the network dependencies for this container group to allow complete control of network setting and + * configuration. For container groups, this will always be an empty list. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 the network dependencies for this container group to allow complete control of network setting and + * configuration along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response> getOutboundNetworkDependenciesEndpointsWithResponse(String resourceGroupName, + String containerGroupName, Context context); + + /** + * Get all network dependencies for container group. + * + * Gets all the network dependencies for this container group to allow complete control of network setting and + * configuration. For container groups, this will always be an empty list. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the network dependencies for this container group to allow complete control of network setting and + * configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + List getOutboundNetworkDependenciesEndpoints(String resourceGroupName, String containerGroupName); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/ContainerInstanceManagementClient.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/ContainerInstanceManagementClient.java new file mode 100644 index 000000000000..41eeb8259cf8 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/ContainerInstanceManagementClient.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** + * The interface for ContainerInstanceManagementClient class. + */ +public interface ContainerInstanceManagementClient { + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the ContainerGroupsClient object to access its operations. + * + * @return the ContainerGroupsClient object. + */ + ContainerGroupsClient getContainerGroups(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the LocationsClient object to access its operations. + * + * @return the LocationsClient object. + */ + LocationsClient getLocations(); + + /** + * Gets the ContainersClient object to access its operations. + * + * @return the ContainersClient object. + */ + ContainersClient getContainers(); + + /** + * Gets the SubnetServiceAssociationLinksClient object to access its operations. + * + * @return the SubnetServiceAssociationLinksClient object. + */ + SubnetServiceAssociationLinksClient getSubnetServiceAssociationLinks(); + + /** + * Gets the NGroupsClient object to access its operations. + * + * @return the NGroupsClient object. + */ + NGroupsClient getNGroups(); + + /** + * Gets the CGProfilesClient object to access its operations. + * + * @return the CGProfilesClient object. + */ + CGProfilesClient getCGProfiles(); + + /** + * Gets the CGProfileOperationsClient object to access its operations. + * + * @return the CGProfileOperationsClient object. + */ + CGProfileOperationsClient getCGProfileOperations(); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/ContainersClient.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/ContainersClient.java new file mode 100644 index 000000000000..74fe5d759ac9 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/ContainersClient.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.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.containerinstance.generated.fluent.models.ContainerAttachResponseInner; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.ContainerExecResponseInner; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.LogsInner; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerExecRequest; + +/** + * An instance of this class provides access to all the operations defined in ContainersClient. + */ +public interface ContainersClient { + /** + * Get the logs for a specified container instance. + * + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param tail The number of lines to show from the tail of the container instance log. If not provided, all + * available logs are shown up to 4mb. + * @param timestamps If true, adds a timestamp at the beginning of every line of log output. If not provided, + * defaults to false. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the logs for a specified container instance in a specified resource group and container group along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listLogsWithResponse(String resourceGroupName, String containerGroupName, String containerName, + Integer tail, Boolean timestamps, Context context); + + /** + * Get the logs for a specified container instance. + * + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the logs for a specified container instance in a specified resource group and container group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LogsInner listLogs(String resourceGroupName, String containerGroupName, String containerName); + + /** + * Executes a command in a specific container instance. + * + * Executes a command for a specific container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param containerExecRequest The request for the exec 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 information for the container exec command along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response executeCommandWithResponse(String resourceGroupName, String containerGroupName, + String containerName, ContainerExecRequest containerExecRequest, Context context); + + /** + * Executes a command in a specific container instance. + * + * Executes a command for a specific container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param containerExecRequest The request for the exec 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 information for the container exec command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContainerExecResponseInner executeCommand(String resourceGroupName, String containerGroupName, String containerName, + ContainerExecRequest containerExecRequest); + + /** + * Attach to the output of a specific container instance. + * + * Attach to the output stream of a specific container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the information for the output stream from container attach along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response attachWithResponse(String resourceGroupName, String containerGroupName, + String containerName, Context context); + + /** + * Attach to the output of a specific container instance. + * + * Attach to the output stream of a specific container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the information for the output stream from container attach. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContainerAttachResponseInner attach(String resourceGroupName, String containerGroupName, String containerName); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/LocationsClient.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/LocationsClient.java new file mode 100644 index 000000000000..8df573ca982e --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/LocationsClient.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.CachedImagesInner; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.CapabilitiesInner; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.UsageInner; + +/** + * An instance of this class provides access to all the operations defined in LocationsClient. + */ +public interface LocationsClient { + /** + * Get the usage for a subscription. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the usage for a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listUsage(String location); + + /** + * Get the usage for a subscription. + * + * @param location The name of the Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the usage for a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listUsage(String location, Context context); + + /** + * Get the list of cached images. + * + * Get the list of cached images on specific OS type for a subscription in a region. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of cached images on specific OS type for a subscription in a region as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listCachedImages(String location); + + /** + * Get the list of cached images. + * + * Get the list of cached images on specific OS type for a subscription in a region. + * + * @param location The name of the Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of cached images on specific OS type for a subscription in a region as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listCachedImages(String location, Context context); + + /** + * Get the list of capabilities of the location. + * + * Get the list of CPU/memory/GPU capabilities of a region. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of CPU/memory/GPU capabilities of a region as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listCapabilities(String location); + + /** + * Get the list of capabilities of the location. + * + * Get the list of CPU/memory/GPU capabilities of a region. + * + * @param location The name of the Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of CPU/memory/GPU capabilities of a region as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listCapabilities(String location, Context context); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/NGroupsClient.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/NGroupsClient.java new file mode 100644 index 000000000000..43220f988473 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/NGroupsClient.java @@ -0,0 +1,461 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.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.containerinstance.generated.fluent.models.NGroupInner; + +/** + * An instance of this class provides access to all the operations defined in NGroupsClient. + */ +public interface NGroupsClient { + /** + * NGroups GET REST API + * + * Get the properties of the specified NGroups resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified NGroups resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String ngroupsName, Context context); + + /** + * NGroups GET REST API + * + * Get the properties of the specified NGroups resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified NGroups resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NGroupInner getByResourceGroup(String resourceGroupName, String ngroupsName); + + /** + * NGroup PUT REST API + * + * Create or update a NGroups resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @param nGroup The NGroup object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 NGroups resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NGroupInner> beginCreateOrUpdate(String resourceGroupName, String ngroupsName, + NGroupInner nGroup); + + /** + * NGroup PUT REST API + * + * Create or update a NGroups resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @param nGroup The NGroup object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 NGroups resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NGroupInner> beginCreateOrUpdate(String resourceGroupName, String ngroupsName, + NGroupInner nGroup, Context context); + + /** + * NGroup PUT REST API + * + * Create or update a NGroups resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @param nGroup The NGroup object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 NGroups resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NGroupInner createOrUpdate(String resourceGroupName, String ngroupsName, NGroupInner nGroup); + + /** + * NGroup PUT REST API + * + * Create or update a NGroups resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @param nGroup The NGroup object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 NGroups resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NGroupInner createOrUpdate(String resourceGroupName, String ngroupsName, NGroupInner nGroup, Context context); + + /** + * NGroups PATCH REST API + * + * Update a specified NGroups resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @param nGroup The NGroup object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 NGroups resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NGroupInner> beginUpdate(String resourceGroupName, String ngroupsName, + NGroupInner nGroup); + + /** + * NGroups PATCH REST API + * + * Update a specified NGroups resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @param nGroup The NGroup object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 NGroups resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NGroupInner> beginUpdate(String resourceGroupName, String ngroupsName, + NGroupInner nGroup, Context context); + + /** + * NGroups PATCH REST API + * + * Update a specified NGroups resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @param nGroup The NGroup object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 NGroups resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NGroupInner update(String resourceGroupName, String ngroupsName, NGroupInner nGroup); + + /** + * NGroups PATCH REST API + * + * Update a specified NGroups resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @param nGroup The NGroup object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 NGroups resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NGroupInner update(String resourceGroupName, String ngroupsName, NGroupInner nGroup, Context context); + + /** + * NGroups Delete REST API + * + * Deletes the NGroups resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 ngroupsName); + + /** + * NGroups Delete REST API + * + * Deletes the NGroups resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 ngroupsName, Context context); + + /** + * NGroups Delete REST API + * + * Deletes the NGroups resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 ngroupsName); + + /** + * NGroups Delete REST API + * + * Deletes the NGroups resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 ngroupsName, Context context); + + /** + * Starts all container groups in the specified NGroups resource. + * + * Starts all container groups in the specified NGroups resource. Compute resources will be allocated and billing + * will start. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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> beginStart(String resourceGroupName, String ngroupsName); + + /** + * Starts all container groups in the specified NGroups resource. + * + * Starts all container groups in the specified NGroups resource. Compute resources will be allocated and billing + * will start. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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> beginStart(String resourceGroupName, String ngroupsName, Context context); + + /** + * Starts all container groups in the specified NGroups resource. + * + * Starts all container groups in the specified NGroups resource. Compute resources will be allocated and billing + * will start. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void start(String resourceGroupName, String ngroupsName); + + /** + * Starts all container groups in the specified NGroups resource. + * + * Starts all container groups in the specified NGroups resource. Compute resources will be allocated and billing + * will start. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void start(String resourceGroupName, String ngroupsName, Context context); + + /** + * Stops all container groups in the specified NGroups resource. + * + * Stops all container groups in the specified NGroups resource. Compute resources will be deallocated and billing + * will stop. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response stopWithResponse(String resourceGroupName, String ngroupsName, Context context); + + /** + * Stops all container groups in the specified NGroups resource. + * + * Stops all container groups in the specified NGroups resource. Compute resources will be deallocated and billing + * will stop. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void stop(String resourceGroupName, String ngroupsName); + + /** + * Restarts all container groups in the specified NGroups resource. + * + * Restarts all container groups in the specified NGroups resource in place. If container image has updates, new + * image will be downloaded. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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> beginRestart(String resourceGroupName, String ngroupsName); + + /** + * Restarts all container groups in the specified NGroups resource. + * + * Restarts all container groups in the specified NGroups resource in place. If container image has updates, new + * image will be downloaded. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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> beginRestart(String resourceGroupName, String ngroupsName, Context context); + + /** + * Restarts all container groups in the specified NGroups resource. + * + * Restarts all container groups in the specified NGroups resource in place. If container image has updates, new + * image will be downloaded. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 restart(String resourceGroupName, String ngroupsName); + + /** + * Restarts all container groups in the specified NGroups resource. + * + * Restarts all container groups in the specified NGroups resource in place. If container image has updates, new + * image will be downloaded. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 restart(String resourceGroupName, String ngroupsName, Context context); + + /** + * GET NGroups under a resource group REST API. + * + * Gets a list of all NGroups resources under a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all NGroups resources under a resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * GET NGroups under a resource group REST API. + * + * Gets a list of all NGroups resources under a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all NGroups resources under a resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * List NGroups in a subscription. + * + * Gets a list of all NGroups resources under a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all NGroups resources under a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List NGroups in a subscription. + * + * Gets a list of all NGroups resources under a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all NGroups resources under a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/OperationsClient.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/OperationsClient.java new file mode 100644 index 000000000000..12dd1c015298 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/OperationsClient.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.containerinstance.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.OperationInner; + +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ +public interface OperationsClient { + /** + * List the operations for Azure Container Instance service. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation list response that contains all operations for Azure Container Instance service as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List the operations for Azure Container Instance service. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation list response that contains all operations for Azure Container Instance service as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/SubnetServiceAssociationLinksClient.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/SubnetServiceAssociationLinksClient.java new file mode 100644 index 000000000000..e71826240ee7 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/SubnetServiceAssociationLinksClient.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.containerinstance.generated.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; + +/** + * An instance of this class provides access to all the operations defined in SubnetServiceAssociationLinksClient. + */ +public interface SubnetServiceAssociationLinksClient { + /** + * Delete container group virtual network association links. + * + * Delete container group virtual network association links. The operation does not delete other resources provided + * by the user. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 virtualNetworkName, + String subnetName); + + /** + * Delete container group virtual network association links. + * + * Delete container group virtual network association links. The operation does not delete other resources provided + * by the user. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 virtualNetworkName, + String subnetName, Context context); + + /** + * Delete container group virtual network association links. + * + * Delete container group virtual network association links. The operation does not delete other resources provided + * by the user. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 virtualNetworkName, String subnetName); + + /** + * Delete container group virtual network association links. + * + * Delete container group virtual network association links. The operation does not delete other resources provided + * by the user. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 virtualNetworkName, String subnetName, Context context); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/CachedImagesInner.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/CachedImagesInner.java new file mode 100644 index 000000000000..f8d336fb0d73 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/CachedImagesInner.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The cached image and OS type. + */ +@Fluent +public final class CachedImagesInner implements JsonSerializable { + /* + * The OS type of the cached image. + */ + private String osType; + + /* + * The cached image name. + */ + private String image; + + /** + * Creates an instance of CachedImagesInner class. + */ + public CachedImagesInner() { + } + + /** + * Get the osType property: The OS type of the cached image. + * + * @return the osType value. + */ + public String osType() { + return this.osType; + } + + /** + * Set the osType property: The OS type of the cached image. + * + * @param osType the osType value to set. + * @return the CachedImagesInner object itself. + */ + public CachedImagesInner withOsType(String osType) { + this.osType = osType; + return this; + } + + /** + * Get the image property: The cached image name. + * + * @return the image value. + */ + public String image() { + return this.image; + } + + /** + * Set the image property: The cached image name. + * + * @param image the image value to set. + * @return the CachedImagesInner object itself. + */ + public CachedImagesInner withImage(String image) { + this.image = image; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (osType() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property osType in model CachedImagesInner")); + } + if (image() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property image in model CachedImagesInner")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CachedImagesInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("osType", this.osType); + jsonWriter.writeStringField("image", this.image); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CachedImagesInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CachedImagesInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CachedImagesInner. + */ + public static CachedImagesInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CachedImagesInner deserializedCachedImagesInner = new CachedImagesInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("osType".equals(fieldName)) { + deserializedCachedImagesInner.osType = reader.getString(); + } else if ("image".equals(fieldName)) { + deserializedCachedImagesInner.image = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCachedImagesInner; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/CapabilitiesInner.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/CapabilitiesInner.java new file mode 100644 index 000000000000..982283a9ab76 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/CapabilitiesInner.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerinstance.generated.models.CapabilitiesCapabilities; +import java.io.IOException; + +/** + * The regional capabilities. + */ +@Immutable +public final class CapabilitiesInner implements JsonSerializable { + /* + * The resource type that this capability describes. + */ + private String resourceType; + + /* + * The OS type that this capability describes. + */ + private String osType; + + /* + * The resource location. + */ + private String location; + + /* + * The ip address type that this capability describes. + */ + private String ipAddressType; + + /* + * The GPU sku that this capability describes. + */ + private String gpu; + + /* + * The supported capabilities. + */ + private CapabilitiesCapabilities capabilities; + + /** + * Creates an instance of CapabilitiesInner class. + */ + public CapabilitiesInner() { + } + + /** + * Get the resourceType property: The resource type that this capability describes. + * + * @return the resourceType value. + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Get the osType property: The OS type that this capability describes. + * + * @return the osType value. + */ + public String osType() { + return this.osType; + } + + /** + * Get the location property: The resource location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the ipAddressType property: The ip address type that this capability describes. + * + * @return the ipAddressType value. + */ + public String ipAddressType() { + return this.ipAddressType; + } + + /** + * Get the gpu property: The GPU sku that this capability describes. + * + * @return the gpu value. + */ + public String gpu() { + return this.gpu; + } + + /** + * Get the capabilities property: The supported capabilities. + * + * @return the capabilities value. + */ + public CapabilitiesCapabilities capabilities() { + return this.capabilities; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (capabilities() != null) { + capabilities().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CapabilitiesInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CapabilitiesInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the CapabilitiesInner. + */ + public static CapabilitiesInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CapabilitiesInner deserializedCapabilitiesInner = new CapabilitiesInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceType".equals(fieldName)) { + deserializedCapabilitiesInner.resourceType = reader.getString(); + } else if ("osType".equals(fieldName)) { + deserializedCapabilitiesInner.osType = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedCapabilitiesInner.location = reader.getString(); + } else if ("ipAddressType".equals(fieldName)) { + deserializedCapabilitiesInner.ipAddressType = reader.getString(); + } else if ("gpu".equals(fieldName)) { + deserializedCapabilitiesInner.gpu = reader.getString(); + } else if ("capabilities".equals(fieldName)) { + deserializedCapabilitiesInner.capabilities = CapabilitiesCapabilities.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCapabilitiesInner; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerAttachResponseInner.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerAttachResponseInner.java new file mode 100644 index 000000000000..83977c0caa1f --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerAttachResponseInner.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The information for the output stream from container attach. + */ +@Fluent +public final class ContainerAttachResponseInner implements JsonSerializable { + /* + * The uri for the output stream from the attach. + */ + private String webSocketUri; + + /* + * The password to the output stream from the attach. Send as an Authorization header value when connecting to the + * websocketUri. + */ + private String password; + + /** + * Creates an instance of ContainerAttachResponseInner class. + */ + public ContainerAttachResponseInner() { + } + + /** + * Get the webSocketUri property: The uri for the output stream from the attach. + * + * @return the webSocketUri value. + */ + public String webSocketUri() { + return this.webSocketUri; + } + + /** + * Set the webSocketUri property: The uri for the output stream from the attach. + * + * @param webSocketUri the webSocketUri value to set. + * @return the ContainerAttachResponseInner object itself. + */ + public ContainerAttachResponseInner withWebSocketUri(String webSocketUri) { + this.webSocketUri = webSocketUri; + return this; + } + + /** + * Get the password property: The password to the output stream from the attach. Send as an Authorization header + * value when connecting to the websocketUri. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Set the password property: The password to the output stream from the attach. Send as an Authorization header + * value when connecting to the websocketUri. + * + * @param password the password value to set. + * @return the ContainerAttachResponseInner object itself. + */ + public ContainerAttachResponseInner withPassword(String password) { + this.password = password; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("webSocketUri", this.webSocketUri); + jsonWriter.writeStringField("password", this.password); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerAttachResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerAttachResponseInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ContainerAttachResponseInner. + */ + public static ContainerAttachResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerAttachResponseInner deserializedContainerAttachResponseInner = new ContainerAttachResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("webSocketUri".equals(fieldName)) { + deserializedContainerAttachResponseInner.webSocketUri = reader.getString(); + } else if ("password".equals(fieldName)) { + deserializedContainerAttachResponseInner.password = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerAttachResponseInner; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerExecResponseInner.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerExecResponseInner.java new file mode 100644 index 000000000000..54aa86d6ffce --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerExecResponseInner.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The information for the container exec command. + */ +@Fluent +public final class ContainerExecResponseInner implements JsonSerializable { + /* + * The uri for the exec websocket. + */ + private String webSocketUri; + + /* + * The password to start the exec command. + */ + private String password; + + /** + * Creates an instance of ContainerExecResponseInner class. + */ + public ContainerExecResponseInner() { + } + + /** + * Get the webSocketUri property: The uri for the exec websocket. + * + * @return the webSocketUri value. + */ + public String webSocketUri() { + return this.webSocketUri; + } + + /** + * Set the webSocketUri property: The uri for the exec websocket. + * + * @param webSocketUri the webSocketUri value to set. + * @return the ContainerExecResponseInner object itself. + */ + public ContainerExecResponseInner withWebSocketUri(String webSocketUri) { + this.webSocketUri = webSocketUri; + return this; + } + + /** + * Get the password property: The password to start the exec command. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Set the password property: The password to start the exec command. + * + * @param password the password value to set. + * @return the ContainerExecResponseInner object itself. + */ + public ContainerExecResponseInner withPassword(String password) { + this.password = password; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("webSocketUri", this.webSocketUri); + jsonWriter.writeStringField("password", this.password); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerExecResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerExecResponseInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ContainerExecResponseInner. + */ + public static ContainerExecResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerExecResponseInner deserializedContainerExecResponseInner = new ContainerExecResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("webSocketUri".equals(fieldName)) { + deserializedContainerExecResponseInner.webSocketUri = reader.getString(); + } else if ("password".equals(fieldName)) { + deserializedContainerExecResponseInner.password = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerExecResponseInner; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerGroupInner.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerGroupInner.java new file mode 100644 index 000000000000..27c1d5b5169e --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerGroupInner.java @@ -0,0 +1,670 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerinstance.generated.models.ConfidentialComputeProperties; +import com.azure.resourcemanager.containerinstance.generated.models.Container; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupDiagnostics; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupIdentity; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupPriority; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupPropertiesInstanceView; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupRestartPolicy; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupSku; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupSubnetId; +import com.azure.resourcemanager.containerinstance.generated.models.DeploymentExtensionSpec; +import com.azure.resourcemanager.containerinstance.generated.models.DnsConfiguration; +import com.azure.resourcemanager.containerinstance.generated.models.EncryptionProperties; +import com.azure.resourcemanager.containerinstance.generated.models.IdentityAcls; +import com.azure.resourcemanager.containerinstance.generated.models.ImageRegistryCredential; +import com.azure.resourcemanager.containerinstance.generated.models.InitContainerDefinition; +import com.azure.resourcemanager.containerinstance.generated.models.IpAddress; +import com.azure.resourcemanager.containerinstance.generated.models.OperatingSystemTypes; +import com.azure.resourcemanager.containerinstance.generated.models.SecretReference; +import com.azure.resourcemanager.containerinstance.generated.models.Volume; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * A container group. + */ +@Fluent +public final class ContainerGroupInner extends Resource { + /* + * The zones for the container group. + */ + private List zones; + + /* + * The identity of the container group, if configured. + */ + private ContainerGroupIdentity identity; + + /* + * The container group properties + */ + private ContainerGroupPropertiesProperties innerProperties = new ContainerGroupPropertiesProperties(); + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ContainerGroupInner class. + */ + public ContainerGroupInner() { + } + + /** + * Get the zones property: The zones for the container group. + * + * @return the zones value. + */ + public List zones() { + return this.zones; + } + + /** + * Set the zones property: The zones for the container group. + * + * @param zones the zones value to set. + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withZones(List zones) { + this.zones = zones; + return this; + } + + /** + * Get the identity property: The identity of the container group, if configured. + * + * @return the identity value. + */ + public ContainerGroupIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The identity of the container group, if configured. + * + * @param identity the identity value to set. + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withIdentity(ContainerGroupIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the innerProperties property: The container group properties. + * + * @return the innerProperties value. + */ + private ContainerGroupPropertiesProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public ContainerGroupInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ContainerGroupInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the container group. This only appears in the + * response. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the secretReferences property: The secret references that will be referenced within the container group. + * + * @return the secretReferences value. + */ + public List secretReferences() { + return this.innerProperties() == null ? null : this.innerProperties().secretReferences(); + } + + /** + * Set the secretReferences property: The secret references that will be referenced within the container group. + * + * @param secretReferences the secretReferences value to set. + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withSecretReferences(List secretReferences) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupPropertiesProperties(); + } + this.innerProperties().withSecretReferences(secretReferences); + return this; + } + + /** + * Get the containers property: The containers within the container group. + * + * @return the containers value. + */ + public List containers() { + return this.innerProperties() == null ? null : this.innerProperties().containers(); + } + + /** + * Set the containers property: The containers within the container group. + * + * @param containers the containers value to set. + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withContainers(List containers) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupPropertiesProperties(); + } + this.innerProperties().withContainers(containers); + return this; + } + + /** + * Get the imageRegistryCredentials property: The image registry credentials by which the container group is created + * from. + * + * @return the imageRegistryCredentials value. + */ + public List imageRegistryCredentials() { + return this.innerProperties() == null ? null : this.innerProperties().imageRegistryCredentials(); + } + + /** + * Set the imageRegistryCredentials property: The image registry credentials by which the container group is created + * from. + * + * @param imageRegistryCredentials the imageRegistryCredentials value to set. + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withImageRegistryCredentials(List imageRegistryCredentials) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupPropertiesProperties(); + } + this.innerProperties().withImageRegistryCredentials(imageRegistryCredentials); + return this; + } + + /** + * Get the restartPolicy property: Restart policy for all containers within the container group. + * - `Always` Always restart + * - `OnFailure` Restart on failure + * - `Never` Never restart. + * + * @return the restartPolicy value. + */ + public ContainerGroupRestartPolicy restartPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().restartPolicy(); + } + + /** + * Set the restartPolicy property: Restart policy for all containers within the container group. + * - `Always` Always restart + * - `OnFailure` Restart on failure + * - `Never` Never restart. + * + * @param restartPolicy the restartPolicy value to set. + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withRestartPolicy(ContainerGroupRestartPolicy restartPolicy) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupPropertiesProperties(); + } + this.innerProperties().withRestartPolicy(restartPolicy); + return this; + } + + /** + * Get the ipAddress property: The IP address type of the container group. + * + * @return the ipAddress value. + */ + public IpAddress ipAddress() { + return this.innerProperties() == null ? null : this.innerProperties().ipAddress(); + } + + /** + * Set the ipAddress property: The IP address type of the container group. + * + * @param ipAddress the ipAddress value to set. + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withIpAddress(IpAddress ipAddress) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupPropertiesProperties(); + } + this.innerProperties().withIpAddress(ipAddress); + return this; + } + + /** + * Get the osType property: The operating system type required by the containers in the container group. + * + * @return the osType value. + */ + public OperatingSystemTypes osType() { + return this.innerProperties() == null ? null : this.innerProperties().osType(); + } + + /** + * Set the osType property: The operating system type required by the containers in the container group. + * + * @param osType the osType value to set. + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withOsType(OperatingSystemTypes osType) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupPropertiesProperties(); + } + this.innerProperties().withOsType(osType); + return this; + } + + /** + * Get the volumes property: The list of volumes that can be mounted by containers in this container group. + * + * @return the volumes value. + */ + public List volumes() { + return this.innerProperties() == null ? null : this.innerProperties().volumes(); + } + + /** + * Set the volumes property: The list of volumes that can be mounted by containers in this container group. + * + * @param volumes the volumes value to set. + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withVolumes(List volumes) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupPropertiesProperties(); + } + this.innerProperties().withVolumes(volumes); + return this; + } + + /** + * Get the instanceView property: The instance view of the container group. Only valid in response. + * + * @return the instanceView value. + */ + public ContainerGroupPropertiesInstanceView instanceView() { + return this.innerProperties() == null ? null : this.innerProperties().instanceView(); + } + + /** + * Get the diagnostics property: The diagnostic information for a container group. + * + * @return the diagnostics value. + */ + public ContainerGroupDiagnostics diagnostics() { + return this.innerProperties() == null ? null : this.innerProperties().diagnostics(); + } + + /** + * Set the diagnostics property: The diagnostic information for a container group. + * + * @param diagnostics the diagnostics value to set. + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withDiagnostics(ContainerGroupDiagnostics diagnostics) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupPropertiesProperties(); + } + this.innerProperties().withDiagnostics(diagnostics); + return this; + } + + /** + * Get the subnetIds property: The subnet resource IDs for a container group. + * + * @return the subnetIds value. + */ + public List subnetIds() { + return this.innerProperties() == null ? null : this.innerProperties().subnetIds(); + } + + /** + * Set the subnetIds property: The subnet resource IDs for a container group. + * + * @param subnetIds the subnetIds value to set. + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withSubnetIds(List subnetIds) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupPropertiesProperties(); + } + this.innerProperties().withSubnetIds(subnetIds); + return this; + } + + /** + * Get the dnsConfig property: The DNS config information for a container group. + * + * @return the dnsConfig value. + */ + public DnsConfiguration dnsConfig() { + return this.innerProperties() == null ? null : this.innerProperties().dnsConfig(); + } + + /** + * Set the dnsConfig property: The DNS config information for a container group. + * + * @param dnsConfig the dnsConfig value to set. + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withDnsConfig(DnsConfiguration dnsConfig) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupPropertiesProperties(); + } + this.innerProperties().withDnsConfig(dnsConfig); + return this; + } + + /** + * Get the sku property: The SKU for a container group. + * + * @return the sku value. + */ + public ContainerGroupSku sku() { + return this.innerProperties() == null ? null : this.innerProperties().sku(); + } + + /** + * Set the sku property: The SKU for a container group. + * + * @param sku the sku value to set. + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withSku(ContainerGroupSku sku) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupPropertiesProperties(); + } + this.innerProperties().withSku(sku); + return this; + } + + /** + * Get the encryptionProperties property: The encryption properties for a container group. + * + * @return the encryptionProperties value. + */ + public EncryptionProperties encryptionProperties() { + return this.innerProperties() == null ? null : this.innerProperties().encryptionProperties(); + } + + /** + * Set the encryptionProperties property: The encryption properties for a container group. + * + * @param encryptionProperties the encryptionProperties value to set. + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withEncryptionProperties(EncryptionProperties encryptionProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupPropertiesProperties(); + } + this.innerProperties().withEncryptionProperties(encryptionProperties); + return this; + } + + /** + * Get the initContainers property: The init containers for a container group. + * + * @return the initContainers value. + */ + public List initContainers() { + return this.innerProperties() == null ? null : this.innerProperties().initContainers(); + } + + /** + * Set the initContainers property: The init containers for a container group. + * + * @param initContainers the initContainers value to set. + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withInitContainers(List initContainers) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupPropertiesProperties(); + } + this.innerProperties().withInitContainers(initContainers); + return this; + } + + /** + * Get the extensions property: extensions used by virtual kubelet. + * + * @return the extensions value. + */ + public List extensions() { + return this.innerProperties() == null ? null : this.innerProperties().extensions(); + } + + /** + * Set the extensions property: extensions used by virtual kubelet. + * + * @param extensions the extensions value to set. + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withExtensions(List extensions) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupPropertiesProperties(); + } + this.innerProperties().withExtensions(extensions); + return this; + } + + /** + * Get the confidentialComputeProperties property: The properties for confidential container group. + * + * @return the confidentialComputeProperties value. + */ + public ConfidentialComputeProperties confidentialComputeProperties() { + return this.innerProperties() == null ? null : this.innerProperties().confidentialComputeProperties(); + } + + /** + * Set the confidentialComputeProperties property: The properties for confidential container group. + * + * @param confidentialComputeProperties the confidentialComputeProperties value to set. + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner + withConfidentialComputeProperties(ConfidentialComputeProperties confidentialComputeProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupPropertiesProperties(); + } + this.innerProperties().withConfidentialComputeProperties(confidentialComputeProperties); + return this; + } + + /** + * Get the priority property: The priority of the container group. + * + * @return the priority value. + */ + public ContainerGroupPriority priority() { + return this.innerProperties() == null ? null : this.innerProperties().priority(); + } + + /** + * Set the priority property: The priority of the container group. + * + * @param priority the priority value to set. + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withPriority(ContainerGroupPriority priority) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupPropertiesProperties(); + } + this.innerProperties().withPriority(priority); + return this; + } + + /** + * Get the identityAcls property: The access control levels of the identities. + * + * @return the identityAcls value. + */ + public IdentityAcls identityAcls() { + return this.innerProperties() == null ? null : this.innerProperties().identityAcls(); + } + + /** + * Set the identityAcls property: The access control levels of the identities. + * + * @param identityAcls the identityAcls value to set. + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withIdentityAcls(IdentityAcls identityAcls) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupPropertiesProperties(); + } + this.innerProperties().withIdentityAcls(identityAcls); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (innerProperties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model ContainerGroupInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ContainerGroupInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeArrayField("zones", this.zones, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("identity", this.identity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerGroupInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerGroupInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ContainerGroupInner. + */ + public static ContainerGroupInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerGroupInner deserializedContainerGroupInner = new ContainerGroupInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedContainerGroupInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedContainerGroupInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedContainerGroupInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedContainerGroupInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedContainerGroupInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedContainerGroupInner.innerProperties + = ContainerGroupPropertiesProperties.fromJson(reader); + } else if ("zones".equals(fieldName)) { + List zones = reader.readArray(reader1 -> reader1.getString()); + deserializedContainerGroupInner.zones = zones; + } else if ("identity".equals(fieldName)) { + deserializedContainerGroupInner.identity = ContainerGroupIdentity.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerGroupInner; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerGroupProfileInner.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerGroupProfileInner.java new file mode 100644 index 000000000000..e3c2fada8444 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerGroupProfileInner.java @@ -0,0 +1,675 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerinstance.generated.models.ConfidentialComputeProperties; +import com.azure.resourcemanager.containerinstance.generated.models.Container; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupDiagnostics; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupPriority; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupRestartPolicy; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupSku; +import com.azure.resourcemanager.containerinstance.generated.models.DeploymentExtensionSpec; +import com.azure.resourcemanager.containerinstance.generated.models.EncryptionProperties; +import com.azure.resourcemanager.containerinstance.generated.models.ImageRegistryCredential; +import com.azure.resourcemanager.containerinstance.generated.models.InitContainerDefinition; +import com.azure.resourcemanager.containerinstance.generated.models.IpAddress; +import com.azure.resourcemanager.containerinstance.generated.models.OperatingSystemTypes; +import com.azure.resourcemanager.containerinstance.generated.models.SecurityContextDefinition; +import com.azure.resourcemanager.containerinstance.generated.models.Volume; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** + * container group profile object. + */ +@Fluent +public final class ContainerGroupProfileInner extends Resource { + /* + * Metadata pertaining to creation and last modification of the resource. + */ + private SystemData systemData; + + /* + * The container group profile properties + */ + private ContainerGroupProfileProperties innerProperties; + + /* + * The zones for the container group. + */ + private List zones; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ContainerGroupProfileInner class. + */ + public ContainerGroupProfileInner() { + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the innerProperties property: The container group profile properties. + * + * @return the innerProperties value. + */ + private ContainerGroupProfileProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the zones property: The zones for the container group. + * + * @return the zones value. + */ + public List zones() { + return this.zones; + } + + /** + * Set the zones property: The zones for the container group. + * + * @param zones the zones value to set. + * @return the ContainerGroupProfileInner object itself. + */ + public ContainerGroupProfileInner withZones(List zones) { + this.zones = zones; + return this; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public ContainerGroupProfileInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ContainerGroupProfileInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the sku property: The SKU for a container group. + * + * @return the sku value. + */ + public ContainerGroupSku sku() { + return this.innerProperties() == null ? null : this.innerProperties().sku(); + } + + /** + * Set the sku property: The SKU for a container group. + * + * @param sku the sku value to set. + * @return the ContainerGroupProfileInner object itself. + */ + public ContainerGroupProfileInner withSku(ContainerGroupSku sku) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupProfileProperties(); + } + this.innerProperties().withSku(sku); + return this; + } + + /** + * Get the encryptionProperties property: The encryption properties for a container group. + * + * @return the encryptionProperties value. + */ + public EncryptionProperties encryptionProperties() { + return this.innerProperties() == null ? null : this.innerProperties().encryptionProperties(); + } + + /** + * Set the encryptionProperties property: The encryption properties for a container group. + * + * @param encryptionProperties the encryptionProperties value to set. + * @return the ContainerGroupProfileInner object itself. + */ + public ContainerGroupProfileInner withEncryptionProperties(EncryptionProperties encryptionProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupProfileProperties(); + } + this.innerProperties().withEncryptionProperties(encryptionProperties); + return this; + } + + /** + * Get the containers property: The containers within the container group. + * + * @return the containers value. + */ + public List containers() { + return this.innerProperties() == null ? null : this.innerProperties().containers(); + } + + /** + * Set the containers property: The containers within the container group. + * + * @param containers the containers value to set. + * @return the ContainerGroupProfileInner object itself. + */ + public ContainerGroupProfileInner withContainers(List containers) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupProfileProperties(); + } + this.innerProperties().withContainers(containers); + return this; + } + + /** + * Get the initContainers property: The init containers for a container group. + * + * @return the initContainers value. + */ + public List initContainers() { + return this.innerProperties() == null ? null : this.innerProperties().initContainers(); + } + + /** + * Set the initContainers property: The init containers for a container group. + * + * @param initContainers the initContainers value to set. + * @return the ContainerGroupProfileInner object itself. + */ + public ContainerGroupProfileInner withInitContainers(List initContainers) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupProfileProperties(); + } + this.innerProperties().withInitContainers(initContainers); + return this; + } + + /** + * Get the extensions property: extensions used by virtual kubelet. + * + * @return the extensions value. + */ + public List extensions() { + return this.innerProperties() == null ? null : this.innerProperties().extensions(); + } + + /** + * Set the extensions property: extensions used by virtual kubelet. + * + * @param extensions the extensions value to set. + * @return the ContainerGroupProfileInner object itself. + */ + public ContainerGroupProfileInner withExtensions(List extensions) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupProfileProperties(); + } + this.innerProperties().withExtensions(extensions); + return this; + } + + /** + * Get the imageRegistryCredentials property: The image registry credentials by which the container group is created + * from. + * + * @return the imageRegistryCredentials value. + */ + public List imageRegistryCredentials() { + return this.innerProperties() == null ? null : this.innerProperties().imageRegistryCredentials(); + } + + /** + * Set the imageRegistryCredentials property: The image registry credentials by which the container group is created + * from. + * + * @param imageRegistryCredentials the imageRegistryCredentials value to set. + * @return the ContainerGroupProfileInner object itself. + */ + public ContainerGroupProfileInner + withImageRegistryCredentials(List imageRegistryCredentials) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupProfileProperties(); + } + this.innerProperties().withImageRegistryCredentials(imageRegistryCredentials); + return this; + } + + /** + * Get the restartPolicy property: Restart policy for all containers within the container group. + * - `Always` Always restart + * - `OnFailure` Restart on failure + * - `Never` Never restart. + * + * @return the restartPolicy value. + */ + public ContainerGroupRestartPolicy restartPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().restartPolicy(); + } + + /** + * Set the restartPolicy property: Restart policy for all containers within the container group. + * - `Always` Always restart + * - `OnFailure` Restart on failure + * - `Never` Never restart. + * + * @param restartPolicy the restartPolicy value to set. + * @return the ContainerGroupProfileInner object itself. + */ + public ContainerGroupProfileInner withRestartPolicy(ContainerGroupRestartPolicy restartPolicy) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupProfileProperties(); + } + this.innerProperties().withRestartPolicy(restartPolicy); + return this; + } + + /** + * Get the shutdownGracePeriod property: Shutdown grace period for containers in a container group. + * + * @return the shutdownGracePeriod value. + */ + public OffsetDateTime shutdownGracePeriod() { + return this.innerProperties() == null ? null : this.innerProperties().shutdownGracePeriod(); + } + + /** + * Set the shutdownGracePeriod property: Shutdown grace period for containers in a container group. + * + * @param shutdownGracePeriod the shutdownGracePeriod value to set. + * @return the ContainerGroupProfileInner object itself. + */ + public ContainerGroupProfileInner withShutdownGracePeriod(OffsetDateTime shutdownGracePeriod) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupProfileProperties(); + } + this.innerProperties().withShutdownGracePeriod(shutdownGracePeriod); + return this; + } + + /** + * Get the ipAddress property: The IP address type of the container group. + * + * @return the ipAddress value. + */ + public IpAddress ipAddress() { + return this.innerProperties() == null ? null : this.innerProperties().ipAddress(); + } + + /** + * Set the ipAddress property: The IP address type of the container group. + * + * @param ipAddress the ipAddress value to set. + * @return the ContainerGroupProfileInner object itself. + */ + public ContainerGroupProfileInner withIpAddress(IpAddress ipAddress) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupProfileProperties(); + } + this.innerProperties().withIpAddress(ipAddress); + return this; + } + + /** + * Get the timeToLive property: Post completion time to live for containers of a CG. + * + * @return the timeToLive value. + */ + public OffsetDateTime timeToLive() { + return this.innerProperties() == null ? null : this.innerProperties().timeToLive(); + } + + /** + * Set the timeToLive property: Post completion time to live for containers of a CG. + * + * @param timeToLive the timeToLive value to set. + * @return the ContainerGroupProfileInner object itself. + */ + public ContainerGroupProfileInner withTimeToLive(OffsetDateTime timeToLive) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupProfileProperties(); + } + this.innerProperties().withTimeToLive(timeToLive); + return this; + } + + /** + * Get the osType property: The operating system type required by the containers in the container group. + * + * @return the osType value. + */ + public OperatingSystemTypes osType() { + return this.innerProperties() == null ? null : this.innerProperties().osType(); + } + + /** + * Set the osType property: The operating system type required by the containers in the container group. + * + * @param osType the osType value to set. + * @return the ContainerGroupProfileInner object itself. + */ + public ContainerGroupProfileInner withOsType(OperatingSystemTypes osType) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupProfileProperties(); + } + this.innerProperties().withOsType(osType); + return this; + } + + /** + * Get the volumes property: The list of volumes that can be mounted by containers in this container group. + * + * @return the volumes value. + */ + public List volumes() { + return this.innerProperties() == null ? null : this.innerProperties().volumes(); + } + + /** + * Set the volumes property: The list of volumes that can be mounted by containers in this container group. + * + * @param volumes the volumes value to set. + * @return the ContainerGroupProfileInner object itself. + */ + public ContainerGroupProfileInner withVolumes(List volumes) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupProfileProperties(); + } + this.innerProperties().withVolumes(volumes); + return this; + } + + /** + * Get the diagnostics property: The diagnostic information for a container group. + * + * @return the diagnostics value. + */ + public ContainerGroupDiagnostics diagnostics() { + return this.innerProperties() == null ? null : this.innerProperties().diagnostics(); + } + + /** + * Set the diagnostics property: The diagnostic information for a container group. + * + * @param diagnostics the diagnostics value to set. + * @return the ContainerGroupProfileInner object itself. + */ + public ContainerGroupProfileInner withDiagnostics(ContainerGroupDiagnostics diagnostics) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupProfileProperties(); + } + this.innerProperties().withDiagnostics(diagnostics); + return this; + } + + /** + * Get the priority property: The priority of the container group. + * + * @return the priority value. + */ + public ContainerGroupPriority priority() { + return this.innerProperties() == null ? null : this.innerProperties().priority(); + } + + /** + * Set the priority property: The priority of the container group. + * + * @param priority the priority value to set. + * @return the ContainerGroupProfileInner object itself. + */ + public ContainerGroupProfileInner withPriority(ContainerGroupPriority priority) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupProfileProperties(); + } + this.innerProperties().withPriority(priority); + return this; + } + + /** + * Get the confidentialComputeProperties property: The properties for confidential container group. + * + * @return the confidentialComputeProperties value. + */ + public ConfidentialComputeProperties confidentialComputeProperties() { + return this.innerProperties() == null ? null : this.innerProperties().confidentialComputeProperties(); + } + + /** + * Set the confidentialComputeProperties property: The properties for confidential container group. + * + * @param confidentialComputeProperties the confidentialComputeProperties value to set. + * @return the ContainerGroupProfileInner object itself. + */ + public ContainerGroupProfileInner + withConfidentialComputeProperties(ConfidentialComputeProperties confidentialComputeProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupProfileProperties(); + } + this.innerProperties().withConfidentialComputeProperties(confidentialComputeProperties); + return this; + } + + /** + * Get the securityContext property: The container security properties. + * + * @return the securityContext value. + */ + public SecurityContextDefinition securityContext() { + return this.innerProperties() == null ? null : this.innerProperties().securityContext(); + } + + /** + * Set the securityContext property: The container security properties. + * + * @param securityContext the securityContext value to set. + * @return the ContainerGroupProfileInner object itself. + */ + public ContainerGroupProfileInner withSecurityContext(SecurityContextDefinition securityContext) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupProfileProperties(); + } + this.innerProperties().withSecurityContext(securityContext); + return this; + } + + /** + * Get the revision property: Container group profile current revision number. + * + * @return the revision value. + */ + public Long revision() { + return this.innerProperties() == null ? null : this.innerProperties().revision(); + } + + /** + * Set the revision property: Container group profile current revision number. + * + * @param revision the revision value to set. + * @return the ContainerGroupProfileInner object itself. + */ + public ContainerGroupProfileInner withRevision(Long revision) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupProfileProperties(); + } + this.innerProperties().withRevision(revision); + return this; + } + + /** + * Get the registeredRevisions property: Registered revisions are calculated at request time based off the records + * in the table logs. + * + * @return the registeredRevisions value. + */ + public List registeredRevisions() { + return this.innerProperties() == null ? null : this.innerProperties().registeredRevisions(); + } + + /** + * Set the registeredRevisions property: Registered revisions are calculated at request time based off the records + * in the table logs. + * + * @param registeredRevisions the registeredRevisions value to set. + * @return the ContainerGroupProfileInner object itself. + */ + public ContainerGroupProfileInner withRegisteredRevisions(List registeredRevisions) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupProfileProperties(); + } + this.innerProperties().withRegisteredRevisions(registeredRevisions); + return this; + } + + /** + * Get the useKrypton property: Gets or sets Krypton use property. + * + * @return the useKrypton value. + */ + public Boolean useKrypton() { + return this.innerProperties() == null ? null : this.innerProperties().useKrypton(); + } + + /** + * Set the useKrypton property: Gets or sets Krypton use property. + * + * @param useKrypton the useKrypton value to set. + * @return the ContainerGroupProfileInner object itself. + */ + public ContainerGroupProfileInner withUseKrypton(Boolean useKrypton) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupProfileProperties(); + } + this.innerProperties().withUseKrypton(useKrypton); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeArrayField("zones", this.zones, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerGroupProfileInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerGroupProfileInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ContainerGroupProfileInner. + */ + public static ContainerGroupProfileInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerGroupProfileInner deserializedContainerGroupProfileInner = new ContainerGroupProfileInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedContainerGroupProfileInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedContainerGroupProfileInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedContainerGroupProfileInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedContainerGroupProfileInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedContainerGroupProfileInner.withTags(tags); + } else if ("systemData".equals(fieldName)) { + deserializedContainerGroupProfileInner.systemData = SystemData.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedContainerGroupProfileInner.innerProperties + = ContainerGroupProfileProperties.fromJson(reader); + } else if ("zones".equals(fieldName)) { + List zones = reader.readArray(reader1 -> reader1.getString()); + deserializedContainerGroupProfileInner.zones = zones; + } else { + reader.skipChildren(); + } + } + + return deserializedContainerGroupProfileInner; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerGroupProfileProperties.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerGroupProfileProperties.java new file mode 100644 index 000000000000..93c57cf360b3 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerGroupProfileProperties.java @@ -0,0 +1,686 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerinstance.generated.models.ConfidentialComputeProperties; +import com.azure.resourcemanager.containerinstance.generated.models.Container; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupDiagnostics; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupPriority; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupRestartPolicy; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupSku; +import com.azure.resourcemanager.containerinstance.generated.models.DeploymentExtensionSpec; +import com.azure.resourcemanager.containerinstance.generated.models.EncryptionProperties; +import com.azure.resourcemanager.containerinstance.generated.models.ImageRegistryCredential; +import com.azure.resourcemanager.containerinstance.generated.models.InitContainerDefinition; +import com.azure.resourcemanager.containerinstance.generated.models.IpAddress; +import com.azure.resourcemanager.containerinstance.generated.models.OperatingSystemTypes; +import com.azure.resourcemanager.containerinstance.generated.models.SecurityContextDefinition; +import com.azure.resourcemanager.containerinstance.generated.models.Volume; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * The container group profile properties. + */ +@Fluent +public final class ContainerGroupProfileProperties implements JsonSerializable { + /* + * The SKU for a container group. + */ + private ContainerGroupSku sku; + + /* + * The encryption properties for a container group. + */ + private EncryptionProperties encryptionProperties; + + /* + * The containers within the container group. + */ + private List containers; + + /* + * The init containers for a container group. + */ + private List initContainers; + + /* + * extensions used by virtual kubelet + */ + private List extensions; + + /* + * The image registry credentials by which the container group is created from. + */ + private List imageRegistryCredentials; + + /* + * Restart policy for all containers within the container group. + * - `Always` Always restart + * - `OnFailure` Restart on failure + * - `Never` Never restart + */ + private ContainerGroupRestartPolicy restartPolicy; + + /* + * Shutdown grace period for containers in a container group. + */ + private OffsetDateTime shutdownGracePeriod; + + /* + * The IP address type of the container group. + */ + private IpAddress ipAddress; + + /* + * Post completion time to live for containers of a CG + */ + private OffsetDateTime timeToLive; + + /* + * The operating system type required by the containers in the container group. + */ + private OperatingSystemTypes osType; + + /* + * The list of volumes that can be mounted by containers in this container group. + */ + private List volumes; + + /* + * The diagnostic information for a container group. + */ + private ContainerGroupDiagnostics diagnostics; + + /* + * The priority of the container group. + */ + private ContainerGroupPriority priority; + + /* + * The properties for confidential container group + */ + private ConfidentialComputeProperties confidentialComputeProperties; + + /* + * The container security properties. + */ + private SecurityContextDefinition securityContext; + + /* + * Container group profile current revision number + */ + private Long revision; + + /* + * Registered revisions are calculated at request time based off the records in the table logs. + */ + private List registeredRevisions; + + /* + * Gets or sets Krypton use property. + */ + private Boolean useKrypton; + + /** + * Creates an instance of ContainerGroupProfileProperties class. + */ + public ContainerGroupProfileProperties() { + } + + /** + * Get the sku property: The SKU for a container group. + * + * @return the sku value. + */ + public ContainerGroupSku sku() { + return this.sku; + } + + /** + * Set the sku property: The SKU for a container group. + * + * @param sku the sku value to set. + * @return the ContainerGroupProfileProperties object itself. + */ + public ContainerGroupProfileProperties withSku(ContainerGroupSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the encryptionProperties property: The encryption properties for a container group. + * + * @return the encryptionProperties value. + */ + public EncryptionProperties encryptionProperties() { + return this.encryptionProperties; + } + + /** + * Set the encryptionProperties property: The encryption properties for a container group. + * + * @param encryptionProperties the encryptionProperties value to set. + * @return the ContainerGroupProfileProperties object itself. + */ + public ContainerGroupProfileProperties withEncryptionProperties(EncryptionProperties encryptionProperties) { + this.encryptionProperties = encryptionProperties; + return this; + } + + /** + * Get the containers property: The containers within the container group. + * + * @return the containers value. + */ + public List containers() { + return this.containers; + } + + /** + * Set the containers property: The containers within the container group. + * + * @param containers the containers value to set. + * @return the ContainerGroupProfileProperties object itself. + */ + public ContainerGroupProfileProperties withContainers(List containers) { + this.containers = containers; + return this; + } + + /** + * Get the initContainers property: The init containers for a container group. + * + * @return the initContainers value. + */ + public List initContainers() { + return this.initContainers; + } + + /** + * Set the initContainers property: The init containers for a container group. + * + * @param initContainers the initContainers value to set. + * @return the ContainerGroupProfileProperties object itself. + */ + public ContainerGroupProfileProperties withInitContainers(List initContainers) { + this.initContainers = initContainers; + return this; + } + + /** + * Get the extensions property: extensions used by virtual kubelet. + * + * @return the extensions value. + */ + public List extensions() { + return this.extensions; + } + + /** + * Set the extensions property: extensions used by virtual kubelet. + * + * @param extensions the extensions value to set. + * @return the ContainerGroupProfileProperties object itself. + */ + public ContainerGroupProfileProperties withExtensions(List extensions) { + this.extensions = extensions; + return this; + } + + /** + * Get the imageRegistryCredentials property: The image registry credentials by which the container group is created + * from. + * + * @return the imageRegistryCredentials value. + */ + public List imageRegistryCredentials() { + return this.imageRegistryCredentials; + } + + /** + * Set the imageRegistryCredentials property: The image registry credentials by which the container group is created + * from. + * + * @param imageRegistryCredentials the imageRegistryCredentials value to set. + * @return the ContainerGroupProfileProperties object itself. + */ + public ContainerGroupProfileProperties + withImageRegistryCredentials(List imageRegistryCredentials) { + this.imageRegistryCredentials = imageRegistryCredentials; + return this; + } + + /** + * Get the restartPolicy property: Restart policy for all containers within the container group. + * - `Always` Always restart + * - `OnFailure` Restart on failure + * - `Never` Never restart. + * + * @return the restartPolicy value. + */ + public ContainerGroupRestartPolicy restartPolicy() { + return this.restartPolicy; + } + + /** + * Set the restartPolicy property: Restart policy for all containers within the container group. + * - `Always` Always restart + * - `OnFailure` Restart on failure + * - `Never` Never restart. + * + * @param restartPolicy the restartPolicy value to set. + * @return the ContainerGroupProfileProperties object itself. + */ + public ContainerGroupProfileProperties withRestartPolicy(ContainerGroupRestartPolicy restartPolicy) { + this.restartPolicy = restartPolicy; + return this; + } + + /** + * Get the shutdownGracePeriod property: Shutdown grace period for containers in a container group. + * + * @return the shutdownGracePeriod value. + */ + public OffsetDateTime shutdownGracePeriod() { + return this.shutdownGracePeriod; + } + + /** + * Set the shutdownGracePeriod property: Shutdown grace period for containers in a container group. + * + * @param shutdownGracePeriod the shutdownGracePeriod value to set. + * @return the ContainerGroupProfileProperties object itself. + */ + public ContainerGroupProfileProperties withShutdownGracePeriod(OffsetDateTime shutdownGracePeriod) { + this.shutdownGracePeriod = shutdownGracePeriod; + return this; + } + + /** + * Get the ipAddress property: The IP address type of the container group. + * + * @return the ipAddress value. + */ + public IpAddress ipAddress() { + return this.ipAddress; + } + + /** + * Set the ipAddress property: The IP address type of the container group. + * + * @param ipAddress the ipAddress value to set. + * @return the ContainerGroupProfileProperties object itself. + */ + public ContainerGroupProfileProperties withIpAddress(IpAddress ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + * Get the timeToLive property: Post completion time to live for containers of a CG. + * + * @return the timeToLive value. + */ + public OffsetDateTime timeToLive() { + return this.timeToLive; + } + + /** + * Set the timeToLive property: Post completion time to live for containers of a CG. + * + * @param timeToLive the timeToLive value to set. + * @return the ContainerGroupProfileProperties object itself. + */ + public ContainerGroupProfileProperties withTimeToLive(OffsetDateTime timeToLive) { + this.timeToLive = timeToLive; + return this; + } + + /** + * Get the osType property: The operating system type required by the containers in the container group. + * + * @return the osType value. + */ + public OperatingSystemTypes osType() { + return this.osType; + } + + /** + * Set the osType property: The operating system type required by the containers in the container group. + * + * @param osType the osType value to set. + * @return the ContainerGroupProfileProperties object itself. + */ + public ContainerGroupProfileProperties withOsType(OperatingSystemTypes osType) { + this.osType = osType; + return this; + } + + /** + * Get the volumes property: The list of volumes that can be mounted by containers in this container group. + * + * @return the volumes value. + */ + public List volumes() { + return this.volumes; + } + + /** + * Set the volumes property: The list of volumes that can be mounted by containers in this container group. + * + * @param volumes the volumes value to set. + * @return the ContainerGroupProfileProperties object itself. + */ + public ContainerGroupProfileProperties withVolumes(List volumes) { + this.volumes = volumes; + return this; + } + + /** + * Get the diagnostics property: The diagnostic information for a container group. + * + * @return the diagnostics value. + */ + public ContainerGroupDiagnostics diagnostics() { + return this.diagnostics; + } + + /** + * Set the diagnostics property: The diagnostic information for a container group. + * + * @param diagnostics the diagnostics value to set. + * @return the ContainerGroupProfileProperties object itself. + */ + public ContainerGroupProfileProperties withDiagnostics(ContainerGroupDiagnostics diagnostics) { + this.diagnostics = diagnostics; + return this; + } + + /** + * Get the priority property: The priority of the container group. + * + * @return the priority value. + */ + public ContainerGroupPriority priority() { + return this.priority; + } + + /** + * Set the priority property: The priority of the container group. + * + * @param priority the priority value to set. + * @return the ContainerGroupProfileProperties object itself. + */ + public ContainerGroupProfileProperties withPriority(ContainerGroupPriority priority) { + this.priority = priority; + return this; + } + + /** + * Get the confidentialComputeProperties property: The properties for confidential container group. + * + * @return the confidentialComputeProperties value. + */ + public ConfidentialComputeProperties confidentialComputeProperties() { + return this.confidentialComputeProperties; + } + + /** + * Set the confidentialComputeProperties property: The properties for confidential container group. + * + * @param confidentialComputeProperties the confidentialComputeProperties value to set. + * @return the ContainerGroupProfileProperties object itself. + */ + public ContainerGroupProfileProperties + withConfidentialComputeProperties(ConfidentialComputeProperties confidentialComputeProperties) { + this.confidentialComputeProperties = confidentialComputeProperties; + return this; + } + + /** + * Get the securityContext property: The container security properties. + * + * @return the securityContext value. + */ + public SecurityContextDefinition securityContext() { + return this.securityContext; + } + + /** + * Set the securityContext property: The container security properties. + * + * @param securityContext the securityContext value to set. + * @return the ContainerGroupProfileProperties object itself. + */ + public ContainerGroupProfileProperties withSecurityContext(SecurityContextDefinition securityContext) { + this.securityContext = securityContext; + return this; + } + + /** + * Get the revision property: Container group profile current revision number. + * + * @return the revision value. + */ + public Long revision() { + return this.revision; + } + + /** + * Set the revision property: Container group profile current revision number. + * + * @param revision the revision value to set. + * @return the ContainerGroupProfileProperties object itself. + */ + public ContainerGroupProfileProperties withRevision(Long revision) { + this.revision = revision; + return this; + } + + /** + * Get the registeredRevisions property: Registered revisions are calculated at request time based off the records + * in the table logs. + * + * @return the registeredRevisions value. + */ + public List registeredRevisions() { + return this.registeredRevisions; + } + + /** + * Set the registeredRevisions property: Registered revisions are calculated at request time based off the records + * in the table logs. + * + * @param registeredRevisions the registeredRevisions value to set. + * @return the ContainerGroupProfileProperties object itself. + */ + public ContainerGroupProfileProperties withRegisteredRevisions(List registeredRevisions) { + this.registeredRevisions = registeredRevisions; + return this; + } + + /** + * Get the useKrypton property: Gets or sets Krypton use property. + * + * @return the useKrypton value. + */ + public Boolean useKrypton() { + return this.useKrypton; + } + + /** + * Set the useKrypton property: Gets or sets Krypton use property. + * + * @param useKrypton the useKrypton value to set. + * @return the ContainerGroupProfileProperties object itself. + */ + public ContainerGroupProfileProperties withUseKrypton(Boolean useKrypton) { + this.useKrypton = useKrypton; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (encryptionProperties() != null) { + encryptionProperties().validate(); + } + if (containers() != null) { + containers().forEach(e -> e.validate()); + } + if (initContainers() != null) { + initContainers().forEach(e -> e.validate()); + } + if (extensions() != null) { + extensions().forEach(e -> e.validate()); + } + if (imageRegistryCredentials() != null) { + imageRegistryCredentials().forEach(e -> e.validate()); + } + if (ipAddress() != null) { + ipAddress().validate(); + } + if (volumes() != null) { + volumes().forEach(e -> e.validate()); + } + if (diagnostics() != null) { + diagnostics().validate(); + } + if (confidentialComputeProperties() != null) { + confidentialComputeProperties().validate(); + } + if (securityContext() != null) { + securityContext().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("sku", this.sku == null ? null : this.sku.toString()); + jsonWriter.writeJsonField("encryptionProperties", this.encryptionProperties); + jsonWriter.writeArrayField("containers", this.containers, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("initContainers", this.initContainers, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("extensions", this.extensions, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("imageRegistryCredentials", this.imageRegistryCredentials, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("restartPolicy", this.restartPolicy == null ? null : this.restartPolicy.toString()); + jsonWriter.writeStringField("shutdownGracePeriod", + this.shutdownGracePeriod == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.shutdownGracePeriod)); + jsonWriter.writeJsonField("ipAddress", this.ipAddress); + jsonWriter.writeStringField("timeToLive", + this.timeToLive == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.timeToLive)); + jsonWriter.writeStringField("osType", this.osType == null ? null : this.osType.toString()); + jsonWriter.writeArrayField("volumes", this.volumes, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("diagnostics", this.diagnostics); + jsonWriter.writeStringField("priority", this.priority == null ? null : this.priority.toString()); + jsonWriter.writeJsonField("confidentialComputeProperties", this.confidentialComputeProperties); + jsonWriter.writeJsonField("securityContext", this.securityContext); + jsonWriter.writeNumberField("revision", this.revision); + jsonWriter.writeArrayField("registeredRevisions", this.registeredRevisions, + (writer, element) -> writer.writeLong(element)); + jsonWriter.writeBooleanField("useKrypton", this.useKrypton); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerGroupProfileProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerGroupProfileProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ContainerGroupProfileProperties. + */ + public static ContainerGroupProfileProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerGroupProfileProperties deserializedContainerGroupProfileProperties + = new ContainerGroupProfileProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sku".equals(fieldName)) { + deserializedContainerGroupProfileProperties.sku = ContainerGroupSku.fromString(reader.getString()); + } else if ("encryptionProperties".equals(fieldName)) { + deserializedContainerGroupProfileProperties.encryptionProperties + = EncryptionProperties.fromJson(reader); + } else if ("containers".equals(fieldName)) { + List containers = reader.readArray(reader1 -> Container.fromJson(reader1)); + deserializedContainerGroupProfileProperties.containers = containers; + } else if ("initContainers".equals(fieldName)) { + List initContainers + = reader.readArray(reader1 -> InitContainerDefinition.fromJson(reader1)); + deserializedContainerGroupProfileProperties.initContainers = initContainers; + } else if ("extensions".equals(fieldName)) { + List extensions + = reader.readArray(reader1 -> DeploymentExtensionSpec.fromJson(reader1)); + deserializedContainerGroupProfileProperties.extensions = extensions; + } else if ("imageRegistryCredentials".equals(fieldName)) { + List imageRegistryCredentials + = reader.readArray(reader1 -> ImageRegistryCredential.fromJson(reader1)); + deserializedContainerGroupProfileProperties.imageRegistryCredentials = imageRegistryCredentials; + } else if ("restartPolicy".equals(fieldName)) { + deserializedContainerGroupProfileProperties.restartPolicy + = ContainerGroupRestartPolicy.fromString(reader.getString()); + } else if ("shutdownGracePeriod".equals(fieldName)) { + deserializedContainerGroupProfileProperties.shutdownGracePeriod = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("ipAddress".equals(fieldName)) { + deserializedContainerGroupProfileProperties.ipAddress = IpAddress.fromJson(reader); + } else if ("timeToLive".equals(fieldName)) { + deserializedContainerGroupProfileProperties.timeToLive = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("osType".equals(fieldName)) { + deserializedContainerGroupProfileProperties.osType + = OperatingSystemTypes.fromString(reader.getString()); + } else if ("volumes".equals(fieldName)) { + List volumes = reader.readArray(reader1 -> Volume.fromJson(reader1)); + deserializedContainerGroupProfileProperties.volumes = volumes; + } else if ("diagnostics".equals(fieldName)) { + deserializedContainerGroupProfileProperties.diagnostics + = ContainerGroupDiagnostics.fromJson(reader); + } else if ("priority".equals(fieldName)) { + deserializedContainerGroupProfileProperties.priority + = ContainerGroupPriority.fromString(reader.getString()); + } else if ("confidentialComputeProperties".equals(fieldName)) { + deserializedContainerGroupProfileProperties.confidentialComputeProperties + = ConfidentialComputeProperties.fromJson(reader); + } else if ("securityContext".equals(fieldName)) { + deserializedContainerGroupProfileProperties.securityContext + = SecurityContextDefinition.fromJson(reader); + } else if ("revision".equals(fieldName)) { + deserializedContainerGroupProfileProperties.revision = reader.getNullable(JsonReader::getLong); + } else if ("registeredRevisions".equals(fieldName)) { + List registeredRevisions = reader.readArray(reader1 -> reader1.getLong()); + deserializedContainerGroupProfileProperties.registeredRevisions = registeredRevisions; + } else if ("useKrypton".equals(fieldName)) { + deserializedContainerGroupProfileProperties.useKrypton = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerGroupProfileProperties; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerGroupPropertiesProperties.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerGroupPropertiesProperties.java new file mode 100644 index 000000000000..02b94632e96c --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerGroupPropertiesProperties.java @@ -0,0 +1,685 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerinstance.generated.models.ConfidentialComputeProperties; +import com.azure.resourcemanager.containerinstance.generated.models.Container; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupDiagnostics; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupPriority; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupPropertiesInstanceView; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupRestartPolicy; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupSku; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupSubnetId; +import com.azure.resourcemanager.containerinstance.generated.models.DeploymentExtensionSpec; +import com.azure.resourcemanager.containerinstance.generated.models.DnsConfiguration; +import com.azure.resourcemanager.containerinstance.generated.models.EncryptionProperties; +import com.azure.resourcemanager.containerinstance.generated.models.IdentityAcls; +import com.azure.resourcemanager.containerinstance.generated.models.ImageRegistryCredential; +import com.azure.resourcemanager.containerinstance.generated.models.InitContainerDefinition; +import com.azure.resourcemanager.containerinstance.generated.models.IpAddress; +import com.azure.resourcemanager.containerinstance.generated.models.OperatingSystemTypes; +import com.azure.resourcemanager.containerinstance.generated.models.SecretReference; +import com.azure.resourcemanager.containerinstance.generated.models.Volume; +import java.io.IOException; +import java.util.List; + +/** + * The container group properties. + */ +@Fluent +public final class ContainerGroupPropertiesProperties implements JsonSerializable { + /* + * The provisioning state of the container group. This only appears in the response. + */ + private String provisioningState; + + /* + * The secret references that will be referenced within the container group. + */ + private List secretReferences; + + /* + * The containers within the container group. + */ + private List containers; + + /* + * The image registry credentials by which the container group is created from. + */ + private List imageRegistryCredentials; + + /* + * Restart policy for all containers within the container group. + * - `Always` Always restart + * - `OnFailure` Restart on failure + * - `Never` Never restart + */ + private ContainerGroupRestartPolicy restartPolicy; + + /* + * The IP address type of the container group. + */ + private IpAddress ipAddress; + + /* + * The operating system type required by the containers in the container group. + */ + private OperatingSystemTypes osType; + + /* + * The list of volumes that can be mounted by containers in this container group. + */ + private List volumes; + + /* + * The instance view of the container group. Only valid in response. + */ + private ContainerGroupPropertiesInstanceView instanceView; + + /* + * The diagnostic information for a container group. + */ + private ContainerGroupDiagnostics diagnostics; + + /* + * The subnet resource IDs for a container group. + */ + private List subnetIds; + + /* + * The DNS config information for a container group. + */ + private DnsConfiguration dnsConfig; + + /* + * The SKU for a container group. + */ + private ContainerGroupSku sku; + + /* + * The encryption properties for a container group. + */ + private EncryptionProperties encryptionProperties; + + /* + * The init containers for a container group. + */ + private List initContainers; + + /* + * extensions used by virtual kubelet + */ + private List extensions; + + /* + * The properties for confidential container group + */ + private ConfidentialComputeProperties confidentialComputeProperties; + + /* + * The priority of the container group. + */ + private ContainerGroupPriority priority; + + /* + * The access control levels of the identities. + */ + private IdentityAcls identityAcls; + + /** + * Creates an instance of ContainerGroupPropertiesProperties class. + */ + public ContainerGroupPropertiesProperties() { + } + + /** + * Get the provisioningState property: The provisioning state of the container group. This only appears in the + * response. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the secretReferences property: The secret references that will be referenced within the container group. + * + * @return the secretReferences value. + */ + public List secretReferences() { + return this.secretReferences; + } + + /** + * Set the secretReferences property: The secret references that will be referenced within the container group. + * + * @param secretReferences the secretReferences value to set. + * @return the ContainerGroupPropertiesProperties object itself. + */ + public ContainerGroupPropertiesProperties withSecretReferences(List secretReferences) { + this.secretReferences = secretReferences; + return this; + } + + /** + * Get the containers property: The containers within the container group. + * + * @return the containers value. + */ + public List containers() { + return this.containers; + } + + /** + * Set the containers property: The containers within the container group. + * + * @param containers the containers value to set. + * @return the ContainerGroupPropertiesProperties object itself. + */ + public ContainerGroupPropertiesProperties withContainers(List containers) { + this.containers = containers; + return this; + } + + /** + * Get the imageRegistryCredentials property: The image registry credentials by which the container group is created + * from. + * + * @return the imageRegistryCredentials value. + */ + public List imageRegistryCredentials() { + return this.imageRegistryCredentials; + } + + /** + * Set the imageRegistryCredentials property: The image registry credentials by which the container group is created + * from. + * + * @param imageRegistryCredentials the imageRegistryCredentials value to set. + * @return the ContainerGroupPropertiesProperties object itself. + */ + public ContainerGroupPropertiesProperties + withImageRegistryCredentials(List imageRegistryCredentials) { + this.imageRegistryCredentials = imageRegistryCredentials; + return this; + } + + /** + * Get the restartPolicy property: Restart policy for all containers within the container group. + * - `Always` Always restart + * - `OnFailure` Restart on failure + * - `Never` Never restart. + * + * @return the restartPolicy value. + */ + public ContainerGroupRestartPolicy restartPolicy() { + return this.restartPolicy; + } + + /** + * Set the restartPolicy property: Restart policy for all containers within the container group. + * - `Always` Always restart + * - `OnFailure` Restart on failure + * - `Never` Never restart. + * + * @param restartPolicy the restartPolicy value to set. + * @return the ContainerGroupPropertiesProperties object itself. + */ + public ContainerGroupPropertiesProperties withRestartPolicy(ContainerGroupRestartPolicy restartPolicy) { + this.restartPolicy = restartPolicy; + return this; + } + + /** + * Get the ipAddress property: The IP address type of the container group. + * + * @return the ipAddress value. + */ + public IpAddress ipAddress() { + return this.ipAddress; + } + + /** + * Set the ipAddress property: The IP address type of the container group. + * + * @param ipAddress the ipAddress value to set. + * @return the ContainerGroupPropertiesProperties object itself. + */ + public ContainerGroupPropertiesProperties withIpAddress(IpAddress ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + * Get the osType property: The operating system type required by the containers in the container group. + * + * @return the osType value. + */ + public OperatingSystemTypes osType() { + return this.osType; + } + + /** + * Set the osType property: The operating system type required by the containers in the container group. + * + * @param osType the osType value to set. + * @return the ContainerGroupPropertiesProperties object itself. + */ + public ContainerGroupPropertiesProperties withOsType(OperatingSystemTypes osType) { + this.osType = osType; + return this; + } + + /** + * Get the volumes property: The list of volumes that can be mounted by containers in this container group. + * + * @return the volumes value. + */ + public List volumes() { + return this.volumes; + } + + /** + * Set the volumes property: The list of volumes that can be mounted by containers in this container group. + * + * @param volumes the volumes value to set. + * @return the ContainerGroupPropertiesProperties object itself. + */ + public ContainerGroupPropertiesProperties withVolumes(List volumes) { + this.volumes = volumes; + return this; + } + + /** + * Get the instanceView property: The instance view of the container group. Only valid in response. + * + * @return the instanceView value. + */ + public ContainerGroupPropertiesInstanceView instanceView() { + return this.instanceView; + } + + /** + * Get the diagnostics property: The diagnostic information for a container group. + * + * @return the diagnostics value. + */ + public ContainerGroupDiagnostics diagnostics() { + return this.diagnostics; + } + + /** + * Set the diagnostics property: The diagnostic information for a container group. + * + * @param diagnostics the diagnostics value to set. + * @return the ContainerGroupPropertiesProperties object itself. + */ + public ContainerGroupPropertiesProperties withDiagnostics(ContainerGroupDiagnostics diagnostics) { + this.diagnostics = diagnostics; + return this; + } + + /** + * Get the subnetIds property: The subnet resource IDs for a container group. + * + * @return the subnetIds value. + */ + public List subnetIds() { + return this.subnetIds; + } + + /** + * Set the subnetIds property: The subnet resource IDs for a container group. + * + * @param subnetIds the subnetIds value to set. + * @return the ContainerGroupPropertiesProperties object itself. + */ + public ContainerGroupPropertiesProperties withSubnetIds(List subnetIds) { + this.subnetIds = subnetIds; + return this; + } + + /** + * Get the dnsConfig property: The DNS config information for a container group. + * + * @return the dnsConfig value. + */ + public DnsConfiguration dnsConfig() { + return this.dnsConfig; + } + + /** + * Set the dnsConfig property: The DNS config information for a container group. + * + * @param dnsConfig the dnsConfig value to set. + * @return the ContainerGroupPropertiesProperties object itself. + */ + public ContainerGroupPropertiesProperties withDnsConfig(DnsConfiguration dnsConfig) { + this.dnsConfig = dnsConfig; + return this; + } + + /** + * Get the sku property: The SKU for a container group. + * + * @return the sku value. + */ + public ContainerGroupSku sku() { + return this.sku; + } + + /** + * Set the sku property: The SKU for a container group. + * + * @param sku the sku value to set. + * @return the ContainerGroupPropertiesProperties object itself. + */ + public ContainerGroupPropertiesProperties withSku(ContainerGroupSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the encryptionProperties property: The encryption properties for a container group. + * + * @return the encryptionProperties value. + */ + public EncryptionProperties encryptionProperties() { + return this.encryptionProperties; + } + + /** + * Set the encryptionProperties property: The encryption properties for a container group. + * + * @param encryptionProperties the encryptionProperties value to set. + * @return the ContainerGroupPropertiesProperties object itself. + */ + public ContainerGroupPropertiesProperties withEncryptionProperties(EncryptionProperties encryptionProperties) { + this.encryptionProperties = encryptionProperties; + return this; + } + + /** + * Get the initContainers property: The init containers for a container group. + * + * @return the initContainers value. + */ + public List initContainers() { + return this.initContainers; + } + + /** + * Set the initContainers property: The init containers for a container group. + * + * @param initContainers the initContainers value to set. + * @return the ContainerGroupPropertiesProperties object itself. + */ + public ContainerGroupPropertiesProperties withInitContainers(List initContainers) { + this.initContainers = initContainers; + return this; + } + + /** + * Get the extensions property: extensions used by virtual kubelet. + * + * @return the extensions value. + */ + public List extensions() { + return this.extensions; + } + + /** + * Set the extensions property: extensions used by virtual kubelet. + * + * @param extensions the extensions value to set. + * @return the ContainerGroupPropertiesProperties object itself. + */ + public ContainerGroupPropertiesProperties withExtensions(List extensions) { + this.extensions = extensions; + return this; + } + + /** + * Get the confidentialComputeProperties property: The properties for confidential container group. + * + * @return the confidentialComputeProperties value. + */ + public ConfidentialComputeProperties confidentialComputeProperties() { + return this.confidentialComputeProperties; + } + + /** + * Set the confidentialComputeProperties property: The properties for confidential container group. + * + * @param confidentialComputeProperties the confidentialComputeProperties value to set. + * @return the ContainerGroupPropertiesProperties object itself. + */ + public ContainerGroupPropertiesProperties + withConfidentialComputeProperties(ConfidentialComputeProperties confidentialComputeProperties) { + this.confidentialComputeProperties = confidentialComputeProperties; + return this; + } + + /** + * Get the priority property: The priority of the container group. + * + * @return the priority value. + */ + public ContainerGroupPriority priority() { + return this.priority; + } + + /** + * Set the priority property: The priority of the container group. + * + * @param priority the priority value to set. + * @return the ContainerGroupPropertiesProperties object itself. + */ + public ContainerGroupPropertiesProperties withPriority(ContainerGroupPriority priority) { + this.priority = priority; + return this; + } + + /** + * Get the identityAcls property: The access control levels of the identities. + * + * @return the identityAcls value. + */ + public IdentityAcls identityAcls() { + return this.identityAcls; + } + + /** + * Set the identityAcls property: The access control levels of the identities. + * + * @param identityAcls the identityAcls value to set. + * @return the ContainerGroupPropertiesProperties object itself. + */ + public ContainerGroupPropertiesProperties withIdentityAcls(IdentityAcls identityAcls) { + this.identityAcls = identityAcls; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (secretReferences() != null) { + secretReferences().forEach(e -> e.validate()); + } + if (containers() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property containers in model ContainerGroupPropertiesProperties")); + } else { + containers().forEach(e -> e.validate()); + } + if (imageRegistryCredentials() != null) { + imageRegistryCredentials().forEach(e -> e.validate()); + } + if (ipAddress() != null) { + ipAddress().validate(); + } + if (osType() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property osType in model ContainerGroupPropertiesProperties")); + } + if (volumes() != null) { + volumes().forEach(e -> e.validate()); + } + if (instanceView() != null) { + instanceView().validate(); + } + if (diagnostics() != null) { + diagnostics().validate(); + } + if (subnetIds() != null) { + subnetIds().forEach(e -> e.validate()); + } + if (dnsConfig() != null) { + dnsConfig().validate(); + } + if (encryptionProperties() != null) { + encryptionProperties().validate(); + } + if (initContainers() != null) { + initContainers().forEach(e -> e.validate()); + } + if (extensions() != null) { + extensions().forEach(e -> e.validate()); + } + if (confidentialComputeProperties() != null) { + confidentialComputeProperties().validate(); + } + if (identityAcls() != null) { + identityAcls().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ContainerGroupPropertiesProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("containers", this.containers, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("osType", this.osType == null ? null : this.osType.toString()); + jsonWriter.writeArrayField("secretReferences", this.secretReferences, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("imageRegistryCredentials", this.imageRegistryCredentials, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("restartPolicy", this.restartPolicy == null ? null : this.restartPolicy.toString()); + jsonWriter.writeJsonField("ipAddress", this.ipAddress); + jsonWriter.writeArrayField("volumes", this.volumes, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("diagnostics", this.diagnostics); + jsonWriter.writeArrayField("subnetIds", this.subnetIds, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("dnsConfig", this.dnsConfig); + jsonWriter.writeStringField("sku", this.sku == null ? null : this.sku.toString()); + jsonWriter.writeJsonField("encryptionProperties", this.encryptionProperties); + jsonWriter.writeArrayField("initContainers", this.initContainers, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("extensions", this.extensions, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("confidentialComputeProperties", this.confidentialComputeProperties); + jsonWriter.writeStringField("priority", this.priority == null ? null : this.priority.toString()); + jsonWriter.writeJsonField("identityAcls", this.identityAcls); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerGroupPropertiesProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerGroupPropertiesProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ContainerGroupPropertiesProperties. + */ + public static ContainerGroupPropertiesProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerGroupPropertiesProperties deserializedContainerGroupPropertiesProperties + = new ContainerGroupPropertiesProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("containers".equals(fieldName)) { + List containers = reader.readArray(reader1 -> Container.fromJson(reader1)); + deserializedContainerGroupPropertiesProperties.containers = containers; + } else if ("osType".equals(fieldName)) { + deserializedContainerGroupPropertiesProperties.osType + = OperatingSystemTypes.fromString(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedContainerGroupPropertiesProperties.provisioningState = reader.getString(); + } else if ("secretReferences".equals(fieldName)) { + List secretReferences + = reader.readArray(reader1 -> SecretReference.fromJson(reader1)); + deserializedContainerGroupPropertiesProperties.secretReferences = secretReferences; + } else if ("imageRegistryCredentials".equals(fieldName)) { + List imageRegistryCredentials + = reader.readArray(reader1 -> ImageRegistryCredential.fromJson(reader1)); + deserializedContainerGroupPropertiesProperties.imageRegistryCredentials = imageRegistryCredentials; + } else if ("restartPolicy".equals(fieldName)) { + deserializedContainerGroupPropertiesProperties.restartPolicy + = ContainerGroupRestartPolicy.fromString(reader.getString()); + } else if ("ipAddress".equals(fieldName)) { + deserializedContainerGroupPropertiesProperties.ipAddress = IpAddress.fromJson(reader); + } else if ("volumes".equals(fieldName)) { + List volumes = reader.readArray(reader1 -> Volume.fromJson(reader1)); + deserializedContainerGroupPropertiesProperties.volumes = volumes; + } else if ("instanceView".equals(fieldName)) { + deserializedContainerGroupPropertiesProperties.instanceView + = ContainerGroupPropertiesInstanceView.fromJson(reader); + } else if ("diagnostics".equals(fieldName)) { + deserializedContainerGroupPropertiesProperties.diagnostics + = ContainerGroupDiagnostics.fromJson(reader); + } else if ("subnetIds".equals(fieldName)) { + List subnetIds + = reader.readArray(reader1 -> ContainerGroupSubnetId.fromJson(reader1)); + deserializedContainerGroupPropertiesProperties.subnetIds = subnetIds; + } else if ("dnsConfig".equals(fieldName)) { + deserializedContainerGroupPropertiesProperties.dnsConfig = DnsConfiguration.fromJson(reader); + } else if ("sku".equals(fieldName)) { + deserializedContainerGroupPropertiesProperties.sku + = ContainerGroupSku.fromString(reader.getString()); + } else if ("encryptionProperties".equals(fieldName)) { + deserializedContainerGroupPropertiesProperties.encryptionProperties + = EncryptionProperties.fromJson(reader); + } else if ("initContainers".equals(fieldName)) { + List initContainers + = reader.readArray(reader1 -> InitContainerDefinition.fromJson(reader1)); + deserializedContainerGroupPropertiesProperties.initContainers = initContainers; + } else if ("extensions".equals(fieldName)) { + List extensions + = reader.readArray(reader1 -> DeploymentExtensionSpec.fromJson(reader1)); + deserializedContainerGroupPropertiesProperties.extensions = extensions; + } else if ("confidentialComputeProperties".equals(fieldName)) { + deserializedContainerGroupPropertiesProperties.confidentialComputeProperties + = ConfidentialComputeProperties.fromJson(reader); + } else if ("priority".equals(fieldName)) { + deserializedContainerGroupPropertiesProperties.priority + = ContainerGroupPriority.fromString(reader.getString()); + } else if ("identityAcls".equals(fieldName)) { + deserializedContainerGroupPropertiesProperties.identityAcls = IdentityAcls.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerGroupPropertiesProperties; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerProperties.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerProperties.java new file mode 100644 index 000000000000..e29fb122bb6a --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerProperties.java @@ -0,0 +1,382 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerPort; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerProbe; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerPropertiesInstanceView; +import com.azure.resourcemanager.containerinstance.generated.models.EnvironmentVariable; +import com.azure.resourcemanager.containerinstance.generated.models.ResourceRequirements; +import com.azure.resourcemanager.containerinstance.generated.models.SecurityContextDefinition; +import com.azure.resourcemanager.containerinstance.generated.models.VolumeMount; +import java.io.IOException; +import java.util.List; + +/** + * The container instance properties. + */ +@Fluent +public final class ContainerProperties implements JsonSerializable { + /* + * The name of the image used to create the container instance. + */ + private String image; + + /* + * The commands to execute within the container instance in exec form. + */ + private List command; + + /* + * The exposed ports on the container instance. + */ + private List ports; + + /* + * The environment variables to set in the container instance. + */ + private List environmentVariables; + + /* + * The instance view of the container instance. Only valid in response. + */ + private ContainerPropertiesInstanceView instanceView; + + /* + * The resource requirements of the container instance. + */ + private ResourceRequirements resources; + + /* + * The volume mounts available to the container instance. + */ + private List volumeMounts; + + /* + * The liveness probe. + */ + private ContainerProbe livenessProbe; + + /* + * The readiness probe. + */ + private ContainerProbe readinessProbe; + + /* + * The container security properties. + */ + private SecurityContextDefinition securityContext; + + /** + * Creates an instance of ContainerProperties class. + */ + public ContainerProperties() { + } + + /** + * Get the image property: The name of the image used to create the container instance. + * + * @return the image value. + */ + public String image() { + return this.image; + } + + /** + * Set the image property: The name of the image used to create the container instance. + * + * @param image the image value to set. + * @return the ContainerProperties object itself. + */ + public ContainerProperties withImage(String image) { + this.image = image; + return this; + } + + /** + * Get the command property: The commands to execute within the container instance in exec form. + * + * @return the command value. + */ + public List command() { + return this.command; + } + + /** + * Set the command property: The commands to execute within the container instance in exec form. + * + * @param command the command value to set. + * @return the ContainerProperties object itself. + */ + public ContainerProperties withCommand(List command) { + this.command = command; + return this; + } + + /** + * Get the ports property: The exposed ports on the container instance. + * + * @return the ports value. + */ + public List ports() { + return this.ports; + } + + /** + * Set the ports property: The exposed ports on the container instance. + * + * @param ports the ports value to set. + * @return the ContainerProperties object itself. + */ + public ContainerProperties withPorts(List ports) { + this.ports = ports; + return this; + } + + /** + * Get the environmentVariables property: The environment variables to set in the container instance. + * + * @return the environmentVariables value. + */ + public List environmentVariables() { + return this.environmentVariables; + } + + /** + * Set the environmentVariables property: The environment variables to set in the container instance. + * + * @param environmentVariables the environmentVariables value to set. + * @return the ContainerProperties object itself. + */ + public ContainerProperties withEnvironmentVariables(List environmentVariables) { + this.environmentVariables = environmentVariables; + return this; + } + + /** + * Get the instanceView property: The instance view of the container instance. Only valid in response. + * + * @return the instanceView value. + */ + public ContainerPropertiesInstanceView instanceView() { + return this.instanceView; + } + + /** + * Get the resources property: The resource requirements of the container instance. + * + * @return the resources value. + */ + public ResourceRequirements resources() { + return this.resources; + } + + /** + * Set the resources property: The resource requirements of the container instance. + * + * @param resources the resources value to set. + * @return the ContainerProperties object itself. + */ + public ContainerProperties withResources(ResourceRequirements resources) { + this.resources = resources; + return this; + } + + /** + * Get the volumeMounts property: The volume mounts available to the container instance. + * + * @return the volumeMounts value. + */ + public List volumeMounts() { + return this.volumeMounts; + } + + /** + * Set the volumeMounts property: The volume mounts available to the container instance. + * + * @param volumeMounts the volumeMounts value to set. + * @return the ContainerProperties object itself. + */ + public ContainerProperties withVolumeMounts(List volumeMounts) { + this.volumeMounts = volumeMounts; + return this; + } + + /** + * Get the livenessProbe property: The liveness probe. + * + * @return the livenessProbe value. + */ + public ContainerProbe livenessProbe() { + return this.livenessProbe; + } + + /** + * Set the livenessProbe property: The liveness probe. + * + * @param livenessProbe the livenessProbe value to set. + * @return the ContainerProperties object itself. + */ + public ContainerProperties withLivenessProbe(ContainerProbe livenessProbe) { + this.livenessProbe = livenessProbe; + return this; + } + + /** + * Get the readinessProbe property: The readiness probe. + * + * @return the readinessProbe value. + */ + public ContainerProbe readinessProbe() { + return this.readinessProbe; + } + + /** + * Set the readinessProbe property: The readiness probe. + * + * @param readinessProbe the readinessProbe value to set. + * @return the ContainerProperties object itself. + */ + public ContainerProperties withReadinessProbe(ContainerProbe readinessProbe) { + this.readinessProbe = readinessProbe; + return this; + } + + /** + * Get the securityContext property: The container security properties. + * + * @return the securityContext value. + */ + public SecurityContextDefinition securityContext() { + return this.securityContext; + } + + /** + * Set the securityContext property: The container security properties. + * + * @param securityContext the securityContext value to set. + * @return the ContainerProperties object itself. + */ + public ContainerProperties withSecurityContext(SecurityContextDefinition securityContext) { + this.securityContext = securityContext; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (image() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property image in model ContainerProperties")); + } + if (ports() != null) { + ports().forEach(e -> e.validate()); + } + if (environmentVariables() != null) { + environmentVariables().forEach(e -> e.validate()); + } + if (instanceView() != null) { + instanceView().validate(); + } + if (resources() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property resources in model ContainerProperties")); + } else { + resources().validate(); + } + if (volumeMounts() != null) { + volumeMounts().forEach(e -> e.validate()); + } + if (livenessProbe() != null) { + livenessProbe().validate(); + } + if (readinessProbe() != null) { + readinessProbe().validate(); + } + if (securityContext() != null) { + securityContext().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ContainerProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("image", this.image); + jsonWriter.writeJsonField("resources", this.resources); + jsonWriter.writeArrayField("command", this.command, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("ports", this.ports, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("environmentVariables", this.environmentVariables, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("volumeMounts", this.volumeMounts, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("livenessProbe", this.livenessProbe); + jsonWriter.writeJsonField("readinessProbe", this.readinessProbe); + jsonWriter.writeJsonField("securityContext", this.securityContext); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ContainerProperties. + */ + public static ContainerProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerProperties deserializedContainerProperties = new ContainerProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("image".equals(fieldName)) { + deserializedContainerProperties.image = reader.getString(); + } else if ("resources".equals(fieldName)) { + deserializedContainerProperties.resources = ResourceRequirements.fromJson(reader); + } else if ("command".equals(fieldName)) { + List command = reader.readArray(reader1 -> reader1.getString()); + deserializedContainerProperties.command = command; + } else if ("ports".equals(fieldName)) { + List ports = reader.readArray(reader1 -> ContainerPort.fromJson(reader1)); + deserializedContainerProperties.ports = ports; + } else if ("environmentVariables".equals(fieldName)) { + List environmentVariables + = reader.readArray(reader1 -> EnvironmentVariable.fromJson(reader1)); + deserializedContainerProperties.environmentVariables = environmentVariables; + } else if ("instanceView".equals(fieldName)) { + deserializedContainerProperties.instanceView = ContainerPropertiesInstanceView.fromJson(reader); + } else if ("volumeMounts".equals(fieldName)) { + List volumeMounts = reader.readArray(reader1 -> VolumeMount.fromJson(reader1)); + deserializedContainerProperties.volumeMounts = volumeMounts; + } else if ("livenessProbe".equals(fieldName)) { + deserializedContainerProperties.livenessProbe = ContainerProbe.fromJson(reader); + } else if ("readinessProbe".equals(fieldName)) { + deserializedContainerProperties.readinessProbe = ContainerProbe.fromJson(reader); + } else if ("securityContext".equals(fieldName)) { + deserializedContainerProperties.securityContext = SecurityContextDefinition.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerProperties; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/DeploymentExtensionSpecProperties.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/DeploymentExtensionSpecProperties.java new file mode 100644 index 000000000000..6f6ed928a74b --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/DeploymentExtensionSpecProperties.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Extension specific properties. + */ +@Fluent +public final class DeploymentExtensionSpecProperties implements JsonSerializable { + /* + * Type of extension to be added. + */ + private String extensionType; + + /* + * Version of the extension being used. + */ + private String version; + + /* + * Settings for the extension. + */ + private Object settings; + + /* + * Protected settings for the extension. + */ + private Object protectedSettings; + + /** + * Creates an instance of DeploymentExtensionSpecProperties class. + */ + public DeploymentExtensionSpecProperties() { + } + + /** + * Get the extensionType property: Type of extension to be added. + * + * @return the extensionType value. + */ + public String extensionType() { + return this.extensionType; + } + + /** + * Set the extensionType property: Type of extension to be added. + * + * @param extensionType the extensionType value to set. + * @return the DeploymentExtensionSpecProperties object itself. + */ + public DeploymentExtensionSpecProperties withExtensionType(String extensionType) { + this.extensionType = extensionType; + return this; + } + + /** + * Get the version property: Version of the extension being used. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: Version of the extension being used. + * + * @param version the version value to set. + * @return the DeploymentExtensionSpecProperties object itself. + */ + public DeploymentExtensionSpecProperties withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get the settings property: Settings for the extension. + * + * @return the settings value. + */ + public Object settings() { + return this.settings; + } + + /** + * Set the settings property: Settings for the extension. + * + * @param settings the settings value to set. + * @return the DeploymentExtensionSpecProperties object itself. + */ + public DeploymentExtensionSpecProperties withSettings(Object settings) { + this.settings = settings; + return this; + } + + /** + * Get the protectedSettings property: Protected settings for the extension. + * + * @return the protectedSettings value. + */ + public Object protectedSettings() { + return this.protectedSettings; + } + + /** + * Set the protectedSettings property: Protected settings for the extension. + * + * @param protectedSettings the protectedSettings value to set. + * @return the DeploymentExtensionSpecProperties object itself. + */ + public DeploymentExtensionSpecProperties withProtectedSettings(Object protectedSettings) { + this.protectedSettings = protectedSettings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (extensionType() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property extensionType in model DeploymentExtensionSpecProperties")); + } + if (version() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property version in model DeploymentExtensionSpecProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeploymentExtensionSpecProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("extensionType", this.extensionType); + jsonWriter.writeStringField("version", this.version); + jsonWriter.writeUntypedField("settings", this.settings); + jsonWriter.writeUntypedField("protectedSettings", this.protectedSettings); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeploymentExtensionSpecProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeploymentExtensionSpecProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DeploymentExtensionSpecProperties. + */ + public static DeploymentExtensionSpecProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeploymentExtensionSpecProperties deserializedDeploymentExtensionSpecProperties + = new DeploymentExtensionSpecProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("extensionType".equals(fieldName)) { + deserializedDeploymentExtensionSpecProperties.extensionType = reader.getString(); + } else if ("version".equals(fieldName)) { + deserializedDeploymentExtensionSpecProperties.version = reader.getString(); + } else if ("settings".equals(fieldName)) { + deserializedDeploymentExtensionSpecProperties.settings = reader.readUntyped(); + } else if ("protectedSettings".equals(fieldName)) { + deserializedDeploymentExtensionSpecProperties.protectedSettings = reader.readUntyped(); + } else { + reader.skipChildren(); + } + } + + return deserializedDeploymentExtensionSpecProperties; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/InitContainerPropertiesDefinition.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/InitContainerPropertiesDefinition.java new file mode 100644 index 000000000000..f39379308167 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/InitContainerPropertiesDefinition.java @@ -0,0 +1,246 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerinstance.generated.models.EnvironmentVariable; +import com.azure.resourcemanager.containerinstance.generated.models.InitContainerPropertiesDefinitionInstanceView; +import com.azure.resourcemanager.containerinstance.generated.models.SecurityContextDefinition; +import com.azure.resourcemanager.containerinstance.generated.models.VolumeMount; +import java.io.IOException; +import java.util.List; + +/** + * The init container definition properties. + */ +@Fluent +public final class InitContainerPropertiesDefinition implements JsonSerializable { + /* + * The image of the init container. + */ + private String image; + + /* + * The command to execute within the init container in exec form. + */ + private List command; + + /* + * The environment variables to set in the init container. + */ + private List environmentVariables; + + /* + * The instance view of the init container. Only valid in response. + */ + private InitContainerPropertiesDefinitionInstanceView instanceView; + + /* + * The volume mounts available to the init container. + */ + private List volumeMounts; + + /* + * The container security properties. + */ + private SecurityContextDefinition securityContext; + + /** + * Creates an instance of InitContainerPropertiesDefinition class. + */ + public InitContainerPropertiesDefinition() { + } + + /** + * Get the image property: The image of the init container. + * + * @return the image value. + */ + public String image() { + return this.image; + } + + /** + * Set the image property: The image of the init container. + * + * @param image the image value to set. + * @return the InitContainerPropertiesDefinition object itself. + */ + public InitContainerPropertiesDefinition withImage(String image) { + this.image = image; + return this; + } + + /** + * Get the command property: The command to execute within the init container in exec form. + * + * @return the command value. + */ + public List command() { + return this.command; + } + + /** + * Set the command property: The command to execute within the init container in exec form. + * + * @param command the command value to set. + * @return the InitContainerPropertiesDefinition object itself. + */ + public InitContainerPropertiesDefinition withCommand(List command) { + this.command = command; + return this; + } + + /** + * Get the environmentVariables property: The environment variables to set in the init container. + * + * @return the environmentVariables value. + */ + public List environmentVariables() { + return this.environmentVariables; + } + + /** + * Set the environmentVariables property: The environment variables to set in the init container. + * + * @param environmentVariables the environmentVariables value to set. + * @return the InitContainerPropertiesDefinition object itself. + */ + public InitContainerPropertiesDefinition withEnvironmentVariables(List environmentVariables) { + this.environmentVariables = environmentVariables; + return this; + } + + /** + * Get the instanceView property: The instance view of the init container. Only valid in response. + * + * @return the instanceView value. + */ + public InitContainerPropertiesDefinitionInstanceView instanceView() { + return this.instanceView; + } + + /** + * Get the volumeMounts property: The volume mounts available to the init container. + * + * @return the volumeMounts value. + */ + public List volumeMounts() { + return this.volumeMounts; + } + + /** + * Set the volumeMounts property: The volume mounts available to the init container. + * + * @param volumeMounts the volumeMounts value to set. + * @return the InitContainerPropertiesDefinition object itself. + */ + public InitContainerPropertiesDefinition withVolumeMounts(List volumeMounts) { + this.volumeMounts = volumeMounts; + return this; + } + + /** + * Get the securityContext property: The container security properties. + * + * @return the securityContext value. + */ + public SecurityContextDefinition securityContext() { + return this.securityContext; + } + + /** + * Set the securityContext property: The container security properties. + * + * @param securityContext the securityContext value to set. + * @return the InitContainerPropertiesDefinition object itself. + */ + public InitContainerPropertiesDefinition withSecurityContext(SecurityContextDefinition securityContext) { + this.securityContext = securityContext; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (environmentVariables() != null) { + environmentVariables().forEach(e -> e.validate()); + } + if (instanceView() != null) { + instanceView().validate(); + } + if (volumeMounts() != null) { + volumeMounts().forEach(e -> e.validate()); + } + if (securityContext() != null) { + securityContext().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("image", this.image); + jsonWriter.writeArrayField("command", this.command, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("environmentVariables", this.environmentVariables, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("volumeMounts", this.volumeMounts, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("securityContext", this.securityContext); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InitContainerPropertiesDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InitContainerPropertiesDefinition if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the InitContainerPropertiesDefinition. + */ + public static InitContainerPropertiesDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InitContainerPropertiesDefinition deserializedInitContainerPropertiesDefinition + = new InitContainerPropertiesDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("image".equals(fieldName)) { + deserializedInitContainerPropertiesDefinition.image = reader.getString(); + } else if ("command".equals(fieldName)) { + List command = reader.readArray(reader1 -> reader1.getString()); + deserializedInitContainerPropertiesDefinition.command = command; + } else if ("environmentVariables".equals(fieldName)) { + List environmentVariables + = reader.readArray(reader1 -> EnvironmentVariable.fromJson(reader1)); + deserializedInitContainerPropertiesDefinition.environmentVariables = environmentVariables; + } else if ("instanceView".equals(fieldName)) { + deserializedInitContainerPropertiesDefinition.instanceView + = InitContainerPropertiesDefinitionInstanceView.fromJson(reader); + } else if ("volumeMounts".equals(fieldName)) { + List volumeMounts = reader.readArray(reader1 -> VolumeMount.fromJson(reader1)); + deserializedInitContainerPropertiesDefinition.volumeMounts = volumeMounts; + } else if ("securityContext".equals(fieldName)) { + deserializedInitContainerPropertiesDefinition.securityContext + = SecurityContextDefinition.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedInitContainerPropertiesDefinition; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ListResultContainerGroupInner.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ListResultContainerGroupInner.java new file mode 100644 index 000000000000..46a3cf81e7c4 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ListResultContainerGroupInner.java @@ -0,0 +1,664 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerinstance.generated.models.ConfidentialComputeProperties; +import com.azure.resourcemanager.containerinstance.generated.models.Container; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupDiagnostics; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupIdentity; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupPriority; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupProvisioningState; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupRestartPolicy; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupSku; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupSubnetId; +import com.azure.resourcemanager.containerinstance.generated.models.DeploymentExtensionSpec; +import com.azure.resourcemanager.containerinstance.generated.models.DnsConfiguration; +import com.azure.resourcemanager.containerinstance.generated.models.EncryptionProperties; +import com.azure.resourcemanager.containerinstance.generated.models.IdentityAcls; +import com.azure.resourcemanager.containerinstance.generated.models.ImageRegistryCredential; +import com.azure.resourcemanager.containerinstance.generated.models.InitContainerDefinition; +import com.azure.resourcemanager.containerinstance.generated.models.IpAddress; +import com.azure.resourcemanager.containerinstance.generated.models.OperatingSystemTypes; +import com.azure.resourcemanager.containerinstance.generated.models.SecretReference; +import com.azure.resourcemanager.containerinstance.generated.models.Volume; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * A container group part of the list result. + */ +@Fluent +public final class ListResultContainerGroupInner extends Resource { + /* + * The zones for the container group. + */ + private List zones; + + /* + * The identity of the container group, if configured. + */ + private ContainerGroupIdentity identity; + + /* + * The container group properties + */ + private ListResultContainerGroupPropertiesProperties innerProperties + = new ListResultContainerGroupPropertiesProperties(); + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ListResultContainerGroupInner class. + */ + public ListResultContainerGroupInner() { + } + + /** + * Get the zones property: The zones for the container group. + * + * @return the zones value. + */ + public List zones() { + return this.zones; + } + + /** + * Set the zones property: The zones for the container group. + * + * @param zones the zones value to set. + * @return the ListResultContainerGroupInner object itself. + */ + public ListResultContainerGroupInner withZones(List zones) { + this.zones = zones; + return this; + } + + /** + * Get the identity property: The identity of the container group, if configured. + * + * @return the identity value. + */ + public ContainerGroupIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The identity of the container group, if configured. + * + * @param identity the identity value to set. + * @return the ListResultContainerGroupInner object itself. + */ + public ListResultContainerGroupInner withIdentity(ContainerGroupIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the innerProperties property: The container group properties. + * + * @return the innerProperties value. + */ + private ListResultContainerGroupPropertiesProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public ListResultContainerGroupInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ListResultContainerGroupInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the container group. This only appears in the + * response. + * + * @return the provisioningState value. + */ + public ContainerGroupProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the secretReferences property: The secret references that will be referenced within the container group. + * + * @return the secretReferences value. + */ + public List secretReferences() { + return this.innerProperties() == null ? null : this.innerProperties().secretReferences(); + } + + /** + * Set the secretReferences property: The secret references that will be referenced within the container group. + * + * @param secretReferences the secretReferences value to set. + * @return the ListResultContainerGroupInner object itself. + */ + public ListResultContainerGroupInner withSecretReferences(List secretReferences) { + if (this.innerProperties() == null) { + this.innerProperties = new ListResultContainerGroupPropertiesProperties(); + } + this.innerProperties().withSecretReferences(secretReferences); + return this; + } + + /** + * Get the containers property: The containers within the container group. + * + * @return the containers value. + */ + public List containers() { + return this.innerProperties() == null ? null : this.innerProperties().containers(); + } + + /** + * Set the containers property: The containers within the container group. + * + * @param containers the containers value to set. + * @return the ListResultContainerGroupInner object itself. + */ + public ListResultContainerGroupInner withContainers(List containers) { + if (this.innerProperties() == null) { + this.innerProperties = new ListResultContainerGroupPropertiesProperties(); + } + this.innerProperties().withContainers(containers); + return this; + } + + /** + * Get the imageRegistryCredentials property: The image registry credentials by which the container group is created + * from. + * + * @return the imageRegistryCredentials value. + */ + public List imageRegistryCredentials() { + return this.innerProperties() == null ? null : this.innerProperties().imageRegistryCredentials(); + } + + /** + * Set the imageRegistryCredentials property: The image registry credentials by which the container group is created + * from. + * + * @param imageRegistryCredentials the imageRegistryCredentials value to set. + * @return the ListResultContainerGroupInner object itself. + */ + public ListResultContainerGroupInner + withImageRegistryCredentials(List imageRegistryCredentials) { + if (this.innerProperties() == null) { + this.innerProperties = new ListResultContainerGroupPropertiesProperties(); + } + this.innerProperties().withImageRegistryCredentials(imageRegistryCredentials); + return this; + } + + /** + * Get the restartPolicy property: Restart policy for all containers within the container group. + * - `Always` Always restart + * - `OnFailure` Restart on failure + * - `Never` Never restart. + * + * @return the restartPolicy value. + */ + public ContainerGroupRestartPolicy restartPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().restartPolicy(); + } + + /** + * Set the restartPolicy property: Restart policy for all containers within the container group. + * - `Always` Always restart + * - `OnFailure` Restart on failure + * - `Never` Never restart. + * + * @param restartPolicy the restartPolicy value to set. + * @return the ListResultContainerGroupInner object itself. + */ + public ListResultContainerGroupInner withRestartPolicy(ContainerGroupRestartPolicy restartPolicy) { + if (this.innerProperties() == null) { + this.innerProperties = new ListResultContainerGroupPropertiesProperties(); + } + this.innerProperties().withRestartPolicy(restartPolicy); + return this; + } + + /** + * Get the ipAddress property: The IP address type of the container group. + * + * @return the ipAddress value. + */ + public IpAddress ipAddress() { + return this.innerProperties() == null ? null : this.innerProperties().ipAddress(); + } + + /** + * Set the ipAddress property: The IP address type of the container group. + * + * @param ipAddress the ipAddress value to set. + * @return the ListResultContainerGroupInner object itself. + */ + public ListResultContainerGroupInner withIpAddress(IpAddress ipAddress) { + if (this.innerProperties() == null) { + this.innerProperties = new ListResultContainerGroupPropertiesProperties(); + } + this.innerProperties().withIpAddress(ipAddress); + return this; + } + + /** + * Get the osType property: The operating system type required by the containers in the container group. + * + * @return the osType value. + */ + public OperatingSystemTypes osType() { + return this.innerProperties() == null ? null : this.innerProperties().osType(); + } + + /** + * Set the osType property: The operating system type required by the containers in the container group. + * + * @param osType the osType value to set. + * @return the ListResultContainerGroupInner object itself. + */ + public ListResultContainerGroupInner withOsType(OperatingSystemTypes osType) { + if (this.innerProperties() == null) { + this.innerProperties = new ListResultContainerGroupPropertiesProperties(); + } + this.innerProperties().withOsType(osType); + return this; + } + + /** + * Get the volumes property: The list of volumes that can be mounted by containers in this container group. + * + * @return the volumes value. + */ + public List volumes() { + return this.innerProperties() == null ? null : this.innerProperties().volumes(); + } + + /** + * Set the volumes property: The list of volumes that can be mounted by containers in this container group. + * + * @param volumes the volumes value to set. + * @return the ListResultContainerGroupInner object itself. + */ + public ListResultContainerGroupInner withVolumes(List volumes) { + if (this.innerProperties() == null) { + this.innerProperties = new ListResultContainerGroupPropertiesProperties(); + } + this.innerProperties().withVolumes(volumes); + return this; + } + + /** + * Get the diagnostics property: The diagnostic information for a container group. + * + * @return the diagnostics value. + */ + public ContainerGroupDiagnostics diagnostics() { + return this.innerProperties() == null ? null : this.innerProperties().diagnostics(); + } + + /** + * Set the diagnostics property: The diagnostic information for a container group. + * + * @param diagnostics the diagnostics value to set. + * @return the ListResultContainerGroupInner object itself. + */ + public ListResultContainerGroupInner withDiagnostics(ContainerGroupDiagnostics diagnostics) { + if (this.innerProperties() == null) { + this.innerProperties = new ListResultContainerGroupPropertiesProperties(); + } + this.innerProperties().withDiagnostics(diagnostics); + return this; + } + + /** + * Get the subnetIds property: The subnet resource IDs for a container group. + * + * @return the subnetIds value. + */ + public List subnetIds() { + return this.innerProperties() == null ? null : this.innerProperties().subnetIds(); + } + + /** + * Set the subnetIds property: The subnet resource IDs for a container group. + * + * @param subnetIds the subnetIds value to set. + * @return the ListResultContainerGroupInner object itself. + */ + public ListResultContainerGroupInner withSubnetIds(List subnetIds) { + if (this.innerProperties() == null) { + this.innerProperties = new ListResultContainerGroupPropertiesProperties(); + } + this.innerProperties().withSubnetIds(subnetIds); + return this; + } + + /** + * Get the dnsConfig property: The DNS config information for a container group. + * + * @return the dnsConfig value. + */ + public DnsConfiguration dnsConfig() { + return this.innerProperties() == null ? null : this.innerProperties().dnsConfig(); + } + + /** + * Set the dnsConfig property: The DNS config information for a container group. + * + * @param dnsConfig the dnsConfig value to set. + * @return the ListResultContainerGroupInner object itself. + */ + public ListResultContainerGroupInner withDnsConfig(DnsConfiguration dnsConfig) { + if (this.innerProperties() == null) { + this.innerProperties = new ListResultContainerGroupPropertiesProperties(); + } + this.innerProperties().withDnsConfig(dnsConfig); + return this; + } + + /** + * Get the sku property: The SKU for a container group. + * + * @return the sku value. + */ + public ContainerGroupSku sku() { + return this.innerProperties() == null ? null : this.innerProperties().sku(); + } + + /** + * Set the sku property: The SKU for a container group. + * + * @param sku the sku value to set. + * @return the ListResultContainerGroupInner object itself. + */ + public ListResultContainerGroupInner withSku(ContainerGroupSku sku) { + if (this.innerProperties() == null) { + this.innerProperties = new ListResultContainerGroupPropertiesProperties(); + } + this.innerProperties().withSku(sku); + return this; + } + + /** + * Get the encryptionProperties property: The encryption properties for a container group. + * + * @return the encryptionProperties value. + */ + public EncryptionProperties encryptionProperties() { + return this.innerProperties() == null ? null : this.innerProperties().encryptionProperties(); + } + + /** + * Set the encryptionProperties property: The encryption properties for a container group. + * + * @param encryptionProperties the encryptionProperties value to set. + * @return the ListResultContainerGroupInner object itself. + */ + public ListResultContainerGroupInner withEncryptionProperties(EncryptionProperties encryptionProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new ListResultContainerGroupPropertiesProperties(); + } + this.innerProperties().withEncryptionProperties(encryptionProperties); + return this; + } + + /** + * Get the initContainers property: The init containers for a container group. + * + * @return the initContainers value. + */ + public List initContainers() { + return this.innerProperties() == null ? null : this.innerProperties().initContainers(); + } + + /** + * Set the initContainers property: The init containers for a container group. + * + * @param initContainers the initContainers value to set. + * @return the ListResultContainerGroupInner object itself. + */ + public ListResultContainerGroupInner withInitContainers(List initContainers) { + if (this.innerProperties() == null) { + this.innerProperties = new ListResultContainerGroupPropertiesProperties(); + } + this.innerProperties().withInitContainers(initContainers); + return this; + } + + /** + * Get the extensions property: extensions used by virtual kubelet. + * + * @return the extensions value. + */ + public List extensions() { + return this.innerProperties() == null ? null : this.innerProperties().extensions(); + } + + /** + * Set the extensions property: extensions used by virtual kubelet. + * + * @param extensions the extensions value to set. + * @return the ListResultContainerGroupInner object itself. + */ + public ListResultContainerGroupInner withExtensions(List extensions) { + if (this.innerProperties() == null) { + this.innerProperties = new ListResultContainerGroupPropertiesProperties(); + } + this.innerProperties().withExtensions(extensions); + return this; + } + + /** + * Get the confidentialComputeProperties property: The properties for confidential container group. + * + * @return the confidentialComputeProperties value. + */ + public ConfidentialComputeProperties confidentialComputeProperties() { + return this.innerProperties() == null ? null : this.innerProperties().confidentialComputeProperties(); + } + + /** + * Set the confidentialComputeProperties property: The properties for confidential container group. + * + * @param confidentialComputeProperties the confidentialComputeProperties value to set. + * @return the ListResultContainerGroupInner object itself. + */ + public ListResultContainerGroupInner + withConfidentialComputeProperties(ConfidentialComputeProperties confidentialComputeProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new ListResultContainerGroupPropertiesProperties(); + } + this.innerProperties().withConfidentialComputeProperties(confidentialComputeProperties); + return this; + } + + /** + * Get the priority property: The priority of the container group. + * + * @return the priority value. + */ + public ContainerGroupPriority priority() { + return this.innerProperties() == null ? null : this.innerProperties().priority(); + } + + /** + * Set the priority property: The priority of the container group. + * + * @param priority the priority value to set. + * @return the ListResultContainerGroupInner object itself. + */ + public ListResultContainerGroupInner withPriority(ContainerGroupPriority priority) { + if (this.innerProperties() == null) { + this.innerProperties = new ListResultContainerGroupPropertiesProperties(); + } + this.innerProperties().withPriority(priority); + return this; + } + + /** + * Get the identityAcls property: The access control levels of the identities. + * + * @return the identityAcls value. + */ + public IdentityAcls identityAcls() { + return this.innerProperties() == null ? null : this.innerProperties().identityAcls(); + } + + /** + * Set the identityAcls property: The access control levels of the identities. + * + * @param identityAcls the identityAcls value to set. + * @return the ListResultContainerGroupInner object itself. + */ + public ListResultContainerGroupInner withIdentityAcls(IdentityAcls identityAcls) { + if (this.innerProperties() == null) { + this.innerProperties = new ListResultContainerGroupPropertiesProperties(); + } + this.innerProperties().withIdentityAcls(identityAcls); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (innerProperties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model ListResultContainerGroupInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ListResultContainerGroupInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeArrayField("zones", this.zones, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("identity", this.identity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListResultContainerGroupInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListResultContainerGroupInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ListResultContainerGroupInner. + */ + public static ListResultContainerGroupInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListResultContainerGroupInner deserializedListResultContainerGroupInner + = new ListResultContainerGroupInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedListResultContainerGroupInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedListResultContainerGroupInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedListResultContainerGroupInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedListResultContainerGroupInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedListResultContainerGroupInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedListResultContainerGroupInner.innerProperties + = ListResultContainerGroupPropertiesProperties.fromJson(reader); + } else if ("zones".equals(fieldName)) { + List zones = reader.readArray(reader1 -> reader1.getString()); + deserializedListResultContainerGroupInner.zones = zones; + } else if ("identity".equals(fieldName)) { + deserializedListResultContainerGroupInner.identity = ContainerGroupIdentity.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedListResultContainerGroupInner; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ListResultContainerGroupPropertiesProperties.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ListResultContainerGroupPropertiesProperties.java new file mode 100644 index 000000000000..4e7caa297493 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ListResultContainerGroupPropertiesProperties.java @@ -0,0 +1,672 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerinstance.generated.models.ConfidentialComputeProperties; +import com.azure.resourcemanager.containerinstance.generated.models.Container; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupDiagnostics; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupPriority; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupProvisioningState; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupRestartPolicy; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupSku; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupSubnetId; +import com.azure.resourcemanager.containerinstance.generated.models.DeploymentExtensionSpec; +import com.azure.resourcemanager.containerinstance.generated.models.DnsConfiguration; +import com.azure.resourcemanager.containerinstance.generated.models.EncryptionProperties; +import com.azure.resourcemanager.containerinstance.generated.models.IdentityAcls; +import com.azure.resourcemanager.containerinstance.generated.models.ImageRegistryCredential; +import com.azure.resourcemanager.containerinstance.generated.models.InitContainerDefinition; +import com.azure.resourcemanager.containerinstance.generated.models.IpAddress; +import com.azure.resourcemanager.containerinstance.generated.models.OperatingSystemTypes; +import com.azure.resourcemanager.containerinstance.generated.models.SecretReference; +import com.azure.resourcemanager.containerinstance.generated.models.Volume; +import java.io.IOException; +import java.util.List; + +/** + * The container group properties. + */ +@Fluent +public final class ListResultContainerGroupPropertiesProperties + implements JsonSerializable { + /* + * The provisioning state of the container group. This only appears in the response. + */ + private ContainerGroupProvisioningState provisioningState; + + /* + * The secret references that will be referenced within the container group. + */ + private List secretReferences; + + /* + * The containers within the container group. + */ + private List containers; + + /* + * The image registry credentials by which the container group is created from. + */ + private List imageRegistryCredentials; + + /* + * Restart policy for all containers within the container group. + * - `Always` Always restart + * - `OnFailure` Restart on failure + * - `Never` Never restart + */ + private ContainerGroupRestartPolicy restartPolicy; + + /* + * The IP address type of the container group. + */ + private IpAddress ipAddress; + + /* + * The operating system type required by the containers in the container group. + */ + private OperatingSystemTypes osType; + + /* + * The list of volumes that can be mounted by containers in this container group. + */ + private List volumes; + + /* + * The diagnostic information for a container group. + */ + private ContainerGroupDiagnostics diagnostics; + + /* + * The subnet resource IDs for a container group. + */ + private List subnetIds; + + /* + * The DNS config information for a container group. + */ + private DnsConfiguration dnsConfig; + + /* + * The SKU for a container group. + */ + private ContainerGroupSku sku; + + /* + * The encryption properties for a container group. + */ + private EncryptionProperties encryptionProperties; + + /* + * The init containers for a container group. + */ + private List initContainers; + + /* + * extensions used by virtual kubelet + */ + private List extensions; + + /* + * The properties for confidential container group + */ + private ConfidentialComputeProperties confidentialComputeProperties; + + /* + * The priority of the container group. + */ + private ContainerGroupPriority priority; + + /* + * The access control levels of the identities. + */ + private IdentityAcls identityAcls; + + /** + * Creates an instance of ListResultContainerGroupPropertiesProperties class. + */ + public ListResultContainerGroupPropertiesProperties() { + } + + /** + * Get the provisioningState property: The provisioning state of the container group. This only appears in the + * response. + * + * @return the provisioningState value. + */ + public ContainerGroupProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the secretReferences property: The secret references that will be referenced within the container group. + * + * @return the secretReferences value. + */ + public List secretReferences() { + return this.secretReferences; + } + + /** + * Set the secretReferences property: The secret references that will be referenced within the container group. + * + * @param secretReferences the secretReferences value to set. + * @return the ListResultContainerGroupPropertiesProperties object itself. + */ + public ListResultContainerGroupPropertiesProperties withSecretReferences(List secretReferences) { + this.secretReferences = secretReferences; + return this; + } + + /** + * Get the containers property: The containers within the container group. + * + * @return the containers value. + */ + public List containers() { + return this.containers; + } + + /** + * Set the containers property: The containers within the container group. + * + * @param containers the containers value to set. + * @return the ListResultContainerGroupPropertiesProperties object itself. + */ + public ListResultContainerGroupPropertiesProperties withContainers(List containers) { + this.containers = containers; + return this; + } + + /** + * Get the imageRegistryCredentials property: The image registry credentials by which the container group is created + * from. + * + * @return the imageRegistryCredentials value. + */ + public List imageRegistryCredentials() { + return this.imageRegistryCredentials; + } + + /** + * Set the imageRegistryCredentials property: The image registry credentials by which the container group is created + * from. + * + * @param imageRegistryCredentials the imageRegistryCredentials value to set. + * @return the ListResultContainerGroupPropertiesProperties object itself. + */ + public ListResultContainerGroupPropertiesProperties + withImageRegistryCredentials(List imageRegistryCredentials) { + this.imageRegistryCredentials = imageRegistryCredentials; + return this; + } + + /** + * Get the restartPolicy property: Restart policy for all containers within the container group. + * - `Always` Always restart + * - `OnFailure` Restart on failure + * - `Never` Never restart. + * + * @return the restartPolicy value. + */ + public ContainerGroupRestartPolicy restartPolicy() { + return this.restartPolicy; + } + + /** + * Set the restartPolicy property: Restart policy for all containers within the container group. + * - `Always` Always restart + * - `OnFailure` Restart on failure + * - `Never` Never restart. + * + * @param restartPolicy the restartPolicy value to set. + * @return the ListResultContainerGroupPropertiesProperties object itself. + */ + public ListResultContainerGroupPropertiesProperties withRestartPolicy(ContainerGroupRestartPolicy restartPolicy) { + this.restartPolicy = restartPolicy; + return this; + } + + /** + * Get the ipAddress property: The IP address type of the container group. + * + * @return the ipAddress value. + */ + public IpAddress ipAddress() { + return this.ipAddress; + } + + /** + * Set the ipAddress property: The IP address type of the container group. + * + * @param ipAddress the ipAddress value to set. + * @return the ListResultContainerGroupPropertiesProperties object itself. + */ + public ListResultContainerGroupPropertiesProperties withIpAddress(IpAddress ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + * Get the osType property: The operating system type required by the containers in the container group. + * + * @return the osType value. + */ + public OperatingSystemTypes osType() { + return this.osType; + } + + /** + * Set the osType property: The operating system type required by the containers in the container group. + * + * @param osType the osType value to set. + * @return the ListResultContainerGroupPropertiesProperties object itself. + */ + public ListResultContainerGroupPropertiesProperties withOsType(OperatingSystemTypes osType) { + this.osType = osType; + return this; + } + + /** + * Get the volumes property: The list of volumes that can be mounted by containers in this container group. + * + * @return the volumes value. + */ + public List volumes() { + return this.volumes; + } + + /** + * Set the volumes property: The list of volumes that can be mounted by containers in this container group. + * + * @param volumes the volumes value to set. + * @return the ListResultContainerGroupPropertiesProperties object itself. + */ + public ListResultContainerGroupPropertiesProperties withVolumes(List volumes) { + this.volumes = volumes; + return this; + } + + /** + * Get the diagnostics property: The diagnostic information for a container group. + * + * @return the diagnostics value. + */ + public ContainerGroupDiagnostics diagnostics() { + return this.diagnostics; + } + + /** + * Set the diagnostics property: The diagnostic information for a container group. + * + * @param diagnostics the diagnostics value to set. + * @return the ListResultContainerGroupPropertiesProperties object itself. + */ + public ListResultContainerGroupPropertiesProperties withDiagnostics(ContainerGroupDiagnostics diagnostics) { + this.diagnostics = diagnostics; + return this; + } + + /** + * Get the subnetIds property: The subnet resource IDs for a container group. + * + * @return the subnetIds value. + */ + public List subnetIds() { + return this.subnetIds; + } + + /** + * Set the subnetIds property: The subnet resource IDs for a container group. + * + * @param subnetIds the subnetIds value to set. + * @return the ListResultContainerGroupPropertiesProperties object itself. + */ + public ListResultContainerGroupPropertiesProperties withSubnetIds(List subnetIds) { + this.subnetIds = subnetIds; + return this; + } + + /** + * Get the dnsConfig property: The DNS config information for a container group. + * + * @return the dnsConfig value. + */ + public DnsConfiguration dnsConfig() { + return this.dnsConfig; + } + + /** + * Set the dnsConfig property: The DNS config information for a container group. + * + * @param dnsConfig the dnsConfig value to set. + * @return the ListResultContainerGroupPropertiesProperties object itself. + */ + public ListResultContainerGroupPropertiesProperties withDnsConfig(DnsConfiguration dnsConfig) { + this.dnsConfig = dnsConfig; + return this; + } + + /** + * Get the sku property: The SKU for a container group. + * + * @return the sku value. + */ + public ContainerGroupSku sku() { + return this.sku; + } + + /** + * Set the sku property: The SKU for a container group. + * + * @param sku the sku value to set. + * @return the ListResultContainerGroupPropertiesProperties object itself. + */ + public ListResultContainerGroupPropertiesProperties withSku(ContainerGroupSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the encryptionProperties property: The encryption properties for a container group. + * + * @return the encryptionProperties value. + */ + public EncryptionProperties encryptionProperties() { + return this.encryptionProperties; + } + + /** + * Set the encryptionProperties property: The encryption properties for a container group. + * + * @param encryptionProperties the encryptionProperties value to set. + * @return the ListResultContainerGroupPropertiesProperties object itself. + */ + public ListResultContainerGroupPropertiesProperties + withEncryptionProperties(EncryptionProperties encryptionProperties) { + this.encryptionProperties = encryptionProperties; + return this; + } + + /** + * Get the initContainers property: The init containers for a container group. + * + * @return the initContainers value. + */ + public List initContainers() { + return this.initContainers; + } + + /** + * Set the initContainers property: The init containers for a container group. + * + * @param initContainers the initContainers value to set. + * @return the ListResultContainerGroupPropertiesProperties object itself. + */ + public ListResultContainerGroupPropertiesProperties + withInitContainers(List initContainers) { + this.initContainers = initContainers; + return this; + } + + /** + * Get the extensions property: extensions used by virtual kubelet. + * + * @return the extensions value. + */ + public List extensions() { + return this.extensions; + } + + /** + * Set the extensions property: extensions used by virtual kubelet. + * + * @param extensions the extensions value to set. + * @return the ListResultContainerGroupPropertiesProperties object itself. + */ + public ListResultContainerGroupPropertiesProperties withExtensions(List extensions) { + this.extensions = extensions; + return this; + } + + /** + * Get the confidentialComputeProperties property: The properties for confidential container group. + * + * @return the confidentialComputeProperties value. + */ + public ConfidentialComputeProperties confidentialComputeProperties() { + return this.confidentialComputeProperties; + } + + /** + * Set the confidentialComputeProperties property: The properties for confidential container group. + * + * @param confidentialComputeProperties the confidentialComputeProperties value to set. + * @return the ListResultContainerGroupPropertiesProperties object itself. + */ + public ListResultContainerGroupPropertiesProperties + withConfidentialComputeProperties(ConfidentialComputeProperties confidentialComputeProperties) { + this.confidentialComputeProperties = confidentialComputeProperties; + return this; + } + + /** + * Get the priority property: The priority of the container group. + * + * @return the priority value. + */ + public ContainerGroupPriority priority() { + return this.priority; + } + + /** + * Set the priority property: The priority of the container group. + * + * @param priority the priority value to set. + * @return the ListResultContainerGroupPropertiesProperties object itself. + */ + public ListResultContainerGroupPropertiesProperties withPriority(ContainerGroupPriority priority) { + this.priority = priority; + return this; + } + + /** + * Get the identityAcls property: The access control levels of the identities. + * + * @return the identityAcls value. + */ + public IdentityAcls identityAcls() { + return this.identityAcls; + } + + /** + * Set the identityAcls property: The access control levels of the identities. + * + * @param identityAcls the identityAcls value to set. + * @return the ListResultContainerGroupPropertiesProperties object itself. + */ + public ListResultContainerGroupPropertiesProperties withIdentityAcls(IdentityAcls identityAcls) { + this.identityAcls = identityAcls; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (secretReferences() != null) { + secretReferences().forEach(e -> e.validate()); + } + if (containers() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property containers in model ListResultContainerGroupPropertiesProperties")); + } else { + containers().forEach(e -> e.validate()); + } + if (imageRegistryCredentials() != null) { + imageRegistryCredentials().forEach(e -> e.validate()); + } + if (ipAddress() != null) { + ipAddress().validate(); + } + if (osType() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property osType in model ListResultContainerGroupPropertiesProperties")); + } + if (volumes() != null) { + volumes().forEach(e -> e.validate()); + } + if (diagnostics() != null) { + diagnostics().validate(); + } + if (subnetIds() != null) { + subnetIds().forEach(e -> e.validate()); + } + if (dnsConfig() != null) { + dnsConfig().validate(); + } + if (encryptionProperties() != null) { + encryptionProperties().validate(); + } + if (initContainers() != null) { + initContainers().forEach(e -> e.validate()); + } + if (extensions() != null) { + extensions().forEach(e -> e.validate()); + } + if (confidentialComputeProperties() != null) { + confidentialComputeProperties().validate(); + } + if (identityAcls() != null) { + identityAcls().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ListResultContainerGroupPropertiesProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("containers", this.containers, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("osType", this.osType == null ? null : this.osType.toString()); + jsonWriter.writeArrayField("secretReferences", this.secretReferences, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("imageRegistryCredentials", this.imageRegistryCredentials, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("restartPolicy", this.restartPolicy == null ? null : this.restartPolicy.toString()); + jsonWriter.writeJsonField("ipAddress", this.ipAddress); + jsonWriter.writeArrayField("volumes", this.volumes, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("diagnostics", this.diagnostics); + jsonWriter.writeArrayField("subnetIds", this.subnetIds, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("dnsConfig", this.dnsConfig); + jsonWriter.writeStringField("sku", this.sku == null ? null : this.sku.toString()); + jsonWriter.writeJsonField("encryptionProperties", this.encryptionProperties); + jsonWriter.writeArrayField("initContainers", this.initContainers, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("extensions", this.extensions, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("confidentialComputeProperties", this.confidentialComputeProperties); + jsonWriter.writeStringField("priority", this.priority == null ? null : this.priority.toString()); + jsonWriter.writeJsonField("identityAcls", this.identityAcls); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListResultContainerGroupPropertiesProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListResultContainerGroupPropertiesProperties if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ListResultContainerGroupPropertiesProperties. + */ + public static ListResultContainerGroupPropertiesProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListResultContainerGroupPropertiesProperties deserializedListResultContainerGroupPropertiesProperties + = new ListResultContainerGroupPropertiesProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("containers".equals(fieldName)) { + List containers = reader.readArray(reader1 -> Container.fromJson(reader1)); + deserializedListResultContainerGroupPropertiesProperties.containers = containers; + } else if ("osType".equals(fieldName)) { + deserializedListResultContainerGroupPropertiesProperties.osType + = OperatingSystemTypes.fromString(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedListResultContainerGroupPropertiesProperties.provisioningState + = ContainerGroupProvisioningState.fromString(reader.getString()); + } else if ("secretReferences".equals(fieldName)) { + List secretReferences + = reader.readArray(reader1 -> SecretReference.fromJson(reader1)); + deserializedListResultContainerGroupPropertiesProperties.secretReferences = secretReferences; + } else if ("imageRegistryCredentials".equals(fieldName)) { + List imageRegistryCredentials + = reader.readArray(reader1 -> ImageRegistryCredential.fromJson(reader1)); + deserializedListResultContainerGroupPropertiesProperties.imageRegistryCredentials + = imageRegistryCredentials; + } else if ("restartPolicy".equals(fieldName)) { + deserializedListResultContainerGroupPropertiesProperties.restartPolicy + = ContainerGroupRestartPolicy.fromString(reader.getString()); + } else if ("ipAddress".equals(fieldName)) { + deserializedListResultContainerGroupPropertiesProperties.ipAddress = IpAddress.fromJson(reader); + } else if ("volumes".equals(fieldName)) { + List volumes = reader.readArray(reader1 -> Volume.fromJson(reader1)); + deserializedListResultContainerGroupPropertiesProperties.volumes = volumes; + } else if ("diagnostics".equals(fieldName)) { + deserializedListResultContainerGroupPropertiesProperties.diagnostics + = ContainerGroupDiagnostics.fromJson(reader); + } else if ("subnetIds".equals(fieldName)) { + List subnetIds + = reader.readArray(reader1 -> ContainerGroupSubnetId.fromJson(reader1)); + deserializedListResultContainerGroupPropertiesProperties.subnetIds = subnetIds; + } else if ("dnsConfig".equals(fieldName)) { + deserializedListResultContainerGroupPropertiesProperties.dnsConfig + = DnsConfiguration.fromJson(reader); + } else if ("sku".equals(fieldName)) { + deserializedListResultContainerGroupPropertiesProperties.sku + = ContainerGroupSku.fromString(reader.getString()); + } else if ("encryptionProperties".equals(fieldName)) { + deserializedListResultContainerGroupPropertiesProperties.encryptionProperties + = EncryptionProperties.fromJson(reader); + } else if ("initContainers".equals(fieldName)) { + List initContainers + = reader.readArray(reader1 -> InitContainerDefinition.fromJson(reader1)); + deserializedListResultContainerGroupPropertiesProperties.initContainers = initContainers; + } else if ("extensions".equals(fieldName)) { + List extensions + = reader.readArray(reader1 -> DeploymentExtensionSpec.fromJson(reader1)); + deserializedListResultContainerGroupPropertiesProperties.extensions = extensions; + } else if ("confidentialComputeProperties".equals(fieldName)) { + deserializedListResultContainerGroupPropertiesProperties.confidentialComputeProperties + = ConfidentialComputeProperties.fromJson(reader); + } else if ("priority".equals(fieldName)) { + deserializedListResultContainerGroupPropertiesProperties.priority + = ContainerGroupPriority.fromString(reader.getString()); + } else if ("identityAcls".equals(fieldName)) { + deserializedListResultContainerGroupPropertiesProperties.identityAcls + = IdentityAcls.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedListResultContainerGroupPropertiesProperties; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/LogsInner.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/LogsInner.java new file mode 100644 index 000000000000..f6fb6c8884f1 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/LogsInner.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The logs. + */ +@Fluent +public final class LogsInner implements JsonSerializable { + /* + * The content of the log. + */ + private String content; + + /** + * Creates an instance of LogsInner class. + */ + public LogsInner() { + } + + /** + * Get the content property: The content of the log. + * + * @return the content value. + */ + public String content() { + return this.content; + } + + /** + * Set the content property: The content of the log. + * + * @param content the content value to set. + * @return the LogsInner object itself. + */ + public LogsInner withContent(String content) { + this.content = content; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("content", this.content); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LogsInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LogsInner if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the LogsInner. + */ + public static LogsInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LogsInner deserializedLogsInner = new LogsInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("content".equals(fieldName)) { + deserializedLogsInner.content = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLogsInner; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/NGroupInner.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/NGroupInner.java new file mode 100644 index 000000000000..2e6d6b32d128 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/NGroupInner.java @@ -0,0 +1,371 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupProfileStub; +import com.azure.resourcemanager.containerinstance.generated.models.ElasticProfile; +import com.azure.resourcemanager.containerinstance.generated.models.NGroupIdentity; +import com.azure.resourcemanager.containerinstance.generated.models.NGroupProvisioningState; +import com.azure.resourcemanager.containerinstance.generated.models.PlacementProfile; +import com.azure.resourcemanager.containerinstance.generated.models.UpdateProfile; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Describes the NGroups resource. + */ +@Fluent +public final class NGroupInner extends Resource { + /* + * Metadata pertaining to creation and last modification of the resource. + */ + private SystemData systemData; + + /* + * Describes the properties of the NGroups resource. + */ + private NGroupProperties innerProperties; + + /* + * The identity of the NGroup, if configured. + */ + private NGroupIdentity identity; + + /* + * The NGroups zones. NOTE: Availability zones can only be set when you create the scale set + */ + private List zones; + + /* + * The geo-location where the resource lives + */ + private String location; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of NGroupInner class. + */ + public NGroupInner() { + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the innerProperties property: Describes the properties of the NGroups resource. + * + * @return the innerProperties value. + */ + private NGroupProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the identity property: The identity of the NGroup, if configured. + * + * @return the identity value. + */ + public NGroupIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The identity of the NGroup, if configured. + * + * @param identity the identity value to set. + * @return the NGroupInner object itself. + */ + public NGroupInner withIdentity(NGroupIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the zones property: The NGroups zones. NOTE: Availability zones can only be set when you create the scale + * set. + * + * @return the zones value. + */ + public List zones() { + return this.zones; + } + + /** + * Set the zones property: The NGroups zones. NOTE: Availability zones can only be set when you create the scale + * set. + * + * @param zones the zones value to set. + * @return the NGroupInner object itself. + */ + public NGroupInner withZones(List zones) { + this.zones = zones; + return this; + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The geo-location where the resource lives. + * + * @param location the location value to set. + * @return the NGroupInner object itself. + */ + public NGroupInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public NGroupInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the elasticProfile property: The elastic profile. + * + * @return the elasticProfile value. + */ + public ElasticProfile elasticProfile() { + return this.innerProperties() == null ? null : this.innerProperties().elasticProfile(); + } + + /** + * Set the elasticProfile property: The elastic profile. + * + * @param elasticProfile the elasticProfile value to set. + * @return the NGroupInner object itself. + */ + public NGroupInner withElasticProfile(ElasticProfile elasticProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new NGroupProperties(); + } + this.innerProperties().withElasticProfile(elasticProfile); + return this; + } + + /** + * Get the placementProfile property: Provides options w.r.t allocation and management w.r.t certain placement + * policies. These utilize capabilities provided by the underlying Azure infrastructure. They are typically used for + * high availability scenarios. E.g., distributing CGs across fault domains. + * + * @return the placementProfile value. + */ + public PlacementProfile placementProfile() { + return this.innerProperties() == null ? null : this.innerProperties().placementProfile(); + } + + /** + * Set the placementProfile property: Provides options w.r.t allocation and management w.r.t certain placement + * policies. These utilize capabilities provided by the underlying Azure infrastructure. They are typically used for + * high availability scenarios. E.g., distributing CGs across fault domains. + * + * @param placementProfile the placementProfile value to set. + * @return the NGroupInner object itself. + */ + public NGroupInner withPlacementProfile(PlacementProfile placementProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new NGroupProperties(); + } + this.innerProperties().withPlacementProfile(placementProfile); + return this; + } + + /** + * Get the containerGroupProfiles property: The Container Group Profiles that could be used in the NGroups resource. + * + * @return the containerGroupProfiles value. + */ + public List containerGroupProfiles() { + return this.innerProperties() == null ? null : this.innerProperties().containerGroupProfiles(); + } + + /** + * Set the containerGroupProfiles property: The Container Group Profiles that could be used in the NGroups resource. + * + * @param containerGroupProfiles the containerGroupProfiles value to set. + * @return the NGroupInner object itself. + */ + public NGroupInner withContainerGroupProfiles(List containerGroupProfiles) { + if (this.innerProperties() == null) { + this.innerProperties = new NGroupProperties(); + } + this.innerProperties().withContainerGroupProfiles(containerGroupProfiles); + return this; + } + + /** + * Get the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public NGroupProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the updateProfile property: Used by the customer to specify the way to update the Container Groups in NGroup. + * + * @return the updateProfile value. + */ + public UpdateProfile updateProfile() { + return this.innerProperties() == null ? null : this.innerProperties().updateProfile(); + } + + /** + * Set the updateProfile property: Used by the customer to specify the way to update the Container Groups in NGroup. + * + * @param updateProfile the updateProfile value to set. + * @return the NGroupInner object itself. + */ + public NGroupInner withUpdateProfile(UpdateProfile updateProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new NGroupProperties(); + } + this.innerProperties().withUpdateProfile(updateProfile); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + if (identity() != null) { + identity().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeArrayField("zones", this.zones, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("location", this.location); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NGroupInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NGroupInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the NGroupInner. + */ + public static NGroupInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NGroupInner deserializedNGroupInner = new NGroupInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedNGroupInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedNGroupInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedNGroupInner.type = reader.getString(); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedNGroupInner.withTags(tags); + } else if ("systemData".equals(fieldName)) { + deserializedNGroupInner.systemData = SystemData.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedNGroupInner.innerProperties = NGroupProperties.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedNGroupInner.identity = NGroupIdentity.fromJson(reader); + } else if ("zones".equals(fieldName)) { + List zones = reader.readArray(reader1 -> reader1.getString()); + deserializedNGroupInner.zones = zones; + } else if ("location".equals(fieldName)) { + deserializedNGroupInner.location = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNGroupInner; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/NGroupProperties.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/NGroupProperties.java new file mode 100644 index 000000000000..6f9761c11c53 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/NGroupProperties.java @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupProfileStub; +import com.azure.resourcemanager.containerinstance.generated.models.ElasticProfile; +import com.azure.resourcemanager.containerinstance.generated.models.NGroupProvisioningState; +import com.azure.resourcemanager.containerinstance.generated.models.PlacementProfile; +import com.azure.resourcemanager.containerinstance.generated.models.UpdateProfile; +import java.io.IOException; +import java.util.List; + +/** + * Describes the properties of the NGroups resource. + */ +@Fluent +public final class NGroupProperties implements JsonSerializable { + /* + * The elastic profile. + */ + private ElasticProfile elasticProfile; + + /* + * Provides options w.r.t allocation and management w.r.t certain placement policies. These utilize capabilities + * provided by the underlying Azure infrastructure. They are typically used for high availability scenarios. E.g., + * distributing CGs across fault domains. + */ + private PlacementProfile placementProfile; + + /* + * The Container Group Profiles that could be used in the NGroups resource. + */ + private List containerGroupProfiles; + + /* + * The provisioning state, which only appears in the response. + */ + private NGroupProvisioningState provisioningState; + + /* + * Used by the customer to specify the way to update the Container Groups in NGroup. + */ + private UpdateProfile updateProfile; + + /** + * Creates an instance of NGroupProperties class. + */ + public NGroupProperties() { + } + + /** + * Get the elasticProfile property: The elastic profile. + * + * @return the elasticProfile value. + */ + public ElasticProfile elasticProfile() { + return this.elasticProfile; + } + + /** + * Set the elasticProfile property: The elastic profile. + * + * @param elasticProfile the elasticProfile value to set. + * @return the NGroupProperties object itself. + */ + public NGroupProperties withElasticProfile(ElasticProfile elasticProfile) { + this.elasticProfile = elasticProfile; + return this; + } + + /** + * Get the placementProfile property: Provides options w.r.t allocation and management w.r.t certain placement + * policies. These utilize capabilities provided by the underlying Azure infrastructure. They are typically used for + * high availability scenarios. E.g., distributing CGs across fault domains. + * + * @return the placementProfile value. + */ + public PlacementProfile placementProfile() { + return this.placementProfile; + } + + /** + * Set the placementProfile property: Provides options w.r.t allocation and management w.r.t certain placement + * policies. These utilize capabilities provided by the underlying Azure infrastructure. They are typically used for + * high availability scenarios. E.g., distributing CGs across fault domains. + * + * @param placementProfile the placementProfile value to set. + * @return the NGroupProperties object itself. + */ + public NGroupProperties withPlacementProfile(PlacementProfile placementProfile) { + this.placementProfile = placementProfile; + return this; + } + + /** + * Get the containerGroupProfiles property: The Container Group Profiles that could be used in the NGroups resource. + * + * @return the containerGroupProfiles value. + */ + public List containerGroupProfiles() { + return this.containerGroupProfiles; + } + + /** + * Set the containerGroupProfiles property: The Container Group Profiles that could be used in the NGroups resource. + * + * @param containerGroupProfiles the containerGroupProfiles value to set. + * @return the NGroupProperties object itself. + */ + public NGroupProperties withContainerGroupProfiles(List containerGroupProfiles) { + this.containerGroupProfiles = containerGroupProfiles; + return this; + } + + /** + * Get the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public NGroupProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the updateProfile property: Used by the customer to specify the way to update the Container Groups in NGroup. + * + * @return the updateProfile value. + */ + public UpdateProfile updateProfile() { + return this.updateProfile; + } + + /** + * Set the updateProfile property: Used by the customer to specify the way to update the Container Groups in NGroup. + * + * @param updateProfile the updateProfile value to set. + * @return the NGroupProperties object itself. + */ + public NGroupProperties withUpdateProfile(UpdateProfile updateProfile) { + this.updateProfile = updateProfile; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (elasticProfile() != null) { + elasticProfile().validate(); + } + if (placementProfile() != null) { + placementProfile().validate(); + } + if (containerGroupProfiles() != null) { + containerGroupProfiles().forEach(e -> e.validate()); + } + if (updateProfile() != null) { + updateProfile().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("elasticProfile", this.elasticProfile); + jsonWriter.writeJsonField("placementProfile", this.placementProfile); + jsonWriter.writeArrayField("containerGroupProfiles", this.containerGroupProfiles, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("updateProfile", this.updateProfile); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NGroupProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NGroupProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the NGroupProperties. + */ + public static NGroupProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NGroupProperties deserializedNGroupProperties = new NGroupProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("elasticProfile".equals(fieldName)) { + deserializedNGroupProperties.elasticProfile = ElasticProfile.fromJson(reader); + } else if ("placementProfile".equals(fieldName)) { + deserializedNGroupProperties.placementProfile = PlacementProfile.fromJson(reader); + } else if ("containerGroupProfiles".equals(fieldName)) { + List containerGroupProfiles + = reader.readArray(reader1 -> ContainerGroupProfileStub.fromJson(reader1)); + deserializedNGroupProperties.containerGroupProfiles = containerGroupProfiles; + } else if ("provisioningState".equals(fieldName)) { + deserializedNGroupProperties.provisioningState + = NGroupProvisioningState.fromString(reader.getString()); + } else if ("updateProfile".equals(fieldName)) { + deserializedNGroupProperties.updateProfile = UpdateProfile.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNGroupProperties; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/OperationInner.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/OperationInner.java new file mode 100644 index 000000000000..85cfc1837052 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/OperationInner.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerInstanceOperationsOrigin; +import com.azure.resourcemanager.containerinstance.generated.models.OperationDisplay; +import java.io.IOException; + +/** + * An operation for Azure Container Instance service. + */ +@Fluent +public final class OperationInner implements JsonSerializable { + /* + * The name of the operation. + */ + private String name; + + /* + * The display information of the operation. + */ + private OperationDisplay display; + + /* + * The additional properties. + */ + private Object properties; + + /* + * The intended executor of the operation. + */ + private ContainerInstanceOperationsOrigin origin; + + /** + * Creates an instance of OperationInner class. + */ + public OperationInner() { + } + + /** + * Get the name property: The name of the operation. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the operation. + * + * @param name the name value to set. + * @return the OperationInner object itself. + */ + public OperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the display property: The display information of the operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display property: The display information of the operation. + * + * @param display the display value to set. + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the properties property: The additional properties. + * + * @return the properties value. + */ + public Object properties() { + return this.properties; + } + + /** + * Set the properties property: The additional properties. + * + * @param properties the properties value to set. + * @return the OperationInner object itself. + */ + public OperationInner withProperties(Object properties) { + this.properties = properties; + return this; + } + + /** + * Get the origin property: The intended executor of the operation. + * + * @return the origin value. + */ + public ContainerInstanceOperationsOrigin origin() { + return this.origin; + } + + /** + * Set the origin property: The intended executor of the operation. + * + * @param origin the origin value to set. + * @return the OperationInner object itself. + */ + public OperationInner withOrigin(ContainerInstanceOperationsOrigin origin) { + this.origin = origin; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property name in model OperationInner")); + } + if (display() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property display in model OperationInner")); + } else { + display().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OperationInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeJsonField("display", this.display); + jsonWriter.writeUntypedField("properties", this.properties); + jsonWriter.writeStringField("origin", this.origin == null ? null : this.origin.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OperationInner. + */ + public static OperationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationInner deserializedOperationInner = new OperationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedOperationInner.name = reader.getString(); + } else if ("display".equals(fieldName)) { + deserializedOperationInner.display = OperationDisplay.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedOperationInner.properties = reader.readUntyped(); + } else if ("origin".equals(fieldName)) { + deserializedOperationInner.origin + = ContainerInstanceOperationsOrigin.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationInner; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/UsageInner.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/UsageInner.java new file mode 100644 index 000000000000..301c17f3eed8 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/UsageInner.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerinstance.generated.models.UsageName; +import java.io.IOException; + +/** + * A single usage result. + */ +@Immutable +public final class UsageInner implements JsonSerializable { + /* + * Id of the usage result + */ + private String id; + + /* + * Unit of the usage result + */ + private String unit; + + /* + * The current usage of the resource + */ + private Integer currentValue; + + /* + * The maximum permitted usage of the resource. + */ + private Integer limit; + + /* + * The name object of the resource + */ + private UsageName name; + + /** + * Creates an instance of UsageInner class. + */ + public UsageInner() { + } + + /** + * Get the id property: Id of the usage result. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the unit property: Unit of the usage result. + * + * @return the unit value. + */ + public String unit() { + return this.unit; + } + + /** + * Get the currentValue property: The current usage of the resource. + * + * @return the currentValue value. + */ + public Integer currentValue() { + return this.currentValue; + } + + /** + * Get the limit property: The maximum permitted usage of the resource. + * + * @return the limit value. + */ + public Integer limit() { + return this.limit; + } + + /** + * Get the name property: The name object of the resource. + * + * @return the name value. + */ + public UsageName name() { + return this.name; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() != null) { + name().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UsageInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UsageInner if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the UsageInner. + */ + public static UsageInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UsageInner deserializedUsageInner = new UsageInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedUsageInner.id = reader.getString(); + } else if ("unit".equals(fieldName)) { + deserializedUsageInner.unit = reader.getString(); + } else if ("currentValue".equals(fieldName)) { + deserializedUsageInner.currentValue = reader.getNullable(JsonReader::getInt); + } else if ("limit".equals(fieldName)) { + deserializedUsageInner.limit = reader.getNullable(JsonReader::getInt); + } else if ("name".equals(fieldName)) { + deserializedUsageInner.name = UsageName.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedUsageInner; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/package-info.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/package-info.java new file mode 100644 index 000000000000..5deed0dfbdc1 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the inner data models for ContainerInstanceManagementClient. + * null. + */ +package com.azure.resourcemanager.containerinstance.generated.fluent.models; diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/package-info.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/package-info.java new file mode 100644 index 000000000000..5143c607394b --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the service clients for ContainerInstanceManagementClient. + * null. + */ +package com.azure.resourcemanager.containerinstance.generated.fluent; diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/CGProfileOperationsClientImpl.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/CGProfileOperationsClientImpl.java new file mode 100644 index 000000000000..071cf8040f80 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/CGProfileOperationsClientImpl.java @@ -0,0 +1,1206 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.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.containerinstance.generated.fluent.CGProfileOperationsClient; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.ContainerGroupProfileInner; +import com.azure.resourcemanager.containerinstance.generated.models.CGProfileOperationsCreateOrUpdateResponse; +import com.azure.resourcemanager.containerinstance.generated.models.CGProfileOperationsUpdateResponse; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupProfileListResult; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupProfilePatch; +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 CGProfileOperationsClient. + */ +public final class CGProfileOperationsClientImpl implements CGProfileOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final CGProfileOperationsService service; + + /** + * The service client containing this operation class. + */ + private final ContainerInstanceManagementClientImpl client; + + /** + * Initializes an instance of CGProfileOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CGProfileOperationsClientImpl(ContainerInstanceManagementClientImpl client) { + this.service = RestProxy.create(CGProfileOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerInstanceManagementClientCGProfileOperations to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerInstanceMan") + public interface CGProfileOperationsService { + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroupProfiles/{containerGroupProfileName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerGroupProfileName") String containerGroupProfileName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ContainerGroupProfileInner containerGroupProfile, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroupProfiles/{containerGroupProfileName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono update(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerGroupProfileName") String containerGroupProfileName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ContainerGroupProfilePatch properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroupProfiles/{containerGroupProfileName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerGroupProfileName") String containerGroupProfileName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroupProfiles/{containerGroupProfileName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerGroupProfileName") String containerGroupProfileName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroupProfiles/{containerGroupProfileName}/revisions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAllRevisions(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerGroupProfileName") String containerGroupProfileName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroupProfiles/{containerGroupProfileName}/revisions/{revisionNumber}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByRevisionNumber(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerGroupProfileName") String containerGroupProfileName, + @QueryParam("api-version") String apiVersion, @PathParam("revisionNumber") String revisionNumber, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAllRevisionsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Create or Update a ContainerGroupProfile + * + * Create a CGProfile if it doesn't exist or update an existing CGProfile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupProfileName ContainerGroupProfile name. + * @param containerGroupProfile The ContainerGroupProfile object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container group profile object on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync(String resourceGroupName, + String containerGroupProfileName, ContainerGroupProfileInner containerGroupProfile) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerGroupProfileName == null) { + return Mono.error( + new IllegalArgumentException("Parameter containerGroupProfileName is required and cannot be null.")); + } + if (containerGroupProfile == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerGroupProfile is required and cannot be null.")); + } else { + containerGroupProfile.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, containerGroupProfileName, this.client.getApiVersion(), containerGroupProfile, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or Update a ContainerGroupProfile + * + * Create a CGProfile if it doesn't exist or update an existing CGProfile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupProfileName ContainerGroupProfile name. + * @param containerGroupProfile The ContainerGroupProfile object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container group profile object on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync(String resourceGroupName, + String containerGroupProfileName, ContainerGroupProfileInner containerGroupProfile, 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 (containerGroupProfileName == null) { + return Mono.error( + new IllegalArgumentException("Parameter containerGroupProfileName is required and cannot be null.")); + } + if (containerGroupProfile == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerGroupProfile is required and cannot be null.")); + } else { + containerGroupProfile.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + containerGroupProfileName, this.client.getApiVersion(), containerGroupProfile, accept, context); + } + + /** + * Create or Update a ContainerGroupProfile + * + * Create a CGProfile if it doesn't exist or update an existing CGProfile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupProfileName ContainerGroupProfile name. + * @param containerGroupProfile The ContainerGroupProfile object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container group profile object on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, + String containerGroupProfileName, ContainerGroupProfileInner containerGroupProfile) { + return createOrUpdateWithResponseAsync(resourceGroupName, containerGroupProfileName, containerGroupProfile) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Create or Update a ContainerGroupProfile + * + * Create a CGProfile if it doesn't exist or update an existing CGProfile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupProfileName ContainerGroupProfile name. + * @param containerGroupProfile The ContainerGroupProfile object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container group profile object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CGProfileOperationsCreateOrUpdateResponse createOrUpdateWithResponse(String resourceGroupName, + String containerGroupProfileName, ContainerGroupProfileInner containerGroupProfile, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, containerGroupProfileName, containerGroupProfile, + context).block(); + } + + /** + * Create or Update a ContainerGroupProfile + * + * Create a CGProfile if it doesn't exist or update an existing CGProfile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupProfileName ContainerGroupProfile name. + * @param containerGroupProfile The ContainerGroupProfile object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container group profile object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContainerGroupProfileInner createOrUpdate(String resourceGroupName, String containerGroupProfileName, + ContainerGroupProfileInner containerGroupProfile) { + return createOrUpdateWithResponse(resourceGroupName, containerGroupProfileName, containerGroupProfile, + Context.NONE).getValue(); + } + + /** + * Container group profile PATCH REST API. + * + * Update a specified container group profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupProfileName ContainerGroupProfile name. + * @param properties The container group profile properties that need to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container group profile object on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateWithResponseAsync(String resourceGroupName, + String containerGroupProfileName, ContainerGroupProfilePatch properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerGroupProfileName == null) { + return Mono.error( + new IllegalArgumentException("Parameter containerGroupProfileName is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, containerGroupProfileName, this.client.getApiVersion(), properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Container group profile PATCH REST API. + * + * Update a specified container group profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupProfileName ContainerGroupProfile name. + * @param properties The container group profile properties that need to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container group profile object on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateWithResponseAsync(String resourceGroupName, + String containerGroupProfileName, ContainerGroupProfilePatch properties, 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 (containerGroupProfileName == null) { + return Mono.error( + new IllegalArgumentException("Parameter containerGroupProfileName is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + containerGroupProfileName, this.client.getApiVersion(), properties, accept, context); + } + + /** + * Container group profile PATCH REST API. + * + * Update a specified container group profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupProfileName ContainerGroupProfile name. + * @param properties The container group profile properties that need to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container group profile object on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String containerGroupProfileName, + ContainerGroupProfilePatch properties) { + return updateWithResponseAsync(resourceGroupName, containerGroupProfileName, properties) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Container group profile PATCH REST API. + * + * Update a specified container group profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupProfileName ContainerGroupProfile name. + * @param properties The container group profile properties that need to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container group profile object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CGProfileOperationsUpdateResponse updateWithResponse(String resourceGroupName, + String containerGroupProfileName, ContainerGroupProfilePatch properties, Context context) { + return updateWithResponseAsync(resourceGroupName, containerGroupProfileName, properties, context).block(); + } + + /** + * Container group profile PATCH REST API. + * + * Update a specified container group profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupProfileName ContainerGroupProfile name. + * @param properties The container group profile properties that need to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container group profile object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContainerGroupProfileInner update(String resourceGroupName, String containerGroupProfileName, + ContainerGroupProfilePatch properties) { + return updateWithResponse(resourceGroupName, containerGroupProfileName, properties, Context.NONE).getValue(); + } + + /** + * Display information about a specified ContainerGroupProfile. + * + * Get the properties of the specified container group profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupProfileName ContainerGroupProfile name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified container group profile along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String containerGroupProfileName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerGroupProfileName == null) { + return Mono.error( + new IllegalArgumentException("Parameter containerGroupProfileName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), + this.client.getApiVersion(), resourceGroupName, containerGroupProfileName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Display information about a specified ContainerGroupProfile. + * + * Get the properties of the specified container group profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupProfileName ContainerGroupProfile name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified container group profile along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String containerGroupProfileName, 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 (containerGroupProfileName == null) { + return Mono.error( + new IllegalArgumentException("Parameter containerGroupProfileName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), + this.client.getApiVersion(), resourceGroupName, containerGroupProfileName, accept, context); + } + + /** + * Display information about a specified ContainerGroupProfile. + * + * Get the properties of the specified container group profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupProfileName ContainerGroupProfile name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified container group profile on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, + String containerGroupProfileName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, containerGroupProfileName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Display information about a specified ContainerGroupProfile. + * + * Get the properties of the specified container group profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupProfileName ContainerGroupProfile name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified container group profile along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String containerGroupProfileName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, containerGroupProfileName, context).block(); + } + + /** + * Display information about a specified ContainerGroupProfile. + * + * Get the properties of the specified container group profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupProfileName ContainerGroupProfile name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified container group profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContainerGroupProfileInner getByResourceGroup(String resourceGroupName, String containerGroupProfileName) { + return getByResourceGroupWithResponse(resourceGroupName, containerGroupProfileName, Context.NONE).getValue(); + } + + /** + * Container group profile DELETE REST API. + * + * Deletes a container group profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupProfileName ContainerGroupProfile name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 containerGroupProfileName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerGroupProfileName == null) { + return Mono.error( + new IllegalArgumentException("Parameter containerGroupProfileName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, containerGroupProfileName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Container group profile DELETE REST API. + * + * Deletes a container group profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupProfileName ContainerGroupProfile name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 containerGroupProfileName, 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 (containerGroupProfileName == null) { + return Mono.error( + new IllegalArgumentException("Parameter containerGroupProfileName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + containerGroupProfileName, this.client.getApiVersion(), accept, context); + } + + /** + * Container group profile DELETE REST API. + * + * Deletes a container group profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupProfileName ContainerGroupProfile name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 containerGroupProfileName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, containerGroupProfileName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Container group profile DELETE REST API. + * + * Deletes a container group profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupProfileName ContainerGroupProfile name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 containerGroupProfileName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, containerGroupProfileName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Container group profile DELETE REST API. + * + * Deletes a container group profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupProfileName ContainerGroupProfile name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 containerGroupProfileName) { + return this.beginDeleteAsync(resourceGroupName, containerGroupProfileName).getSyncPoller(); + } + + /** + * Container group profile DELETE REST API. + * + * Deletes a container group profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupProfileName ContainerGroupProfile name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 containerGroupProfileName, + Context context) { + return this.beginDeleteAsync(resourceGroupName, containerGroupProfileName, context).getSyncPoller(); + } + + /** + * Container group profile DELETE REST API. + * + * Deletes a container group profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupProfileName ContainerGroupProfile name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 containerGroupProfileName) { + return beginDeleteAsync(resourceGroupName, containerGroupProfileName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Container group profile DELETE REST API. + * + * Deletes a container group profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupProfileName ContainerGroupProfile name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 containerGroupProfileName, Context context) { + return beginDeleteAsync(resourceGroupName, containerGroupProfileName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Container group profile DELETE REST API. + * + * Deletes a container group profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupProfileName ContainerGroupProfile name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 containerGroupProfileName) { + deleteAsync(resourceGroupName, containerGroupProfileName).block(); + } + + /** + * Container group profile DELETE REST API. + * + * Deletes a container group profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupProfileName ContainerGroupProfile name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 containerGroupProfileName, Context context) { + deleteAsync(resourceGroupName, containerGroupProfileName, context).block(); + } + + /** + * Get a list of all the revisions of the specified container group profile in the given subscription and resource + * group. + * + * Get a list of all the revisions of the specified container group profile in the given subscription and resource + * group. This operation returns properties of each revision of the specified container group profile including + * containers, image registry credentials, restart policy, IP address type, OS type volumes, revision number, etc. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupProfileName ContainerGroupProfile name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all the revisions of the specified container group profile in the given subscription and + * resource group along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllRevisionsSinglePageAsync(String resourceGroupName, + String containerGroupProfileName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerGroupProfileName == null) { + return Mono.error( + new IllegalArgumentException("Parameter containerGroupProfileName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listAllRevisions(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, containerGroupProfileName, 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())); + } + + /** + * Get a list of all the revisions of the specified container group profile in the given subscription and resource + * group. + * + * Get a list of all the revisions of the specified container group profile in the given subscription and resource + * group. This operation returns properties of each revision of the specified container group profile including + * containers, image registry credentials, restart policy, IP address type, OS type volumes, revision number, etc. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupProfileName ContainerGroupProfile name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all the revisions of the specified container group profile in the given subscription and + * resource group along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllRevisionsSinglePageAsync(String resourceGroupName, + String containerGroupProfileName, 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 (containerGroupProfileName == null) { + return Mono.error( + new IllegalArgumentException("Parameter containerGroupProfileName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listAllRevisions(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + containerGroupProfileName, this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get a list of all the revisions of the specified container group profile in the given subscription and resource + * group. + * + * Get a list of all the revisions of the specified container group profile in the given subscription and resource + * group. This operation returns properties of each revision of the specified container group profile including + * containers, image registry credentials, restart policy, IP address type, OS type volumes, revision number, etc. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupProfileName ContainerGroupProfile name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all the revisions of the specified container group profile in the given subscription and + * resource group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAllRevisionsAsync(String resourceGroupName, + String containerGroupProfileName) { + return new PagedFlux<>(() -> listAllRevisionsSinglePageAsync(resourceGroupName, containerGroupProfileName), + nextLink -> listAllRevisionsNextSinglePageAsync(nextLink)); + } + + /** + * Get a list of all the revisions of the specified container group profile in the given subscription and resource + * group. + * + * Get a list of all the revisions of the specified container group profile in the given subscription and resource + * group. This operation returns properties of each revision of the specified container group profile including + * containers, image registry credentials, restart policy, IP address type, OS type volumes, revision number, etc. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupProfileName ContainerGroupProfile name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all the revisions of the specified container group profile in the given subscription and + * resource group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAllRevisionsAsync(String resourceGroupName, + String containerGroupProfileName, Context context) { + return new PagedFlux<>( + () -> listAllRevisionsSinglePageAsync(resourceGroupName, containerGroupProfileName, context), + nextLink -> listAllRevisionsNextSinglePageAsync(nextLink, context)); + } + + /** + * Get a list of all the revisions of the specified container group profile in the given subscription and resource + * group. + * + * Get a list of all the revisions of the specified container group profile in the given subscription and resource + * group. This operation returns properties of each revision of the specified container group profile including + * containers, image registry credentials, restart policy, IP address type, OS type volumes, revision number, etc. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupProfileName ContainerGroupProfile name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all the revisions of the specified container group profile in the given subscription and + * resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAllRevisions(String resourceGroupName, + String containerGroupProfileName) { + return new PagedIterable<>(listAllRevisionsAsync(resourceGroupName, containerGroupProfileName)); + } + + /** + * Get a list of all the revisions of the specified container group profile in the given subscription and resource + * group. + * + * Get a list of all the revisions of the specified container group profile in the given subscription and resource + * group. This operation returns properties of each revision of the specified container group profile including + * containers, image registry credentials, restart policy, IP address type, OS type volumes, revision number, etc. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupProfileName ContainerGroupProfile name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all the revisions of the specified container group profile in the given subscription and + * resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAllRevisions(String resourceGroupName, + String containerGroupProfileName, Context context) { + return new PagedIterable<>(listAllRevisionsAsync(resourceGroupName, containerGroupProfileName, context)); + } + + /** + * Get the properties of the specified revision of the container group profile. + * + * Gets the properties of the specified revision of the container group profile in the given subscription and + * resource group. The operation returns the properties of container group profile including containers, image + * registry credentials, restart policy, IP address type, OS type, volumes, current revision number, etc. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupProfileName ContainerGroupProfile name. + * @param revisionNumber The revision number of the container group profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified revision of the container group profile in the given subscription and + * resource group along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByRevisionNumberWithResponseAsync(String resourceGroupName, + String containerGroupProfileName, String revisionNumber) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerGroupProfileName == null) { + return Mono.error( + new IllegalArgumentException("Parameter containerGroupProfileName is required and cannot be null.")); + } + if (revisionNumber == null) { + return Mono.error(new IllegalArgumentException("Parameter revisionNumber is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByRevisionNumber(this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, containerGroupProfileName, + this.client.getApiVersion(), revisionNumber, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the properties of the specified revision of the container group profile. + * + * Gets the properties of the specified revision of the container group profile in the given subscription and + * resource group. The operation returns the properties of container group profile including containers, image + * registry credentials, restart policy, IP address type, OS type, volumes, current revision number, etc. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupProfileName ContainerGroupProfile name. + * @param revisionNumber The revision number of the container group profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified revision of the container group profile in the given subscription and + * resource group along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByRevisionNumberWithResponseAsync(String resourceGroupName, + String containerGroupProfileName, String revisionNumber, 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 (containerGroupProfileName == null) { + return Mono.error( + new IllegalArgumentException("Parameter containerGroupProfileName is required and cannot be null.")); + } + if (revisionNumber == null) { + return Mono.error(new IllegalArgumentException("Parameter revisionNumber is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByRevisionNumber(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, containerGroupProfileName, this.client.getApiVersion(), revisionNumber, accept, context); + } + + /** + * Get the properties of the specified revision of the container group profile. + * + * Gets the properties of the specified revision of the container group profile in the given subscription and + * resource group. The operation returns the properties of container group profile including containers, image + * registry credentials, restart policy, IP address type, OS type, volumes, current revision number, etc. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupProfileName ContainerGroupProfile name. + * @param revisionNumber The revision number of the container group profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified revision of the container group profile in the given subscription and + * resource group on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByRevisionNumberAsync(String resourceGroupName, + String containerGroupProfileName, String revisionNumber) { + return getByRevisionNumberWithResponseAsync(resourceGroupName, containerGroupProfileName, revisionNumber) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the properties of the specified revision of the container group profile. + * + * Gets the properties of the specified revision of the container group profile in the given subscription and + * resource group. The operation returns the properties of container group profile including containers, image + * registry credentials, restart policy, IP address type, OS type, volumes, current revision number, etc. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupProfileName ContainerGroupProfile name. + * @param revisionNumber The revision number of the container group profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified revision of the container group profile in the given subscription and + * resource group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByRevisionNumberWithResponse(String resourceGroupName, + String containerGroupProfileName, String revisionNumber, Context context) { + return getByRevisionNumberWithResponseAsync(resourceGroupName, containerGroupProfileName, revisionNumber, + context).block(); + } + + /** + * Get the properties of the specified revision of the container group profile. + * + * Gets the properties of the specified revision of the container group profile in the given subscription and + * resource group. The operation returns the properties of container group profile including containers, image + * registry credentials, restart policy, IP address type, OS type, volumes, current revision number, etc. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupProfileName ContainerGroupProfile name. + * @param revisionNumber The revision number of the container group profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified revision of the container group profile in the given subscription and + * resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContainerGroupProfileInner getByRevisionNumber(String resourceGroupName, String containerGroupProfileName, + String revisionNumber) { + return getByRevisionNumberWithResponse(resourceGroupName, containerGroupProfileName, revisionNumber, + Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the container group profile list response along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllRevisionsNextSinglePageAsync(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.listAllRevisionsNext(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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the container group profile list response along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllRevisionsNextSinglePageAsync(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.listAllRevisionsNext(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/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/CGProfileOperationsImpl.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/CGProfileOperationsImpl.java new file mode 100644 index 000000000000..e162796dbcc3 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/CGProfileOperationsImpl.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.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.containerinstance.generated.fluent.CGProfileOperationsClient; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.ContainerGroupProfileInner; +import com.azure.resourcemanager.containerinstance.generated.models.CGProfileOperations; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupProfile; + +public final class CGProfileOperationsImpl implements CGProfileOperations { + private static final ClientLogger LOGGER = new ClientLogger(CGProfileOperationsImpl.class); + + private final CGProfileOperationsClient innerClient; + + private final com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager; + + public CGProfileOperationsImpl(CGProfileOperationsClient innerClient, + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, + String containerGroupProfileName, Context context) { + Response inner = this.serviceClient() + .getByResourceGroupWithResponse(resourceGroupName, containerGroupProfileName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ContainerGroupProfileImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ContainerGroupProfile getByResourceGroup(String resourceGroupName, String containerGroupProfileName) { + ContainerGroupProfileInner inner + = this.serviceClient().getByResourceGroup(resourceGroupName, containerGroupProfileName); + if (inner != null) { + return new ContainerGroupProfileImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String containerGroupProfileName) { + this.serviceClient().delete(resourceGroupName, containerGroupProfileName); + } + + public void delete(String resourceGroupName, String containerGroupProfileName, Context context) { + this.serviceClient().delete(resourceGroupName, containerGroupProfileName, context); + } + + public PagedIterable listAllRevisions(String resourceGroupName, + String containerGroupProfileName) { + PagedIterable inner + = this.serviceClient().listAllRevisions(resourceGroupName, containerGroupProfileName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ContainerGroupProfileImpl(inner1, this.manager())); + } + + public PagedIterable listAllRevisions(String resourceGroupName, + String containerGroupProfileName, Context context) { + PagedIterable inner + = this.serviceClient().listAllRevisions(resourceGroupName, containerGroupProfileName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ContainerGroupProfileImpl(inner1, this.manager())); + } + + public Response getByRevisionNumberWithResponse(String resourceGroupName, + String containerGroupProfileName, String revisionNumber, Context context) { + Response inner = this.serviceClient() + .getByRevisionNumberWithResponse(resourceGroupName, containerGroupProfileName, revisionNumber, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ContainerGroupProfileImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ContainerGroupProfile getByRevisionNumber(String resourceGroupName, String containerGroupProfileName, + String revisionNumber) { + ContainerGroupProfileInner inner + = this.serviceClient().getByRevisionNumber(resourceGroupName, containerGroupProfileName, revisionNumber); + if (inner != null) { + return new ContainerGroupProfileImpl(inner, this.manager()); + } else { + return null; + } + } + + public ContainerGroupProfile getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String containerGroupProfileName = ResourceManagerUtils.getValueFromIdByName(id, "containerGroupProfiles"); + if (containerGroupProfileName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'containerGroupProfiles'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, containerGroupProfileName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String containerGroupProfileName = ResourceManagerUtils.getValueFromIdByName(id, "containerGroupProfiles"); + if (containerGroupProfileName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'containerGroupProfiles'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, containerGroupProfileName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String containerGroupProfileName = ResourceManagerUtils.getValueFromIdByName(id, "containerGroupProfiles"); + if (containerGroupProfileName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'containerGroupProfiles'.", id))); + } + this.delete(resourceGroupName, containerGroupProfileName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String containerGroupProfileName = ResourceManagerUtils.getValueFromIdByName(id, "containerGroupProfiles"); + if (containerGroupProfileName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'containerGroupProfiles'.", id))); + } + this.delete(resourceGroupName, containerGroupProfileName, context); + } + + private CGProfileOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager() { + return this.serviceManager; + } + + public ContainerGroupProfileImpl define(String name) { + return new ContainerGroupProfileImpl(name, this.manager()); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/CGProfilesClientImpl.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/CGProfilesClientImpl.java new file mode 100644 index 000000000000..bbb9e711ac6a --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/CGProfilesClientImpl.java @@ -0,0 +1,479 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.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.containerinstance.generated.fluent.CGProfilesClient; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.ContainerGroupProfileInner; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupProfileListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in CGProfilesClient. + */ +public final class CGProfilesClientImpl implements CGProfilesClient { + /** + * The proxy service used to perform REST calls. + */ + private final CGProfilesService service; + + /** + * The service client containing this operation class. + */ + private final ContainerInstanceManagementClientImpl client; + + /** + * Initializes an instance of CGProfilesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CGProfilesClientImpl(ContainerInstanceManagementClientImpl client) { + this.service + = RestProxy.create(CGProfilesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerInstanceManagementClientCGProfiles to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerInstanceMan") + public interface CGProfilesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/containerGroupProfiles") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroupProfiles") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List container group profiles in a subscription. + * + * Gets a list of all container group profiles under a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all container group profiles under a subscription along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List container group profiles in a subscription. + * + * Gets a list of all container group profiles under a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all container group profiles under a subscription along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List container group profiles in a subscription. + * + * Gets a list of all container group profiles under a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all container group profiles under a subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List container group profiles in a subscription. + * + * Gets a list of all container group profiles under a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all container group profiles under a subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List container group profiles in a subscription. + * + * Gets a list of all container group profiles under a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all container group profiles under a subscription as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List container group profiles in a subscription. + * + * Gets a list of all container group profiles under a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all container group profiles under a subscription as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List container group profiles in a resource group. + * + * Gets a list of all container group profiles under a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all container group profiles under a resource group along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List container group profiles in a resource group. + * + * Gets a list of all container group profiles under a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all container group profiles under a resource group along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List container group profiles in a resource group. + * + * Gets a list of all container group profiles under a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all container group profiles under a resource group as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List container group profiles in a resource group. + * + * Gets a list of all container group profiles under a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all container group profiles under a resource group as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List container group profiles in a resource group. + * + * Gets a list of all container group profiles under a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all container group profiles under a resource group as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List container group profiles in a resource group. + * + * Gets a list of all container group profiles under a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all container group profiles under a resource group as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the container group profile list response along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the container group profile list response along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the container group profile list response along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the container group profile list response along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/CGProfilesImpl.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/CGProfilesImpl.java new file mode 100644 index 000000000000..f8e661af45ff --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/CGProfilesImpl.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerinstance.generated.fluent.CGProfilesClient; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.ContainerGroupProfileInner; +import com.azure.resourcemanager.containerinstance.generated.models.CGProfiles; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupProfile; + +public final class CGProfilesImpl implements CGProfiles { + private static final ClientLogger LOGGER = new ClientLogger(CGProfilesImpl.class); + + private final CGProfilesClient innerClient; + + private final com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager; + + public CGProfilesImpl(CGProfilesClient innerClient, + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ContainerGroupProfileImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ContainerGroupProfileImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ContainerGroupProfileImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ContainerGroupProfileImpl(inner1, this.manager())); + } + + private CGProfilesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/CachedImagesImpl.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/CachedImagesImpl.java new file mode 100644 index 000000000000..9de395ccd789 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/CachedImagesImpl.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.containerinstance.generated.implementation; + +import com.azure.resourcemanager.containerinstance.generated.fluent.models.CachedImagesInner; +import com.azure.resourcemanager.containerinstance.generated.models.CachedImages; + +public final class CachedImagesImpl implements CachedImages { + private CachedImagesInner innerObject; + + private final com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager; + + CachedImagesImpl(CachedImagesInner innerObject, + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String osType() { + return this.innerModel().osType(); + } + + public String image() { + return this.innerModel().image(); + } + + public CachedImagesInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/CapabilitiesImpl.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/CapabilitiesImpl.java new file mode 100644 index 000000000000..e8c4e5f490c5 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/CapabilitiesImpl.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.containerinstance.generated.implementation; + +import com.azure.resourcemanager.containerinstance.generated.fluent.models.CapabilitiesInner; +import com.azure.resourcemanager.containerinstance.generated.models.Capabilities; +import com.azure.resourcemanager.containerinstance.generated.models.CapabilitiesCapabilities; + +public final class CapabilitiesImpl implements Capabilities { + private CapabilitiesInner innerObject; + + private final com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager; + + CapabilitiesImpl(CapabilitiesInner innerObject, + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String resourceType() { + return this.innerModel().resourceType(); + } + + public String osType() { + return this.innerModel().osType(); + } + + public String location() { + return this.innerModel().location(); + } + + public String ipAddressType() { + return this.innerModel().ipAddressType(); + } + + public String gpu() { + return this.innerModel().gpu(); + } + + public CapabilitiesCapabilities capabilities() { + return this.innerModel().capabilities(); + } + + public CapabilitiesInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerAttachResponseImpl.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerAttachResponseImpl.java new file mode 100644 index 000000000000..6752d44f496a --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerAttachResponseImpl.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.containerinstance.generated.implementation; + +import com.azure.resourcemanager.containerinstance.generated.fluent.models.ContainerAttachResponseInner; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerAttachResponse; + +public final class ContainerAttachResponseImpl implements ContainerAttachResponse { + private ContainerAttachResponseInner innerObject; + + private final com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager; + + ContainerAttachResponseImpl(ContainerAttachResponseInner innerObject, + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String webSocketUri() { + return this.innerModel().webSocketUri(); + } + + public String password() { + return this.innerModel().password(); + } + + public ContainerAttachResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerExecResponseImpl.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerExecResponseImpl.java new file mode 100644 index 000000000000..52b4133b4064 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerExecResponseImpl.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.containerinstance.generated.implementation; + +import com.azure.resourcemanager.containerinstance.generated.fluent.models.ContainerExecResponseInner; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerExecResponse; + +public final class ContainerExecResponseImpl implements ContainerExecResponse { + private ContainerExecResponseInner innerObject; + + private final com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager; + + ContainerExecResponseImpl(ContainerExecResponseInner innerObject, + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String webSocketUri() { + return this.innerModel().webSocketUri(); + } + + public String password() { + return this.innerModel().password(); + } + + public ContainerExecResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerGroupImpl.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerGroupImpl.java new file mode 100644 index 000000000000..9f05710df1b9 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerGroupImpl.java @@ -0,0 +1,415 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.ContainerGroupInner; +import com.azure.resourcemanager.containerinstance.generated.models.ConfidentialComputeProperties; +import com.azure.resourcemanager.containerinstance.generated.models.Container; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroup; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupDiagnostics; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupIdentity; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupPriority; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupPropertiesInstanceView; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupRestartPolicy; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupSku; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupSubnetId; +import com.azure.resourcemanager.containerinstance.generated.models.DeploymentExtensionSpec; +import com.azure.resourcemanager.containerinstance.generated.models.DnsConfiguration; +import com.azure.resourcemanager.containerinstance.generated.models.EncryptionProperties; +import com.azure.resourcemanager.containerinstance.generated.models.IdentityAcls; +import com.azure.resourcemanager.containerinstance.generated.models.ImageRegistryCredential; +import com.azure.resourcemanager.containerinstance.generated.models.InitContainerDefinition; +import com.azure.resourcemanager.containerinstance.generated.models.IpAddress; +import com.azure.resourcemanager.containerinstance.generated.models.OperatingSystemTypes; +import com.azure.resourcemanager.containerinstance.generated.models.SecretReference; +import com.azure.resourcemanager.containerinstance.generated.models.Volume; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class ContainerGroupImpl implements ContainerGroup, ContainerGroup.Definition, ContainerGroup.Update { + private ContainerGroupInner innerObject; + + private final com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager 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 List zones() { + List inner = this.innerModel().zones(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ContainerGroupIdentity identity() { + return this.innerModel().identity(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public List secretReferences() { + List inner = this.innerModel().secretReferences(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List containers() { + List inner = this.innerModel().containers(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List imageRegistryCredentials() { + List inner = this.innerModel().imageRegistryCredentials(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ContainerGroupRestartPolicy restartPolicy() { + return this.innerModel().restartPolicy(); + } + + public IpAddress ipAddress() { + return this.innerModel().ipAddress(); + } + + public OperatingSystemTypes osType() { + return this.innerModel().osType(); + } + + public List volumes() { + List inner = this.innerModel().volumes(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ContainerGroupPropertiesInstanceView instanceView() { + return this.innerModel().instanceView(); + } + + public ContainerGroupDiagnostics diagnostics() { + return this.innerModel().diagnostics(); + } + + public List subnetIds() { + List inner = this.innerModel().subnetIds(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public DnsConfiguration dnsConfig() { + return this.innerModel().dnsConfig(); + } + + public ContainerGroupSku sku() { + return this.innerModel().sku(); + } + + public EncryptionProperties encryptionProperties() { + return this.innerModel().encryptionProperties(); + } + + public List initContainers() { + List inner = this.innerModel().initContainers(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List extensions() { + List inner = this.innerModel().extensions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ConfidentialComputeProperties confidentialComputeProperties() { + return this.innerModel().confidentialComputeProperties(); + } + + public ContainerGroupPriority priority() { + return this.innerModel().priority(); + } + + public IdentityAcls identityAcls() { + return this.innerModel().identityAcls(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ContainerGroupInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String containerGroupName; + + public ContainerGroupImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public ContainerGroup create() { + this.innerObject = serviceManager.serviceClient() + .getContainerGroups() + .createOrUpdate(resourceGroupName, containerGroupName, this.innerModel(), Context.NONE); + return this; + } + + public ContainerGroup create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getContainerGroups() + .createOrUpdate(resourceGroupName, containerGroupName, this.innerModel(), context); + return this; + } + + ContainerGroupImpl(String name, + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager) { + this.innerObject = new ContainerGroupInner(); + this.serviceManager = serviceManager; + this.containerGroupName = name; + } + + public ContainerGroupImpl update() { + return this; + } + + public ContainerGroup apply() { + this.innerObject = serviceManager.serviceClient() + .getContainerGroups() + .createOrUpdate(resourceGroupName, containerGroupName, this.innerModel(), Context.NONE); + return this; + } + + public ContainerGroup apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getContainerGroups() + .createOrUpdate(resourceGroupName, containerGroupName, this.innerModel(), context); + return this; + } + + ContainerGroupImpl(ContainerGroupInner innerObject, + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.containerGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "containerGroups"); + } + + public ContainerGroup refresh() { + this.innerObject = serviceManager.serviceClient() + .getContainerGroups() + .getByResourceGroupWithResponse(resourceGroupName, containerGroupName, Context.NONE) + .getValue(); + return this; + } + + public ContainerGroup refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getContainerGroups() + .getByResourceGroupWithResponse(resourceGroupName, containerGroupName, context) + .getValue(); + return this; + } + + public void restart() { + serviceManager.containerGroups().restart(resourceGroupName, containerGroupName); + } + + public void restart(Context context) { + serviceManager.containerGroups().restart(resourceGroupName, containerGroupName, context); + } + + public Response stopWithResponse(Context context) { + return serviceManager.containerGroups().stopWithResponse(resourceGroupName, containerGroupName, context); + } + + public void stop() { + serviceManager.containerGroups().stop(resourceGroupName, containerGroupName); + } + + public void start() { + serviceManager.containerGroups().start(resourceGroupName, containerGroupName); + } + + public void start(Context context) { + serviceManager.containerGroups().start(resourceGroupName, containerGroupName, context); + } + + public ContainerGroupImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ContainerGroupImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ContainerGroupImpl withContainers(List containers) { + this.innerModel().withContainers(containers); + return this; + } + + public ContainerGroupImpl withOsType(OperatingSystemTypes osType) { + this.innerModel().withOsType(osType); + return this; + } + + public ContainerGroupImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public ContainerGroupImpl withZones(List zones) { + this.innerModel().withZones(zones); + return this; + } + + public ContainerGroupImpl withIdentity(ContainerGroupIdentity identity) { + this.innerModel().withIdentity(identity); + return this; + } + + public ContainerGroupImpl withSecretReferences(List secretReferences) { + this.innerModel().withSecretReferences(secretReferences); + return this; + } + + public ContainerGroupImpl withImageRegistryCredentials(List imageRegistryCredentials) { + this.innerModel().withImageRegistryCredentials(imageRegistryCredentials); + return this; + } + + public ContainerGroupImpl withRestartPolicy(ContainerGroupRestartPolicy restartPolicy) { + this.innerModel().withRestartPolicy(restartPolicy); + return this; + } + + public ContainerGroupImpl withIpAddress(IpAddress ipAddress) { + this.innerModel().withIpAddress(ipAddress); + return this; + } + + public ContainerGroupImpl withVolumes(List volumes) { + this.innerModel().withVolumes(volumes); + return this; + } + + public ContainerGroupImpl withDiagnostics(ContainerGroupDiagnostics diagnostics) { + this.innerModel().withDiagnostics(diagnostics); + return this; + } + + public ContainerGroupImpl withSubnetIds(List subnetIds) { + this.innerModel().withSubnetIds(subnetIds); + return this; + } + + public ContainerGroupImpl withDnsConfig(DnsConfiguration dnsConfig) { + this.innerModel().withDnsConfig(dnsConfig); + return this; + } + + public ContainerGroupImpl withSku(ContainerGroupSku sku) { + this.innerModel().withSku(sku); + return this; + } + + public ContainerGroupImpl withEncryptionProperties(EncryptionProperties encryptionProperties) { + this.innerModel().withEncryptionProperties(encryptionProperties); + return this; + } + + public ContainerGroupImpl withInitContainers(List initContainers) { + this.innerModel().withInitContainers(initContainers); + return this; + } + + public ContainerGroupImpl withExtensions(List extensions) { + this.innerModel().withExtensions(extensions); + return this; + } + + public ContainerGroupImpl + withConfidentialComputeProperties(ConfidentialComputeProperties confidentialComputeProperties) { + this.innerModel().withConfidentialComputeProperties(confidentialComputeProperties); + return this; + } + + public ContainerGroupImpl withPriority(ContainerGroupPriority priority) { + this.innerModel().withPriority(priority); + return this; + } + + public ContainerGroupImpl withIdentityAcls(IdentityAcls identityAcls) { + this.innerModel().withIdentityAcls(identityAcls); + return this; + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerGroupProfileImpl.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerGroupProfileImpl.java new file mode 100644 index 000000000000..aedf87112b55 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerGroupProfileImpl.java @@ -0,0 +1,407 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.ContainerGroupProfileInner; +import com.azure.resourcemanager.containerinstance.generated.models.ConfidentialComputeProperties; +import com.azure.resourcemanager.containerinstance.generated.models.Container; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupDiagnostics; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupPriority; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupProfile; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupProfilePatch; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupRestartPolicy; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupSku; +import com.azure.resourcemanager.containerinstance.generated.models.DeploymentExtensionSpec; +import com.azure.resourcemanager.containerinstance.generated.models.EncryptionProperties; +import com.azure.resourcemanager.containerinstance.generated.models.ImageRegistryCredential; +import com.azure.resourcemanager.containerinstance.generated.models.InitContainerDefinition; +import com.azure.resourcemanager.containerinstance.generated.models.IpAddress; +import com.azure.resourcemanager.containerinstance.generated.models.OperatingSystemTypes; +import com.azure.resourcemanager.containerinstance.generated.models.SecurityContextDefinition; +import com.azure.resourcemanager.containerinstance.generated.models.Volume; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class ContainerGroupProfileImpl + implements ContainerGroupProfile, ContainerGroupProfile.Definition, ContainerGroupProfile.Update { + private ContainerGroupProfileInner innerObject; + + private final com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager 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 List zones() { + List inner = this.innerModel().zones(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ContainerGroupSku sku() { + return this.innerModel().sku(); + } + + public EncryptionProperties encryptionProperties() { + return this.innerModel().encryptionProperties(); + } + + public List containers() { + List inner = this.innerModel().containers(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List initContainers() { + List inner = this.innerModel().initContainers(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List extensions() { + List inner = this.innerModel().extensions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List imageRegistryCredentials() { + List inner = this.innerModel().imageRegistryCredentials(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ContainerGroupRestartPolicy restartPolicy() { + return this.innerModel().restartPolicy(); + } + + public OffsetDateTime shutdownGracePeriod() { + return this.innerModel().shutdownGracePeriod(); + } + + public IpAddress ipAddress() { + return this.innerModel().ipAddress(); + } + + public OffsetDateTime timeToLive() { + return this.innerModel().timeToLive(); + } + + public OperatingSystemTypes osType() { + return this.innerModel().osType(); + } + + public List volumes() { + List inner = this.innerModel().volumes(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ContainerGroupDiagnostics diagnostics() { + return this.innerModel().diagnostics(); + } + + public ContainerGroupPriority priority() { + return this.innerModel().priority(); + } + + public ConfidentialComputeProperties confidentialComputeProperties() { + return this.innerModel().confidentialComputeProperties(); + } + + public SecurityContextDefinition securityContext() { + return this.innerModel().securityContext(); + } + + public Long revision() { + return this.innerModel().revision(); + } + + public List registeredRevisions() { + List inner = this.innerModel().registeredRevisions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Boolean useKrypton() { + return this.innerModel().useKrypton(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ContainerGroupProfileInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String containerGroupProfileName; + + private ContainerGroupProfilePatch updateProperties; + + public ContainerGroupProfileImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public ContainerGroupProfile create() { + this.innerObject = serviceManager.serviceClient() + .getCGProfileOperations() + .createOrUpdateWithResponse(resourceGroupName, containerGroupProfileName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public ContainerGroupProfile create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getCGProfileOperations() + .createOrUpdateWithResponse(resourceGroupName, containerGroupProfileName, this.innerModel(), context) + .getValue(); + return this; + } + + ContainerGroupProfileImpl(String name, + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager) { + this.innerObject = new ContainerGroupProfileInner(); + this.serviceManager = serviceManager; + this.containerGroupProfileName = name; + } + + public ContainerGroupProfileImpl update() { + this.updateProperties = new ContainerGroupProfilePatch(); + return this; + } + + public ContainerGroupProfile apply() { + this.innerObject = serviceManager.serviceClient() + .getCGProfileOperations() + .updateWithResponse(resourceGroupName, containerGroupProfileName, updateProperties, Context.NONE) + .getValue(); + return this; + } + + public ContainerGroupProfile apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getCGProfileOperations() + .updateWithResponse(resourceGroupName, containerGroupProfileName, updateProperties, context) + .getValue(); + return this; + } + + ContainerGroupProfileImpl(ContainerGroupProfileInner innerObject, + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.containerGroupProfileName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "containerGroupProfiles"); + } + + public ContainerGroupProfile refresh() { + this.innerObject = serviceManager.serviceClient() + .getCGProfileOperations() + .getByResourceGroupWithResponse(resourceGroupName, containerGroupProfileName, Context.NONE) + .getValue(); + return this; + } + + public ContainerGroupProfile refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getCGProfileOperations() + .getByResourceGroupWithResponse(resourceGroupName, containerGroupProfileName, context) + .getValue(); + return this; + } + + public ContainerGroupProfileImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ContainerGroupProfileImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ContainerGroupProfileImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public ContainerGroupProfileImpl withZones(List zones) { + this.innerModel().withZones(zones); + return this; + } + + public ContainerGroupProfileImpl withSku(ContainerGroupSku sku) { + this.innerModel().withSku(sku); + return this; + } + + public ContainerGroupProfileImpl withEncryptionProperties(EncryptionProperties encryptionProperties) { + this.innerModel().withEncryptionProperties(encryptionProperties); + return this; + } + + public ContainerGroupProfileImpl withContainers(List containers) { + this.innerModel().withContainers(containers); + return this; + } + + public ContainerGroupProfileImpl withInitContainers(List initContainers) { + this.innerModel().withInitContainers(initContainers); + return this; + } + + public ContainerGroupProfileImpl withExtensions(List extensions) { + this.innerModel().withExtensions(extensions); + return this; + } + + public ContainerGroupProfileImpl + withImageRegistryCredentials(List imageRegistryCredentials) { + this.innerModel().withImageRegistryCredentials(imageRegistryCredentials); + return this; + } + + public ContainerGroupProfileImpl withRestartPolicy(ContainerGroupRestartPolicy restartPolicy) { + this.innerModel().withRestartPolicy(restartPolicy); + return this; + } + + public ContainerGroupProfileImpl withShutdownGracePeriod(OffsetDateTime shutdownGracePeriod) { + this.innerModel().withShutdownGracePeriod(shutdownGracePeriod); + return this; + } + + public ContainerGroupProfileImpl withIpAddress(IpAddress ipAddress) { + this.innerModel().withIpAddress(ipAddress); + return this; + } + + public ContainerGroupProfileImpl withTimeToLive(OffsetDateTime timeToLive) { + this.innerModel().withTimeToLive(timeToLive); + return this; + } + + public ContainerGroupProfileImpl withOsType(OperatingSystemTypes osType) { + this.innerModel().withOsType(osType); + return this; + } + + public ContainerGroupProfileImpl withVolumes(List volumes) { + this.innerModel().withVolumes(volumes); + return this; + } + + public ContainerGroupProfileImpl withDiagnostics(ContainerGroupDiagnostics diagnostics) { + this.innerModel().withDiagnostics(diagnostics); + return this; + } + + public ContainerGroupProfileImpl withPriority(ContainerGroupPriority priority) { + this.innerModel().withPriority(priority); + return this; + } + + public ContainerGroupProfileImpl + withConfidentialComputeProperties(ConfidentialComputeProperties confidentialComputeProperties) { + this.innerModel().withConfidentialComputeProperties(confidentialComputeProperties); + return this; + } + + public ContainerGroupProfileImpl withSecurityContext(SecurityContextDefinition securityContext) { + this.innerModel().withSecurityContext(securityContext); + return this; + } + + public ContainerGroupProfileImpl withRevision(Long revision) { + this.innerModel().withRevision(revision); + return this; + } + + public ContainerGroupProfileImpl withRegisteredRevisions(List registeredRevisions) { + this.innerModel().withRegisteredRevisions(registeredRevisions); + return this; + } + + public ContainerGroupProfileImpl withUseKrypton(Boolean useKrypton) { + this.innerModel().withUseKrypton(useKrypton); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerGroupsClientImpl.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerGroupsClientImpl.java new file mode 100644 index 000000000000..5906361bf4e2 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerGroupsClientImpl.java @@ -0,0 +1,2102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.Resource; +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.containerinstance.generated.fluent.ContainerGroupsClient; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.ContainerGroupInner; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.ListResultContainerGroupInner; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupListResult; +import java.nio.ByteBuffer; +import java.util.List; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ContainerGroupsClient. + */ +public final class ContainerGroupsClientImpl implements ContainerGroupsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ContainerGroupsService service; + + /** + * The service client containing this operation class. + */ + private final ContainerInstanceManagementClientImpl client; + + /** + * Initializes an instance of ContainerGroupsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ContainerGroupsClientImpl(ContainerInstanceManagementClientImpl client) { + this.service + = RestProxy.create(ContainerGroupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerInstanceManagementClientContainerGroups to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerInstanceMan") + public interface ContainerGroupsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/containerGroups") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerGroupName") String containerGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerGroupName") String containerGroupName, + @BodyParam("application/json") ContainerGroupInner containerGroup, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerGroupName") String containerGroupName, + @BodyParam("application/json") Resource resource, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerGroupName") String containerGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/restart") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> restart(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerGroupName") String containerGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/stop") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> stop(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerGroupName") String containerGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/start") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> start(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerGroupName") String containerGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/outboundNetworkDependenciesEndpoints") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> getOutboundNetworkDependenciesEndpoints(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerGroupName") String containerGroupName, @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); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a list of container groups in the specified subscription. + * + * Get a list of container groups in the specified subscription. This operation returns properties of each container + * group including containers, image registry credentials, restart policy, IP address type, OS type, state, and + * volumes. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of container groups in the specified subscription along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + 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())); + } + + /** + * Get a list of container groups in the specified subscription. + * + * Get a list of container groups in the specified subscription. This operation returns properties of each container + * group including containers, image registry credentials, restart policy, IP address type, OS type, state, and + * volumes. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of container groups in the specified subscription along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get a list of container groups in the specified subscription. + * + * Get a list of container groups in the specified subscription. This operation returns properties of each container + * group including containers, image registry credentials, restart policy, IP address type, OS type, state, and + * volumes. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of container groups in the specified subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get a list of container groups in the specified subscription. + * + * Get a list of container groups in the specified subscription. This operation returns properties of each container + * group including containers, image registry credentials, restart policy, IP address type, OS type, state, and + * volumes. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of container groups in the specified subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Get a list of container groups in the specified subscription. + * + * Get a list of container groups in the specified subscription. This operation returns properties of each container + * group including containers, image registry credentials, restart policy, IP address type, OS type, state, and + * volumes. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of container groups in the specified subscription as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Get a list of container groups in the specified subscription. + * + * Get a list of container groups in the specified subscription. This operation returns properties of each container + * group including containers, image registry credentials, restart policy, IP address type, OS type, state, and + * volumes. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of container groups in the specified subscription as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * + * Get a list of container groups in a specified subscription and resource group. This operation returns properties + * of each container group including containers, image registry credentials, restart policy, IP address type, OS + * type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of container groups in a specified subscription and resource group along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), + this.client.getSubscriptionId(), this.client.getApiVersion(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * + * Get a list of container groups in a specified subscription and resource group. This operation returns properties + * of each container group including containers, image registry credentials, restart policy, IP address type, OS + * type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of container groups in a specified subscription and resource group along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), + this.client.getApiVersion(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * + * Get a list of container groups in a specified subscription and resource group. This operation returns properties + * of each container group including containers, image registry credentials, restart policy, IP address type, OS + * type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of container groups in a specified subscription and resource group as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * + * Get a list of container groups in a specified subscription and resource group. This operation returns properties + * of each container group including containers, image registry credentials, restart policy, IP address type, OS + * type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of container groups in a specified subscription and resource group as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, + Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * + * Get a list of container groups in a specified subscription and resource group. This operation returns properties + * of each container group including containers, image registry credentials, restart policy, IP address type, OS + * type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of container groups in a specified subscription and resource group as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * + * Get a list of container groups in a specified subscription and resource group. This operation returns properties + * of each container group including containers, image registry credentials, restart policy, IP address type, OS + * type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of container groups in a specified subscription and resource group as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get the properties of the specified container group. + * + * Gets the properties of the specified container group in the specified subscription and resource group. The + * operation returns the properties of each container group including containers, image registry credentials, + * restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified container group in the specified subscription and resource group along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String containerGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), + this.client.getApiVersion(), resourceGroupName, containerGroupName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the properties of the specified container group. + * + * Gets the properties of the specified container group in the specified subscription and resource group. The + * operation returns the properties of each container group including containers, image registry credentials, + * restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified container group in the specified subscription and resource group along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String containerGroupName, 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 (containerGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), + this.client.getApiVersion(), resourceGroupName, containerGroupName, accept, context); + } + + /** + * Get the properties of the specified container group. + * + * Gets the properties of the specified container group in the specified subscription and resource group. The + * operation returns the properties of each container group including containers, image registry credentials, + * restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified container group in the specified subscription and resource group on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String containerGroupName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, containerGroupName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the properties of the specified container group. + * + * Gets the properties of the specified container group in the specified subscription and resource group. The + * operation returns the properties of each container group including containers, image registry credentials, + * restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified container group in the specified subscription and resource group along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String containerGroupName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, containerGroupName, context).block(); + } + + /** + * Get the properties of the specified container group. + * + * Gets the properties of the specified container group in the specified subscription and resource group. The + * operation returns the properties of each container group including containers, image registry credentials, + * restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified container group in the specified subscription and resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContainerGroupInner getByResourceGroup(String resourceGroupName, String containerGroupName) { + return getByResourceGroupWithResponse(resourceGroupName, containerGroupName, Context.NONE).getValue(); + } + + /** + * Create or update container groups. + * + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container group along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String containerGroupName, ContainerGroupInner containerGroup) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null.")); + } + if (containerGroup == null) { + return Mono.error(new IllegalArgumentException("Parameter containerGroup is required and cannot be null.")); + } else { + containerGroup.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + this.client.getApiVersion(), resourceGroupName, containerGroupName, containerGroup, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update container groups. + * + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container group along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String containerGroupName, ContainerGroupInner containerGroup, 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 (containerGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null.")); + } + if (containerGroup == null) { + return Mono.error(new IllegalArgumentException("Parameter containerGroup is required and cannot be null.")); + } else { + containerGroup.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + this.client.getApiVersion(), resourceGroupName, containerGroupName, containerGroup, accept, context); + } + + /** + * Create or update container groups. + * + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a container group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ContainerGroupInner> beginCreateOrUpdateAsync( + String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, containerGroupName, containerGroup); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ContainerGroupInner.class, ContainerGroupInner.class, this.client.getContext()); + } + + /** + * Create or update container groups. + * + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a container group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ContainerGroupInner> beginCreateOrUpdateAsync( + String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, containerGroupName, containerGroup, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ContainerGroupInner.class, ContainerGroupInner.class, context); + } + + /** + * Create or update container groups. + * + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a container group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ContainerGroupInner> + beginCreateOrUpdate(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) { + return this.beginCreateOrUpdateAsync(resourceGroupName, containerGroupName, containerGroup).getSyncPoller(); + } + + /** + * Create or update container groups. + * + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a container group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ContainerGroupInner> beginCreateOrUpdate( + String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup, Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, containerGroupName, containerGroup, context) + .getSyncPoller(); + } + + /** + * Create or update container groups. + * + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container group on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String containerGroupName, + ContainerGroupInner containerGroup) { + return beginCreateOrUpdateAsync(resourceGroupName, containerGroupName, containerGroup).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update container groups. + * + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container group on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String containerGroupName, + ContainerGroupInner containerGroup, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, containerGroupName, containerGroup, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update container groups. + * + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContainerGroupInner createOrUpdate(String resourceGroupName, String containerGroupName, + ContainerGroupInner containerGroup) { + return createOrUpdateAsync(resourceGroupName, containerGroupName, containerGroup).block(); + } + + /** + * Create or update container groups. + * + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContainerGroupInner createOrUpdate(String resourceGroupName, String containerGroupName, + ContainerGroupInner containerGroup, Context context) { + return createOrUpdateAsync(resourceGroupName, containerGroupName, containerGroup, context).block(); + } + + /** + * Update container groups. + * + * Updates container group tags with specified values. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param resource The container group resource with just the tags to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container group along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync(String resourceGroupName, + String containerGroupName, Resource resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), + this.client.getApiVersion(), resourceGroupName, containerGroupName, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update container groups. + * + * Updates container group tags with specified values. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param resource The container group resource with just the tags to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container group along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync(String resourceGroupName, + String containerGroupName, Resource resource, 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 (containerGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), + resourceGroupName, containerGroupName, resource, accept, context); + } + + /** + * Update container groups. + * + * Updates container group tags with specified values. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param resource The container group resource with just the tags to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container group on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String containerGroupName, + Resource resource) { + return updateWithResponseAsync(resourceGroupName, containerGroupName, resource) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Update container groups. + * + * Updates container group tags with specified values. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param resource The container group resource with just the tags to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse(String resourceGroupName, String containerGroupName, + Resource resource, Context context) { + return updateWithResponseAsync(resourceGroupName, containerGroupName, resource, context).block(); + } + + /** + * Update container groups. + * + * Updates container group tags with specified values. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param resource The container group resource with just the tags to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContainerGroupInner update(String resourceGroupName, String containerGroupName, Resource resource) { + return updateWithResponse(resourceGroupName, containerGroupName, resource, Context.NONE).getValue(); + } + + /** + * Delete the specified container group. + * + * Delete the specified container group in the specified subscription and resource group. The operation does not + * delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container group along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String containerGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + this.client.getApiVersion(), resourceGroupName, containerGroupName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete the specified container group. + * + * Delete the specified container group in the specified subscription and resource group. The operation does not + * delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container group along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String containerGroupName, 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 (containerGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), + resourceGroupName, containerGroupName, accept, context); + } + + /** + * Delete the specified container group. + * + * Delete the specified container group in the specified subscription and resource group. The operation does not + * delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a container group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ContainerGroupInner> beginDeleteAsync(String resourceGroupName, + String containerGroupName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, containerGroupName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ContainerGroupInner.class, ContainerGroupInner.class, this.client.getContext()); + } + + /** + * Delete the specified container group. + * + * Delete the specified container group in the specified subscription and resource group. The operation does not + * delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a container group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ContainerGroupInner> beginDeleteAsync(String resourceGroupName, + String containerGroupName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, containerGroupName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ContainerGroupInner.class, ContainerGroupInner.class, context); + } + + /** + * Delete the specified container group. + * + * Delete the specified container group in the specified subscription and resource group. The operation does not + * delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a container group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ContainerGroupInner> beginDelete(String resourceGroupName, + String containerGroupName) { + return this.beginDeleteAsync(resourceGroupName, containerGroupName).getSyncPoller(); + } + + /** + * Delete the specified container group. + * + * Delete the specified container group in the specified subscription and resource group. The operation does not + * delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a container group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ContainerGroupInner> beginDelete(String resourceGroupName, + String containerGroupName, Context context) { + return this.beginDeleteAsync(resourceGroupName, containerGroupName, context).getSyncPoller(); + } + + /** + * Delete the specified container group. + * + * Delete the specified container group in the specified subscription and resource group. The operation does not + * delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container group on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String containerGroupName) { + return beginDeleteAsync(resourceGroupName, containerGroupName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the specified container group. + * + * Delete the specified container group in the specified subscription and resource group. The operation does not + * delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container group on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String containerGroupName, + Context context) { + return beginDeleteAsync(resourceGroupName, containerGroupName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the specified container group. + * + * Delete the specified container group in the specified subscription and resource group. The operation does not + * delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContainerGroupInner delete(String resourceGroupName, String containerGroupName) { + return deleteAsync(resourceGroupName, containerGroupName).block(); + } + + /** + * Delete the specified container group. + * + * Delete the specified container group in the specified subscription and resource group. The operation does not + * delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContainerGroupInner delete(String resourceGroupName, String containerGroupName, Context context) { + return deleteAsync(resourceGroupName, containerGroupName, context).block(); + } + + /** + * Restarts all containers in a container group. + * + * Restarts all containers in a container group in place. If container image has updates, new image will be + * downloaded. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> restartWithResponseAsync(String resourceGroupName, + String containerGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.restart(this.client.getEndpoint(), this.client.getSubscriptionId(), + this.client.getApiVersion(), resourceGroupName, containerGroupName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Restarts all containers in a container group. + * + * Restarts all containers in a container group in place. If container image has updates, new image will be + * downloaded. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> restartWithResponseAsync(String resourceGroupName, + String containerGroupName, 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 (containerGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.restart(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), + resourceGroupName, containerGroupName, accept, context); + } + + /** + * Restarts all containers in a container group. + * + * Restarts all containers in a container group in place. If container image has updates, new image will be + * downloaded. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginRestartAsync(String resourceGroupName, String containerGroupName) { + Mono>> mono = restartWithResponseAsync(resourceGroupName, containerGroupName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Restarts all containers in a container group. + * + * Restarts all containers in a container group in place. If container image has updates, new image will be + * downloaded. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginRestartAsync(String resourceGroupName, String containerGroupName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = restartWithResponseAsync(resourceGroupName, containerGroupName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Restarts all containers in a container group. + * + * Restarts all containers in a container group in place. If container image has updates, new image will be + * downloaded. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRestart(String resourceGroupName, String containerGroupName) { + return this.beginRestartAsync(resourceGroupName, containerGroupName).getSyncPoller(); + } + + /** + * Restarts all containers in a container group. + * + * Restarts all containers in a container group in place. If container image has updates, new image will be + * downloaded. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRestart(String resourceGroupName, String containerGroupName, + Context context) { + return this.beginRestartAsync(resourceGroupName, containerGroupName, context).getSyncPoller(); + } + + /** + * Restarts all containers in a container group. + * + * Restarts all containers in a container group in place. If container image has updates, new image will be + * downloaded. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restartAsync(String resourceGroupName, String containerGroupName) { + return beginRestartAsync(resourceGroupName, containerGroupName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restarts all containers in a container group. + * + * Restarts all containers in a container group in place. If container image has updates, new image will be + * downloaded. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restartAsync(String resourceGroupName, String containerGroupName, Context context) { + return beginRestartAsync(resourceGroupName, containerGroupName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restarts all containers in a container group. + * + * Restarts all containers in a container group in place. If container image has updates, new image will be + * downloaded. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void restart(String resourceGroupName, String containerGroupName) { + restartAsync(resourceGroupName, containerGroupName).block(); + } + + /** + * Restarts all containers in a container group. + * + * Restarts all containers in a container group in place. If container image has updates, new image will be + * downloaded. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void restart(String resourceGroupName, String containerGroupName, Context context) { + restartAsync(resourceGroupName, containerGroupName, context).block(); + } + + /** + * Stops all containers in a container group. + * + * Stops all containers in a container group. Compute resources will be deallocated and billing will stop. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> stopWithResponseAsync(String resourceGroupName, String containerGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.stop(this.client.getEndpoint(), this.client.getSubscriptionId(), + this.client.getApiVersion(), resourceGroupName, containerGroupName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Stops all containers in a container group. + * + * Stops all containers in a container group. Compute resources will be deallocated and billing will stop. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> stopWithResponseAsync(String resourceGroupName, String containerGroupName, + 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 (containerGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.stop(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), + resourceGroupName, containerGroupName, accept, context); + } + + /** + * Stops all containers in a container group. + * + * Stops all containers in a container group. Compute resources will be deallocated and billing will stop. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono stopAsync(String resourceGroupName, String containerGroupName) { + return stopWithResponseAsync(resourceGroupName, containerGroupName).flatMap(ignored -> Mono.empty()); + } + + /** + * Stops all containers in a container group. + * + * Stops all containers in a container group. Compute resources will be deallocated and billing will stop. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response stopWithResponse(String resourceGroupName, String containerGroupName, Context context) { + return stopWithResponseAsync(resourceGroupName, containerGroupName, context).block(); + } + + /** + * Stops all containers in a container group. + * + * Stops all containers in a container group. Compute resources will be deallocated and billing will stop. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void stop(String resourceGroupName, String containerGroupName) { + stopWithResponse(resourceGroupName, containerGroupName, Context.NONE); + } + + /** + * Starts all containers in a container group. + * + * Starts all containers in a container group. Compute resources will be allocated and billing will start. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startWithResponseAsync(String resourceGroupName, + String containerGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.start(this.client.getEndpoint(), this.client.getSubscriptionId(), + this.client.getApiVersion(), resourceGroupName, containerGroupName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Starts all containers in a container group. + * + * Starts all containers in a container group. Compute resources will be allocated and billing will start. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startWithResponseAsync(String resourceGroupName, String containerGroupName, + 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 (containerGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.start(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), + resourceGroupName, containerGroupName, accept, context); + } + + /** + * Starts all containers in a container group. + * + * Starts all containers in a container group. Compute resources will be allocated and billing will start. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginStartAsync(String resourceGroupName, String containerGroupName) { + Mono>> mono = startWithResponseAsync(resourceGroupName, containerGroupName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Starts all containers in a container group. + * + * Starts all containers in a container group. Compute resources will be allocated and billing will start. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginStartAsync(String resourceGroupName, String containerGroupName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = startWithResponseAsync(resourceGroupName, containerGroupName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Starts all containers in a container group. + * + * Starts all containers in a container group. Compute resources will be allocated and billing will start. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStart(String resourceGroupName, String containerGroupName) { + return this.beginStartAsync(resourceGroupName, containerGroupName).getSyncPoller(); + } + + /** + * Starts all containers in a container group. + * + * Starts all containers in a container group. Compute resources will be allocated and billing will start. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStart(String resourceGroupName, String containerGroupName, + Context context) { + return this.beginStartAsync(resourceGroupName, containerGroupName, context).getSyncPoller(); + } + + /** + * Starts all containers in a container group. + * + * Starts all containers in a container group. Compute resources will be allocated and billing will start. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync(String resourceGroupName, String containerGroupName) { + return beginStartAsync(resourceGroupName, containerGroupName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts all containers in a container group. + * + * Starts all containers in a container group. Compute resources will be allocated and billing will start. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync(String resourceGroupName, String containerGroupName, Context context) { + return beginStartAsync(resourceGroupName, containerGroupName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts all containers in a container group. + * + * Starts all containers in a container group. Compute resources will be allocated and billing will start. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void start(String resourceGroupName, String containerGroupName) { + startAsync(resourceGroupName, containerGroupName).block(); + } + + /** + * Starts all containers in a container group. + * + * Starts all containers in a container group. Compute resources will be allocated and billing will start. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void start(String resourceGroupName, String containerGroupName, Context context) { + startAsync(resourceGroupName, containerGroupName, context).block(); + } + + /** + * Get all network dependencies for container group. + * + * Gets all the network dependencies for this container group to allow complete control of network setting and + * configuration. For container groups, this will always be an empty list. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the network dependencies for this container group to allow complete control of network setting and + * configuration along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> + getOutboundNetworkDependenciesEndpointsWithResponseAsync(String resourceGroupName, String containerGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getOutboundNetworkDependenciesEndpoints(this.client.getEndpoint(), + this.client.getSubscriptionId(), this.client.getApiVersion(), resourceGroupName, containerGroupName, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get all network dependencies for container group. + * + * Gets all the network dependencies for this container group to allow complete control of network setting and + * configuration. For container groups, this will always be an empty list. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the network dependencies for this container group to allow complete control of network setting and + * configuration along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getOutboundNetworkDependenciesEndpointsWithResponseAsync( + String resourceGroupName, String containerGroupName, 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 (containerGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getOutboundNetworkDependenciesEndpoints(this.client.getEndpoint(), + this.client.getSubscriptionId(), this.client.getApiVersion(), resourceGroupName, containerGroupName, accept, + context); + } + + /** + * Get all network dependencies for container group. + * + * Gets all the network dependencies for this container group to allow complete control of network setting and + * configuration. For container groups, this will always be an empty list. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the network dependencies for this container group to allow complete control of network setting and + * configuration on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getOutboundNetworkDependenciesEndpointsAsync(String resourceGroupName, + String containerGroupName) { + return getOutboundNetworkDependenciesEndpointsWithResponseAsync(resourceGroupName, containerGroupName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get all network dependencies for container group. + * + * Gets all the network dependencies for this container group to allow complete control of network setting and + * configuration. For container groups, this will always be an empty list. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the network dependencies for this container group to allow complete control of network setting and + * configuration along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response> getOutboundNetworkDependenciesEndpointsWithResponse(String resourceGroupName, + String containerGroupName, Context context) { + return getOutboundNetworkDependenciesEndpointsWithResponseAsync(resourceGroupName, containerGroupName, context) + .block(); + } + + /** + * Get all network dependencies for container group. + * + * Gets all the network dependencies for this container group to allow complete control of network setting and + * configuration. For container groups, this will always be an empty list. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the network dependencies for this container group to allow complete control of network setting and + * configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public List getOutboundNetworkDependenciesEndpoints(String resourceGroupName, String containerGroupName) { + return getOutboundNetworkDependenciesEndpointsWithResponse(resourceGroupName, containerGroupName, Context.NONE) + .getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the container group list response that contains the container group properties 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the container group list response that contains the container group properties 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)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the container group list response that contains the container group properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the container group list response that contains the container group properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerGroupsImpl.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerGroupsImpl.java new file mode 100644 index 000000000000..ad01acd6bf1e --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerGroupsImpl.java @@ -0,0 +1,224 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.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.management.Resource; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerinstance.generated.fluent.ContainerGroupsClient; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.ContainerGroupInner; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.ListResultContainerGroupInner; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroup; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroups; +import com.azure.resourcemanager.containerinstance.generated.models.ListResultContainerGroup; +import java.util.Collections; +import java.util.List; + +public final class ContainerGroupsImpl implements ContainerGroups { + private static final ClientLogger LOGGER = new ClientLogger(ContainerGroupsImpl.class); + + private final ContainerGroupsClient innerClient; + + private final com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager; + + public ContainerGroupsImpl(ContainerGroupsClient innerClient, + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ListResultContainerGroupImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ListResultContainerGroupImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ListResultContainerGroupImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ListResultContainerGroupImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String containerGroupName, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, containerGroupName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ContainerGroupImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ContainerGroup getByResourceGroup(String resourceGroupName, String containerGroupName) { + ContainerGroupInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, containerGroupName); + if (inner != null) { + return new ContainerGroupImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response updateWithResponse(String resourceGroupName, String containerGroupName, + Resource resource, Context context) { + Response inner + = this.serviceClient().updateWithResponse(resourceGroupName, containerGroupName, resource, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ContainerGroupImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ContainerGroup update(String resourceGroupName, String containerGroupName, Resource resource) { + ContainerGroupInner inner = this.serviceClient().update(resourceGroupName, containerGroupName, resource); + if (inner != null) { + return new ContainerGroupImpl(inner, this.manager()); + } else { + return null; + } + } + + public ContainerGroup deleteByResourceGroup(String resourceGroupName, String containerGroupName) { + ContainerGroupInner inner = this.serviceClient().delete(resourceGroupName, containerGroupName); + if (inner != null) { + return new ContainerGroupImpl(inner, this.manager()); + } else { + return null; + } + } + + public ContainerGroup delete(String resourceGroupName, String containerGroupName, Context context) { + ContainerGroupInner inner = this.serviceClient().delete(resourceGroupName, containerGroupName, context); + if (inner != null) { + return new ContainerGroupImpl(inner, this.manager()); + } else { + return null; + } + } + + public void restart(String resourceGroupName, String containerGroupName) { + this.serviceClient().restart(resourceGroupName, containerGroupName); + } + + public void restart(String resourceGroupName, String containerGroupName, Context context) { + this.serviceClient().restart(resourceGroupName, containerGroupName, context); + } + + public Response stopWithResponse(String resourceGroupName, String containerGroupName, Context context) { + return this.serviceClient().stopWithResponse(resourceGroupName, containerGroupName, context); + } + + public void stop(String resourceGroupName, String containerGroupName) { + this.serviceClient().stop(resourceGroupName, containerGroupName); + } + + public void start(String resourceGroupName, String containerGroupName) { + this.serviceClient().start(resourceGroupName, containerGroupName); + } + + public void start(String resourceGroupName, String containerGroupName, Context context) { + this.serviceClient().start(resourceGroupName, containerGroupName, context); + } + + public Response> getOutboundNetworkDependenciesEndpointsWithResponse(String resourceGroupName, + String containerGroupName, Context context) { + return this.serviceClient() + .getOutboundNetworkDependenciesEndpointsWithResponse(resourceGroupName, containerGroupName, context); + } + + public List getOutboundNetworkDependenciesEndpoints(String resourceGroupName, String containerGroupName) { + List inner + = this.serviceClient().getOutboundNetworkDependenciesEndpoints(resourceGroupName, containerGroupName); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ContainerGroup getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String containerGroupName = ResourceManagerUtils.getValueFromIdByName(id, "containerGroups"); + if (containerGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'containerGroups'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, containerGroupName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String containerGroupName = ResourceManagerUtils.getValueFromIdByName(id, "containerGroups"); + if (containerGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'containerGroups'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, containerGroupName, context); + } + + public ContainerGroup deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String containerGroupName = ResourceManagerUtils.getValueFromIdByName(id, "containerGroups"); + if (containerGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'containerGroups'.", id))); + } + return this.delete(resourceGroupName, containerGroupName, Context.NONE); + } + + public ContainerGroup deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String containerGroupName = ResourceManagerUtils.getValueFromIdByName(id, "containerGroups"); + if (containerGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'containerGroups'.", id))); + } + return this.delete(resourceGroupName, containerGroupName, context); + } + + private ContainerGroupsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager() { + return this.serviceManager; + } + + public ContainerGroupImpl define(String name) { + return new ContainerGroupImpl(name, this.manager()); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerInstanceManagementClientBuilder.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerInstanceManagementClientBuilder.java new file mode 100644 index 000000000000..f2e6d3f78ade --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerInstanceManagementClientBuilder.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** + * A builder for creating a new instance of the ContainerInstanceManagementClientImpl type. + */ +@ServiceClientBuilder(serviceClients = { ContainerInstanceManagementClientImpl.class }) +public final class ContainerInstanceManagementClientBuilder { + /* + * The ID of the target subscription. The value must be an UUID. + */ + private String subscriptionId; + + /** + * Sets The ID of the target subscription. The value must be an UUID. + * + * @param subscriptionId the subscriptionId value. + * @return the ContainerInstanceManagementClientBuilder. + */ + public ContainerInstanceManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the ContainerInstanceManagementClientBuilder. + */ + public ContainerInstanceManagementClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The environment to connect to + */ + private AzureEnvironment environment; + + /** + * Sets The environment to connect to. + * + * @param environment the environment value. + * @return the ContainerInstanceManagementClientBuilder. + */ + public ContainerInstanceManagementClientBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the ContainerInstanceManagementClientBuilder. + */ + public ContainerInstanceManagementClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the ContainerInstanceManagementClientBuilder. + */ + public ContainerInstanceManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the ContainerInstanceManagementClientBuilder. + */ + public ContainerInstanceManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of ContainerInstanceManagementClientImpl with the provided parameters. + * + * @return an instance of ContainerInstanceManagementClientImpl. + */ + public ContainerInstanceManagementClientImpl buildClient() { + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; + AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; + HttpPipeline localPipeline = (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval + = (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); + ContainerInstanceManagementClientImpl client = new ContainerInstanceManagementClientImpl(localPipeline, + localSerializerAdapter, localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); + return client; + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerInstanceManagementClientImpl.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerInstanceManagementClientImpl.java new file mode 100644 index 000000000000..c5f4f5b9c6c9 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerInstanceManagementClientImpl.java @@ -0,0 +1,400 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.util.Context; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.containerinstance.generated.fluent.CGProfileOperationsClient; +import com.azure.resourcemanager.containerinstance.generated.fluent.CGProfilesClient; +import com.azure.resourcemanager.containerinstance.generated.fluent.ContainerGroupsClient; +import com.azure.resourcemanager.containerinstance.generated.fluent.ContainerInstanceManagementClient; +import com.azure.resourcemanager.containerinstance.generated.fluent.ContainersClient; +import com.azure.resourcemanager.containerinstance.generated.fluent.LocationsClient; +import com.azure.resourcemanager.containerinstance.generated.fluent.NGroupsClient; +import com.azure.resourcemanager.containerinstance.generated.fluent.OperationsClient; +import com.azure.resourcemanager.containerinstance.generated.fluent.SubnetServiceAssociationLinksClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the ContainerInstanceManagementClientImpl type. + */ +@ServiceClient(builder = ContainerInstanceManagementClientBuilder.class) +public final class ContainerInstanceManagementClientImpl implements ContainerInstanceManagementClient { + /** + * The ID of the target subscription. The value must be an UUID. + */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** + * server parameter. + */ + private final String endpoint; + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** + * Api Version. + */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** + * The HTTP pipeline to send requests through. + */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** + * The serializer to serialize an object into a string. + */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** + * The default poll interval for long-running operation. + */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** + * The ContainerGroupsClient object to access its operations. + */ + private final ContainerGroupsClient containerGroups; + + /** + * Gets the ContainerGroupsClient object to access its operations. + * + * @return the ContainerGroupsClient object. + */ + public ContainerGroupsClient getContainerGroups() { + return this.containerGroups; + } + + /** + * The OperationsClient object to access its operations. + */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** + * The LocationsClient object to access its operations. + */ + private final LocationsClient locations; + + /** + * Gets the LocationsClient object to access its operations. + * + * @return the LocationsClient object. + */ + public LocationsClient getLocations() { + return this.locations; + } + + /** + * The ContainersClient object to access its operations. + */ + private final ContainersClient containers; + + /** + * Gets the ContainersClient object to access its operations. + * + * @return the ContainersClient object. + */ + public ContainersClient getContainers() { + return this.containers; + } + + /** + * The SubnetServiceAssociationLinksClient object to access its operations. + */ + private final SubnetServiceAssociationLinksClient subnetServiceAssociationLinks; + + /** + * Gets the SubnetServiceAssociationLinksClient object to access its operations. + * + * @return the SubnetServiceAssociationLinksClient object. + */ + public SubnetServiceAssociationLinksClient getSubnetServiceAssociationLinks() { + return this.subnetServiceAssociationLinks; + } + + /** + * The NGroupsClient object to access its operations. + */ + private final NGroupsClient nGroups; + + /** + * Gets the NGroupsClient object to access its operations. + * + * @return the NGroupsClient object. + */ + public NGroupsClient getNGroups() { + return this.nGroups; + } + + /** + * The CGProfilesClient object to access its operations. + */ + private final CGProfilesClient cGProfiles; + + /** + * Gets the CGProfilesClient object to access its operations. + * + * @return the CGProfilesClient object. + */ + public CGProfilesClient getCGProfiles() { + return this.cGProfiles; + } + + /** + * The CGProfileOperationsClient object to access its operations. + */ + private final CGProfileOperationsClient cGProfileOperations; + + /** + * Gets the CGProfileOperationsClient object to access its operations. + * + * @return the CGProfileOperationsClient object. + */ + public CGProfileOperationsClient getCGProfileOperations() { + return this.cGProfileOperations; + } + + /** + * Initializes an instance of ContainerInstanceManagementClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param defaultPollInterval The default poll interval for long-running operation. + * @param environment The Azure environment. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. + * @param endpoint server parameter. + */ + ContainerInstanceManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId, String endpoint) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = "2024-11-01-preview"; + this.containerGroups = new ContainerGroupsClientImpl(this); + this.operations = new OperationsClientImpl(this); + this.locations = new LocationsClientImpl(this); + this.containers = new ContainersClientImpl(this); + this.subnetServiceAssociationLinks = new SubnetServiceAssociationLinksClientImpl(this); + this.nGroups = new NGroupsClientImpl(this); + this.cGProfiles = new CGProfilesClientImpl(this); + this.cGProfileOperations = new CGProfileOperationsClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + return CoreUtils.mergeContexts(this.getContext(), context); + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult(Mono>> activationResponse, + HttpPipeline httpPipeline, Type pollResultType, Type finalResultType, Context context) { + return PollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, activationResponse, context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = new HttpResponseImpl(lroError.getResponseStatusCode(), lroError.getResponseHeaders(), + lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = this.getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + LOGGER.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(HttpHeaderName.fromString(s)); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ContainerInstanceManagementClientImpl.class); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainersClientImpl.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainersClientImpl.java new file mode 100644 index 000000000000..52b710cf477e --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainersClientImpl.java @@ -0,0 +1,573 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.implementation; + +import com.azure.core.annotation.BodyParam; +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.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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.containerinstance.generated.fluent.ContainersClient; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.ContainerAttachResponseInner; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.ContainerExecResponseInner; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.LogsInner; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerExecRequest; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ContainersClient. + */ +public final class ContainersClientImpl implements ContainersClient { + /** + * The proxy service used to perform REST calls. + */ + private final ContainersService service; + + /** + * The service client containing this operation class. + */ + private final ContainerInstanceManagementClientImpl client; + + /** + * Initializes an instance of ContainersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ContainersClientImpl(ContainerInstanceManagementClientImpl client) { + this.service + = RestProxy.create(ContainersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerInstanceManagementClientContainers to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerInstanceMan") + public interface ContainersService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/logs") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listLogs(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerGroupName") String containerGroupName, + @PathParam("containerName") String containerName, @QueryParam("tail") Integer tail, + @QueryParam("timestamps") Boolean timestamps, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/exec") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> executeCommand(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerGroupName") String containerGroupName, + @PathParam("containerName") String containerName, + @BodyParam("application/json") ContainerExecRequest containerExecRequest, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/attach") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> attach(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerGroupName") String containerGroupName, + @PathParam("containerName") String containerName, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get the logs for a specified container instance. + * + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param tail The number of lines to show from the tail of the container instance log. If not provided, all + * available logs are shown up to 4mb. + * @param timestamps If true, adds a timestamp at the beginning of every line of log output. If not provided, + * defaults to false. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the logs for a specified container instance in a specified resource group and container group along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listLogsWithResponseAsync(String resourceGroupName, String containerGroupName, + String containerName, Integer tail, Boolean timestamps) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listLogs(this.client.getEndpoint(), this.client.getSubscriptionId(), + this.client.getApiVersion(), resourceGroupName, containerGroupName, containerName, tail, timestamps, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the logs for a specified container instance. + * + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param tail The number of lines to show from the tail of the container instance log. If not provided, all + * available logs are shown up to 4mb. + * @param timestamps If true, adds a timestamp at the beginning of every line of log output. If not provided, + * defaults to false. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the logs for a specified container instance in a specified resource group and container group along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listLogsWithResponseAsync(String resourceGroupName, String containerGroupName, + String containerName, Integer tail, Boolean timestamps, 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 (containerGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listLogs(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), + resourceGroupName, containerGroupName, containerName, tail, timestamps, accept, context); + } + + /** + * Get the logs for a specified container instance. + * + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the logs for a specified container instance in a specified resource group and container group on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listLogsAsync(String resourceGroupName, String containerGroupName, String containerName) { + final Integer tail = null; + final Boolean timestamps = null; + return listLogsWithResponseAsync(resourceGroupName, containerGroupName, containerName, tail, timestamps) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the logs for a specified container instance. + * + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param tail The number of lines to show from the tail of the container instance log. If not provided, all + * available logs are shown up to 4mb. + * @param timestamps If true, adds a timestamp at the beginning of every line of log output. If not provided, + * defaults to false. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the logs for a specified container instance in a specified resource group and container group along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listLogsWithResponse(String resourceGroupName, String containerGroupName, + String containerName, Integer tail, Boolean timestamps, Context context) { + return listLogsWithResponseAsync(resourceGroupName, containerGroupName, containerName, tail, timestamps, + context).block(); + } + + /** + * Get the logs for a specified container instance. + * + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the logs for a specified container instance in a specified resource group and container group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LogsInner listLogs(String resourceGroupName, String containerGroupName, String containerName) { + final Integer tail = null; + final Boolean timestamps = null; + return listLogsWithResponse(resourceGroupName, containerGroupName, containerName, tail, timestamps, + Context.NONE).getValue(); + } + + /** + * Executes a command in a specific container instance. + * + * Executes a command for a specific container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param containerExecRequest The request for the exec 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 information for the container exec command along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> executeCommandWithResponseAsync(String resourceGroupName, + String containerGroupName, String containerName, ContainerExecRequest containerExecRequest) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (containerExecRequest == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerExecRequest is required and cannot be null.")); + } else { + containerExecRequest.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.executeCommand(this.client.getEndpoint(), this.client.getSubscriptionId(), + this.client.getApiVersion(), resourceGroupName, containerGroupName, containerName, containerExecRequest, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Executes a command in a specific container instance. + * + * Executes a command for a specific container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param containerExecRequest The request for the exec 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 information for the container exec command along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> executeCommandWithResponseAsync(String resourceGroupName, + String containerGroupName, String containerName, ContainerExecRequest containerExecRequest, 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 (containerGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (containerExecRequest == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerExecRequest is required and cannot be null.")); + } else { + containerExecRequest.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.executeCommand(this.client.getEndpoint(), this.client.getSubscriptionId(), + this.client.getApiVersion(), resourceGroupName, containerGroupName, containerName, containerExecRequest, + accept, context); + } + + /** + * Executes a command in a specific container instance. + * + * Executes a command for a specific container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param containerExecRequest The request for the exec 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 information for the container exec command on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono executeCommandAsync(String resourceGroupName, String containerGroupName, + String containerName, ContainerExecRequest containerExecRequest) { + return executeCommandWithResponseAsync(resourceGroupName, containerGroupName, containerName, + containerExecRequest).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Executes a command in a specific container instance. + * + * Executes a command for a specific container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param containerExecRequest The request for the exec 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 information for the container exec command along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response executeCommandWithResponse(String resourceGroupName, + String containerGroupName, String containerName, ContainerExecRequest containerExecRequest, Context context) { + return executeCommandWithResponseAsync(resourceGroupName, containerGroupName, containerName, + containerExecRequest, context).block(); + } + + /** + * Executes a command in a specific container instance. + * + * Executes a command for a specific container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param containerExecRequest The request for the exec 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 information for the container exec command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContainerExecResponseInner executeCommand(String resourceGroupName, String containerGroupName, + String containerName, ContainerExecRequest containerExecRequest) { + return executeCommandWithResponse(resourceGroupName, containerGroupName, containerName, containerExecRequest, + Context.NONE).getValue(); + } + + /** + * Attach to the output of a specific container instance. + * + * Attach to the output stream of a specific container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the information for the output stream from container attach along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> attachWithResponseAsync(String resourceGroupName, + String containerGroupName, String containerName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.attach(this.client.getEndpoint(), this.client.getSubscriptionId(), + this.client.getApiVersion(), resourceGroupName, containerGroupName, containerName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Attach to the output of a specific container instance. + * + * Attach to the output stream of a specific container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the information for the output stream from container attach along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> attachWithResponseAsync(String resourceGroupName, + String containerGroupName, String containerName, 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 (containerGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.attach(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), + resourceGroupName, containerGroupName, containerName, accept, context); + } + + /** + * Attach to the output of a specific container instance. + * + * Attach to the output stream of a specific container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the information for the output stream from container attach on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono attachAsync(String resourceGroupName, String containerGroupName, + String containerName) { + return attachWithResponseAsync(resourceGroupName, containerGroupName, containerName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Attach to the output of a specific container instance. + * + * Attach to the output stream of a specific container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the information for the output stream from container attach along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response attachWithResponse(String resourceGroupName, + String containerGroupName, String containerName, Context context) { + return attachWithResponseAsync(resourceGroupName, containerGroupName, containerName, context).block(); + } + + /** + * Attach to the output of a specific container instance. + * + * Attach to the output stream of a specific container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the information for the output stream from container attach. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContainerAttachResponseInner attach(String resourceGroupName, String containerGroupName, + String containerName) { + return attachWithResponse(resourceGroupName, containerGroupName, containerName, Context.NONE).getValue(); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainersImpl.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainersImpl.java new file mode 100644 index 000000000000..3e6f5028fedf --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainersImpl.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.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.containerinstance.generated.fluent.ContainersClient; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.ContainerAttachResponseInner; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.ContainerExecResponseInner; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.LogsInner; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerAttachResponse; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerExecRequest; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerExecResponse; +import com.azure.resourcemanager.containerinstance.generated.models.Containers; +import com.azure.resourcemanager.containerinstance.generated.models.Logs; + +public final class ContainersImpl implements Containers { + private static final ClientLogger LOGGER = new ClientLogger(ContainersImpl.class); + + private final ContainersClient innerClient; + + private final com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager; + + public ContainersImpl(ContainersClient innerClient, + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response listLogsWithResponse(String resourceGroupName, String containerGroupName, + String containerName, Integer tail, Boolean timestamps, Context context) { + Response inner = this.serviceClient() + .listLogsWithResponse(resourceGroupName, containerGroupName, containerName, tail, timestamps, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new LogsImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Logs listLogs(String resourceGroupName, String containerGroupName, String containerName) { + LogsInner inner = this.serviceClient().listLogs(resourceGroupName, containerGroupName, containerName); + if (inner != null) { + return new LogsImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response executeCommandWithResponse(String resourceGroupName, + String containerGroupName, String containerName, ContainerExecRequest containerExecRequest, Context context) { + Response inner = this.serviceClient() + .executeCommandWithResponse(resourceGroupName, containerGroupName, containerName, containerExecRequest, + context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ContainerExecResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ContainerExecResponse executeCommand(String resourceGroupName, String containerGroupName, + String containerName, ContainerExecRequest containerExecRequest) { + ContainerExecResponseInner inner = this.serviceClient() + .executeCommand(resourceGroupName, containerGroupName, containerName, containerExecRequest); + if (inner != null) { + return new ContainerExecResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response attachWithResponse(String resourceGroupName, String containerGroupName, + String containerName, Context context) { + Response inner + = this.serviceClient().attachWithResponse(resourceGroupName, containerGroupName, containerName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ContainerAttachResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ContainerAttachResponse attach(String resourceGroupName, String containerGroupName, String containerName) { + ContainerAttachResponseInner inner + = this.serviceClient().attach(resourceGroupName, containerGroupName, containerName); + if (inner != null) { + return new ContainerAttachResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + private ContainersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ListResultContainerGroupImpl.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ListResultContainerGroupImpl.java new file mode 100644 index 000000000000..d778107aa19d --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ListResultContainerGroupImpl.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.implementation; + +import com.azure.resourcemanager.containerinstance.generated.fluent.models.ListResultContainerGroupInner; +import com.azure.resourcemanager.containerinstance.generated.models.ConfidentialComputeProperties; +import com.azure.resourcemanager.containerinstance.generated.models.Container; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupDiagnostics; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupIdentity; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupPriority; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupProvisioningState; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupRestartPolicy; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupSku; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupSubnetId; +import com.azure.resourcemanager.containerinstance.generated.models.DeploymentExtensionSpec; +import com.azure.resourcemanager.containerinstance.generated.models.DnsConfiguration; +import com.azure.resourcemanager.containerinstance.generated.models.EncryptionProperties; +import com.azure.resourcemanager.containerinstance.generated.models.IdentityAcls; +import com.azure.resourcemanager.containerinstance.generated.models.ImageRegistryCredential; +import com.azure.resourcemanager.containerinstance.generated.models.InitContainerDefinition; +import com.azure.resourcemanager.containerinstance.generated.models.IpAddress; +import com.azure.resourcemanager.containerinstance.generated.models.ListResultContainerGroup; +import com.azure.resourcemanager.containerinstance.generated.models.OperatingSystemTypes; +import com.azure.resourcemanager.containerinstance.generated.models.SecretReference; +import com.azure.resourcemanager.containerinstance.generated.models.Volume; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class ListResultContainerGroupImpl implements ListResultContainerGroup { + private ListResultContainerGroupInner innerObject; + + private final com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager; + + ListResultContainerGroupImpl(ListResultContainerGroupInner innerObject, + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager 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 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 List zones() { + List inner = this.innerModel().zones(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ContainerGroupIdentity identity() { + return this.innerModel().identity(); + } + + public ContainerGroupProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public List secretReferences() { + List inner = this.innerModel().secretReferences(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List containers() { + List inner = this.innerModel().containers(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List imageRegistryCredentials() { + List inner = this.innerModel().imageRegistryCredentials(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ContainerGroupRestartPolicy restartPolicy() { + return this.innerModel().restartPolicy(); + } + + public IpAddress ipAddress() { + return this.innerModel().ipAddress(); + } + + public OperatingSystemTypes osType() { + return this.innerModel().osType(); + } + + public List volumes() { + List inner = this.innerModel().volumes(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ContainerGroupDiagnostics diagnostics() { + return this.innerModel().diagnostics(); + } + + public List subnetIds() { + List inner = this.innerModel().subnetIds(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public DnsConfiguration dnsConfig() { + return this.innerModel().dnsConfig(); + } + + public ContainerGroupSku sku() { + return this.innerModel().sku(); + } + + public EncryptionProperties encryptionProperties() { + return this.innerModel().encryptionProperties(); + } + + public List initContainers() { + List inner = this.innerModel().initContainers(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List extensions() { + List inner = this.innerModel().extensions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ConfidentialComputeProperties confidentialComputeProperties() { + return this.innerModel().confidentialComputeProperties(); + } + + public ContainerGroupPriority priority() { + return this.innerModel().priority(); + } + + public IdentityAcls identityAcls() { + return this.innerModel().identityAcls(); + } + + public ListResultContainerGroupInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/LocationsClientImpl.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/LocationsClientImpl.java new file mode 100644 index 000000000000..676719f7fd04 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/LocationsClientImpl.java @@ -0,0 +1,618 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.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.containerinstance.generated.fluent.LocationsClient; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.CachedImagesInner; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.CapabilitiesInner; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.UsageInner; +import com.azure.resourcemanager.containerinstance.generated.models.CachedImagesListResult; +import com.azure.resourcemanager.containerinstance.generated.models.CapabilitiesListResult; +import com.azure.resourcemanager.containerinstance.generated.models.UsageListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in LocationsClient. + */ +public final class LocationsClientImpl implements LocationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final LocationsService service; + + /** + * The service client containing this operation class. + */ + private final ContainerInstanceManagementClientImpl client; + + /** + * Initializes an instance of LocationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LocationsClientImpl(ContainerInstanceManagementClientImpl client) { + this.service + = RestProxy.create(LocationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerInstanceManagementClientLocations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerInstanceMan") + public interface LocationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/locations/{location}/usages") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listUsage(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/locations/{location}/cachedImages") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listCachedImages(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/locations/{location}/capabilities") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listCapabilities(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listCachedImagesNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listCapabilitiesNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get the usage for a subscription. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the usage for a subscription along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listUsageSinglePageAsync(String location) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listUsage(this.client.getEndpoint(), this.client.getSubscriptionId(), + location, this.client.getApiVersion(), 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())); + } + + /** + * Get the usage for a subscription. + * + * @param location The name of the Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the usage for a subscription along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listUsageSinglePageAsync(String location, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listUsage(this.client.getEndpoint(), this.client.getSubscriptionId(), location, + this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), null, null)); + } + + /** + * Get the usage for a subscription. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the usage for a subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listUsageAsync(String location) { + return new PagedFlux<>(() -> listUsageSinglePageAsync(location)); + } + + /** + * Get the usage for a subscription. + * + * @param location The name of the Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the usage for a subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listUsageAsync(String location, Context context) { + return new PagedFlux<>(() -> listUsageSinglePageAsync(location, context)); + } + + /** + * Get the usage for a subscription. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the usage for a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listUsage(String location) { + return new PagedIterable<>(listUsageAsync(location)); + } + + /** + * Get the usage for a subscription. + * + * @param location The name of the Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the usage for a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listUsage(String location, Context context) { + return new PagedIterable<>(listUsageAsync(location, context)); + } + + /** + * Get the list of cached images. + * + * Get the list of cached images on specific OS type for a subscription in a region. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of cached images on specific OS type for a subscription in a region along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listCachedImagesSinglePageAsync(String location) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listCachedImages(this.client.getEndpoint(), this.client.getSubscriptionId(), + location, 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())); + } + + /** + * Get the list of cached images. + * + * Get the list of cached images on specific OS type for a subscription in a region. + * + * @param location The name of the Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of cached images on specific OS type for a subscription in a region along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listCachedImagesSinglePageAsync(String location, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listCachedImages(this.client.getEndpoint(), this.client.getSubscriptionId(), location, + this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the list of cached images. + * + * Get the list of cached images on specific OS type for a subscription in a region. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of cached images on specific OS type for a subscription in a region as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listCachedImagesAsync(String location) { + return new PagedFlux<>(() -> listCachedImagesSinglePageAsync(location), + nextLink -> listCachedImagesNextSinglePageAsync(nextLink)); + } + + /** + * Get the list of cached images. + * + * Get the list of cached images on specific OS type for a subscription in a region. + * + * @param location The name of the Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of cached images on specific OS type for a subscription in a region as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listCachedImagesAsync(String location, Context context) { + return new PagedFlux<>(() -> listCachedImagesSinglePageAsync(location, context), + nextLink -> listCachedImagesNextSinglePageAsync(nextLink, context)); + } + + /** + * Get the list of cached images. + * + * Get the list of cached images on specific OS type for a subscription in a region. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of cached images on specific OS type for a subscription in a region as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listCachedImages(String location) { + return new PagedIterable<>(listCachedImagesAsync(location)); + } + + /** + * Get the list of cached images. + * + * Get the list of cached images on specific OS type for a subscription in a region. + * + * @param location The name of the Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of cached images on specific OS type for a subscription in a region as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listCachedImages(String location, Context context) { + return new PagedIterable<>(listCachedImagesAsync(location, context)); + } + + /** + * Get the list of capabilities of the location. + * + * Get the list of CPU/memory/GPU capabilities of a region. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of CPU/memory/GPU capabilities of a region along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listCapabilitiesSinglePageAsync(String location) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listCapabilities(this.client.getEndpoint(), this.client.getSubscriptionId(), + location, 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())); + } + + /** + * Get the list of capabilities of the location. + * + * Get the list of CPU/memory/GPU capabilities of a region. + * + * @param location The name of the Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of CPU/memory/GPU capabilities of a region along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listCapabilitiesSinglePageAsync(String location, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listCapabilities(this.client.getEndpoint(), this.client.getSubscriptionId(), location, + this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the list of capabilities of the location. + * + * Get the list of CPU/memory/GPU capabilities of a region. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of CPU/memory/GPU capabilities of a region as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listCapabilitiesAsync(String location) { + return new PagedFlux<>(() -> listCapabilitiesSinglePageAsync(location), + nextLink -> listCapabilitiesNextSinglePageAsync(nextLink)); + } + + /** + * Get the list of capabilities of the location. + * + * Get the list of CPU/memory/GPU capabilities of a region. + * + * @param location The name of the Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of CPU/memory/GPU capabilities of a region as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listCapabilitiesAsync(String location, Context context) { + return new PagedFlux<>(() -> listCapabilitiesSinglePageAsync(location, context), + nextLink -> listCapabilitiesNextSinglePageAsync(nextLink, context)); + } + + /** + * Get the list of capabilities of the location. + * + * Get the list of CPU/memory/GPU capabilities of a region. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of CPU/memory/GPU capabilities of a region as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listCapabilities(String location) { + return new PagedIterable<>(listCapabilitiesAsync(location)); + } + + /** + * Get the list of capabilities of the location. + * + * Get the list of CPU/memory/GPU capabilities of a region. + * + * @param location The name of the Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of CPU/memory/GPU capabilities of a region as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listCapabilities(String location, Context context) { + return new PagedIterable<>(listCapabilitiesAsync(location, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response containing cached images along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listCachedImagesNextSinglePageAsync(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.listCachedImagesNext(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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response containing cached images along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listCachedImagesNextSinglePageAsync(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.listCachedImagesNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response containing list of capabilities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listCapabilitiesNextSinglePageAsync(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.listCapabilitiesNext(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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response containing list of capabilities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listCapabilitiesNextSinglePageAsync(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.listCapabilitiesNext(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/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/LocationsImpl.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/LocationsImpl.java new file mode 100644 index 000000000000..0727c019ae5c --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/LocationsImpl.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.containerinstance.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerinstance.generated.fluent.LocationsClient; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.CachedImagesInner; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.CapabilitiesInner; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.UsageInner; +import com.azure.resourcemanager.containerinstance.generated.models.CachedImages; +import com.azure.resourcemanager.containerinstance.generated.models.Capabilities; +import com.azure.resourcemanager.containerinstance.generated.models.Locations; +import com.azure.resourcemanager.containerinstance.generated.models.Usage; + +public final class LocationsImpl implements Locations { + private static final ClientLogger LOGGER = new ClientLogger(LocationsImpl.class); + + private final LocationsClient innerClient; + + private final com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager; + + public LocationsImpl(LocationsClient innerClient, + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listUsage(String location) { + PagedIterable inner = this.serviceClient().listUsage(location); + return ResourceManagerUtils.mapPage(inner, inner1 -> new UsageImpl(inner1, this.manager())); + } + + public PagedIterable listUsage(String location, Context context) { + PagedIterable inner = this.serviceClient().listUsage(location, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new UsageImpl(inner1, this.manager())); + } + + public PagedIterable listCachedImages(String location) { + PagedIterable inner = this.serviceClient().listCachedImages(location); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CachedImagesImpl(inner1, this.manager())); + } + + public PagedIterable listCachedImages(String location, Context context) { + PagedIterable inner = this.serviceClient().listCachedImages(location, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CachedImagesImpl(inner1, this.manager())); + } + + public PagedIterable listCapabilities(String location) { + PagedIterable inner = this.serviceClient().listCapabilities(location); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CapabilitiesImpl(inner1, this.manager())); + } + + public PagedIterable listCapabilities(String location, Context context) { + PagedIterable inner = this.serviceClient().listCapabilities(location, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CapabilitiesImpl(inner1, this.manager())); + } + + private LocationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/LogsImpl.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/LogsImpl.java new file mode 100644 index 000000000000..b53cc23fb6f3 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/LogsImpl.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.containerinstance.generated.implementation; + +import com.azure.resourcemanager.containerinstance.generated.fluent.models.LogsInner; +import com.azure.resourcemanager.containerinstance.generated.models.Logs; + +public final class LogsImpl implements Logs { + private LogsInner innerObject; + + private final com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager; + + LogsImpl(LogsInner innerObject, + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String content() { + return this.innerModel().content(); + } + + public LogsInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/NGroupImpl.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/NGroupImpl.java new file mode 100644 index 000000000000..49c40ca85de7 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/NGroupImpl.java @@ -0,0 +1,255 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.NGroupInner; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupProfileStub; +import com.azure.resourcemanager.containerinstance.generated.models.ElasticProfile; +import com.azure.resourcemanager.containerinstance.generated.models.NGroup; +import com.azure.resourcemanager.containerinstance.generated.models.NGroupIdentity; +import com.azure.resourcemanager.containerinstance.generated.models.NGroupProvisioningState; +import com.azure.resourcemanager.containerinstance.generated.models.PlacementProfile; +import com.azure.resourcemanager.containerinstance.generated.models.UpdateProfile; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class NGroupImpl implements NGroup, NGroup.Definition, NGroup.Update { + private NGroupInner innerObject; + + private final com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + 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 NGroupIdentity identity() { + return this.innerModel().identity(); + } + + public List zones() { + List inner = this.innerModel().zones(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String location() { + return this.innerModel().location(); + } + + public ElasticProfile elasticProfile() { + return this.innerModel().elasticProfile(); + } + + public PlacementProfile placementProfile() { + return this.innerModel().placementProfile(); + } + + public List containerGroupProfiles() { + List inner = this.innerModel().containerGroupProfiles(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public NGroupProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public UpdateProfile updateProfile() { + return this.innerModel().updateProfile(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public NGroupInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String ngroupsName; + + public NGroupImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public NGroup create() { + this.innerObject = serviceManager.serviceClient() + .getNGroups() + .createOrUpdate(resourceGroupName, ngroupsName, this.innerModel(), Context.NONE); + return this; + } + + public NGroup create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getNGroups() + .createOrUpdate(resourceGroupName, ngroupsName, this.innerModel(), context); + return this; + } + + NGroupImpl(String name, + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager) { + this.innerObject = new NGroupInner(); + this.serviceManager = serviceManager; + this.ngroupsName = name; + } + + public NGroupImpl update() { + return this; + } + + public NGroup apply() { + this.innerObject = serviceManager.serviceClient() + .getNGroups() + .update(resourceGroupName, ngroupsName, this.innerModel(), Context.NONE); + return this; + } + + public NGroup apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getNGroups() + .update(resourceGroupName, ngroupsName, this.innerModel(), context); + return this; + } + + NGroupImpl(NGroupInner innerObject, + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.ngroupsName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "ngroups"); + } + + public NGroup refresh() { + this.innerObject = serviceManager.serviceClient() + .getNGroups() + .getByResourceGroupWithResponse(resourceGroupName, ngroupsName, Context.NONE) + .getValue(); + return this; + } + + public NGroup refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getNGroups() + .getByResourceGroupWithResponse(resourceGroupName, ngroupsName, context) + .getValue(); + return this; + } + + public void start() { + serviceManager.nGroups().start(resourceGroupName, ngroupsName); + } + + public void start(Context context) { + serviceManager.nGroups().start(resourceGroupName, ngroupsName, context); + } + + public Response stopWithResponse(Context context) { + return serviceManager.nGroups().stopWithResponse(resourceGroupName, ngroupsName, context); + } + + public void stop() { + serviceManager.nGroups().stop(resourceGroupName, ngroupsName); + } + + public void restart() { + serviceManager.nGroups().restart(resourceGroupName, ngroupsName); + } + + public void restart(Context context) { + serviceManager.nGroups().restart(resourceGroupName, ngroupsName, context); + } + + public NGroupImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public NGroupImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public NGroupImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public NGroupImpl withIdentity(NGroupIdentity identity) { + this.innerModel().withIdentity(identity); + return this; + } + + public NGroupImpl withZones(List zones) { + this.innerModel().withZones(zones); + return this; + } + + public NGroupImpl withElasticProfile(ElasticProfile elasticProfile) { + this.innerModel().withElasticProfile(elasticProfile); + return this; + } + + public NGroupImpl withPlacementProfile(PlacementProfile placementProfile) { + this.innerModel().withPlacementProfile(placementProfile); + return this; + } + + public NGroupImpl withContainerGroupProfiles(List containerGroupProfiles) { + this.innerModel().withContainerGroupProfiles(containerGroupProfiles); + return this; + } + + public NGroupImpl withUpdateProfile(UpdateProfile updateProfile) { + this.innerModel().withUpdateProfile(updateProfile); + return this; + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/NGroupsClientImpl.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/NGroupsClientImpl.java new file mode 100644 index 000000000000..ec60b57143c3 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/NGroupsClientImpl.java @@ -0,0 +1,1969 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerinstance.generated.fluent.NGroupsClient; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.NGroupInner; +import com.azure.resourcemanager.containerinstance.generated.models.NGroupsListResult; +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 NGroupsClient. + */ +public final class NGroupsClientImpl implements NGroupsClient { + /** + * The proxy service used to perform REST calls. + */ + private final NGroupsService service; + + /** + * The service client containing this operation class. + */ + private final ContainerInstanceManagementClientImpl client; + + /** + * Initializes an instance of NGroupsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NGroupsClientImpl(ContainerInstanceManagementClientImpl client) { + this.service = RestProxy.create(NGroupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerInstanceManagementClientNGroups to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerInstanceMan") + public interface NGroupsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/ngroups/{ngroupsName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("ngroupsName") String ngroupsName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/ngroups/{ngroupsName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("ngroupsName") String ngroupsName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") NGroupInner nGroup, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/ngroups/{ngroupsName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("ngroupsName") String ngroupsName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") NGroupInner nGroup, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/ngroups/{ngroupsName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("ngroupsName") String ngroupsName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/ngroups/{ngroupsName}/start") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> start(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("ngroupsName") String ngroupsName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/ngroups/{ngroupsName}/stop") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> stop(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("ngroupsName") String ngroupsName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/ngroups/{ngroupsName}/restart") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> restart(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("ngroupsName") String ngroupsName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/ngroups") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/ngroups") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * NGroups GET REST API + * + * Get the properties of the specified NGroups resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified NGroups resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String ngroupsName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (ngroupsName == null) { + return Mono.error(new IllegalArgumentException("Parameter ngroupsName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), + this.client.getApiVersion(), resourceGroupName, ngroupsName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * NGroups GET REST API + * + * Get the properties of the specified NGroups resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified NGroups resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String ngroupsName, 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 (ngroupsName == null) { + return Mono.error(new IllegalArgumentException("Parameter ngroupsName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), + this.client.getApiVersion(), resourceGroupName, ngroupsName, accept, context); + } + + /** + * NGroups GET REST API + * + * Get the properties of the specified NGroups resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified NGroups resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String ngroupsName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, ngroupsName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * NGroups GET REST API + * + * Get the properties of the specified NGroups resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified NGroups resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String ngroupsName, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, ngroupsName, context).block(); + } + + /** + * NGroups GET REST API + * + * Get the properties of the specified NGroups resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified NGroups resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NGroupInner getByResourceGroup(String resourceGroupName, String ngroupsName) { + return getByResourceGroupWithResponse(resourceGroupName, ngroupsName, Context.NONE).getValue(); + } + + /** + * NGroup PUT REST API + * + * Create or update a NGroups resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @param nGroup The NGroup object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 NGroups resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String ngroupsName, NGroupInner nGroup) { + 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 (ngroupsName == null) { + return Mono.error(new IllegalArgumentException("Parameter ngroupsName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (nGroup == null) { + return Mono.error(new IllegalArgumentException("Parameter nGroup is required and cannot be null.")); + } else { + nGroup.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, ngroupsName, + this.client.getApiVersion(), this.client.getSubscriptionId(), nGroup, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * NGroup PUT REST API + * + * Create or update a NGroups resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @param nGroup The NGroup object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 NGroups resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String ngroupsName, NGroupInner nGroup, 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 (ngroupsName == null) { + return Mono.error(new IllegalArgumentException("Parameter ngroupsName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (nGroup == null) { + return Mono.error(new IllegalArgumentException("Parameter nGroup is required and cannot be null.")); + } else { + nGroup.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, ngroupsName, + this.client.getApiVersion(), this.client.getSubscriptionId(), nGroup, accept, context); + } + + /** + * NGroup PUT REST API + * + * Create or update a NGroups resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @param nGroup The NGroup object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 NGroups resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NGroupInner> beginCreateOrUpdateAsync(String resourceGroupName, + String ngroupsName, NGroupInner nGroup) { + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, ngroupsName, nGroup); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + NGroupInner.class, NGroupInner.class, this.client.getContext()); + } + + /** + * NGroup PUT REST API + * + * Create or update a NGroups resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @param nGroup The NGroup object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 NGroups resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NGroupInner> beginCreateOrUpdateAsync(String resourceGroupName, + String ngroupsName, NGroupInner nGroup, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, ngroupsName, nGroup, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + NGroupInner.class, NGroupInner.class, context); + } + + /** + * NGroup PUT REST API + * + * Create or update a NGroups resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @param nGroup The NGroup object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 NGroups resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NGroupInner> beginCreateOrUpdate(String resourceGroupName, + String ngroupsName, NGroupInner nGroup) { + return this.beginCreateOrUpdateAsync(resourceGroupName, ngroupsName, nGroup).getSyncPoller(); + } + + /** + * NGroup PUT REST API + * + * Create or update a NGroups resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @param nGroup The NGroup object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 NGroups resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NGroupInner> beginCreateOrUpdate(String resourceGroupName, + String ngroupsName, NGroupInner nGroup, Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, ngroupsName, nGroup, context).getSyncPoller(); + } + + /** + * NGroup PUT REST API + * + * Create or update a NGroups resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @param nGroup The NGroup object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 NGroups resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String ngroupsName, NGroupInner nGroup) { + return beginCreateOrUpdateAsync(resourceGroupName, ngroupsName, nGroup).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * NGroup PUT REST API + * + * Create or update a NGroups resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @param nGroup The NGroup object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 NGroups resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String ngroupsName, NGroupInner nGroup, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, ngroupsName, nGroup, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * NGroup PUT REST API + * + * Create or update a NGroups resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @param nGroup The NGroup object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 NGroups resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NGroupInner createOrUpdate(String resourceGroupName, String ngroupsName, NGroupInner nGroup) { + return createOrUpdateAsync(resourceGroupName, ngroupsName, nGroup).block(); + } + + /** + * NGroup PUT REST API + * + * Create or update a NGroups resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @param nGroup The NGroup object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 NGroups resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NGroupInner createOrUpdate(String resourceGroupName, String ngroupsName, NGroupInner nGroup, + Context context) { + return createOrUpdateAsync(resourceGroupName, ngroupsName, nGroup, context).block(); + } + + /** + * NGroups PATCH REST API + * + * Update a specified NGroups resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @param nGroup The NGroup object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 NGroups resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String ngroupsName, + NGroupInner nGroup) { + 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 (ngroupsName == null) { + return Mono.error(new IllegalArgumentException("Parameter ngroupsName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (nGroup == null) { + return Mono.error(new IllegalArgumentException("Parameter nGroup is required and cannot be null.")); + } else { + nGroup.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), resourceGroupName, ngroupsName, + this.client.getApiVersion(), this.client.getSubscriptionId(), nGroup, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * NGroups PATCH REST API + * + * Update a specified NGroups resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @param nGroup The NGroup object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 NGroups resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String ngroupsName, + NGroupInner nGroup, 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 (ngroupsName == null) { + return Mono.error(new IllegalArgumentException("Parameter ngroupsName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (nGroup == null) { + return Mono.error(new IllegalArgumentException("Parameter nGroup is required and cannot be null.")); + } else { + nGroup.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), resourceGroupName, ngroupsName, this.client.getApiVersion(), + this.client.getSubscriptionId(), nGroup, accept, context); + } + + /** + * NGroups PATCH REST API + * + * Update a specified NGroups resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @param nGroup The NGroup object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 NGroups resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NGroupInner> beginUpdateAsync(String resourceGroupName, + String ngroupsName, NGroupInner nGroup) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, ngroupsName, nGroup); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + NGroupInner.class, NGroupInner.class, this.client.getContext()); + } + + /** + * NGroups PATCH REST API + * + * Update a specified NGroups resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @param nGroup The NGroup object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 NGroups resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NGroupInner> beginUpdateAsync(String resourceGroupName, + String ngroupsName, NGroupInner nGroup, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = updateWithResponseAsync(resourceGroupName, ngroupsName, nGroup, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + NGroupInner.class, NGroupInner.class, context); + } + + /** + * NGroups PATCH REST API + * + * Update a specified NGroups resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @param nGroup The NGroup object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 NGroups resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NGroupInner> beginUpdate(String resourceGroupName, String ngroupsName, + NGroupInner nGroup) { + return this.beginUpdateAsync(resourceGroupName, ngroupsName, nGroup).getSyncPoller(); + } + + /** + * NGroups PATCH REST API + * + * Update a specified NGroups resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @param nGroup The NGroup object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 NGroups resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NGroupInner> beginUpdate(String resourceGroupName, String ngroupsName, + NGroupInner nGroup, Context context) { + return this.beginUpdateAsync(resourceGroupName, ngroupsName, nGroup, context).getSyncPoller(); + } + + /** + * NGroups PATCH REST API + * + * Update a specified NGroups resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @param nGroup The NGroup object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 NGroups resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String ngroupsName, NGroupInner nGroup) { + return beginUpdateAsync(resourceGroupName, ngroupsName, nGroup).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * NGroups PATCH REST API + * + * Update a specified NGroups resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @param nGroup The NGroup object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 NGroups resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String ngroupsName, NGroupInner nGroup, + Context context) { + return beginUpdateAsync(resourceGroupName, ngroupsName, nGroup, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * NGroups PATCH REST API + * + * Update a specified NGroups resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @param nGroup The NGroup object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 NGroups resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NGroupInner update(String resourceGroupName, String ngroupsName, NGroupInner nGroup) { + return updateAsync(resourceGroupName, ngroupsName, nGroup).block(); + } + + /** + * NGroups PATCH REST API + * + * Update a specified NGroups resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @param nGroup The NGroup object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 NGroups resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NGroupInner update(String resourceGroupName, String ngroupsName, NGroupInner nGroup, Context context) { + return updateAsync(resourceGroupName, ngroupsName, nGroup, context).block(); + } + + /** + * NGroups Delete REST API + * + * Deletes the NGroups resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 ngroupsName) { + 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 (ngroupsName == null) { + return Mono.error(new IllegalArgumentException("Parameter ngroupsName is required 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, ngroupsName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * NGroups Delete REST API + * + * Deletes the NGroups resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 ngroupsName, + 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 (ngroupsName == null) { + return Mono.error(new IllegalArgumentException("Parameter ngroupsName is required 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, ngroupsName, this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context); + } + + /** + * NGroups Delete REST API + * + * Deletes the NGroups resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 ngroupsName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, ngroupsName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * NGroups Delete REST API + * + * Deletes the NGroups resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 ngroupsName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, ngroupsName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * NGroups Delete REST API + * + * Deletes the NGroups resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 ngroupsName) { + return this.beginDeleteAsync(resourceGroupName, ngroupsName).getSyncPoller(); + } + + /** + * NGroups Delete REST API + * + * Deletes the NGroups resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 ngroupsName, + Context context) { + return this.beginDeleteAsync(resourceGroupName, ngroupsName, context).getSyncPoller(); + } + + /** + * NGroups Delete REST API + * + * Deletes the NGroups resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 ngroupsName) { + return beginDeleteAsync(resourceGroupName, ngroupsName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * NGroups Delete REST API + * + * Deletes the NGroups resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 ngroupsName, Context context) { + return beginDeleteAsync(resourceGroupName, ngroupsName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * NGroups Delete REST API + * + * Deletes the NGroups resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 ngroupsName) { + deleteAsync(resourceGroupName, ngroupsName).block(); + } + + /** + * NGroups Delete REST API + * + * Deletes the NGroups resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 ngroupsName, Context context) { + deleteAsync(resourceGroupName, ngroupsName, context).block(); + } + + /** + * Starts all container groups in the specified NGroups resource. + * + * Starts all container groups in the specified NGroups resource. Compute resources will be allocated and billing + * will start. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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>> startWithResponseAsync(String resourceGroupName, String ngroupsName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (ngroupsName == null) { + return Mono.error(new IllegalArgumentException("Parameter ngroupsName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.start(this.client.getEndpoint(), this.client.getSubscriptionId(), + this.client.getApiVersion(), resourceGroupName, ngroupsName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Starts all container groups in the specified NGroups resource. + * + * Starts all container groups in the specified NGroups resource. Compute resources will be allocated and billing + * will start. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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>> startWithResponseAsync(String resourceGroupName, String ngroupsName, + 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 (ngroupsName == null) { + return Mono.error(new IllegalArgumentException("Parameter ngroupsName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.start(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), + resourceGroupName, ngroupsName, accept, context); + } + + /** + * Starts all container groups in the specified NGroups resource. + * + * Starts all container groups in the specified NGroups resource. Compute resources will be allocated and billing + * will start. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginStartAsync(String resourceGroupName, String ngroupsName) { + Mono>> mono = startWithResponseAsync(resourceGroupName, ngroupsName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Starts all container groups in the specified NGroups resource. + * + * Starts all container groups in the specified NGroups resource. Compute resources will be allocated and billing + * will start. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginStartAsync(String resourceGroupName, String ngroupsName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = startWithResponseAsync(resourceGroupName, ngroupsName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Starts all container groups in the specified NGroups resource. + * + * Starts all container groups in the specified NGroups resource. Compute resources will be allocated and billing + * will start. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> beginStart(String resourceGroupName, String ngroupsName) { + return this.beginStartAsync(resourceGroupName, ngroupsName).getSyncPoller(); + } + + /** + * Starts all container groups in the specified NGroups resource. + * + * Starts all container groups in the specified NGroups resource. Compute resources will be allocated and billing + * will start. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> beginStart(String resourceGroupName, String ngroupsName, + Context context) { + return this.beginStartAsync(resourceGroupName, ngroupsName, context).getSyncPoller(); + } + + /** + * Starts all container groups in the specified NGroups resource. + * + * Starts all container groups in the specified NGroups resource. Compute resources will be allocated and billing + * will start. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync(String resourceGroupName, String ngroupsName) { + return beginStartAsync(resourceGroupName, ngroupsName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts all container groups in the specified NGroups resource. + * + * Starts all container groups in the specified NGroups resource. Compute resources will be allocated and billing + * will start. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync(String resourceGroupName, String ngroupsName, Context context) { + return beginStartAsync(resourceGroupName, ngroupsName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts all container groups in the specified NGroups resource. + * + * Starts all container groups in the specified NGroups resource. Compute resources will be allocated and billing + * will start. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void start(String resourceGroupName, String ngroupsName) { + startAsync(resourceGroupName, ngroupsName).block(); + } + + /** + * Starts all container groups in the specified NGroups resource. + * + * Starts all container groups in the specified NGroups resource. Compute resources will be allocated and billing + * will start. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void start(String resourceGroupName, String ngroupsName, Context context) { + startAsync(resourceGroupName, ngroupsName, context).block(); + } + + /** + * Stops all container groups in the specified NGroups resource. + * + * Stops all container groups in the specified NGroups resource. Compute resources will be deallocated and billing + * will stop. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> stopWithResponseAsync(String resourceGroupName, String ngroupsName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (ngroupsName == null) { + return Mono.error(new IllegalArgumentException("Parameter ngroupsName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.stop(this.client.getEndpoint(), this.client.getSubscriptionId(), + this.client.getApiVersion(), resourceGroupName, ngroupsName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Stops all container groups in the specified NGroups resource. + * + * Stops all container groups in the specified NGroups resource. Compute resources will be deallocated and billing + * will stop. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> stopWithResponseAsync(String resourceGroupName, String ngroupsName, 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 (ngroupsName == null) { + return Mono.error(new IllegalArgumentException("Parameter ngroupsName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.stop(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), + resourceGroupName, ngroupsName, accept, context); + } + + /** + * Stops all container groups in the specified NGroups resource. + * + * Stops all container groups in the specified NGroups resource. Compute resources will be deallocated and billing + * will stop. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono stopAsync(String resourceGroupName, String ngroupsName) { + return stopWithResponseAsync(resourceGroupName, ngroupsName).flatMap(ignored -> Mono.empty()); + } + + /** + * Stops all container groups in the specified NGroups resource. + * + * Stops all container groups in the specified NGroups resource. Compute resources will be deallocated and billing + * will stop. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response stopWithResponse(String resourceGroupName, String ngroupsName, Context context) { + return stopWithResponseAsync(resourceGroupName, ngroupsName, context).block(); + } + + /** + * Stops all container groups in the specified NGroups resource. + * + * Stops all container groups in the specified NGroups resource. Compute resources will be deallocated and billing + * will stop. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void stop(String resourceGroupName, String ngroupsName) { + stopWithResponse(resourceGroupName, ngroupsName, Context.NONE); + } + + /** + * Restarts all container groups in the specified NGroups resource. + * + * Restarts all container groups in the specified NGroups resource in place. If container image has updates, new + * image will be downloaded. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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>> restartWithResponseAsync(String resourceGroupName, String ngroupsName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (ngroupsName == null) { + return Mono.error(new IllegalArgumentException("Parameter ngroupsName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.restart(this.client.getEndpoint(), this.client.getSubscriptionId(), + this.client.getApiVersion(), resourceGroupName, ngroupsName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Restarts all container groups in the specified NGroups resource. + * + * Restarts all container groups in the specified NGroups resource in place. If container image has updates, new + * image will be downloaded. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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>> restartWithResponseAsync(String resourceGroupName, String ngroupsName, + 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 (ngroupsName == null) { + return Mono.error(new IllegalArgumentException("Parameter ngroupsName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.restart(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), + resourceGroupName, ngroupsName, accept, context); + } + + /** + * Restarts all container groups in the specified NGroups resource. + * + * Restarts all container groups in the specified NGroups resource in place. If container image has updates, new + * image will be downloaded. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginRestartAsync(String resourceGroupName, String ngroupsName) { + Mono>> mono = restartWithResponseAsync(resourceGroupName, ngroupsName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Restarts all container groups in the specified NGroups resource. + * + * Restarts all container groups in the specified NGroups resource in place. If container image has updates, new + * image will be downloaded. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginRestartAsync(String resourceGroupName, String ngroupsName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = restartWithResponseAsync(resourceGroupName, ngroupsName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Restarts all container groups in the specified NGroups resource. + * + * Restarts all container groups in the specified NGroups resource in place. If container image has updates, new + * image will be downloaded. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> beginRestart(String resourceGroupName, String ngroupsName) { + return this.beginRestartAsync(resourceGroupName, ngroupsName).getSyncPoller(); + } + + /** + * Restarts all container groups in the specified NGroups resource. + * + * Restarts all container groups in the specified NGroups resource in place. If container image has updates, new + * image will be downloaded. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> beginRestart(String resourceGroupName, String ngroupsName, + Context context) { + return this.beginRestartAsync(resourceGroupName, ngroupsName, context).getSyncPoller(); + } + + /** + * Restarts all container groups in the specified NGroups resource. + * + * Restarts all container groups in the specified NGroups resource in place. If container image has updates, new + * image will be downloaded. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restartAsync(String resourceGroupName, String ngroupsName) { + return beginRestartAsync(resourceGroupName, ngroupsName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restarts all container groups in the specified NGroups resource. + * + * Restarts all container groups in the specified NGroups resource in place. If container image has updates, new + * image will be downloaded. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restartAsync(String resourceGroupName, String ngroupsName, Context context) { + return beginRestartAsync(resourceGroupName, ngroupsName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restarts all container groups in the specified NGroups resource. + * + * Restarts all container groups in the specified NGroups resource in place. If container image has updates, new + * image will be downloaded. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 restart(String resourceGroupName, String ngroupsName) { + restartAsync(resourceGroupName, ngroupsName).block(); + } + + /** + * Restarts all container groups in the specified NGroups resource. + * + * Restarts all container groups in the specified NGroups resource in place. If container image has updates, new + * image will be downloaded. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 restart(String resourceGroupName, String ngroupsName, Context context) { + restartAsync(resourceGroupName, ngroupsName, context).block(); + } + + /** + * GET NGroups under a resource group REST API. + * + * Gets a list of all NGroups resources under a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all NGroups resources under a resource group along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, 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())); + } + + /** + * GET NGroups under a resource group REST API. + * + * Gets a list of all NGroups resources under a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all NGroups resources under a resource group along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * GET NGroups under a resource group REST API. + * + * Gets a list of all NGroups resources under a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all NGroups resources under a resource group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * GET NGroups under a resource group REST API. + * + * Gets a list of all NGroups resources under a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all NGroups resources under a resource group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * GET NGroups under a resource group REST API. + * + * Gets a list of all NGroups resources under a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all NGroups resources under a resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * GET NGroups under a resource group REST API. + * + * Gets a list of all NGroups resources under a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all NGroups resources under a resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * List NGroups in a subscription. + * + * Gets a list of all NGroups resources under a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all NGroups resources under a subscription along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List NGroups in a subscription. + * + * Gets a list of all NGroups resources under a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all NGroups resources under a subscription along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List NGroups in a subscription. + * + * Gets a list of all NGroups resources under a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all NGroups resources under a subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List NGroups in a subscription. + * + * Gets a list of all NGroups resources under a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all NGroups resources under a subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List NGroups in a subscription. + * + * Gets a list of all NGroups resources under a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all NGroups resources under a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List NGroups in a subscription. + * + * Gets a list of all NGroups resources under a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all NGroups resources under a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NGroups list response that contains the NGroups properties along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NGroups list response that contains the NGroups properties along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NGroups list response that contains the NGroups properties 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NGroups list response that contains the NGroups properties 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/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/NGroupsImpl.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/NGroupsImpl.java new file mode 100644 index 000000000000..794d2ef91bef --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/NGroupsImpl.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.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.containerinstance.generated.fluent.NGroupsClient; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.NGroupInner; +import com.azure.resourcemanager.containerinstance.generated.models.NGroup; +import com.azure.resourcemanager.containerinstance.generated.models.NGroups; + +public final class NGroupsImpl implements NGroups { + private static final ClientLogger LOGGER = new ClientLogger(NGroupsImpl.class); + + private final NGroupsClient innerClient; + + private final com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager; + + public NGroupsImpl(NGroupsClient innerClient, + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String ngroupsName, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, ngroupsName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new NGroupImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public NGroup getByResourceGroup(String resourceGroupName, String ngroupsName) { + NGroupInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, ngroupsName); + if (inner != null) { + return new NGroupImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String ngroupsName) { + this.serviceClient().delete(resourceGroupName, ngroupsName); + } + + public void delete(String resourceGroupName, String ngroupsName, Context context) { + this.serviceClient().delete(resourceGroupName, ngroupsName, context); + } + + public void start(String resourceGroupName, String ngroupsName) { + this.serviceClient().start(resourceGroupName, ngroupsName); + } + + public void start(String resourceGroupName, String ngroupsName, Context context) { + this.serviceClient().start(resourceGroupName, ngroupsName, context); + } + + public Response stopWithResponse(String resourceGroupName, String ngroupsName, Context context) { + return this.serviceClient().stopWithResponse(resourceGroupName, ngroupsName, context); + } + + public void stop(String resourceGroupName, String ngroupsName) { + this.serviceClient().stop(resourceGroupName, ngroupsName); + } + + public void restart(String resourceGroupName, String ngroupsName) { + this.serviceClient().restart(resourceGroupName, ngroupsName); + } + + public void restart(String resourceGroupName, String ngroupsName, Context context) { + this.serviceClient().restart(resourceGroupName, ngroupsName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NGroupImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NGroupImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NGroupImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NGroupImpl(inner1, this.manager())); + } + + public NGroup getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String ngroupsName = ResourceManagerUtils.getValueFromIdByName(id, "ngroups"); + if (ngroupsName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ngroups'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, ngroupsName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String ngroupsName = ResourceManagerUtils.getValueFromIdByName(id, "ngroups"); + if (ngroupsName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ngroups'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, ngroupsName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String ngroupsName = ResourceManagerUtils.getValueFromIdByName(id, "ngroups"); + if (ngroupsName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ngroups'.", id))); + } + this.delete(resourceGroupName, ngroupsName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String ngroupsName = ResourceManagerUtils.getValueFromIdByName(id, "ngroups"); + if (ngroupsName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ngroups'.", id))); + } + this.delete(resourceGroupName, ngroupsName, context); + } + + private NGroupsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager() { + return this.serviceManager; + } + + public NGroupImpl define(String name) { + return new NGroupImpl(name, this.manager()); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/OperationImpl.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/OperationImpl.java new file mode 100644 index 000000000000..147ebfdb239e --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/OperationImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.implementation; + +import com.azure.resourcemanager.containerinstance.generated.fluent.models.OperationInner; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerInstanceOperationsOrigin; +import com.azure.resourcemanager.containerinstance.generated.models.Operation; +import com.azure.resourcemanager.containerinstance.generated.models.OperationDisplay; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager; + + OperationImpl(OperationInner innerObject, + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public OperationDisplay display() { + return this.innerModel().display(); + } + + public Object properties() { + return this.innerModel().properties(); + } + + public ContainerInstanceOperationsOrigin origin() { + return this.innerModel().origin(); + } + + public OperationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/OperationsClientImpl.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/OperationsClientImpl.java new file mode 100644 index 000000000000..5dfe070cb4d4 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/OperationsClientImpl.java @@ -0,0 +1,235 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.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.containerinstance.generated.fluent.OperationsClient; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.OperationInner; +import com.azure.resourcemanager.containerinstance.generated.models.OperationListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ +public final class OperationsClientImpl implements OperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final OperationsService service; + + /** + * The service client containing this operation class. + */ + private final ContainerInstanceManagementClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(ContainerInstanceManagementClientImpl client) { + this.service + = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerInstanceManagementClientOperations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerInstanceMan") + public interface OperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.ContainerInstance/operations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * List the operations for Azure Container Instance service. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation list response that contains all operations for Azure Container Instance service along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List the operations for Azure Container Instance service. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation list response that contains all operations for Azure Container Instance service along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List the operations for Azure Container Instance service. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation list response that contains all operations for Azure Container Instance service as + * paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List the operations for Azure Container Instance service. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation list response that contains all operations for Azure Container Instance service as + * paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List the operations for Azure Container Instance service. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation list response that contains all operations for Azure Container Instance service as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List the operations for Azure Container Instance service. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation list response that contains all operations for Azure Container Instance service as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation list response that contains all operations for Azure Container Instance service 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation list response that contains all operations for Azure Container Instance service 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/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/OperationsImpl.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/OperationsImpl.java new file mode 100644 index 000000000000..1062edcc97f0 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/OperationsImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerinstance.generated.fluent.OperationsClient; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.OperationInner; +import com.azure.resourcemanager.containerinstance.generated.models.Operation; +import com.azure.resourcemanager.containerinstance.generated.models.Operations; + +public final class OperationsImpl implements Operations { + private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager; + + public OperationsImpl(OperationsClient innerClient, + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ResourceManagerUtils.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ResourceManagerUtils.java new file mode 100644 index 000000000000..a8afb2fc5ef2 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ResourceManagerUtils.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.implementation; + +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.util.CoreUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import reactor.core.publisher.Flux; + +final class ResourceManagerUtils { + private ResourceManagerUtils() { + } + + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterator itr = Arrays.stream(id.split("/")).iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null) { + return null; + } + String parameterNameParentheses = "{" + parameterName + "}"; + List idSegmentsReverted = Arrays.asList(id.split("/")); + List pathSegments = Arrays.asList(pathTemplate.split("/")); + Collections.reverse(idSegmentsReverted); + Iterator idItrReverted = idSegmentsReverted.iterator(); + int pathIndex = pathSegments.size(); + while (idItrReverted.hasNext() && pathIndex > 0) { + String idSegment = idItrReverted.next(); + String pathSegment = pathSegments.get(--pathIndex); + if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { + if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { + if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { + List segments = new ArrayList<>(); + segments.add(idSegment); + idItrReverted.forEachRemaining(segments::add); + Collections.reverse(segments); + if (!segments.isEmpty() && segments.get(0).isEmpty()) { + segments.remove(0); + } + return String.join("/", segments); + } else { + return idSegment; + } + } + } + } + return null; + } + + static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { + return new PagedIterableImpl<>(pageIterable, mapper); + } + + private static final class PagedIterableImpl extends PagedIterable { + + private final PagedIterable pagedIterable; + private final Function mapper; + private final Function, PagedResponse> pageMapper; + + private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { + super(PagedFlux.create(() -> (continuationToken, pageSize) -> Flux + .fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + this.pagedIterable = pagedIterable; + this.mapper = mapper; + this.pageMapper = getPageMapper(mapper); + } + + private static Function, PagedResponse> getPageMapper(Function mapper) { + return page -> new PagedResponseBase(page.getRequest(), page.getStatusCode(), page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), page.getContinuationToken(), + null); + } + + @Override + public Stream stream() { + return pagedIterable.stream().map(mapper); + } + + @Override + public Stream> streamByPage() { + return pagedIterable.streamByPage().map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken) { + return pagedIterable.streamByPage(continuationToken).map(pageMapper); + } + + @Override + public Stream> streamByPage(int preferredPageSize) { + return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken, int preferredPageSize) { + return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + } + + @Override + public Iterator iterator() { + return new IteratorImpl<>(pagedIterable.iterator(), mapper); + } + + @Override + public Iterable> iterableByPage() { + return new IterableImpl<>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl<>(pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + } + } + + private static final class IteratorImpl implements Iterator { + + private final Iterator iterator; + private final Function mapper; + + private IteratorImpl(Iterator iterator, Function mapper) { + this.iterator = iterator; + this.mapper = mapper; + } + + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public S next() { + return mapper.apply(iterator.next()); + } + + @Override + public void remove() { + iterator.remove(); + } + } + + private static final class IterableImpl implements Iterable { + + private final Iterable iterable; + private final Function mapper; + + private IterableImpl(Iterable iterable, Function mapper) { + this.iterable = iterable; + this.mapper = mapper; + } + + @Override + public Iterator iterator() { + return new IteratorImpl<>(iterable.iterator(), mapper); + } + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/SubnetServiceAssociationLinksClientImpl.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/SubnetServiceAssociationLinksClientImpl.java new file mode 100644 index 000000000000..cbc8d2c70119 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/SubnetServiceAssociationLinksClientImpl.java @@ -0,0 +1,328 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.implementation; + +import com.azure.core.annotation.Delete; +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.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.containerinstance.generated.fluent.SubnetServiceAssociationLinksClient; +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 SubnetServiceAssociationLinksClient. + */ +public final class SubnetServiceAssociationLinksClientImpl implements SubnetServiceAssociationLinksClient { + /** + * The proxy service used to perform REST calls. + */ + private final SubnetServiceAssociationLinksService service; + + /** + * The service client containing this operation class. + */ + private final ContainerInstanceManagementClientImpl client; + + /** + * Initializes an instance of SubnetServiceAssociationLinksClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SubnetServiceAssociationLinksClientImpl(ContainerInstanceManagementClientImpl client) { + this.service = RestProxy.create(SubnetServiceAssociationLinksService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerInstanceManagementClientSubnetServiceAssociationLinks to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerInstanceMan") + public interface SubnetServiceAssociationLinksService { + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/providers/Microsoft.ContainerInstance/serviceAssociationLinks/default") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkName") String virtualNetworkName, @PathParam("subnetName") String subnetName, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Delete container group virtual network association links. + * + * Delete container group virtual network association links. The operation does not delete other resources provided + * by the user. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 virtualNetworkName, String subnetName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); + } + if (subnetName == null) { + return Mono.error(new IllegalArgumentException("Parameter subnetName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + this.client.getApiVersion(), resourceGroupName, virtualNetworkName, subnetName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete container group virtual network association links. + * + * Delete container group virtual network association links. The operation does not delete other resources provided + * by the user. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 virtualNetworkName, String subnetName, 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 (virtualNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); + } + if (subnetName == null) { + return Mono.error(new IllegalArgumentException("Parameter subnetName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), + resourceGroupName, virtualNetworkName, subnetName, accept, context); + } + + /** + * Delete container group virtual network association links. + * + * Delete container group virtual network association links. The operation does not delete other resources provided + * by the user. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 virtualNetworkName, + String subnetName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, virtualNetworkName, subnetName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete container group virtual network association links. + * + * Delete container group virtual network association links. The operation does not delete other resources provided + * by the user. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 virtualNetworkName, + String subnetName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, virtualNetworkName, subnetName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete container group virtual network association links. + * + * Delete container group virtual network association links. The operation does not delete other resources provided + * by the user. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 virtualNetworkName, + String subnetName) { + return this.beginDeleteAsync(resourceGroupName, virtualNetworkName, subnetName).getSyncPoller(); + } + + /** + * Delete container group virtual network association links. + * + * Delete container group virtual network association links. The operation does not delete other resources provided + * by the user. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 virtualNetworkName, + String subnetName, Context context) { + return this.beginDeleteAsync(resourceGroupName, virtualNetworkName, subnetName, context).getSyncPoller(); + } + + /** + * Delete container group virtual network association links. + * + * Delete container group virtual network association links. The operation does not delete other resources provided + * by the user. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualNetworkName, String subnetName) { + return beginDeleteAsync(resourceGroupName, virtualNetworkName, subnetName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete container group virtual network association links. + * + * Delete container group virtual network association links. The operation does not delete other resources provided + * by the user. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualNetworkName, String subnetName, + Context context) { + return beginDeleteAsync(resourceGroupName, virtualNetworkName, subnetName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete container group virtual network association links. + * + * Delete container group virtual network association links. The operation does not delete other resources provided + * by the user. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 virtualNetworkName, String subnetName) { + deleteAsync(resourceGroupName, virtualNetworkName, subnetName).block(); + } + + /** + * Delete container group virtual network association links. + * + * Delete container group virtual network association links. The operation does not delete other resources provided + * by the user. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 virtualNetworkName, String subnetName, Context context) { + deleteAsync(resourceGroupName, virtualNetworkName, subnetName, context).block(); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/SubnetServiceAssociationLinksImpl.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/SubnetServiceAssociationLinksImpl.java new file mode 100644 index 000000000000..26ff5ad91ccf --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/SubnetServiceAssociationLinksImpl.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.containerinstance.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerinstance.generated.fluent.SubnetServiceAssociationLinksClient; +import com.azure.resourcemanager.containerinstance.generated.models.SubnetServiceAssociationLinks; + +public final class SubnetServiceAssociationLinksImpl implements SubnetServiceAssociationLinks { + private static final ClientLogger LOGGER = new ClientLogger(SubnetServiceAssociationLinksImpl.class); + + private final SubnetServiceAssociationLinksClient innerClient; + + private final com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager; + + public SubnetServiceAssociationLinksImpl(SubnetServiceAssociationLinksClient innerClient, + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete(String resourceGroupName, String virtualNetworkName, String subnetName) { + this.serviceClient().delete(resourceGroupName, virtualNetworkName, subnetName); + } + + public void delete(String resourceGroupName, String virtualNetworkName, String subnetName, Context context) { + this.serviceClient().delete(resourceGroupName, virtualNetworkName, subnetName, context); + } + + private SubnetServiceAssociationLinksClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/UsageImpl.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/UsageImpl.java new file mode 100644 index 000000000000..2e6755912823 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/UsageImpl.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.implementation; + +import com.azure.resourcemanager.containerinstance.generated.fluent.models.UsageInner; +import com.azure.resourcemanager.containerinstance.generated.models.Usage; +import com.azure.resourcemanager.containerinstance.generated.models.UsageName; + +public final class UsageImpl implements Usage { + private UsageInner innerObject; + + private final com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager; + + UsageImpl(UsageInner innerObject, + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String unit() { + return this.innerModel().unit(); + } + + public Integer currentValue() { + return this.innerModel().currentValue(); + } + + public Integer limit() { + return this.innerModel().limit(); + } + + public UsageName name() { + return this.innerModel().name(); + } + + public UsageInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/package-info.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/package-info.java new file mode 100644 index 000000000000..d17d55e9572c --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the implementations for ContainerInstanceManagementClient. + * null. + */ +package com.azure.resourcemanager.containerinstance.generated.implementation; diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ApiEntityReference.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ApiEntityReference.java new file mode 100644 index 000000000000..5dc2277fe071 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ApiEntityReference.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.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The API entity reference. + */ +@Fluent +public final class ApiEntityReference implements JsonSerializable { + /* + * The ARM resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... + */ + private String id; + + /** + * Creates an instance of ApiEntityReference class. + */ + public ApiEntityReference() { + } + + /** + * Get the id property: The ARM resource id in the form of + * /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The ARM resource id in the form of + * /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... + * + * @param id the id value to set. + * @return the ApiEntityReference object itself. + */ + public ApiEntityReference withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApiEntityReference from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApiEntityReference if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ApiEntityReference. + */ + public static ApiEntityReference fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApiEntityReference deserializedApiEntityReference = new ApiEntityReference(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedApiEntityReference.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApiEntityReference; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ApplicationGateway.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ApplicationGateway.java new file mode 100644 index 000000000000..e6c76189d0a3 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ApplicationGateway.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Application Gateway the CG profile will use to interact with CGs in a backend pool. + */ +@Fluent +public final class ApplicationGateway implements JsonSerializable { + /* + * The Application Gateway ARM resource Id. + */ + private String resource; + + /* + * List of Application Gateway Backend Address Pools. + */ + private List backendAddressPools; + + /** + * Creates an instance of ApplicationGateway class. + */ + public ApplicationGateway() { + } + + /** + * Get the resource property: The Application Gateway ARM resource Id. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource property: The Application Gateway ARM resource Id. + * + * @param resource the resource value to set. + * @return the ApplicationGateway object itself. + */ + public ApplicationGateway withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the backendAddressPools property: List of Application Gateway Backend Address Pools. + * + * @return the backendAddressPools value. + */ + public List backendAddressPools() { + return this.backendAddressPools; + } + + /** + * Set the backendAddressPools property: List of Application Gateway Backend Address Pools. + * + * @param backendAddressPools the backendAddressPools value to set. + * @return the ApplicationGateway object itself. + */ + public ApplicationGateway withBackendAddressPools(List backendAddressPools) { + this.backendAddressPools = backendAddressPools; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (backendAddressPools() != null) { + backendAddressPools().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resource", this.resource); + jsonWriter.writeArrayField("backendAddressPools", this.backendAddressPools, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGateway from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGateway if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGateway. + */ + public static ApplicationGateway fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGateway deserializedApplicationGateway = new ApplicationGateway(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resource".equals(fieldName)) { + deserializedApplicationGateway.resource = reader.getString(); + } else if ("backendAddressPools".equals(fieldName)) { + List backendAddressPools + = reader.readArray(reader1 -> ApplicationGatewayBackendAddressPool.fromJson(reader1)); + deserializedApplicationGateway.backendAddressPools = backendAddressPools; + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGateway; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ApplicationGatewayBackendAddressPool.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ApplicationGatewayBackendAddressPool.java new file mode 100644 index 000000000000..fdb811e1c774 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ApplicationGatewayBackendAddressPool.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.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * NGroups application gateway backend address pool. + */ +@Fluent +public final class ApplicationGatewayBackendAddressPool + implements JsonSerializable { + /* + * The application gateway backend address pool ARM resource Id. + */ + private String resource; + + /** + * Creates an instance of ApplicationGatewayBackendAddressPool class. + */ + public ApplicationGatewayBackendAddressPool() { + } + + /** + * Get the resource property: The application gateway backend address pool ARM resource Id. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource property: The application gateway backend address pool ARM resource Id. + * + * @param resource the resource value to set. + * @return the ApplicationGatewayBackendAddressPool object itself. + */ + public ApplicationGatewayBackendAddressPool withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resource", this.resource); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayBackendAddressPool from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayBackendAddressPool if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayBackendAddressPool. + */ + public static ApplicationGatewayBackendAddressPool fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayBackendAddressPool deserializedApplicationGatewayBackendAddressPool + = new ApplicationGatewayBackendAddressPool(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resource".equals(fieldName)) { + deserializedApplicationGatewayBackendAddressPool.resource = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayBackendAddressPool; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/AzureFileShareAccessTier.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/AzureFileShareAccessTier.java new file mode 100644 index 000000000000..8be297284597 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/AzureFileShareAccessTier.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +/** + * Access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. + * FileStorage account can choose Premium. Learn more at: + * https://learn.microsoft.com/en-us/rest/api/storagerp/file-shares/create?tabs=HTTP#shareaccesstier. + */ +public enum AzureFileShareAccessTier { + /** + * Enum value Cool. + */ + COOL("Cool"), + + /** + * Enum value Hot. + */ + HOT("Hot"), + + /** + * Enum value Premium. + */ + PREMIUM("Premium"), + + /** + * Enum value TransactionOptimized. + */ + TRANSACTION_OPTIMIZED("TransactionOptimized"); + + /** + * The actual serialized value for a AzureFileShareAccessTier instance. + */ + private final String value; + + AzureFileShareAccessTier(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AzureFileShareAccessTier instance. + * + * @param value the serialized value to parse. + * @return the parsed AzureFileShareAccessTier object, or null if unable to parse. + */ + public static AzureFileShareAccessTier fromString(String value) { + if (value == null) { + return null; + } + AzureFileShareAccessTier[] items = AzureFileShareAccessTier.values(); + for (AzureFileShareAccessTier item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/AzureFileShareAccessType.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/AzureFileShareAccessType.java new file mode 100644 index 000000000000..3536a0ffa65d --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/AzureFileShareAccessType.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.containerinstance.generated.models; + +/** + * Specifies how Container Groups can access the Azure file share i.e. all CG will share same Azure file share or going + * to have exclusive file share. + */ +public enum AzureFileShareAccessType { + /** + * Enum value Shared. + */ + SHARED("Shared"), + + /** + * Enum value Exclusive. + */ + EXCLUSIVE("Exclusive"); + + /** + * The actual serialized value for a AzureFileShareAccessType instance. + */ + private final String value; + + AzureFileShareAccessType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AzureFileShareAccessType instance. + * + * @param value the serialized value to parse. + * @return the parsed AzureFileShareAccessType object, or null if unable to parse. + */ + public static AzureFileShareAccessType fromString(String value) { + if (value == null) { + return null; + } + AzureFileShareAccessType[] items = AzureFileShareAccessType.values(); + for (AzureFileShareAccessType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/AzureFileVolume.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/AzureFileVolume.java new file mode 100644 index 000000000000..04e100c43d55 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/AzureFileVolume.java @@ -0,0 +1,220 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The properties of the Azure File volume. Azure File shares are mounted as volumes. + */ +@Fluent +public final class AzureFileVolume implements JsonSerializable { + /* + * The name of the Azure File share to be mounted as a volume. + */ + private String shareName; + + /* + * The flag indicating whether the Azure File shared mounted as a volume is read-only. + */ + private Boolean readOnly; + + /* + * The name of the storage account that contains the Azure File share. + */ + private String storageAccountName; + + /* + * The storage account access key used to access the Azure File share. + */ + private String storageAccountKey; + + /* + * The reference to the storage account access key used to access the Azure File share. + */ + private String storageAccountKeyReference; + + /** + * Creates an instance of AzureFileVolume class. + */ + public AzureFileVolume() { + } + + /** + * Get the shareName property: The name of the Azure File share to be mounted as a volume. + * + * @return the shareName value. + */ + public String shareName() { + return this.shareName; + } + + /** + * Set the shareName property: The name of the Azure File share to be mounted as a volume. + * + * @param shareName the shareName value to set. + * @return the AzureFileVolume object itself. + */ + public AzureFileVolume withShareName(String shareName) { + this.shareName = shareName; + return this; + } + + /** + * Get the readOnly property: The flag indicating whether the Azure File shared mounted as a volume is read-only. + * + * @return the readOnly value. + */ + public Boolean readOnly() { + return this.readOnly; + } + + /** + * Set the readOnly property: The flag indicating whether the Azure File shared mounted as a volume is read-only. + * + * @param readOnly the readOnly value to set. + * @return the AzureFileVolume object itself. + */ + public AzureFileVolume withReadOnly(Boolean readOnly) { + this.readOnly = readOnly; + return this; + } + + /** + * Get the storageAccountName property: The name of the storage account that contains the Azure File share. + * + * @return the storageAccountName value. + */ + public String storageAccountName() { + return this.storageAccountName; + } + + /** + * Set the storageAccountName property: The name of the storage account that contains the Azure File share. + * + * @param storageAccountName the storageAccountName value to set. + * @return the AzureFileVolume object itself. + */ + public AzureFileVolume withStorageAccountName(String storageAccountName) { + this.storageAccountName = storageAccountName; + return this; + } + + /** + * Get the storageAccountKey property: The storage account access key used to access the Azure File share. + * + * @return the storageAccountKey value. + */ + public String storageAccountKey() { + return this.storageAccountKey; + } + + /** + * Set the storageAccountKey property: The storage account access key used to access the Azure File share. + * + * @param storageAccountKey the storageAccountKey value to set. + * @return the AzureFileVolume object itself. + */ + public AzureFileVolume withStorageAccountKey(String storageAccountKey) { + this.storageAccountKey = storageAccountKey; + return this; + } + + /** + * Get the storageAccountKeyReference property: The reference to the storage account access key used to access the + * Azure File share. + * + * @return the storageAccountKeyReference value. + */ + public String storageAccountKeyReference() { + return this.storageAccountKeyReference; + } + + /** + * Set the storageAccountKeyReference property: The reference to the storage account access key used to access the + * Azure File share. + * + * @param storageAccountKeyReference the storageAccountKeyReference value to set. + * @return the AzureFileVolume object itself. + */ + public AzureFileVolume withStorageAccountKeyReference(String storageAccountKeyReference) { + this.storageAccountKeyReference = storageAccountKeyReference; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (shareName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property shareName in model AzureFileVolume")); + } + if (storageAccountName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property storageAccountName in model AzureFileVolume")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AzureFileVolume.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("shareName", this.shareName); + jsonWriter.writeStringField("storageAccountName", this.storageAccountName); + jsonWriter.writeBooleanField("readOnly", this.readOnly); + jsonWriter.writeStringField("storageAccountKey", this.storageAccountKey); + jsonWriter.writeStringField("storageAccountKeyReference", this.storageAccountKeyReference); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureFileVolume from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureFileVolume if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AzureFileVolume. + */ + public static AzureFileVolume fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureFileVolume deserializedAzureFileVolume = new AzureFileVolume(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("shareName".equals(fieldName)) { + deserializedAzureFileVolume.shareName = reader.getString(); + } else if ("storageAccountName".equals(fieldName)) { + deserializedAzureFileVolume.storageAccountName = reader.getString(); + } else if ("readOnly".equals(fieldName)) { + deserializedAzureFileVolume.readOnly = reader.getNullable(JsonReader::getBoolean); + } else if ("storageAccountKey".equals(fieldName)) { + deserializedAzureFileVolume.storageAccountKey = reader.getString(); + } else if ("storageAccountKeyReference".equals(fieldName)) { + deserializedAzureFileVolume.storageAccountKeyReference = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureFileVolume; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/CGProfileOperations.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/CGProfileOperations.java new file mode 100644 index 000000000000..8c09b09f512b --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/CGProfileOperations.java @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.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 CGProfileOperations. + */ +public interface CGProfileOperations { + /** + * Display information about a specified ContainerGroupProfile. + * + * Get the properties of the specified container group profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupProfileName ContainerGroupProfile name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified container group profile along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, + String containerGroupProfileName, Context context); + + /** + * Display information about a specified ContainerGroupProfile. + * + * Get the properties of the specified container group profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupProfileName ContainerGroupProfile name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified container group profile. + */ + ContainerGroupProfile getByResourceGroup(String resourceGroupName, String containerGroupProfileName); + + /** + * Container group profile DELETE REST API. + * + * Deletes a container group profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupProfileName ContainerGroupProfile name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String containerGroupProfileName); + + /** + * Container group profile DELETE REST API. + * + * Deletes a container group profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupProfileName ContainerGroupProfile name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 containerGroupProfileName, Context context); + + /** + * Get a list of all the revisions of the specified container group profile in the given subscription and resource + * group. + * + * Get a list of all the revisions of the specified container group profile in the given subscription and resource + * group. This operation returns properties of each revision of the specified container group profile including + * containers, image registry credentials, restart policy, IP address type, OS type volumes, revision number, etc. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupProfileName ContainerGroupProfile name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all the revisions of the specified container group profile in the given subscription and + * resource group as paginated response with {@link PagedIterable}. + */ + PagedIterable listAllRevisions(String resourceGroupName, String containerGroupProfileName); + + /** + * Get a list of all the revisions of the specified container group profile in the given subscription and resource + * group. + * + * Get a list of all the revisions of the specified container group profile in the given subscription and resource + * group. This operation returns properties of each revision of the specified container group profile including + * containers, image registry credentials, restart policy, IP address type, OS type volumes, revision number, etc. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupProfileName ContainerGroupProfile name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all the revisions of the specified container group profile in the given subscription and + * resource group as paginated response with {@link PagedIterable}. + */ + PagedIterable listAllRevisions(String resourceGroupName, String containerGroupProfileName, + Context context); + + /** + * Get the properties of the specified revision of the container group profile. + * + * Gets the properties of the specified revision of the container group profile in the given subscription and + * resource group. The operation returns the properties of container group profile including containers, image + * registry credentials, restart policy, IP address type, OS type, volumes, current revision number, etc. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupProfileName ContainerGroupProfile name. + * @param revisionNumber The revision number of the container group profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified revision of the container group profile in the given subscription and + * resource group along with {@link Response}. + */ + Response getByRevisionNumberWithResponse(String resourceGroupName, + String containerGroupProfileName, String revisionNumber, Context context); + + /** + * Get the properties of the specified revision of the container group profile. + * + * Gets the properties of the specified revision of the container group profile in the given subscription and + * resource group. The operation returns the properties of container group profile including containers, image + * registry credentials, restart policy, IP address type, OS type, volumes, current revision number, etc. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupProfileName ContainerGroupProfile name. + * @param revisionNumber The revision number of the container group profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified revision of the container group profile in the given subscription and + * resource group. + */ + ContainerGroupProfile getByRevisionNumber(String resourceGroupName, String containerGroupProfileName, + String revisionNumber); + + /** + * Display information about a specified ContainerGroupProfile. + * + * Get the properties of the specified container group profile. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified container group profile along with {@link Response}. + */ + ContainerGroupProfile getById(String id); + + /** + * Display information about a specified ContainerGroupProfile. + * + * Get the properties of the specified container group profile. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified container group profile along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Container group profile DELETE REST API. + * + * Deletes a container group profile. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Container group profile DELETE REST API. + * + * Deletes a container group profile. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ContainerGroupProfile resource. + * + * @param name resource name. + * @return the first stage of the new ContainerGroupProfile definition. + */ + ContainerGroupProfile.DefinitionStages.Blank define(String name); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/CGProfileOperationsCreateOrUpdateHeaders.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/CGProfileOperationsCreateOrUpdateHeaders.java new file mode 100644 index 000000000000..b7ecad6bc8dc --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/CGProfileOperationsCreateOrUpdateHeaders.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; + +/** + * The CGProfileOperationsCreateOrUpdateHeaders model. + */ +@Fluent +public final class CGProfileOperationsCreateOrUpdateHeaders { + /* + * The x-ms-correlation-request-id property. + */ + private String xMsCorrelationRequestId; + + private static final HttpHeaderName X_MS_CORRELATION_REQUEST_ID + = HttpHeaderName.fromString("x-ms-correlation-request-id"); + + // HttpHeaders containing the raw property values. + /** + * Creates an instance of CGProfileOperationsCreateOrUpdateHeaders class. + * + * @param rawHeaders The raw HttpHeaders that will be used to create the property values. + */ + public CGProfileOperationsCreateOrUpdateHeaders(HttpHeaders rawHeaders) { + this.xMsCorrelationRequestId = rawHeaders.getValue(X_MS_CORRELATION_REQUEST_ID); + } + + /** + * Get the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @return the xMsCorrelationRequestId value. + */ + public String xMsCorrelationRequestId() { + return this.xMsCorrelationRequestId; + } + + /** + * Set the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @param xMsCorrelationRequestId the xMsCorrelationRequestId value to set. + * @return the CGProfileOperationsCreateOrUpdateHeaders object itself. + */ + public CGProfileOperationsCreateOrUpdateHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/CGProfileOperationsCreateOrUpdateResponse.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/CGProfileOperationsCreateOrUpdateResponse.java new file mode 100644 index 000000000000..08bfb6c63337 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/CGProfileOperationsCreateOrUpdateResponse.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.containerinstance.generated.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.ContainerGroupProfileInner; + +/** + * Contains all response data for the createOrUpdate operation. + */ +public final class CGProfileOperationsCreateOrUpdateResponse + extends ResponseBase { + /** + * Creates an instance of CGProfileOperationsCreateOrUpdateResponse. + * + * @param request the request which resulted in this CGProfileOperationsCreateOrUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public CGProfileOperationsCreateOrUpdateResponse(HttpRequest request, int statusCode, HttpHeaders rawHeaders, + ContainerGroupProfileInner value, CGProfileOperationsCreateOrUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** + * Gets the deserialized response body. + * + * @return the deserialized response body. + */ + @Override + public ContainerGroupProfileInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/CGProfileOperationsUpdateHeaders.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/CGProfileOperationsUpdateHeaders.java new file mode 100644 index 000000000000..eb6ce8574f8b --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/CGProfileOperationsUpdateHeaders.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; + +/** + * The CGProfileOperationsUpdateHeaders model. + */ +@Fluent +public final class CGProfileOperationsUpdateHeaders { + /* + * The x-ms-correlation-request-id property. + */ + private String xMsCorrelationRequestId; + + private static final HttpHeaderName X_MS_CORRELATION_REQUEST_ID + = HttpHeaderName.fromString("x-ms-correlation-request-id"); + + // HttpHeaders containing the raw property values. + /** + * Creates an instance of CGProfileOperationsUpdateHeaders class. + * + * @param rawHeaders The raw HttpHeaders that will be used to create the property values. + */ + public CGProfileOperationsUpdateHeaders(HttpHeaders rawHeaders) { + this.xMsCorrelationRequestId = rawHeaders.getValue(X_MS_CORRELATION_REQUEST_ID); + } + + /** + * Get the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @return the xMsCorrelationRequestId value. + */ + public String xMsCorrelationRequestId() { + return this.xMsCorrelationRequestId; + } + + /** + * Set the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @param xMsCorrelationRequestId the xMsCorrelationRequestId value to set. + * @return the CGProfileOperationsUpdateHeaders object itself. + */ + public CGProfileOperationsUpdateHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/CGProfileOperationsUpdateResponse.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/CGProfileOperationsUpdateResponse.java new file mode 100644 index 000000000000..279df3e8c768 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/CGProfileOperationsUpdateResponse.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.containerinstance.generated.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.ContainerGroupProfileInner; + +/** + * Contains all response data for the update operation. + */ +public final class CGProfileOperationsUpdateResponse + extends ResponseBase { + /** + * Creates an instance of CGProfileOperationsUpdateResponse. + * + * @param request the request which resulted in this CGProfileOperationsUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public CGProfileOperationsUpdateResponse(HttpRequest request, int statusCode, HttpHeaders rawHeaders, + ContainerGroupProfileInner value, CGProfileOperationsUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** + * Gets the deserialized response body. + * + * @return the deserialized response body. + */ + @Override + public ContainerGroupProfileInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/CGProfiles.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/CGProfiles.java new file mode 100644 index 000000000000..17d809b4a402 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/CGProfiles.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** + * Resource collection API of CGProfiles. + */ +public interface CGProfiles { + /** + * List container group profiles in a subscription. + * + * Gets a list of all container group profiles under a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all container group profiles under a subscription as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List container group profiles in a subscription. + * + * Gets a list of all container group profiles under a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all container group profiles under a subscription as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List container group profiles in a resource group. + * + * Gets a list of all container group profiles under a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all container group profiles under a resource group as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List container group profiles in a resource group. + * + * Gets a list of all container group profiles under a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all container group profiles under a resource group as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/CachedImages.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/CachedImages.java new file mode 100644 index 000000000000..1bbeab6d991f --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/CachedImages.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.containerinstance.generated.models; + +import com.azure.resourcemanager.containerinstance.generated.fluent.models.CachedImagesInner; + +/** + * An immutable client-side representation of CachedImages. + */ +public interface CachedImages { + /** + * Gets the osType property: The OS type of the cached image. + * + * @return the osType value. + */ + String osType(); + + /** + * Gets the image property: The cached image name. + * + * @return the image value. + */ + String image(); + + /** + * Gets the inner com.azure.resourcemanager.containerinstance.generated.fluent.models.CachedImagesInner object. + * + * @return the inner object. + */ + CachedImagesInner innerModel(); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/CachedImagesListResult.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/CachedImagesListResult.java new file mode 100644 index 000000000000..a5450bb22a71 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/CachedImagesListResult.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.CachedImagesInner; +import java.io.IOException; +import java.util.List; + +/** + * The response containing cached images. + */ +@Fluent +public final class CachedImagesListResult implements JsonSerializable { + /* + * The list of cached images. + */ + private List value; + + /* + * The URI to fetch the next page of cached images. + */ + private String nextLink; + + /** + * Creates an instance of CachedImagesListResult class. + */ + public CachedImagesListResult() { + } + + /** + * Get the value property: The list of cached images. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of cached images. + * + * @param value the value value to set. + * @return the CachedImagesListResult object itself. + */ + public CachedImagesListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI to fetch the next page of cached images. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI to fetch the next page of cached images. + * + * @param nextLink the nextLink value to set. + * @return the CachedImagesListResult object itself. + */ + public CachedImagesListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CachedImagesListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CachedImagesListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the CachedImagesListResult. + */ + public static CachedImagesListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CachedImagesListResult deserializedCachedImagesListResult = new CachedImagesListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> CachedImagesInner.fromJson(reader1)); + deserializedCachedImagesListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedCachedImagesListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCachedImagesListResult; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Capabilities.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Capabilities.java new file mode 100644 index 000000000000..67e2f18aa471 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Capabilities.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.resourcemanager.containerinstance.generated.fluent.models.CapabilitiesInner; + +/** + * An immutable client-side representation of Capabilities. + */ +public interface Capabilities { + /** + * Gets the resourceType property: The resource type that this capability describes. + * + * @return the resourceType value. + */ + String resourceType(); + + /** + * Gets the osType property: The OS type that this capability describes. + * + * @return the osType value. + */ + String osType(); + + /** + * Gets the location property: The resource location. + * + * @return the location value. + */ + String location(); + + /** + * Gets the ipAddressType property: The ip address type that this capability describes. + * + * @return the ipAddressType value. + */ + String ipAddressType(); + + /** + * Gets the gpu property: The GPU sku that this capability describes. + * + * @return the gpu value. + */ + String gpu(); + + /** + * Gets the capabilities property: The supported capabilities. + * + * @return the capabilities value. + */ + CapabilitiesCapabilities capabilities(); + + /** + * Gets the inner com.azure.resourcemanager.containerinstance.generated.fluent.models.CapabilitiesInner object. + * + * @return the inner object. + */ + CapabilitiesInner innerModel(); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/CapabilitiesCapabilities.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/CapabilitiesCapabilities.java new file mode 100644 index 000000000000..ebe403b80662 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/CapabilitiesCapabilities.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The supported capabilities. + */ +@Immutable +public final class CapabilitiesCapabilities implements JsonSerializable { + /* + * The maximum allowed memory request in GB. + */ + private Float maxMemoryInGB; + + /* + * The maximum allowed CPU request in cores. + */ + private Float maxCpu; + + /* + * The maximum allowed GPU count. + */ + private Float maxGpuCount; + + /** + * Creates an instance of CapabilitiesCapabilities class. + */ + public CapabilitiesCapabilities() { + } + + /** + * Get the maxMemoryInGB property: The maximum allowed memory request in GB. + * + * @return the maxMemoryInGB value. + */ + public Float maxMemoryInGB() { + return this.maxMemoryInGB; + } + + /** + * Get the maxCpu property: The maximum allowed CPU request in cores. + * + * @return the maxCpu value. + */ + public Float maxCpu() { + return this.maxCpu; + } + + /** + * Get the maxGpuCount property: The maximum allowed GPU count. + * + * @return the maxGpuCount value. + */ + public Float maxGpuCount() { + return this.maxGpuCount; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CapabilitiesCapabilities from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CapabilitiesCapabilities if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CapabilitiesCapabilities. + */ + public static CapabilitiesCapabilities fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CapabilitiesCapabilities deserializedCapabilitiesCapabilities = new CapabilitiesCapabilities(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("maxMemoryInGB".equals(fieldName)) { + deserializedCapabilitiesCapabilities.maxMemoryInGB = reader.getNullable(JsonReader::getFloat); + } else if ("maxCpu".equals(fieldName)) { + deserializedCapabilitiesCapabilities.maxCpu = reader.getNullable(JsonReader::getFloat); + } else if ("maxGpuCount".equals(fieldName)) { + deserializedCapabilitiesCapabilities.maxGpuCount = reader.getNullable(JsonReader::getFloat); + } else { + reader.skipChildren(); + } + } + + return deserializedCapabilitiesCapabilities; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/CapabilitiesListResult.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/CapabilitiesListResult.java new file mode 100644 index 000000000000..6d762ca4d472 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/CapabilitiesListResult.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.CapabilitiesInner; +import java.io.IOException; +import java.util.List; + +/** + * The response containing list of capabilities. + */ +@Fluent +public final class CapabilitiesListResult implements JsonSerializable { + /* + * The list of capabilities. + */ + private List value; + + /* + * The URI to fetch the next page of capabilities. + */ + private String nextLink; + + /** + * Creates an instance of CapabilitiesListResult class. + */ + public CapabilitiesListResult() { + } + + /** + * Get the value property: The list of capabilities. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of capabilities. + * + * @param value the value value to set. + * @return the CapabilitiesListResult object itself. + */ + public CapabilitiesListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI to fetch the next page of capabilities. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI to fetch the next page of capabilities. + * + * @param nextLink the nextLink value to set. + * @return the CapabilitiesListResult object itself. + */ + public CapabilitiesListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CapabilitiesListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CapabilitiesListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the CapabilitiesListResult. + */ + public static CapabilitiesListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CapabilitiesListResult deserializedCapabilitiesListResult = new CapabilitiesListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> CapabilitiesInner.fromJson(reader1)); + deserializedCapabilitiesListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedCapabilitiesListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCapabilitiesListResult; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ConfidentialComputeProperties.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ConfidentialComputeProperties.java new file mode 100644 index 000000000000..a4c21cb63c7e --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ConfidentialComputeProperties.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.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The properties for confidential container group. + */ +@Fluent +public final class ConfidentialComputeProperties implements JsonSerializable { + /* + * The base64 encoded confidential compute enforcement policy + */ + private String ccePolicy; + + /** + * Creates an instance of ConfidentialComputeProperties class. + */ + public ConfidentialComputeProperties() { + } + + /** + * Get the ccePolicy property: The base64 encoded confidential compute enforcement policy. + * + * @return the ccePolicy value. + */ + public String ccePolicy() { + return this.ccePolicy; + } + + /** + * Set the ccePolicy property: The base64 encoded confidential compute enforcement policy. + * + * @param ccePolicy the ccePolicy value to set. + * @return the ConfidentialComputeProperties object itself. + */ + public ConfidentialComputeProperties withCcePolicy(String ccePolicy) { + this.ccePolicy = ccePolicy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("ccePolicy", this.ccePolicy); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConfidentialComputeProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConfidentialComputeProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ConfidentialComputeProperties. + */ + public static ConfidentialComputeProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConfidentialComputeProperties deserializedConfidentialComputeProperties + = new ConfidentialComputeProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ccePolicy".equals(fieldName)) { + deserializedConfidentialComputeProperties.ccePolicy = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedConfidentialComputeProperties; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Container.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Container.java new file mode 100644 index 000000000000..6ce9989bd79c --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Container.java @@ -0,0 +1,342 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.ContainerProperties; +import java.io.IOException; +import java.util.List; + +/** + * A container instance. + */ +@Fluent +public final class Container implements JsonSerializable { + /* + * The user-provided name of the container instance. + */ + private String name; + + /* + * The properties of the container instance. + */ + private ContainerProperties innerProperties = new ContainerProperties(); + + /** + * Creates an instance of Container class. + */ + public Container() { + } + + /** + * Get the name property: The user-provided name of the container instance. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The user-provided name of the container instance. + * + * @param name the name value to set. + * @return the Container object itself. + */ + public Container withName(String name) { + this.name = name; + return this; + } + + /** + * Get the innerProperties property: The properties of the container instance. + * + * @return the innerProperties value. + */ + private ContainerProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the image property: The name of the image used to create the container instance. + * + * @return the image value. + */ + public String image() { + return this.innerProperties() == null ? null : this.innerProperties().image(); + } + + /** + * Set the image property: The name of the image used to create the container instance. + * + * @param image the image value to set. + * @return the Container object itself. + */ + public Container withImage(String image) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerProperties(); + } + this.innerProperties().withImage(image); + return this; + } + + /** + * Get the command property: The commands to execute within the container instance in exec form. + * + * @return the command value. + */ + public List command() { + return this.innerProperties() == null ? null : this.innerProperties().command(); + } + + /** + * Set the command property: The commands to execute within the container instance in exec form. + * + * @param command the command value to set. + * @return the Container object itself. + */ + public Container withCommand(List command) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerProperties(); + } + this.innerProperties().withCommand(command); + return this; + } + + /** + * Get the ports property: The exposed ports on the container instance. + * + * @return the ports value. + */ + public List ports() { + return this.innerProperties() == null ? null : this.innerProperties().ports(); + } + + /** + * Set the ports property: The exposed ports on the container instance. + * + * @param ports the ports value to set. + * @return the Container object itself. + */ + public Container withPorts(List ports) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerProperties(); + } + this.innerProperties().withPorts(ports); + return this; + } + + /** + * Get the environmentVariables property: The environment variables to set in the container instance. + * + * @return the environmentVariables value. + */ + public List environmentVariables() { + return this.innerProperties() == null ? null : this.innerProperties().environmentVariables(); + } + + /** + * Set the environmentVariables property: The environment variables to set in the container instance. + * + * @param environmentVariables the environmentVariables value to set. + * @return the Container object itself. + */ + public Container withEnvironmentVariables(List environmentVariables) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerProperties(); + } + this.innerProperties().withEnvironmentVariables(environmentVariables); + return this; + } + + /** + * Get the instanceView property: The instance view of the container instance. Only valid in response. + * + * @return the instanceView value. + */ + public ContainerPropertiesInstanceView instanceView() { + return this.innerProperties() == null ? null : this.innerProperties().instanceView(); + } + + /** + * Get the resources property: The resource requirements of the container instance. + * + * @return the resources value. + */ + public ResourceRequirements resources() { + return this.innerProperties() == null ? null : this.innerProperties().resources(); + } + + /** + * Set the resources property: The resource requirements of the container instance. + * + * @param resources the resources value to set. + * @return the Container object itself. + */ + public Container withResources(ResourceRequirements resources) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerProperties(); + } + this.innerProperties().withResources(resources); + return this; + } + + /** + * Get the volumeMounts property: The volume mounts available to the container instance. + * + * @return the volumeMounts value. + */ + public List volumeMounts() { + return this.innerProperties() == null ? null : this.innerProperties().volumeMounts(); + } + + /** + * Set the volumeMounts property: The volume mounts available to the container instance. + * + * @param volumeMounts the volumeMounts value to set. + * @return the Container object itself. + */ + public Container withVolumeMounts(List volumeMounts) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerProperties(); + } + this.innerProperties().withVolumeMounts(volumeMounts); + return this; + } + + /** + * Get the livenessProbe property: The liveness probe. + * + * @return the livenessProbe value. + */ + public ContainerProbe livenessProbe() { + return this.innerProperties() == null ? null : this.innerProperties().livenessProbe(); + } + + /** + * Set the livenessProbe property: The liveness probe. + * + * @param livenessProbe the livenessProbe value to set. + * @return the Container object itself. + */ + public Container withLivenessProbe(ContainerProbe livenessProbe) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerProperties(); + } + this.innerProperties().withLivenessProbe(livenessProbe); + return this; + } + + /** + * Get the readinessProbe property: The readiness probe. + * + * @return the readinessProbe value. + */ + public ContainerProbe readinessProbe() { + return this.innerProperties() == null ? null : this.innerProperties().readinessProbe(); + } + + /** + * Set the readinessProbe property: The readiness probe. + * + * @param readinessProbe the readinessProbe value to set. + * @return the Container object itself. + */ + public Container withReadinessProbe(ContainerProbe readinessProbe) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerProperties(); + } + this.innerProperties().withReadinessProbe(readinessProbe); + return this; + } + + /** + * Get the securityContext property: The container security properties. + * + * @return the securityContext value. + */ + public SecurityContextDefinition securityContext() { + return this.innerProperties() == null ? null : this.innerProperties().securityContext(); + } + + /** + * Set the securityContext property: The container security properties. + * + * @param securityContext the securityContext value to set. + * @return the Container object itself. + */ + public Container withSecurityContext(SecurityContextDefinition securityContext) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerProperties(); + } + this.innerProperties().withSecurityContext(securityContext); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property name in model Container")); + } + if (innerProperties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property innerProperties in model Container")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(Container.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Container from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Container if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Container. + */ + public static Container fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Container deserializedContainer = new Container(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedContainer.name = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedContainer.innerProperties = ContainerProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedContainer; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerAttachResponse.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerAttachResponse.java new file mode 100644 index 000000000000..d49a6bc8c7de --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerAttachResponse.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.resourcemanager.containerinstance.generated.fluent.models.ContainerAttachResponseInner; + +/** + * An immutable client-side representation of ContainerAttachResponse. + */ +public interface ContainerAttachResponse { + /** + * Gets the webSocketUri property: The uri for the output stream from the attach. + * + * @return the webSocketUri value. + */ + String webSocketUri(); + + /** + * Gets the password property: The password to the output stream from the attach. Send as an Authorization header + * value when connecting to the websocketUri. + * + * @return the password value. + */ + String password(); + + /** + * Gets the inner com.azure.resourcemanager.containerinstance.generated.fluent.models.ContainerAttachResponseInner + * object. + * + * @return the inner object. + */ + ContainerAttachResponseInner innerModel(); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerExec.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerExec.java new file mode 100644 index 000000000000..cf2747eee824 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerExec.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.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The container execution command, for liveness or readiness probe. + */ +@Fluent +public final class ContainerExec implements JsonSerializable { + /* + * The commands to execute within the container. + */ + private List command; + + /** + * Creates an instance of ContainerExec class. + */ + public ContainerExec() { + } + + /** + * Get the command property: The commands to execute within the container. + * + * @return the command value. + */ + public List command() { + return this.command; + } + + /** + * Set the command property: The commands to execute within the container. + * + * @param command the command value to set. + * @return the ContainerExec object itself. + */ + public ContainerExec withCommand(List command) { + this.command = command; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("command", this.command, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerExec from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerExec if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ContainerExec. + */ + public static ContainerExec fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerExec deserializedContainerExec = new ContainerExec(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("command".equals(fieldName)) { + List command = reader.readArray(reader1 -> reader1.getString()); + deserializedContainerExec.command = command; + } else { + reader.skipChildren(); + } + } + + return deserializedContainerExec; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerExecRequest.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerExecRequest.java new file mode 100644 index 000000000000..ffc110ac9c85 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerExecRequest.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The container exec request. + */ +@Fluent +public final class ContainerExecRequest implements JsonSerializable { + /* + * The command to be executed. + */ + private String command; + + /* + * The size of the terminal. + */ + private ContainerExecRequestTerminalSize terminalSize; + + /** + * Creates an instance of ContainerExecRequest class. + */ + public ContainerExecRequest() { + } + + /** + * Get the command property: The command to be executed. + * + * @return the command value. + */ + public String command() { + return this.command; + } + + /** + * Set the command property: The command to be executed. + * + * @param command the command value to set. + * @return the ContainerExecRequest object itself. + */ + public ContainerExecRequest withCommand(String command) { + this.command = command; + return this; + } + + /** + * Get the terminalSize property: The size of the terminal. + * + * @return the terminalSize value. + */ + public ContainerExecRequestTerminalSize terminalSize() { + return this.terminalSize; + } + + /** + * Set the terminalSize property: The size of the terminal. + * + * @param terminalSize the terminalSize value to set. + * @return the ContainerExecRequest object itself. + */ + public ContainerExecRequest withTerminalSize(ContainerExecRequestTerminalSize terminalSize) { + this.terminalSize = terminalSize; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (terminalSize() != null) { + terminalSize().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("command", this.command); + jsonWriter.writeJsonField("terminalSize", this.terminalSize); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerExecRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerExecRequest if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ContainerExecRequest. + */ + public static ContainerExecRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerExecRequest deserializedContainerExecRequest = new ContainerExecRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("command".equals(fieldName)) { + deserializedContainerExecRequest.command = reader.getString(); + } else if ("terminalSize".equals(fieldName)) { + deserializedContainerExecRequest.terminalSize = ContainerExecRequestTerminalSize.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerExecRequest; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerExecRequestTerminalSize.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerExecRequestTerminalSize.java new file mode 100644 index 000000000000..c326b6bf1ab0 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerExecRequestTerminalSize.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The size of the terminal. + */ +@Fluent +public final class ContainerExecRequestTerminalSize implements JsonSerializable { + /* + * The row size of the terminal + */ + private Integer rows; + + /* + * The column size of the terminal + */ + private Integer cols; + + /** + * Creates an instance of ContainerExecRequestTerminalSize class. + */ + public ContainerExecRequestTerminalSize() { + } + + /** + * Get the rows property: The row size of the terminal. + * + * @return the rows value. + */ + public Integer rows() { + return this.rows; + } + + /** + * Set the rows property: The row size of the terminal. + * + * @param rows the rows value to set. + * @return the ContainerExecRequestTerminalSize object itself. + */ + public ContainerExecRequestTerminalSize withRows(Integer rows) { + this.rows = rows; + return this; + } + + /** + * Get the cols property: The column size of the terminal. + * + * @return the cols value. + */ + public Integer cols() { + return this.cols; + } + + /** + * Set the cols property: The column size of the terminal. + * + * @param cols the cols value to set. + * @return the ContainerExecRequestTerminalSize object itself. + */ + public ContainerExecRequestTerminalSize withCols(Integer cols) { + this.cols = cols; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("rows", this.rows); + jsonWriter.writeNumberField("cols", this.cols); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerExecRequestTerminalSize from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerExecRequestTerminalSize if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ContainerExecRequestTerminalSize. + */ + public static ContainerExecRequestTerminalSize fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerExecRequestTerminalSize deserializedContainerExecRequestTerminalSize + = new ContainerExecRequestTerminalSize(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("rows".equals(fieldName)) { + deserializedContainerExecRequestTerminalSize.rows = reader.getNullable(JsonReader::getInt); + } else if ("cols".equals(fieldName)) { + deserializedContainerExecRequestTerminalSize.cols = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerExecRequestTerminalSize; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerExecResponse.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerExecResponse.java new file mode 100644 index 000000000000..bc3104a44c66 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerExecResponse.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.resourcemanager.containerinstance.generated.fluent.models.ContainerExecResponseInner; + +/** + * An immutable client-side representation of ContainerExecResponse. + */ +public interface ContainerExecResponse { + /** + * Gets the webSocketUri property: The uri for the exec websocket. + * + * @return the webSocketUri value. + */ + String webSocketUri(); + + /** + * Gets the password property: The password to start the exec command. + * + * @return the password value. + */ + String password(); + + /** + * Gets the inner com.azure.resourcemanager.containerinstance.generated.fluent.models.ContainerExecResponseInner + * object. + * + * @return the inner object. + */ + ContainerExecResponseInner innerModel(); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroup.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroup.java new file mode 100644 index 000000000000..f87c71307364 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroup.java @@ -0,0 +1,978 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.ContainerGroupInner; +import java.util.List; +import java.util.Map; + +/** + * An immutable client-side representation of ContainerGroup. + */ +public interface ContainerGroup { + /** + * 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 zones property: The zones for the container group. + * + * @return the zones value. + */ + List zones(); + + /** + * Gets the identity property: The identity of the container group, if configured. + * + * @return the identity value. + */ + ContainerGroupIdentity identity(); + + /** + * Gets the provisioningState property: The provisioning state of the container group. This only appears in the + * response. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the secretReferences property: The secret references that will be referenced within the container group. + * + * @return the secretReferences value. + */ + List secretReferences(); + + /** + * Gets the containers property: The containers within the container group. + * + * @return the containers value. + */ + List containers(); + + /** + * Gets the imageRegistryCredentials property: The image registry credentials by which the container group is + * created from. + * + * @return the imageRegistryCredentials value. + */ + List imageRegistryCredentials(); + + /** + * Gets the restartPolicy property: Restart policy for all containers within the container group. + * - `Always` Always restart + * - `OnFailure` Restart on failure + * - `Never` Never restart. + * + * @return the restartPolicy value. + */ + ContainerGroupRestartPolicy restartPolicy(); + + /** + * Gets the ipAddress property: The IP address type of the container group. + * + * @return the ipAddress value. + */ + IpAddress ipAddress(); + + /** + * Gets the osType property: The operating system type required by the containers in the container group. + * + * @return the osType value. + */ + OperatingSystemTypes osType(); + + /** + * Gets the volumes property: The list of volumes that can be mounted by containers in this container group. + * + * @return the volumes value. + */ + List volumes(); + + /** + * Gets the instanceView property: The instance view of the container group. Only valid in response. + * + * @return the instanceView value. + */ + ContainerGroupPropertiesInstanceView instanceView(); + + /** + * Gets the diagnostics property: The diagnostic information for a container group. + * + * @return the diagnostics value. + */ + ContainerGroupDiagnostics diagnostics(); + + /** + * Gets the subnetIds property: The subnet resource IDs for a container group. + * + * @return the subnetIds value. + */ + List subnetIds(); + + /** + * Gets the dnsConfig property: The DNS config information for a container group. + * + * @return the dnsConfig value. + */ + DnsConfiguration dnsConfig(); + + /** + * Gets the sku property: The SKU for a container group. + * + * @return the sku value. + */ + ContainerGroupSku sku(); + + /** + * Gets the encryptionProperties property: The encryption properties for a container group. + * + * @return the encryptionProperties value. + */ + EncryptionProperties encryptionProperties(); + + /** + * Gets the initContainers property: The init containers for a container group. + * + * @return the initContainers value. + */ + List initContainers(); + + /** + * Gets the extensions property: extensions used by virtual kubelet. + * + * @return the extensions value. + */ + List extensions(); + + /** + * Gets the confidentialComputeProperties property: The properties for confidential container group. + * + * @return the confidentialComputeProperties value. + */ + ConfidentialComputeProperties confidentialComputeProperties(); + + /** + * Gets the priority property: The priority of the container group. + * + * @return the priority value. + */ + ContainerGroupPriority priority(); + + /** + * Gets the identityAcls property: The access control levels of the identities. + * + * @return the identityAcls value. + */ + IdentityAcls identityAcls(); + + /** + * 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.containerinstance.generated.fluent.models.ContainerGroupInner object. + * + * @return the inner object. + */ + ContainerGroupInner innerModel(); + + /** + * The entirety of the ContainerGroup definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithLocation, DefinitionStages.WithResourceGroup, + DefinitionStages.WithContainers, DefinitionStages.WithOsType, DefinitionStages.WithCreate { + } + + /** + * The ContainerGroup definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the ContainerGroup definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the ContainerGroup definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the ContainerGroup definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithContainers withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the ContainerGroup definition allowing to specify containers. + */ + interface WithContainers { + /** + * Specifies the containers property: The containers within the container group.. + * + * @param containers The containers within the container group. + * @return the next definition stage. + */ + WithOsType withContainers(List containers); + } + + /** + * The stage of the ContainerGroup definition allowing to specify osType. + */ + interface WithOsType { + /** + * Specifies the osType property: The operating system type required by the containers in the container + * group.. + * + * @param osType The operating system type required by the containers in the container group. + * @return the next definition stage. + */ + WithCreate withOsType(OperatingSystemTypes osType); + } + + /** + * The stage of the ContainerGroup 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.WithZones, DefinitionStages.WithIdentity, + DefinitionStages.WithSecretReferences, DefinitionStages.WithImageRegistryCredentials, + DefinitionStages.WithRestartPolicy, DefinitionStages.WithIpAddress, DefinitionStages.WithVolumes, + DefinitionStages.WithDiagnostics, DefinitionStages.WithSubnetIds, DefinitionStages.WithDnsConfig, + DefinitionStages.WithSku, DefinitionStages.WithEncryptionProperties, DefinitionStages.WithInitContainers, + DefinitionStages.WithExtensions, DefinitionStages.WithConfidentialComputeProperties, + DefinitionStages.WithPriority, DefinitionStages.WithIdentityAcls { + /** + * Executes the create request. + * + * @return the created resource. + */ + ContainerGroup create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ContainerGroup create(Context context); + } + + /** + * The stage of the ContainerGroup 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 ContainerGroup definition allowing to specify zones. + */ + interface WithZones { + /** + * Specifies the zones property: The zones for the container group.. + * + * @param zones The zones for the container group. + * @return the next definition stage. + */ + WithCreate withZones(List zones); + } + + /** + * The stage of the ContainerGroup definition allowing to specify identity. + */ + interface WithIdentity { + /** + * Specifies the identity property: The identity of the container group, if configured.. + * + * @param identity The identity of the container group, if configured. + * @return the next definition stage. + */ + WithCreate withIdentity(ContainerGroupIdentity identity); + } + + /** + * The stage of the ContainerGroup definition allowing to specify secretReferences. + */ + interface WithSecretReferences { + /** + * Specifies the secretReferences property: The secret references that will be referenced within the + * container group.. + * + * @param secretReferences The secret references that will be referenced within the container group. + * @return the next definition stage. + */ + WithCreate withSecretReferences(List secretReferences); + } + + /** + * The stage of the ContainerGroup definition allowing to specify imageRegistryCredentials. + */ + interface WithImageRegistryCredentials { + /** + * Specifies the imageRegistryCredentials property: The image registry credentials by which the container + * group is created from.. + * + * @param imageRegistryCredentials The image registry credentials by which the container group is created + * from. + * @return the next definition stage. + */ + WithCreate withImageRegistryCredentials(List imageRegistryCredentials); + } + + /** + * The stage of the ContainerGroup definition allowing to specify restartPolicy. + */ + interface WithRestartPolicy { + /** + * Specifies the restartPolicy property: Restart policy for all containers within the container group. + * - `Always` Always restart + * - `OnFailure` Restart on failure + * - `Never` Never restart + * . + * + * @param restartPolicy Restart policy for all containers within the container group. + * - `Always` Always restart + * - `OnFailure` Restart on failure + * - `Never` Never restart. + * @return the next definition stage. + */ + WithCreate withRestartPolicy(ContainerGroupRestartPolicy restartPolicy); + } + + /** + * The stage of the ContainerGroup definition allowing to specify ipAddress. + */ + interface WithIpAddress { + /** + * Specifies the ipAddress property: The IP address type of the container group.. + * + * @param ipAddress The IP address type of the container group. + * @return the next definition stage. + */ + WithCreate withIpAddress(IpAddress ipAddress); + } + + /** + * The stage of the ContainerGroup definition allowing to specify volumes. + */ + interface WithVolumes { + /** + * Specifies the volumes property: The list of volumes that can be mounted by containers in this container + * group.. + * + * @param volumes The list of volumes that can be mounted by containers in this container group. + * @return the next definition stage. + */ + WithCreate withVolumes(List volumes); + } + + /** + * The stage of the ContainerGroup definition allowing to specify diagnostics. + */ + interface WithDiagnostics { + /** + * Specifies the diagnostics property: The diagnostic information for a container group.. + * + * @param diagnostics The diagnostic information for a container group. + * @return the next definition stage. + */ + WithCreate withDiagnostics(ContainerGroupDiagnostics diagnostics); + } + + /** + * The stage of the ContainerGroup definition allowing to specify subnetIds. + */ + interface WithSubnetIds { + /** + * Specifies the subnetIds property: The subnet resource IDs for a container group.. + * + * @param subnetIds The subnet resource IDs for a container group. + * @return the next definition stage. + */ + WithCreate withSubnetIds(List subnetIds); + } + + /** + * The stage of the ContainerGroup definition allowing to specify dnsConfig. + */ + interface WithDnsConfig { + /** + * Specifies the dnsConfig property: The DNS config information for a container group.. + * + * @param dnsConfig The DNS config information for a container group. + * @return the next definition stage. + */ + WithCreate withDnsConfig(DnsConfiguration dnsConfig); + } + + /** + * The stage of the ContainerGroup definition allowing to specify sku. + */ + interface WithSku { + /** + * Specifies the sku property: The SKU for a container group.. + * + * @param sku The SKU for a container group. + * @return the next definition stage. + */ + WithCreate withSku(ContainerGroupSku sku); + } + + /** + * The stage of the ContainerGroup definition allowing to specify encryptionProperties. + */ + interface WithEncryptionProperties { + /** + * Specifies the encryptionProperties property: The encryption properties for a container group.. + * + * @param encryptionProperties The encryption properties for a container group. + * @return the next definition stage. + */ + WithCreate withEncryptionProperties(EncryptionProperties encryptionProperties); + } + + /** + * The stage of the ContainerGroup definition allowing to specify initContainers. + */ + interface WithInitContainers { + /** + * Specifies the initContainers property: The init containers for a container group.. + * + * @param initContainers The init containers for a container group. + * @return the next definition stage. + */ + WithCreate withInitContainers(List initContainers); + } + + /** + * The stage of the ContainerGroup definition allowing to specify extensions. + */ + interface WithExtensions { + /** + * Specifies the extensions property: extensions used by virtual kubelet. + * + * @param extensions extensions used by virtual kubelet. + * @return the next definition stage. + */ + WithCreate withExtensions(List extensions); + } + + /** + * The stage of the ContainerGroup definition allowing to specify confidentialComputeProperties. + */ + interface WithConfidentialComputeProperties { + /** + * Specifies the confidentialComputeProperties property: The properties for confidential container group. + * + * @param confidentialComputeProperties The properties for confidential container group. + * @return the next definition stage. + */ + WithCreate withConfidentialComputeProperties(ConfidentialComputeProperties confidentialComputeProperties); + } + + /** + * The stage of the ContainerGroup definition allowing to specify priority. + */ + interface WithPriority { + /** + * Specifies the priority property: The priority of the container group.. + * + * @param priority The priority of the container group. + * @return the next definition stage. + */ + WithCreate withPriority(ContainerGroupPriority priority); + } + + /** + * The stage of the ContainerGroup definition allowing to specify identityAcls. + */ + interface WithIdentityAcls { + /** + * Specifies the identityAcls property: The access control levels of the identities.. + * + * @param identityAcls The access control levels of the identities. + * @return the next definition stage. + */ + WithCreate withIdentityAcls(IdentityAcls identityAcls); + } + } + + /** + * Begins update for the ContainerGroup resource. + * + * @return the stage of resource update. + */ + ContainerGroup.Update update(); + + /** + * The template for ContainerGroup update. + */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithZones, UpdateStages.WithIdentity, + UpdateStages.WithSecretReferences, UpdateStages.WithContainers, UpdateStages.WithImageRegistryCredentials, + UpdateStages.WithRestartPolicy, UpdateStages.WithIpAddress, UpdateStages.WithOsType, UpdateStages.WithVolumes, + UpdateStages.WithDiagnostics, UpdateStages.WithSubnetIds, UpdateStages.WithDnsConfig, UpdateStages.WithSku, + UpdateStages.WithEncryptionProperties, UpdateStages.WithInitContainers, UpdateStages.WithExtensions, + UpdateStages.WithConfidentialComputeProperties, UpdateStages.WithPriority, UpdateStages.WithIdentityAcls { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ContainerGroup apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ContainerGroup apply(Context context); + } + + /** + * The ContainerGroup update stages. + */ + interface UpdateStages { + /** + * The stage of the ContainerGroup update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + + /** + * The stage of the ContainerGroup update allowing to specify zones. + */ + interface WithZones { + /** + * Specifies the zones property: The zones for the container group.. + * + * @param zones The zones for the container group. + * @return the next definition stage. + */ + Update withZones(List zones); + } + + /** + * The stage of the ContainerGroup update allowing to specify identity. + */ + interface WithIdentity { + /** + * Specifies the identity property: The identity of the container group, if configured.. + * + * @param identity The identity of the container group, if configured. + * @return the next definition stage. + */ + Update withIdentity(ContainerGroupIdentity identity); + } + + /** + * The stage of the ContainerGroup update allowing to specify secretReferences. + */ + interface WithSecretReferences { + /** + * Specifies the secretReferences property: The secret references that will be referenced within the + * container group.. + * + * @param secretReferences The secret references that will be referenced within the container group. + * @return the next definition stage. + */ + Update withSecretReferences(List secretReferences); + } + + /** + * The stage of the ContainerGroup update allowing to specify containers. + */ + interface WithContainers { + /** + * Specifies the containers property: The containers within the container group.. + * + * @param containers The containers within the container group. + * @return the next definition stage. + */ + Update withContainers(List containers); + } + + /** + * The stage of the ContainerGroup update allowing to specify imageRegistryCredentials. + */ + interface WithImageRegistryCredentials { + /** + * Specifies the imageRegistryCredentials property: The image registry credentials by which the container + * group is created from.. + * + * @param imageRegistryCredentials The image registry credentials by which the container group is created + * from. + * @return the next definition stage. + */ + Update withImageRegistryCredentials(List imageRegistryCredentials); + } + + /** + * The stage of the ContainerGroup update allowing to specify restartPolicy. + */ + interface WithRestartPolicy { + /** + * Specifies the restartPolicy property: Restart policy for all containers within the container group. + * - `Always` Always restart + * - `OnFailure` Restart on failure + * - `Never` Never restart + * . + * + * @param restartPolicy Restart policy for all containers within the container group. + * - `Always` Always restart + * - `OnFailure` Restart on failure + * - `Never` Never restart. + * @return the next definition stage. + */ + Update withRestartPolicy(ContainerGroupRestartPolicy restartPolicy); + } + + /** + * The stage of the ContainerGroup update allowing to specify ipAddress. + */ + interface WithIpAddress { + /** + * Specifies the ipAddress property: The IP address type of the container group.. + * + * @param ipAddress The IP address type of the container group. + * @return the next definition stage. + */ + Update withIpAddress(IpAddress ipAddress); + } + + /** + * The stage of the ContainerGroup update allowing to specify osType. + */ + interface WithOsType { + /** + * Specifies the osType property: The operating system type required by the containers in the container + * group.. + * + * @param osType The operating system type required by the containers in the container group. + * @return the next definition stage. + */ + Update withOsType(OperatingSystemTypes osType); + } + + /** + * The stage of the ContainerGroup update allowing to specify volumes. + */ + interface WithVolumes { + /** + * Specifies the volumes property: The list of volumes that can be mounted by containers in this container + * group.. + * + * @param volumes The list of volumes that can be mounted by containers in this container group. + * @return the next definition stage. + */ + Update withVolumes(List volumes); + } + + /** + * The stage of the ContainerGroup update allowing to specify diagnostics. + */ + interface WithDiagnostics { + /** + * Specifies the diagnostics property: The diagnostic information for a container group.. + * + * @param diagnostics The diagnostic information for a container group. + * @return the next definition stage. + */ + Update withDiagnostics(ContainerGroupDiagnostics diagnostics); + } + + /** + * The stage of the ContainerGroup update allowing to specify subnetIds. + */ + interface WithSubnetIds { + /** + * Specifies the subnetIds property: The subnet resource IDs for a container group.. + * + * @param subnetIds The subnet resource IDs for a container group. + * @return the next definition stage. + */ + Update withSubnetIds(List subnetIds); + } + + /** + * The stage of the ContainerGroup update allowing to specify dnsConfig. + */ + interface WithDnsConfig { + /** + * Specifies the dnsConfig property: The DNS config information for a container group.. + * + * @param dnsConfig The DNS config information for a container group. + * @return the next definition stage. + */ + Update withDnsConfig(DnsConfiguration dnsConfig); + } + + /** + * The stage of the ContainerGroup update allowing to specify sku. + */ + interface WithSku { + /** + * Specifies the sku property: The SKU for a container group.. + * + * @param sku The SKU for a container group. + * @return the next definition stage. + */ + Update withSku(ContainerGroupSku sku); + } + + /** + * The stage of the ContainerGroup update allowing to specify encryptionProperties. + */ + interface WithEncryptionProperties { + /** + * Specifies the encryptionProperties property: The encryption properties for a container group.. + * + * @param encryptionProperties The encryption properties for a container group. + * @return the next definition stage. + */ + Update withEncryptionProperties(EncryptionProperties encryptionProperties); + } + + /** + * The stage of the ContainerGroup update allowing to specify initContainers. + */ + interface WithInitContainers { + /** + * Specifies the initContainers property: The init containers for a container group.. + * + * @param initContainers The init containers for a container group. + * @return the next definition stage. + */ + Update withInitContainers(List initContainers); + } + + /** + * The stage of the ContainerGroup update allowing to specify extensions. + */ + interface WithExtensions { + /** + * Specifies the extensions property: extensions used by virtual kubelet. + * + * @param extensions extensions used by virtual kubelet. + * @return the next definition stage. + */ + Update withExtensions(List extensions); + } + + /** + * The stage of the ContainerGroup update allowing to specify confidentialComputeProperties. + */ + interface WithConfidentialComputeProperties { + /** + * Specifies the confidentialComputeProperties property: The properties for confidential container group. + * + * @param confidentialComputeProperties The properties for confidential container group. + * @return the next definition stage. + */ + Update withConfidentialComputeProperties(ConfidentialComputeProperties confidentialComputeProperties); + } + + /** + * The stage of the ContainerGroup update allowing to specify priority. + */ + interface WithPriority { + /** + * Specifies the priority property: The priority of the container group.. + * + * @param priority The priority of the container group. + * @return the next definition stage. + */ + Update withPriority(ContainerGroupPriority priority); + } + + /** + * The stage of the ContainerGroup update allowing to specify identityAcls. + */ + interface WithIdentityAcls { + /** + * Specifies the identityAcls property: The access control levels of the identities.. + * + * @param identityAcls The access control levels of the identities. + * @return the next definition stage. + */ + Update withIdentityAcls(IdentityAcls identityAcls); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ContainerGroup refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ContainerGroup refresh(Context context); + + /** + * Restarts all containers in a container group. + * + * Restarts all containers in a container group in place. If container image has updates, new image will be + * downloaded. + * + * @throws com.azure.core.management.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 restart(); + + /** + * Restarts all containers in a container group. + * + * Restarts all containers in a container group in place. If container image has updates, new image will be + * downloaded. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 restart(Context context); + + /** + * Stops all containers in a container group. + * + * Stops all containers in a container group. Compute resources will be deallocated and billing will stop. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response stopWithResponse(Context context); + + /** + * Stops all containers in a container group. + * + * Stops all containers in a container group. Compute resources will be deallocated and billing will stop. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stop(); + + /** + * Starts all containers in a container group. + * + * Starts all containers in a container group. Compute resources will be allocated and billing will start. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(); + + /** + * Starts all containers in a container group. + * + * Starts all containers in a container group. Compute resources will be allocated and billing will start. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(Context context); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupDiagnostics.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupDiagnostics.java new file mode 100644 index 000000000000..5f91405ce76a --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupDiagnostics.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.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Container group diagnostic information. + */ +@Fluent +public final class ContainerGroupDiagnostics implements JsonSerializable { + /* + * Container group log analytics information. + */ + private LogAnalytics logAnalytics; + + /** + * Creates an instance of ContainerGroupDiagnostics class. + */ + public ContainerGroupDiagnostics() { + } + + /** + * Get the logAnalytics property: Container group log analytics information. + * + * @return the logAnalytics value. + */ + public LogAnalytics logAnalytics() { + return this.logAnalytics; + } + + /** + * Set the logAnalytics property: Container group log analytics information. + * + * @param logAnalytics the logAnalytics value to set. + * @return the ContainerGroupDiagnostics object itself. + */ + public ContainerGroupDiagnostics withLogAnalytics(LogAnalytics logAnalytics) { + this.logAnalytics = logAnalytics; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (logAnalytics() != null) { + logAnalytics().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("logAnalytics", this.logAnalytics); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerGroupDiagnostics from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerGroupDiagnostics if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ContainerGroupDiagnostics. + */ + public static ContainerGroupDiagnostics fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerGroupDiagnostics deserializedContainerGroupDiagnostics = new ContainerGroupDiagnostics(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("logAnalytics".equals(fieldName)) { + deserializedContainerGroupDiagnostics.logAnalytics = LogAnalytics.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerGroupDiagnostics; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupIdentity.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupIdentity.java new file mode 100644 index 000000000000..aaba0c8d3d8b --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupIdentity.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Identity for the container group. + */ +@Fluent +public final class ContainerGroupIdentity implements JsonSerializable { + /* + * The principal id of the container group identity. This property will only be provided for a system assigned + * identity. + */ + private String principalId; + + /* + * The tenant id associated with the container group. This property will only be provided for a system assigned + * identity. + */ + private String tenantId; + + /* + * The type of identity used for the container group. The type 'SystemAssigned, UserAssigned' includes both an + * implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities + * from the container group. + */ + private ResourceIdentityType type; + + /* + * The list of user identities associated with the container group. + */ + private Map userAssignedIdentities; + + /** + * Creates an instance of ContainerGroupIdentity class. + */ + public ContainerGroupIdentity() { + } + + /** + * Get the principalId property: The principal id of the container group identity. This property will only be + * provided for a system assigned identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: The tenant id associated with the container group. This property will only be provided + * for a system assigned identity. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the type property: The type of identity used for the container group. The type 'SystemAssigned, UserAssigned' + * includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove + * any identities from the container group. + * + * @return the type value. + */ + public ResourceIdentityType type() { + return this.type; + } + + /** + * Set the type property: The type of identity used for the container group. The type 'SystemAssigned, UserAssigned' + * includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove + * any identities from the container group. + * + * @param type the type value to set. + * @return the ContainerGroupIdentity object itself. + */ + public ContainerGroupIdentity withType(ResourceIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the userAssignedIdentities property: The list of user identities associated with the container group. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: The list of user identities associated with the container group. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the ContainerGroupIdentity object itself. + */ + public ContainerGroupIdentity + withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (userAssignedIdentities() != null) { + userAssignedIdentities().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeMapField("userAssignedIdentities", this.userAssignedIdentities, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerGroupIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerGroupIdentity if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ContainerGroupIdentity. + */ + public static ContainerGroupIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerGroupIdentity deserializedContainerGroupIdentity = new ContainerGroupIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("principalId".equals(fieldName)) { + deserializedContainerGroupIdentity.principalId = reader.getString(); + } else if ("tenantId".equals(fieldName)) { + deserializedContainerGroupIdentity.tenantId = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedContainerGroupIdentity.type = ResourceIdentityType.fromString(reader.getString()); + } else if ("userAssignedIdentities".equals(fieldName)) { + Map userAssignedIdentities + = reader.readMap(reader1 -> UserAssignedIdentities.fromJson(reader1)); + deserializedContainerGroupIdentity.userAssignedIdentities = userAssignedIdentities; + } else { + reader.skipChildren(); + } + } + + return deserializedContainerGroupIdentity; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupIpAddressType.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupIpAddressType.java new file mode 100644 index 000000000000..0d04bedfaf1d --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupIpAddressType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Specifies if the IP is exposed to the public internet or private VNET. + */ +public final class ContainerGroupIpAddressType extends ExpandableStringEnum { + /** + * Static value Public for ContainerGroupIpAddressType. + */ + public static final ContainerGroupIpAddressType PUBLIC = fromString("Public"); + + /** + * Static value Private for ContainerGroupIpAddressType. + */ + public static final ContainerGroupIpAddressType PRIVATE = fromString("Private"); + + /** + * Creates a new instance of ContainerGroupIpAddressType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ContainerGroupIpAddressType() { + } + + /** + * Creates or finds a ContainerGroupIpAddressType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ContainerGroupIpAddressType. + */ + public static ContainerGroupIpAddressType fromString(String name) { + return fromString(name, ContainerGroupIpAddressType.class); + } + + /** + * Gets known ContainerGroupIpAddressType values. + * + * @return known ContainerGroupIpAddressType values. + */ + public static Collection values() { + return values(ContainerGroupIpAddressType.class); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupListResult.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupListResult.java new file mode 100644 index 000000000000..e29d2af0b5cc --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupListResult.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.ListResultContainerGroupInner; +import java.io.IOException; +import java.util.List; + +/** + * The container group list response that contains the container group properties. + */ +@Fluent +public final class ContainerGroupListResult implements JsonSerializable { + /* + * The list of container groups. + */ + private List value; + + /* + * The URI to fetch the next page of container groups. + */ + private String nextLink; + + /** + * Creates an instance of ContainerGroupListResult class. + */ + public ContainerGroupListResult() { + } + + /** + * Get the value property: The list of container groups. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of container groups. + * + * @param value the value value to set. + * @return the ContainerGroupListResult object itself. + */ + public ContainerGroupListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI to fetch the next page of container groups. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI to fetch the next page of container groups. + * + * @param nextLink the nextLink value to set. + * @return the ContainerGroupListResult object itself. + */ + public ContainerGroupListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerGroupListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerGroupListResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ContainerGroupListResult. + */ + public static ContainerGroupListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerGroupListResult deserializedContainerGroupListResult = new ContainerGroupListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ListResultContainerGroupInner.fromJson(reader1)); + deserializedContainerGroupListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedContainerGroupListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerGroupListResult; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupNetworkProtocol.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupNetworkProtocol.java new file mode 100644 index 000000000000..55119d5dc080 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupNetworkProtocol.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The protocol associated with the port. + */ +public final class ContainerGroupNetworkProtocol extends ExpandableStringEnum { + /** + * Static value TCP for ContainerGroupNetworkProtocol. + */ + public static final ContainerGroupNetworkProtocol TCP = fromString("TCP"); + + /** + * Static value UDP for ContainerGroupNetworkProtocol. + */ + public static final ContainerGroupNetworkProtocol UDP = fromString("UDP"); + + /** + * Creates a new instance of ContainerGroupNetworkProtocol value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ContainerGroupNetworkProtocol() { + } + + /** + * Creates or finds a ContainerGroupNetworkProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding ContainerGroupNetworkProtocol. + */ + public static ContainerGroupNetworkProtocol fromString(String name) { + return fromString(name, ContainerGroupNetworkProtocol.class); + } + + /** + * Gets known ContainerGroupNetworkProtocol values. + * + * @return known ContainerGroupNetworkProtocol values. + */ + public static Collection values() { + return values(ContainerGroupNetworkProtocol.class); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupPriority.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupPriority.java new file mode 100644 index 000000000000..a218e67f264d --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupPriority.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The priority of the container group. + */ +public final class ContainerGroupPriority extends ExpandableStringEnum { + /** + * Static value Regular for ContainerGroupPriority. + */ + public static final ContainerGroupPriority REGULAR = fromString("Regular"); + + /** + * Static value Spot for ContainerGroupPriority. + */ + public static final ContainerGroupPriority SPOT = fromString("Spot"); + + /** + * Creates a new instance of ContainerGroupPriority value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ContainerGroupPriority() { + } + + /** + * Creates or finds a ContainerGroupPriority from its string representation. + * + * @param name a name to look for. + * @return the corresponding ContainerGroupPriority. + */ + public static ContainerGroupPriority fromString(String name) { + return fromString(name, ContainerGroupPriority.class); + } + + /** + * Gets known ContainerGroupPriority values. + * + * @return known ContainerGroupPriority values. + */ + public static Collection values() { + return values(ContainerGroupPriority.class); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupProfile.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupProfile.java new file mode 100644 index 000000000000..5299021af0a9 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupProfile.java @@ -0,0 +1,661 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.ContainerGroupProfileInner; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** + * An immutable client-side representation of ContainerGroupProfile. + */ +public interface ContainerGroupProfile { + /** + * 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: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the zones property: The zones for the container group. + * + * @return the zones value. + */ + List zones(); + + /** + * Gets the sku property: The SKU for a container group. + * + * @return the sku value. + */ + ContainerGroupSku sku(); + + /** + * Gets the encryptionProperties property: The encryption properties for a container group. + * + * @return the encryptionProperties value. + */ + EncryptionProperties encryptionProperties(); + + /** + * Gets the containers property: The containers within the container group. + * + * @return the containers value. + */ + List containers(); + + /** + * Gets the initContainers property: The init containers for a container group. + * + * @return the initContainers value. + */ + List initContainers(); + + /** + * Gets the extensions property: extensions used by virtual kubelet. + * + * @return the extensions value. + */ + List extensions(); + + /** + * Gets the imageRegistryCredentials property: The image registry credentials by which the container group is + * created from. + * + * @return the imageRegistryCredentials value. + */ + List imageRegistryCredentials(); + + /** + * Gets the restartPolicy property: Restart policy for all containers within the container group. + * - `Always` Always restart + * - `OnFailure` Restart on failure + * - `Never` Never restart. + * + * @return the restartPolicy value. + */ + ContainerGroupRestartPolicy restartPolicy(); + + /** + * Gets the shutdownGracePeriod property: Shutdown grace period for containers in a container group. + * + * @return the shutdownGracePeriod value. + */ + OffsetDateTime shutdownGracePeriod(); + + /** + * Gets the ipAddress property: The IP address type of the container group. + * + * @return the ipAddress value. + */ + IpAddress ipAddress(); + + /** + * Gets the timeToLive property: Post completion time to live for containers of a CG. + * + * @return the timeToLive value. + */ + OffsetDateTime timeToLive(); + + /** + * Gets the osType property: The operating system type required by the containers in the container group. + * + * @return the osType value. + */ + OperatingSystemTypes osType(); + + /** + * Gets the volumes property: The list of volumes that can be mounted by containers in this container group. + * + * @return the volumes value. + */ + List volumes(); + + /** + * Gets the diagnostics property: The diagnostic information for a container group. + * + * @return the diagnostics value. + */ + ContainerGroupDiagnostics diagnostics(); + + /** + * Gets the priority property: The priority of the container group. + * + * @return the priority value. + */ + ContainerGroupPriority priority(); + + /** + * Gets the confidentialComputeProperties property: The properties for confidential container group. + * + * @return the confidentialComputeProperties value. + */ + ConfidentialComputeProperties confidentialComputeProperties(); + + /** + * Gets the securityContext property: The container security properties. + * + * @return the securityContext value. + */ + SecurityContextDefinition securityContext(); + + /** + * Gets the revision property: Container group profile current revision number. + * + * @return the revision value. + */ + Long revision(); + + /** + * Gets the registeredRevisions property: Registered revisions are calculated at request time based off the records + * in the table logs. + * + * @return the registeredRevisions value. + */ + List registeredRevisions(); + + /** + * Gets the useKrypton property: Gets or sets Krypton use property. + * + * @return the useKrypton value. + */ + Boolean useKrypton(); + + /** + * 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.containerinstance.generated.fluent.models.ContainerGroupProfileInner + * object. + * + * @return the inner object. + */ + ContainerGroupProfileInner innerModel(); + + /** + * The entirety of the ContainerGroupProfile definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The ContainerGroupProfile definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the ContainerGroupProfile definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the ContainerGroupProfile definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the ContainerGroupProfile definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the ContainerGroupProfile 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.WithZones, DefinitionStages.WithSku, + DefinitionStages.WithEncryptionProperties, DefinitionStages.WithContainers, + DefinitionStages.WithInitContainers, DefinitionStages.WithExtensions, + DefinitionStages.WithImageRegistryCredentials, DefinitionStages.WithRestartPolicy, + DefinitionStages.WithShutdownGracePeriod, DefinitionStages.WithIpAddress, DefinitionStages.WithTimeToLive, + DefinitionStages.WithOsType, DefinitionStages.WithVolumes, DefinitionStages.WithDiagnostics, + DefinitionStages.WithPriority, DefinitionStages.WithConfidentialComputeProperties, + DefinitionStages.WithSecurityContext, DefinitionStages.WithRevision, + DefinitionStages.WithRegisteredRevisions, DefinitionStages.WithUseKrypton { + /** + * Executes the create request. + * + * @return the created resource. + */ + ContainerGroupProfile create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ContainerGroupProfile create(Context context); + } + + /** + * The stage of the ContainerGroupProfile 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 ContainerGroupProfile definition allowing to specify zones. + */ + interface WithZones { + /** + * Specifies the zones property: The zones for the container group.. + * + * @param zones The zones for the container group. + * @return the next definition stage. + */ + WithCreate withZones(List zones); + } + + /** + * The stage of the ContainerGroupProfile definition allowing to specify sku. + */ + interface WithSku { + /** + * Specifies the sku property: The SKU for a container group.. + * + * @param sku The SKU for a container group. + * @return the next definition stage. + */ + WithCreate withSku(ContainerGroupSku sku); + } + + /** + * The stage of the ContainerGroupProfile definition allowing to specify encryptionProperties. + */ + interface WithEncryptionProperties { + /** + * Specifies the encryptionProperties property: The encryption properties for a container group.. + * + * @param encryptionProperties The encryption properties for a container group. + * @return the next definition stage. + */ + WithCreate withEncryptionProperties(EncryptionProperties encryptionProperties); + } + + /** + * The stage of the ContainerGroupProfile definition allowing to specify containers. + */ + interface WithContainers { + /** + * Specifies the containers property: The containers within the container group.. + * + * @param containers The containers within the container group. + * @return the next definition stage. + */ + WithCreate withContainers(List containers); + } + + /** + * The stage of the ContainerGroupProfile definition allowing to specify initContainers. + */ + interface WithInitContainers { + /** + * Specifies the initContainers property: The init containers for a container group.. + * + * @param initContainers The init containers for a container group. + * @return the next definition stage. + */ + WithCreate withInitContainers(List initContainers); + } + + /** + * The stage of the ContainerGroupProfile definition allowing to specify extensions. + */ + interface WithExtensions { + /** + * Specifies the extensions property: extensions used by virtual kubelet. + * + * @param extensions extensions used by virtual kubelet. + * @return the next definition stage. + */ + WithCreate withExtensions(List extensions); + } + + /** + * The stage of the ContainerGroupProfile definition allowing to specify imageRegistryCredentials. + */ + interface WithImageRegistryCredentials { + /** + * Specifies the imageRegistryCredentials property: The image registry credentials by which the container + * group is created from.. + * + * @param imageRegistryCredentials The image registry credentials by which the container group is created + * from. + * @return the next definition stage. + */ + WithCreate withImageRegistryCredentials(List imageRegistryCredentials); + } + + /** + * The stage of the ContainerGroupProfile definition allowing to specify restartPolicy. + */ + interface WithRestartPolicy { + /** + * Specifies the restartPolicy property: Restart policy for all containers within the container group. + * - `Always` Always restart + * - `OnFailure` Restart on failure + * - `Never` Never restart + * . + * + * @param restartPolicy Restart policy for all containers within the container group. + * - `Always` Always restart + * - `OnFailure` Restart on failure + * - `Never` Never restart. + * @return the next definition stage. + */ + WithCreate withRestartPolicy(ContainerGroupRestartPolicy restartPolicy); + } + + /** + * The stage of the ContainerGroupProfile definition allowing to specify shutdownGracePeriod. + */ + interface WithShutdownGracePeriod { + /** + * Specifies the shutdownGracePeriod property: Shutdown grace period for containers in a container group.. + * + * @param shutdownGracePeriod Shutdown grace period for containers in a container group. + * @return the next definition stage. + */ + WithCreate withShutdownGracePeriod(OffsetDateTime shutdownGracePeriod); + } + + /** + * The stage of the ContainerGroupProfile definition allowing to specify ipAddress. + */ + interface WithIpAddress { + /** + * Specifies the ipAddress property: The IP address type of the container group.. + * + * @param ipAddress The IP address type of the container group. + * @return the next definition stage. + */ + WithCreate withIpAddress(IpAddress ipAddress); + } + + /** + * The stage of the ContainerGroupProfile definition allowing to specify timeToLive. + */ + interface WithTimeToLive { + /** + * Specifies the timeToLive property: Post completion time to live for containers of a CG. + * + * @param timeToLive Post completion time to live for containers of a CG. + * @return the next definition stage. + */ + WithCreate withTimeToLive(OffsetDateTime timeToLive); + } + + /** + * The stage of the ContainerGroupProfile definition allowing to specify osType. + */ + interface WithOsType { + /** + * Specifies the osType property: The operating system type required by the containers in the container + * group.. + * + * @param osType The operating system type required by the containers in the container group. + * @return the next definition stage. + */ + WithCreate withOsType(OperatingSystemTypes osType); + } + + /** + * The stage of the ContainerGroupProfile definition allowing to specify volumes. + */ + interface WithVolumes { + /** + * Specifies the volumes property: The list of volumes that can be mounted by containers in this container + * group.. + * + * @param volumes The list of volumes that can be mounted by containers in this container group. + * @return the next definition stage. + */ + WithCreate withVolumes(List volumes); + } + + /** + * The stage of the ContainerGroupProfile definition allowing to specify diagnostics. + */ + interface WithDiagnostics { + /** + * Specifies the diagnostics property: The diagnostic information for a container group.. + * + * @param diagnostics The diagnostic information for a container group. + * @return the next definition stage. + */ + WithCreate withDiagnostics(ContainerGroupDiagnostics diagnostics); + } + + /** + * The stage of the ContainerGroupProfile definition allowing to specify priority. + */ + interface WithPriority { + /** + * Specifies the priority property: The priority of the container group.. + * + * @param priority The priority of the container group. + * @return the next definition stage. + */ + WithCreate withPriority(ContainerGroupPriority priority); + } + + /** + * The stage of the ContainerGroupProfile definition allowing to specify confidentialComputeProperties. + */ + interface WithConfidentialComputeProperties { + /** + * Specifies the confidentialComputeProperties property: The properties for confidential container group. + * + * @param confidentialComputeProperties The properties for confidential container group. + * @return the next definition stage. + */ + WithCreate withConfidentialComputeProperties(ConfidentialComputeProperties confidentialComputeProperties); + } + + /** + * The stage of the ContainerGroupProfile definition allowing to specify securityContext. + */ + interface WithSecurityContext { + /** + * Specifies the securityContext property: The container security properties.. + * + * @param securityContext The container security properties. + * @return the next definition stage. + */ + WithCreate withSecurityContext(SecurityContextDefinition securityContext); + } + + /** + * The stage of the ContainerGroupProfile definition allowing to specify revision. + */ + interface WithRevision { + /** + * Specifies the revision property: Container group profile current revision number. + * + * @param revision Container group profile current revision number. + * @return the next definition stage. + */ + WithCreate withRevision(Long revision); + } + + /** + * The stage of the ContainerGroupProfile definition allowing to specify registeredRevisions. + */ + interface WithRegisteredRevisions { + /** + * Specifies the registeredRevisions property: Registered revisions are calculated at request time based off + * the records in the table logs.. + * + * @param registeredRevisions Registered revisions are calculated at request time based off the records in + * the table logs. + * @return the next definition stage. + */ + WithCreate withRegisteredRevisions(List registeredRevisions); + } + + /** + * The stage of the ContainerGroupProfile definition allowing to specify useKrypton. + */ + interface WithUseKrypton { + /** + * Specifies the useKrypton property: Gets or sets Krypton use property.. + * + * @param useKrypton Gets or sets Krypton use property. + * @return the next definition stage. + */ + WithCreate withUseKrypton(Boolean useKrypton); + } + } + + /** + * Begins update for the ContainerGroupProfile resource. + * + * @return the stage of resource update. + */ + ContainerGroupProfile.Update update(); + + /** + * The template for ContainerGroupProfile update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ContainerGroupProfile apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ContainerGroupProfile apply(Context context); + } + + /** + * The ContainerGroupProfile update stages. + */ + interface UpdateStages { + /** + * The stage of the ContainerGroupProfile 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. + */ + ContainerGroupProfile refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ContainerGroupProfile refresh(Context context); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupProfileListResult.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupProfileListResult.java new file mode 100644 index 000000000000..d30282d9ed02 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupProfileListResult.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.ContainerGroupProfileInner; +import java.io.IOException; +import java.util.List; + +/** + * The container group profile list response. + */ +@Fluent +public final class ContainerGroupProfileListResult implements JsonSerializable { + /* + * The list of ContainerGroupProfiles under a subscription or resource group. + */ + private List value; + + /* + * The URI to fetch the next page of Container Group Profiles. + */ + private String nextLink; + + /** + * Creates an instance of ContainerGroupProfileListResult class. + */ + public ContainerGroupProfileListResult() { + } + + /** + * Get the value property: The list of ContainerGroupProfiles under a subscription or resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of ContainerGroupProfiles under a subscription or resource group. + * + * @param value the value value to set. + * @return the ContainerGroupProfileListResult object itself. + */ + public ContainerGroupProfileListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI to fetch the next page of Container Group Profiles. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI to fetch the next page of Container Group Profiles. + * + * @param nextLink the nextLink value to set. + * @return the ContainerGroupProfileListResult object itself. + */ + public ContainerGroupProfileListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerGroupProfileListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerGroupProfileListResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ContainerGroupProfileListResult. + */ + public static ContainerGroupProfileListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerGroupProfileListResult deserializedContainerGroupProfileListResult + = new ContainerGroupProfileListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ContainerGroupProfileInner.fromJson(reader1)); + deserializedContainerGroupProfileListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedContainerGroupProfileListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerGroupProfileListResult; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupProfilePatch.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupProfilePatch.java new file mode 100644 index 000000000000..f26765c873c3 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupProfilePatch.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.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Properties of container group profile that need to be patched. + */ +@Fluent +public final class ContainerGroupProfilePatch implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of ContainerGroupProfilePatch class. + */ + public ContainerGroupProfilePatch() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the ContainerGroupProfilePatch object itself. + */ + public ContainerGroupProfilePatch withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerGroupProfilePatch from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerGroupProfilePatch if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ContainerGroupProfilePatch. + */ + public static ContainerGroupProfilePatch fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerGroupProfilePatch deserializedContainerGroupProfilePatch = new ContainerGroupProfilePatch(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedContainerGroupProfilePatch.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedContainerGroupProfilePatch; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupProfileStub.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupProfileStub.java new file mode 100644 index 000000000000..7f0841583183 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupProfileStub.java @@ -0,0 +1,224 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The object that contains a reference to a Container Group Profile and it's other related properties. + */ +@Fluent +public final class ContainerGroupProfileStub implements JsonSerializable { + /* + * A reference to the container group profile ARM resource hosted in ACI RP. + */ + private ApiEntityReference resource; + + /* + * The revision of the CG profile is an optional property. If customer does not to provide a revision then NGroups + * will pickup the latest revision of CGProfile. + */ + private Integer revision; + + /* + * A network profile for network settings of a ContainerGroupProfile. + */ + private NetworkProfile networkProfile; + + /* + * Storage profile for storage related settings of a container group profile. + */ + private StorageProfile storageProfile; + + /* + * Container Group properties which can be set while creating or updating the NGroups. + */ + private NGroupContainerGroupProperties containerGroupProperties; + + /** + * Creates an instance of ContainerGroupProfileStub class. + */ + public ContainerGroupProfileStub() { + } + + /** + * Get the resource property: A reference to the container group profile ARM resource hosted in ACI RP. + * + * @return the resource value. + */ + public ApiEntityReference resource() { + return this.resource; + } + + /** + * Set the resource property: A reference to the container group profile ARM resource hosted in ACI RP. + * + * @param resource the resource value to set. + * @return the ContainerGroupProfileStub object itself. + */ + public ContainerGroupProfileStub withResource(ApiEntityReference resource) { + this.resource = resource; + return this; + } + + /** + * Get the revision property: The revision of the CG profile is an optional property. If customer does not to + * provide a revision then NGroups will pickup the latest revision of CGProfile. + * + * @return the revision value. + */ + public Integer revision() { + return this.revision; + } + + /** + * Set the revision property: The revision of the CG profile is an optional property. If customer does not to + * provide a revision then NGroups will pickup the latest revision of CGProfile. + * + * @param revision the revision value to set. + * @return the ContainerGroupProfileStub object itself. + */ + public ContainerGroupProfileStub withRevision(Integer revision) { + this.revision = revision; + return this; + } + + /** + * Get the networkProfile property: A network profile for network settings of a ContainerGroupProfile. + * + * @return the networkProfile value. + */ + public NetworkProfile networkProfile() { + return this.networkProfile; + } + + /** + * Set the networkProfile property: A network profile for network settings of a ContainerGroupProfile. + * + * @param networkProfile the networkProfile value to set. + * @return the ContainerGroupProfileStub object itself. + */ + public ContainerGroupProfileStub withNetworkProfile(NetworkProfile networkProfile) { + this.networkProfile = networkProfile; + return this; + } + + /** + * Get the storageProfile property: Storage profile for storage related settings of a container group profile. + * + * @return the storageProfile value. + */ + public StorageProfile storageProfile() { + return this.storageProfile; + } + + /** + * Set the storageProfile property: Storage profile for storage related settings of a container group profile. + * + * @param storageProfile the storageProfile value to set. + * @return the ContainerGroupProfileStub object itself. + */ + public ContainerGroupProfileStub withStorageProfile(StorageProfile storageProfile) { + this.storageProfile = storageProfile; + return this; + } + + /** + * Get the containerGroupProperties property: Container Group properties which can be set while creating or updating + * the NGroups. + * + * @return the containerGroupProperties value. + */ + public NGroupContainerGroupProperties containerGroupProperties() { + return this.containerGroupProperties; + } + + /** + * Set the containerGroupProperties property: Container Group properties which can be set while creating or updating + * the NGroups. + * + * @param containerGroupProperties the containerGroupProperties value to set. + * @return the ContainerGroupProfileStub object itself. + */ + public ContainerGroupProfileStub + withContainerGroupProperties(NGroupContainerGroupProperties containerGroupProperties) { + this.containerGroupProperties = containerGroupProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (resource() != null) { + resource().validate(); + } + if (networkProfile() != null) { + networkProfile().validate(); + } + if (storageProfile() != null) { + storageProfile().validate(); + } + if (containerGroupProperties() != null) { + containerGroupProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("resource", this.resource); + jsonWriter.writeNumberField("revision", this.revision); + jsonWriter.writeJsonField("networkProfile", this.networkProfile); + jsonWriter.writeJsonField("storageProfile", this.storageProfile); + jsonWriter.writeJsonField("containerGroupProperties", this.containerGroupProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerGroupProfileStub from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerGroupProfileStub if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ContainerGroupProfileStub. + */ + public static ContainerGroupProfileStub fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerGroupProfileStub deserializedContainerGroupProfileStub = new ContainerGroupProfileStub(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resource".equals(fieldName)) { + deserializedContainerGroupProfileStub.resource = ApiEntityReference.fromJson(reader); + } else if ("revision".equals(fieldName)) { + deserializedContainerGroupProfileStub.revision = reader.getNullable(JsonReader::getInt); + } else if ("networkProfile".equals(fieldName)) { + deserializedContainerGroupProfileStub.networkProfile = NetworkProfile.fromJson(reader); + } else if ("storageProfile".equals(fieldName)) { + deserializedContainerGroupProfileStub.storageProfile = StorageProfile.fromJson(reader); + } else if ("containerGroupProperties".equals(fieldName)) { + deserializedContainerGroupProfileStub.containerGroupProperties + = NGroupContainerGroupProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerGroupProfileStub; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupProperties.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupProperties.java new file mode 100644 index 000000000000..b280660373e0 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupProperties.java @@ -0,0 +1,558 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.ContainerGroupPropertiesProperties; +import java.io.IOException; +import java.util.List; + +/** + * The container group properties. + */ +@Fluent +public class ContainerGroupProperties implements JsonSerializable { + /* + * The identity of the container group, if configured. + */ + private ContainerGroupIdentity identity; + + /* + * The container group properties + */ + private ContainerGroupPropertiesProperties innerProperties = new ContainerGroupPropertiesProperties(); + + /** + * Creates an instance of ContainerGroupProperties class. + */ + public ContainerGroupProperties() { + } + + /** + * Get the identity property: The identity of the container group, if configured. + * + * @return the identity value. + */ + public ContainerGroupIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The identity of the container group, if configured. + * + * @param identity the identity value to set. + * @return the ContainerGroupProperties object itself. + */ + public ContainerGroupProperties withIdentity(ContainerGroupIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the innerProperties property: The container group properties. + * + * @return the innerProperties value. + */ + private ContainerGroupPropertiesProperties innerProperties() { + return this.innerProperties; + } + + /** + * Set the innerProperties property: The container group properties. + * + * @param innerProperties the innerProperties value to set. + * @return the ContainerGroupProperties object itself. + */ + ContainerGroupProperties withInnerProperties(ContainerGroupPropertiesProperties innerProperties) { + this.innerProperties = innerProperties; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the container group. This only appears in the + * response. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the secretReferences property: The secret references that will be referenced within the container group. + * + * @return the secretReferences value. + */ + public List secretReferences() { + return this.innerProperties() == null ? null : this.innerProperties().secretReferences(); + } + + /** + * Set the secretReferences property: The secret references that will be referenced within the container group. + * + * @param secretReferences the secretReferences value to set. + * @return the ContainerGroupProperties object itself. + */ + public ContainerGroupProperties withSecretReferences(List secretReferences) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupPropertiesProperties(); + } + this.innerProperties().withSecretReferences(secretReferences); + return this; + } + + /** + * Get the containers property: The containers within the container group. + * + * @return the containers value. + */ + public List containers() { + return this.innerProperties() == null ? null : this.innerProperties().containers(); + } + + /** + * Set the containers property: The containers within the container group. + * + * @param containers the containers value to set. + * @return the ContainerGroupProperties object itself. + */ + public ContainerGroupProperties withContainers(List containers) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupPropertiesProperties(); + } + this.innerProperties().withContainers(containers); + return this; + } + + /** + * Get the imageRegistryCredentials property: The image registry credentials by which the container group is created + * from. + * + * @return the imageRegistryCredentials value. + */ + public List imageRegistryCredentials() { + return this.innerProperties() == null ? null : this.innerProperties().imageRegistryCredentials(); + } + + /** + * Set the imageRegistryCredentials property: The image registry credentials by which the container group is created + * from. + * + * @param imageRegistryCredentials the imageRegistryCredentials value to set. + * @return the ContainerGroupProperties object itself. + */ + public ContainerGroupProperties + withImageRegistryCredentials(List imageRegistryCredentials) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupPropertiesProperties(); + } + this.innerProperties().withImageRegistryCredentials(imageRegistryCredentials); + return this; + } + + /** + * Get the restartPolicy property: Restart policy for all containers within the container group. + * - `Always` Always restart + * - `OnFailure` Restart on failure + * - `Never` Never restart. + * + * @return the restartPolicy value. + */ + public ContainerGroupRestartPolicy restartPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().restartPolicy(); + } + + /** + * Set the restartPolicy property: Restart policy for all containers within the container group. + * - `Always` Always restart + * - `OnFailure` Restart on failure + * - `Never` Never restart. + * + * @param restartPolicy the restartPolicy value to set. + * @return the ContainerGroupProperties object itself. + */ + public ContainerGroupProperties withRestartPolicy(ContainerGroupRestartPolicy restartPolicy) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupPropertiesProperties(); + } + this.innerProperties().withRestartPolicy(restartPolicy); + return this; + } + + /** + * Get the ipAddress property: The IP address type of the container group. + * + * @return the ipAddress value. + */ + public IpAddress ipAddress() { + return this.innerProperties() == null ? null : this.innerProperties().ipAddress(); + } + + /** + * Set the ipAddress property: The IP address type of the container group. + * + * @param ipAddress the ipAddress value to set. + * @return the ContainerGroupProperties object itself. + */ + public ContainerGroupProperties withIpAddress(IpAddress ipAddress) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupPropertiesProperties(); + } + this.innerProperties().withIpAddress(ipAddress); + return this; + } + + /** + * Get the osType property: The operating system type required by the containers in the container group. + * + * @return the osType value. + */ + public OperatingSystemTypes osType() { + return this.innerProperties() == null ? null : this.innerProperties().osType(); + } + + /** + * Set the osType property: The operating system type required by the containers in the container group. + * + * @param osType the osType value to set. + * @return the ContainerGroupProperties object itself. + */ + public ContainerGroupProperties withOsType(OperatingSystemTypes osType) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupPropertiesProperties(); + } + this.innerProperties().withOsType(osType); + return this; + } + + /** + * Get the volumes property: The list of volumes that can be mounted by containers in this container group. + * + * @return the volumes value. + */ + public List volumes() { + return this.innerProperties() == null ? null : this.innerProperties().volumes(); + } + + /** + * Set the volumes property: The list of volumes that can be mounted by containers in this container group. + * + * @param volumes the volumes value to set. + * @return the ContainerGroupProperties object itself. + */ + public ContainerGroupProperties withVolumes(List volumes) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupPropertiesProperties(); + } + this.innerProperties().withVolumes(volumes); + return this; + } + + /** + * Get the instanceView property: The instance view of the container group. Only valid in response. + * + * @return the instanceView value. + */ + public ContainerGroupPropertiesInstanceView instanceView() { + return this.innerProperties() == null ? null : this.innerProperties().instanceView(); + } + + /** + * Get the diagnostics property: The diagnostic information for a container group. + * + * @return the diagnostics value. + */ + public ContainerGroupDiagnostics diagnostics() { + return this.innerProperties() == null ? null : this.innerProperties().diagnostics(); + } + + /** + * Set the diagnostics property: The diagnostic information for a container group. + * + * @param diagnostics the diagnostics value to set. + * @return the ContainerGroupProperties object itself. + */ + public ContainerGroupProperties withDiagnostics(ContainerGroupDiagnostics diagnostics) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupPropertiesProperties(); + } + this.innerProperties().withDiagnostics(diagnostics); + return this; + } + + /** + * Get the subnetIds property: The subnet resource IDs for a container group. + * + * @return the subnetIds value. + */ + public List subnetIds() { + return this.innerProperties() == null ? null : this.innerProperties().subnetIds(); + } + + /** + * Set the subnetIds property: The subnet resource IDs for a container group. + * + * @param subnetIds the subnetIds value to set. + * @return the ContainerGroupProperties object itself. + */ + public ContainerGroupProperties withSubnetIds(List subnetIds) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupPropertiesProperties(); + } + this.innerProperties().withSubnetIds(subnetIds); + return this; + } + + /** + * Get the dnsConfig property: The DNS config information for a container group. + * + * @return the dnsConfig value. + */ + public DnsConfiguration dnsConfig() { + return this.innerProperties() == null ? null : this.innerProperties().dnsConfig(); + } + + /** + * Set the dnsConfig property: The DNS config information for a container group. + * + * @param dnsConfig the dnsConfig value to set. + * @return the ContainerGroupProperties object itself. + */ + public ContainerGroupProperties withDnsConfig(DnsConfiguration dnsConfig) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupPropertiesProperties(); + } + this.innerProperties().withDnsConfig(dnsConfig); + return this; + } + + /** + * Get the sku property: The SKU for a container group. + * + * @return the sku value. + */ + public ContainerGroupSku sku() { + return this.innerProperties() == null ? null : this.innerProperties().sku(); + } + + /** + * Set the sku property: The SKU for a container group. + * + * @param sku the sku value to set. + * @return the ContainerGroupProperties object itself. + */ + public ContainerGroupProperties withSku(ContainerGroupSku sku) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupPropertiesProperties(); + } + this.innerProperties().withSku(sku); + return this; + } + + /** + * Get the encryptionProperties property: The encryption properties for a container group. + * + * @return the encryptionProperties value. + */ + public EncryptionProperties encryptionProperties() { + return this.innerProperties() == null ? null : this.innerProperties().encryptionProperties(); + } + + /** + * Set the encryptionProperties property: The encryption properties for a container group. + * + * @param encryptionProperties the encryptionProperties value to set. + * @return the ContainerGroupProperties object itself. + */ + public ContainerGroupProperties withEncryptionProperties(EncryptionProperties encryptionProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupPropertiesProperties(); + } + this.innerProperties().withEncryptionProperties(encryptionProperties); + return this; + } + + /** + * Get the initContainers property: The init containers for a container group. + * + * @return the initContainers value. + */ + public List initContainers() { + return this.innerProperties() == null ? null : this.innerProperties().initContainers(); + } + + /** + * Set the initContainers property: The init containers for a container group. + * + * @param initContainers the initContainers value to set. + * @return the ContainerGroupProperties object itself. + */ + public ContainerGroupProperties withInitContainers(List initContainers) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupPropertiesProperties(); + } + this.innerProperties().withInitContainers(initContainers); + return this; + } + + /** + * Get the extensions property: extensions used by virtual kubelet. + * + * @return the extensions value. + */ + public List extensions() { + return this.innerProperties() == null ? null : this.innerProperties().extensions(); + } + + /** + * Set the extensions property: extensions used by virtual kubelet. + * + * @param extensions the extensions value to set. + * @return the ContainerGroupProperties object itself. + */ + public ContainerGroupProperties withExtensions(List extensions) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupPropertiesProperties(); + } + this.innerProperties().withExtensions(extensions); + return this; + } + + /** + * Get the confidentialComputeProperties property: The properties for confidential container group. + * + * @return the confidentialComputeProperties value. + */ + public ConfidentialComputeProperties confidentialComputeProperties() { + return this.innerProperties() == null ? null : this.innerProperties().confidentialComputeProperties(); + } + + /** + * Set the confidentialComputeProperties property: The properties for confidential container group. + * + * @param confidentialComputeProperties the confidentialComputeProperties value to set. + * @return the ContainerGroupProperties object itself. + */ + public ContainerGroupProperties + withConfidentialComputeProperties(ConfidentialComputeProperties confidentialComputeProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupPropertiesProperties(); + } + this.innerProperties().withConfidentialComputeProperties(confidentialComputeProperties); + return this; + } + + /** + * Get the priority property: The priority of the container group. + * + * @return the priority value. + */ + public ContainerGroupPriority priority() { + return this.innerProperties() == null ? null : this.innerProperties().priority(); + } + + /** + * Set the priority property: The priority of the container group. + * + * @param priority the priority value to set. + * @return the ContainerGroupProperties object itself. + */ + public ContainerGroupProperties withPriority(ContainerGroupPriority priority) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupPropertiesProperties(); + } + this.innerProperties().withPriority(priority); + return this; + } + + /** + * Get the identityAcls property: The access control levels of the identities. + * + * @return the identityAcls value. + */ + public IdentityAcls identityAcls() { + return this.innerProperties() == null ? null : this.innerProperties().identityAcls(); + } + + /** + * Set the identityAcls property: The access control levels of the identities. + * + * @param identityAcls the identityAcls value to set. + * @return the ContainerGroupProperties object itself. + */ + public ContainerGroupProperties withIdentityAcls(IdentityAcls identityAcls) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupPropertiesProperties(); + } + this.innerProperties().withIdentityAcls(identityAcls); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (innerProperties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model ContainerGroupProperties")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ContainerGroupProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("identity", this.identity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerGroupProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerGroupProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ContainerGroupProperties. + */ + public static ContainerGroupProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerGroupProperties deserializedContainerGroupProperties = new ContainerGroupProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedContainerGroupProperties.innerProperties + = ContainerGroupPropertiesProperties.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedContainerGroupProperties.identity = ContainerGroupIdentity.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerGroupProperties; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupPropertiesInstanceView.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupPropertiesInstanceView.java new file mode 100644 index 000000000000..ce86654f3bc2 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupPropertiesInstanceView.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The instance view of the container group. Only valid in response. + */ +@Immutable +public final class ContainerGroupPropertiesInstanceView + implements JsonSerializable { + /* + * The events of this container group. + */ + private List events; + + /* + * The state of the container group. Only valid in response. + */ + private String state; + + /** + * Creates an instance of ContainerGroupPropertiesInstanceView class. + */ + public ContainerGroupPropertiesInstanceView() { + } + + /** + * Get the events property: The events of this container group. + * + * @return the events value. + */ + public List events() { + return this.events; + } + + /** + * Get the state property: The state of the container group. Only valid in response. + * + * @return the state value. + */ + public String state() { + return this.state; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (events() != null) { + events().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerGroupPropertiesInstanceView from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerGroupPropertiesInstanceView if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ContainerGroupPropertiesInstanceView. + */ + public static ContainerGroupPropertiesInstanceView fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerGroupPropertiesInstanceView deserializedContainerGroupPropertiesInstanceView + = new ContainerGroupPropertiesInstanceView(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("events".equals(fieldName)) { + List events = reader.readArray(reader1 -> Event.fromJson(reader1)); + deserializedContainerGroupPropertiesInstanceView.events = events; + } else if ("state".equals(fieldName)) { + deserializedContainerGroupPropertiesInstanceView.state = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerGroupPropertiesInstanceView; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupProvisioningState.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupProvisioningState.java new file mode 100644 index 000000000000..94bf854e7270 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupProvisioningState.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The provisioning state of the container group. This only appears in the response. + */ +public final class ContainerGroupProvisioningState extends ExpandableStringEnum { + /** + * Static value NotSpecified for ContainerGroupProvisioningState. + */ + public static final ContainerGroupProvisioningState NOT_SPECIFIED = fromString("NotSpecified"); + + /** + * Static value Accepted for ContainerGroupProvisioningState. + */ + public static final ContainerGroupProvisioningState ACCEPTED = fromString("Accepted"); + + /** + * Static value Pending for ContainerGroupProvisioningState. + */ + public static final ContainerGroupProvisioningState PENDING = fromString("Pending"); + + /** + * Static value Updating for ContainerGroupProvisioningState. + */ + public static final ContainerGroupProvisioningState UPDATING = fromString("Updating"); + + /** + * Static value Creating for ContainerGroupProvisioningState. + */ + public static final ContainerGroupProvisioningState CREATING = fromString("Creating"); + + /** + * Static value Repairing for ContainerGroupProvisioningState. + */ + public static final ContainerGroupProvisioningState REPAIRING = fromString("Repairing"); + + /** + * Static value Unhealthy for ContainerGroupProvisioningState. + */ + public static final ContainerGroupProvisioningState UNHEALTHY = fromString("Unhealthy"); + + /** + * Static value Failed for ContainerGroupProvisioningState. + */ + public static final ContainerGroupProvisioningState FAILED = fromString("Failed"); + + /** + * Static value Canceled for ContainerGroupProvisioningState. + */ + public static final ContainerGroupProvisioningState CANCELED = fromString("Canceled"); + + /** + * Static value Succeeded for ContainerGroupProvisioningState. + */ + public static final ContainerGroupProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Deleting for ContainerGroupProvisioningState. + */ + public static final ContainerGroupProvisioningState DELETING = fromString("Deleting"); + + /** + * Static value NotAccessible for ContainerGroupProvisioningState. + */ + public static final ContainerGroupProvisioningState NOT_ACCESSIBLE = fromString("NotAccessible"); + + /** + * Static value PreProvisioned for ContainerGroupProvisioningState. + */ + public static final ContainerGroupProvisioningState PRE_PROVISIONED = fromString("PreProvisioned"); + + /** + * Creates a new instance of ContainerGroupProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ContainerGroupProvisioningState() { + } + + /** + * Creates or finds a ContainerGroupProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ContainerGroupProvisioningState. + */ + public static ContainerGroupProvisioningState fromString(String name) { + return fromString(name, ContainerGroupProvisioningState.class); + } + + /** + * Gets known ContainerGroupProvisioningState values. + * + * @return known ContainerGroupProvisioningState values. + */ + public static Collection values() { + return values(ContainerGroupProvisioningState.class); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupRestartPolicy.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupRestartPolicy.java new file mode 100644 index 000000000000..895153a69db0 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupRestartPolicy.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.containerinstance.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Restart policy for all containers within the container group. + * - `Always` Always restart + * - `OnFailure` Restart on failure + * - `Never` Never restart. + */ +public final class ContainerGroupRestartPolicy extends ExpandableStringEnum { + /** + * Static value Always for ContainerGroupRestartPolicy. + */ + public static final ContainerGroupRestartPolicy ALWAYS = fromString("Always"); + + /** + * Static value OnFailure for ContainerGroupRestartPolicy. + */ + public static final ContainerGroupRestartPolicy ON_FAILURE = fromString("OnFailure"); + + /** + * Static value Never for ContainerGroupRestartPolicy. + */ + public static final ContainerGroupRestartPolicy NEVER = fromString("Never"); + + /** + * Creates a new instance of ContainerGroupRestartPolicy value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ContainerGroupRestartPolicy() { + } + + /** + * Creates or finds a ContainerGroupRestartPolicy from its string representation. + * + * @param name a name to look for. + * @return the corresponding ContainerGroupRestartPolicy. + */ + public static ContainerGroupRestartPolicy fromString(String name) { + return fromString(name, ContainerGroupRestartPolicy.class); + } + + /** + * Gets known ContainerGroupRestartPolicy values. + * + * @return known ContainerGroupRestartPolicy values. + */ + public static Collection values() { + return values(ContainerGroupRestartPolicy.class); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupSku.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupSku.java new file mode 100644 index 000000000000..8fd3c1b5a471 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupSku.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The container group SKU. + */ +public final class ContainerGroupSku extends ExpandableStringEnum { + /** + * Static value NotSpecified for ContainerGroupSku. + */ + public static final ContainerGroupSku NOT_SPECIFIED = fromString("NotSpecified"); + + /** + * Static value Standard for ContainerGroupSku. + */ + public static final ContainerGroupSku STANDARD = fromString("Standard"); + + /** + * Static value Dedicated for ContainerGroupSku. + */ + public static final ContainerGroupSku DEDICATED = fromString("Dedicated"); + + /** + * Static value Confidential for ContainerGroupSku. + */ + public static final ContainerGroupSku CONFIDENTIAL = fromString("Confidential"); + + /** + * Creates a new instance of ContainerGroupSku value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ContainerGroupSku() { + } + + /** + * Creates or finds a ContainerGroupSku from its string representation. + * + * @param name a name to look for. + * @return the corresponding ContainerGroupSku. + */ + public static ContainerGroupSku fromString(String name) { + return fromString(name, ContainerGroupSku.class); + } + + /** + * Gets known ContainerGroupSku values. + * + * @return known ContainerGroupSku values. + */ + public static Collection values() { + return values(ContainerGroupSku.class); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupSubnetId.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupSubnetId.java new file mode 100644 index 000000000000..44f35a732414 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupSubnetId.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Container group subnet information. + */ +@Fluent +public final class ContainerGroupSubnetId implements JsonSerializable { + /* + * Resource ID of virtual network and subnet. + */ + private String id; + + /* + * Friendly name for the subnet. + */ + private String name; + + /** + * Creates an instance of ContainerGroupSubnetId class. + */ + public ContainerGroupSubnetId() { + } + + /** + * Get the id property: Resource ID of virtual network and subnet. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID of virtual network and subnet. + * + * @param id the id value to set. + * @return the ContainerGroupSubnetId object itself. + */ + public ContainerGroupSubnetId withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name property: Friendly name for the subnet. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Friendly name for the subnet. + * + * @param name the name value to set. + * @return the ContainerGroupSubnetId object itself. + */ + public ContainerGroupSubnetId withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (id() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property id in model ContainerGroupSubnetId")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ContainerGroupSubnetId.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerGroupSubnetId from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerGroupSubnetId if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ContainerGroupSubnetId. + */ + public static ContainerGroupSubnetId fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerGroupSubnetId deserializedContainerGroupSubnetId = new ContainerGroupSubnetId(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedContainerGroupSubnetId.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedContainerGroupSubnetId.name = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerGroupSubnetId; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroups.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroups.java new file mode 100644 index 000000000000..71c463a8ad43 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroups.java @@ -0,0 +1,365 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.Resource; +import com.azure.core.util.Context; +import java.util.List; + +/** + * Resource collection API of ContainerGroups. + */ +public interface ContainerGroups { + /** + * Get a list of container groups in the specified subscription. + * + * Get a list of container groups in the specified subscription. This operation returns properties of each container + * group including containers, image registry credentials, restart policy, IP address type, OS type, state, and + * volumes. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of container groups in the specified subscription as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Get a list of container groups in the specified subscription. + * + * Get a list of container groups in the specified subscription. This operation returns properties of each container + * group including containers, image registry credentials, restart policy, IP address type, OS type, state, and + * volumes. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of container groups in the specified subscription as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Get a list of container groups in the specified subscription and resource group. + * + * Get a list of container groups in a specified subscription and resource group. This operation returns properties + * of each container group including containers, image registry credentials, restart policy, IP address type, OS + * type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of container groups in a specified subscription and resource group as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Get a list of container groups in the specified subscription and resource group. + * + * Get a list of container groups in a specified subscription and resource group. This operation returns properties + * of each container group including containers, image registry credentials, restart policy, IP address type, OS + * type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of container groups in a specified subscription and resource group as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get the properties of the specified container group. + * + * Gets the properties of the specified container group in the specified subscription and resource group. The + * operation returns the properties of each container group including containers, image registry credentials, + * restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified container group in the specified subscription and resource group along + * with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String containerGroupName, + Context context); + + /** + * Get the properties of the specified container group. + * + * Gets the properties of the specified container group in the specified subscription and resource group. The + * operation returns the properties of each container group including containers, image registry credentials, + * restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified container group in the specified subscription and resource group. + */ + ContainerGroup getByResourceGroup(String resourceGroupName, String containerGroupName); + + /** + * Update container groups. + * + * Updates container group tags with specified values. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param resource The container group resource with just the tags to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container group along with {@link Response}. + */ + Response updateWithResponse(String resourceGroupName, String containerGroupName, Resource resource, + Context context); + + /** + * Update container groups. + * + * Updates container group tags with specified values. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param resource The container group resource with just the tags to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container group. + */ + ContainerGroup update(String resourceGroupName, String containerGroupName, Resource resource); + + /** + * Delete the specified container group. + * + * Delete the specified container group in the specified subscription and resource group. The operation does not + * delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container group. + */ + ContainerGroup deleteByResourceGroup(String resourceGroupName, String containerGroupName); + + /** + * Delete the specified container group. + * + * Delete the specified container group in the specified subscription and resource group. The operation does not + * delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container group. + */ + ContainerGroup delete(String resourceGroupName, String containerGroupName, Context context); + + /** + * Restarts all containers in a container group. + * + * Restarts all containers in a container group in place. If container image has updates, new image will be + * downloaded. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void restart(String resourceGroupName, String containerGroupName); + + /** + * Restarts all containers in a container group. + * + * Restarts all containers in a container group in place. If container image has updates, new image will be + * downloaded. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 restart(String resourceGroupName, String containerGroupName, Context context); + + /** + * Stops all containers in a container group. + * + * Stops all containers in a container group. Compute resources will be deallocated and billing will stop. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response stopWithResponse(String resourceGroupName, String containerGroupName, Context context); + + /** + * Stops all containers in a container group. + * + * Stops all containers in a container group. Compute resources will be deallocated and billing will stop. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stop(String resourceGroupName, String containerGroupName); + + /** + * Starts all containers in a container group. + * + * Starts all containers in a container group. Compute resources will be allocated and billing will start. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(String resourceGroupName, String containerGroupName); + + /** + * Starts all containers in a container group. + * + * Starts all containers in a container group. Compute resources will be allocated and billing will start. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(String resourceGroupName, String containerGroupName, Context context); + + /** + * Get all network dependencies for container group. + * + * Gets all the network dependencies for this container group to allow complete control of network setting and + * configuration. For container groups, this will always be an empty list. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 the network dependencies for this container group to allow complete control of network setting and + * configuration along with {@link Response}. + */ + Response> getOutboundNetworkDependenciesEndpointsWithResponse(String resourceGroupName, + String containerGroupName, Context context); + + /** + * Get all network dependencies for container group. + * + * Gets all the network dependencies for this container group to allow complete control of network setting and + * configuration. For container groups, this will always be an empty list. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the network dependencies for this container group to allow complete control of network setting and + * configuration. + */ + List getOutboundNetworkDependenciesEndpoints(String resourceGroupName, String containerGroupName); + + /** + * Get the properties of the specified container group. + * + * Gets the properties of the specified container group in the specified subscription and resource group. The + * operation returns the properties of each container group including containers, image registry credentials, + * restart policy, IP address type, OS type, state, and volumes. + * + * @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 the properties of the specified container group in the specified subscription and resource group along + * with {@link Response}. + */ + ContainerGroup getById(String id); + + /** + * Get the properties of the specified container group. + * + * Gets the properties of the specified container group in the specified subscription and resource group. The + * operation returns the properties of each container group including containers, image registry credentials, + * restart policy, IP address type, OS type, state, and volumes. + * + * @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 the properties of the specified container group in the specified subscription and resource group along + * with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete the specified container group. + * + * Delete the specified container group in the specified subscription and resource group. The operation does not + * delete other resources provided by the user, such as volumes. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container group. + */ + ContainerGroup deleteById(String id); + + /** + * Delete the specified container group. + * + * Delete the specified container group in the specified subscription and resource group. The operation does not + * delete other resources provided by the user, such as volumes. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container group. + */ + ContainerGroup deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ContainerGroup resource. + * + * @param name resource name. + * @return the first stage of the new ContainerGroup definition. + */ + ContainerGroup.DefinitionStages.Blank define(String name); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerHttpGet.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerHttpGet.java new file mode 100644 index 000000000000..33caadddd071 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerHttpGet.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The container Http Get settings, for liveness or readiness probe. + */ +@Fluent +public final class ContainerHttpGet implements JsonSerializable { + /* + * The path to probe. + */ + private String path; + + /* + * The port number to probe. + */ + private int port; + + /* + * The scheme. + */ + private Scheme scheme; + + /* + * The HTTP headers. + */ + private List httpHeaders; + + /** + * Creates an instance of ContainerHttpGet class. + */ + public ContainerHttpGet() { + } + + /** + * Get the path property: The path to probe. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: The path to probe. + * + * @param path the path value to set. + * @return the ContainerHttpGet object itself. + */ + public ContainerHttpGet withPath(String path) { + this.path = path; + return this; + } + + /** + * Get the port property: The port number to probe. + * + * @return the port value. + */ + public int port() { + return this.port; + } + + /** + * Set the port property: The port number to probe. + * + * @param port the port value to set. + * @return the ContainerHttpGet object itself. + */ + public ContainerHttpGet withPort(int port) { + this.port = port; + return this; + } + + /** + * Get the scheme property: The scheme. + * + * @return the scheme value. + */ + public Scheme scheme() { + return this.scheme; + } + + /** + * Set the scheme property: The scheme. + * + * @param scheme the scheme value to set. + * @return the ContainerHttpGet object itself. + */ + public ContainerHttpGet withScheme(Scheme scheme) { + this.scheme = scheme; + return this; + } + + /** + * Get the httpHeaders property: The HTTP headers. + * + * @return the httpHeaders value. + */ + public List httpHeaders() { + return this.httpHeaders; + } + + /** + * Set the httpHeaders property: The HTTP headers. + * + * @param httpHeaders the httpHeaders value to set. + * @return the ContainerHttpGet object itself. + */ + public ContainerHttpGet withHttpHeaders(List httpHeaders) { + this.httpHeaders = httpHeaders; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (httpHeaders() != null) { + httpHeaders().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("port", this.port); + jsonWriter.writeStringField("path", this.path); + jsonWriter.writeStringField("scheme", this.scheme == null ? null : this.scheme.toString()); + jsonWriter.writeArrayField("httpHeaders", this.httpHeaders, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerHttpGet from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerHttpGet if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ContainerHttpGet. + */ + public static ContainerHttpGet fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerHttpGet deserializedContainerHttpGet = new ContainerHttpGet(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("port".equals(fieldName)) { + deserializedContainerHttpGet.port = reader.getInt(); + } else if ("path".equals(fieldName)) { + deserializedContainerHttpGet.path = reader.getString(); + } else if ("scheme".equals(fieldName)) { + deserializedContainerHttpGet.scheme = Scheme.fromString(reader.getString()); + } else if ("httpHeaders".equals(fieldName)) { + List httpHeaders = reader.readArray(reader1 -> HttpHeader.fromJson(reader1)); + deserializedContainerHttpGet.httpHeaders = httpHeaders; + } else { + reader.skipChildren(); + } + } + + return deserializedContainerHttpGet; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerInstanceOperationsOrigin.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerInstanceOperationsOrigin.java new file mode 100644 index 000000000000..0e3fa2678ead --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerInstanceOperationsOrigin.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The intended executor of the operation. + */ +public final class ContainerInstanceOperationsOrigin extends ExpandableStringEnum { + /** + * Static value User for ContainerInstanceOperationsOrigin. + */ + public static final ContainerInstanceOperationsOrigin USER = fromString("User"); + + /** + * Static value System for ContainerInstanceOperationsOrigin. + */ + public static final ContainerInstanceOperationsOrigin SYSTEM = fromString("System"); + + /** + * Creates a new instance of ContainerInstanceOperationsOrigin value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ContainerInstanceOperationsOrigin() { + } + + /** + * Creates or finds a ContainerInstanceOperationsOrigin from its string representation. + * + * @param name a name to look for. + * @return the corresponding ContainerInstanceOperationsOrigin. + */ + public static ContainerInstanceOperationsOrigin fromString(String name) { + return fromString(name, ContainerInstanceOperationsOrigin.class); + } + + /** + * Gets known ContainerInstanceOperationsOrigin values. + * + * @return known ContainerInstanceOperationsOrigin values. + */ + public static Collection values() { + return values(ContainerInstanceOperationsOrigin.class); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerNetworkProtocol.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerNetworkProtocol.java new file mode 100644 index 000000000000..e68b2379a094 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerNetworkProtocol.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The protocol associated with the port. + */ +public final class ContainerNetworkProtocol extends ExpandableStringEnum { + /** + * Static value TCP for ContainerNetworkProtocol. + */ + public static final ContainerNetworkProtocol TCP = fromString("TCP"); + + /** + * Static value UDP for ContainerNetworkProtocol. + */ + public static final ContainerNetworkProtocol UDP = fromString("UDP"); + + /** + * Creates a new instance of ContainerNetworkProtocol value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ContainerNetworkProtocol() { + } + + /** + * Creates or finds a ContainerNetworkProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding ContainerNetworkProtocol. + */ + public static ContainerNetworkProtocol fromString(String name) { + return fromString(name, ContainerNetworkProtocol.class); + } + + /** + * Gets known ContainerNetworkProtocol values. + * + * @return known ContainerNetworkProtocol values. + */ + public static Collection values() { + return values(ContainerNetworkProtocol.class); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerPort.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerPort.java new file mode 100644 index 000000000000..ab14565aa614 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerPort.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The port exposed on the container instance. + */ +@Fluent +public final class ContainerPort implements JsonSerializable { + /* + * The protocol associated with the port. + */ + private ContainerNetworkProtocol protocol; + + /* + * The port number exposed within the container group. + */ + private int port; + + /** + * Creates an instance of ContainerPort class. + */ + public ContainerPort() { + } + + /** + * Get the protocol property: The protocol associated with the port. + * + * @return the protocol value. + */ + public ContainerNetworkProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol property: The protocol associated with the port. + * + * @param protocol the protocol value to set. + * @return the ContainerPort object itself. + */ + public ContainerPort withProtocol(ContainerNetworkProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the port property: The port number exposed within the container group. + * + * @return the port value. + */ + public int port() { + return this.port; + } + + /** + * Set the port property: The port number exposed within the container group. + * + * @param port the port value to set. + * @return the ContainerPort object itself. + */ + public ContainerPort withPort(int port) { + this.port = port; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("port", this.port); + jsonWriter.writeStringField("protocol", this.protocol == null ? null : this.protocol.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerPort from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerPort if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ContainerPort. + */ + public static ContainerPort fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerPort deserializedContainerPort = new ContainerPort(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("port".equals(fieldName)) { + deserializedContainerPort.port = reader.getInt(); + } else if ("protocol".equals(fieldName)) { + deserializedContainerPort.protocol = ContainerNetworkProtocol.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerPort; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerProbe.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerProbe.java new file mode 100644 index 000000000000..dca52d8c82b8 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerProbe.java @@ -0,0 +1,267 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The container probe, for liveness or readiness. + */ +@Fluent +public final class ContainerProbe implements JsonSerializable { + /* + * The execution command to probe + */ + private ContainerExec exec; + + /* + * The Http Get settings to probe + */ + private ContainerHttpGet httpGet; + + /* + * The initial delay seconds. + */ + private Integer initialDelaySeconds; + + /* + * The period seconds. + */ + private Integer periodSeconds; + + /* + * The failure threshold. + */ + private Integer failureThreshold; + + /* + * The success threshold. + */ + private Integer successThreshold; + + /* + * The timeout seconds. + */ + private Integer timeoutSeconds; + + /** + * Creates an instance of ContainerProbe class. + */ + public ContainerProbe() { + } + + /** + * Get the exec property: The execution command to probe. + * + * @return the exec value. + */ + public ContainerExec exec() { + return this.exec; + } + + /** + * Set the exec property: The execution command to probe. + * + * @param exec the exec value to set. + * @return the ContainerProbe object itself. + */ + public ContainerProbe withExec(ContainerExec exec) { + this.exec = exec; + return this; + } + + /** + * Get the httpGet property: The Http Get settings to probe. + * + * @return the httpGet value. + */ + public ContainerHttpGet httpGet() { + return this.httpGet; + } + + /** + * Set the httpGet property: The Http Get settings to probe. + * + * @param httpGet the httpGet value to set. + * @return the ContainerProbe object itself. + */ + public ContainerProbe withHttpGet(ContainerHttpGet httpGet) { + this.httpGet = httpGet; + return this; + } + + /** + * Get the initialDelaySeconds property: The initial delay seconds. + * + * @return the initialDelaySeconds value. + */ + public Integer initialDelaySeconds() { + return this.initialDelaySeconds; + } + + /** + * Set the initialDelaySeconds property: The initial delay seconds. + * + * @param initialDelaySeconds the initialDelaySeconds value to set. + * @return the ContainerProbe object itself. + */ + public ContainerProbe withInitialDelaySeconds(Integer initialDelaySeconds) { + this.initialDelaySeconds = initialDelaySeconds; + return this; + } + + /** + * Get the periodSeconds property: The period seconds. + * + * @return the periodSeconds value. + */ + public Integer periodSeconds() { + return this.periodSeconds; + } + + /** + * Set the periodSeconds property: The period seconds. + * + * @param periodSeconds the periodSeconds value to set. + * @return the ContainerProbe object itself. + */ + public ContainerProbe withPeriodSeconds(Integer periodSeconds) { + this.periodSeconds = periodSeconds; + return this; + } + + /** + * Get the failureThreshold property: The failure threshold. + * + * @return the failureThreshold value. + */ + public Integer failureThreshold() { + return this.failureThreshold; + } + + /** + * Set the failureThreshold property: The failure threshold. + * + * @param failureThreshold the failureThreshold value to set. + * @return the ContainerProbe object itself. + */ + public ContainerProbe withFailureThreshold(Integer failureThreshold) { + this.failureThreshold = failureThreshold; + return this; + } + + /** + * Get the successThreshold property: The success threshold. + * + * @return the successThreshold value. + */ + public Integer successThreshold() { + return this.successThreshold; + } + + /** + * Set the successThreshold property: The success threshold. + * + * @param successThreshold the successThreshold value to set. + * @return the ContainerProbe object itself. + */ + public ContainerProbe withSuccessThreshold(Integer successThreshold) { + this.successThreshold = successThreshold; + return this; + } + + /** + * Get the timeoutSeconds property: The timeout seconds. + * + * @return the timeoutSeconds value. + */ + public Integer timeoutSeconds() { + return this.timeoutSeconds; + } + + /** + * Set the timeoutSeconds property: The timeout seconds. + * + * @param timeoutSeconds the timeoutSeconds value to set. + * @return the ContainerProbe object itself. + */ + public ContainerProbe withTimeoutSeconds(Integer timeoutSeconds) { + this.timeoutSeconds = timeoutSeconds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (exec() != null) { + exec().validate(); + } + if (httpGet() != null) { + httpGet().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("exec", this.exec); + jsonWriter.writeJsonField("httpGet", this.httpGet); + jsonWriter.writeNumberField("initialDelaySeconds", this.initialDelaySeconds); + jsonWriter.writeNumberField("periodSeconds", this.periodSeconds); + jsonWriter.writeNumberField("failureThreshold", this.failureThreshold); + jsonWriter.writeNumberField("successThreshold", this.successThreshold); + jsonWriter.writeNumberField("timeoutSeconds", this.timeoutSeconds); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerProbe from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerProbe if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ContainerProbe. + */ + public static ContainerProbe fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerProbe deserializedContainerProbe = new ContainerProbe(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("exec".equals(fieldName)) { + deserializedContainerProbe.exec = ContainerExec.fromJson(reader); + } else if ("httpGet".equals(fieldName)) { + deserializedContainerProbe.httpGet = ContainerHttpGet.fromJson(reader); + } else if ("initialDelaySeconds".equals(fieldName)) { + deserializedContainerProbe.initialDelaySeconds = reader.getNullable(JsonReader::getInt); + } else if ("periodSeconds".equals(fieldName)) { + deserializedContainerProbe.periodSeconds = reader.getNullable(JsonReader::getInt); + } else if ("failureThreshold".equals(fieldName)) { + deserializedContainerProbe.failureThreshold = reader.getNullable(JsonReader::getInt); + } else if ("successThreshold".equals(fieldName)) { + deserializedContainerProbe.successThreshold = reader.getNullable(JsonReader::getInt); + } else if ("timeoutSeconds".equals(fieldName)) { + deserializedContainerProbe.timeoutSeconds = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerProbe; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerPropertiesInstanceView.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerPropertiesInstanceView.java new file mode 100644 index 000000000000..a2059fef1d88 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerPropertiesInstanceView.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The instance view of the container instance. Only valid in response. + */ +@Immutable +public final class ContainerPropertiesInstanceView implements JsonSerializable { + /* + * The number of times that the container instance has been restarted. + */ + private Integer restartCount; + + /* + * Current container instance state. + */ + private ContainerState currentState; + + /* + * Previous container instance state. + */ + private ContainerState previousState; + + /* + * The events of the container instance. + */ + private List events; + + /** + * Creates an instance of ContainerPropertiesInstanceView class. + */ + public ContainerPropertiesInstanceView() { + } + + /** + * Get the restartCount property: The number of times that the container instance has been restarted. + * + * @return the restartCount value. + */ + public Integer restartCount() { + return this.restartCount; + } + + /** + * Get the currentState property: Current container instance state. + * + * @return the currentState value. + */ + public ContainerState currentState() { + return this.currentState; + } + + /** + * Get the previousState property: Previous container instance state. + * + * @return the previousState value. + */ + public ContainerState previousState() { + return this.previousState; + } + + /** + * Get the events property: The events of the container instance. + * + * @return the events value. + */ + public List events() { + return this.events; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (currentState() != null) { + currentState().validate(); + } + if (previousState() != null) { + previousState().validate(); + } + if (events() != null) { + events().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerPropertiesInstanceView from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerPropertiesInstanceView if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ContainerPropertiesInstanceView. + */ + public static ContainerPropertiesInstanceView fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerPropertiesInstanceView deserializedContainerPropertiesInstanceView + = new ContainerPropertiesInstanceView(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("restartCount".equals(fieldName)) { + deserializedContainerPropertiesInstanceView.restartCount = reader.getNullable(JsonReader::getInt); + } else if ("currentState".equals(fieldName)) { + deserializedContainerPropertiesInstanceView.currentState = ContainerState.fromJson(reader); + } else if ("previousState".equals(fieldName)) { + deserializedContainerPropertiesInstanceView.previousState = ContainerState.fromJson(reader); + } else if ("events".equals(fieldName)) { + List events = reader.readArray(reader1 -> Event.fromJson(reader1)); + deserializedContainerPropertiesInstanceView.events = events; + } else { + reader.skipChildren(); + } + } + + return deserializedContainerPropertiesInstanceView; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerState.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerState.java new file mode 100644 index 000000000000..ede47a9c9474 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerState.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * The container instance state. + */ +@Immutable +public final class ContainerState implements JsonSerializable { + /* + * The state of the container instance. + */ + private String state; + + /* + * The date-time when the container instance state started. + */ + private OffsetDateTime startTime; + + /* + * The container instance exit codes correspond to those from the `docker run` command. + */ + private Integer exitCode; + + /* + * The date-time when the container instance state finished. + */ + private OffsetDateTime finishTime; + + /* + * The human-readable status of the container instance state. + */ + private String detailStatus; + + /** + * Creates an instance of ContainerState class. + */ + public ContainerState() { + } + + /** + * Get the state property: The state of the container instance. + * + * @return the state value. + */ + public String state() { + return this.state; + } + + /** + * Get the startTime property: The date-time when the container instance state started. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Get the exitCode property: The container instance exit codes correspond to those from the `docker run` command. + * + * @return the exitCode value. + */ + public Integer exitCode() { + return this.exitCode; + } + + /** + * Get the finishTime property: The date-time when the container instance state finished. + * + * @return the finishTime value. + */ + public OffsetDateTime finishTime() { + return this.finishTime; + } + + /** + * Get the detailStatus property: The human-readable status of the container instance state. + * + * @return the detailStatus value. + */ + public String detailStatus() { + return this.detailStatus; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerState if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ContainerState. + */ + public static ContainerState fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerState deserializedContainerState = new ContainerState(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("state".equals(fieldName)) { + deserializedContainerState.state = reader.getString(); + } else if ("startTime".equals(fieldName)) { + deserializedContainerState.startTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("exitCode".equals(fieldName)) { + deserializedContainerState.exitCode = reader.getNullable(JsonReader::getInt); + } else if ("finishTime".equals(fieldName)) { + deserializedContainerState.finishTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("detailStatus".equals(fieldName)) { + deserializedContainerState.detailStatus = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerState; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Containers.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Containers.java new file mode 100644 index 000000000000..4dbd4c3c9868 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Containers.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of Containers. + */ +public interface Containers { + /** + * Get the logs for a specified container instance. + * + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param tail The number of lines to show from the tail of the container instance log. If not provided, all + * available logs are shown up to 4mb. + * @param timestamps If true, adds a timestamp at the beginning of every line of log output. If not provided, + * defaults to false. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the logs for a specified container instance in a specified resource group and container group along with + * {@link Response}. + */ + Response listLogsWithResponse(String resourceGroupName, String containerGroupName, String containerName, + Integer tail, Boolean timestamps, Context context); + + /** + * Get the logs for a specified container instance. + * + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the logs for a specified container instance in a specified resource group and container group. + */ + Logs listLogs(String resourceGroupName, String containerGroupName, String containerName); + + /** + * Executes a command in a specific container instance. + * + * Executes a command for a specific container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param containerExecRequest The request for the exec 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 information for the container exec command along with {@link Response}. + */ + Response executeCommandWithResponse(String resourceGroupName, String containerGroupName, + String containerName, ContainerExecRequest containerExecRequest, Context context); + + /** + * Executes a command in a specific container instance. + * + * Executes a command for a specific container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param containerExecRequest The request for the exec 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 information for the container exec command. + */ + ContainerExecResponse executeCommand(String resourceGroupName, String containerGroupName, String containerName, + ContainerExecRequest containerExecRequest); + + /** + * Attach to the output of a specific container instance. + * + * Attach to the output stream of a specific container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the information for the output stream from container attach along with {@link Response}. + */ + Response attachWithResponse(String resourceGroupName, String containerGroupName, + String containerName, Context context); + + /** + * Attach to the output of a specific container instance. + * + * Attach to the output stream of a specific container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the information for the output stream from container attach. + */ + ContainerAttachResponse attach(String resourceGroupName, String containerGroupName, String containerName); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/DeploymentExtensionSpec.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/DeploymentExtensionSpec.java new file mode 100644 index 000000000000..cadc878dd80d --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/DeploymentExtensionSpec.java @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.DeploymentExtensionSpecProperties; +import java.io.IOException; + +/** + * Extension sidecars to be added to the deployment. + */ +@Fluent +public final class DeploymentExtensionSpec implements JsonSerializable { + /* + * Name of the extension. + */ + private String name; + + /* + * Extension specific properties + */ + private DeploymentExtensionSpecProperties innerProperties; + + /** + * Creates an instance of DeploymentExtensionSpec class. + */ + public DeploymentExtensionSpec() { + } + + /** + * Get the name property: Name of the extension. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the extension. + * + * @param name the name value to set. + * @return the DeploymentExtensionSpec object itself. + */ + public DeploymentExtensionSpec withName(String name) { + this.name = name; + return this; + } + + /** + * Get the innerProperties property: Extension specific properties. + * + * @return the innerProperties value. + */ + private DeploymentExtensionSpecProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the extensionType property: Type of extension to be added. + * + * @return the extensionType value. + */ + public String extensionType() { + return this.innerProperties() == null ? null : this.innerProperties().extensionType(); + } + + /** + * Set the extensionType property: Type of extension to be added. + * + * @param extensionType the extensionType value to set. + * @return the DeploymentExtensionSpec object itself. + */ + public DeploymentExtensionSpec withExtensionType(String extensionType) { + if (this.innerProperties() == null) { + this.innerProperties = new DeploymentExtensionSpecProperties(); + } + this.innerProperties().withExtensionType(extensionType); + return this; + } + + /** + * Get the version property: Version of the extension being used. + * + * @return the version value. + */ + public String version() { + return this.innerProperties() == null ? null : this.innerProperties().version(); + } + + /** + * Set the version property: Version of the extension being used. + * + * @param version the version value to set. + * @return the DeploymentExtensionSpec object itself. + */ + public DeploymentExtensionSpec withVersion(String version) { + if (this.innerProperties() == null) { + this.innerProperties = new DeploymentExtensionSpecProperties(); + } + this.innerProperties().withVersion(version); + return this; + } + + /** + * Get the settings property: Settings for the extension. + * + * @return the settings value. + */ + public Object settings() { + return this.innerProperties() == null ? null : this.innerProperties().settings(); + } + + /** + * Set the settings property: Settings for the extension. + * + * @param settings the settings value to set. + * @return the DeploymentExtensionSpec object itself. + */ + public DeploymentExtensionSpec withSettings(Object settings) { + if (this.innerProperties() == null) { + this.innerProperties = new DeploymentExtensionSpecProperties(); + } + this.innerProperties().withSettings(settings); + return this; + } + + /** + * Get the protectedSettings property: Protected settings for the extension. + * + * @return the protectedSettings value. + */ + public Object protectedSettings() { + return this.innerProperties() == null ? null : this.innerProperties().protectedSettings(); + } + + /** + * Set the protectedSettings property: Protected settings for the extension. + * + * @param protectedSettings the protectedSettings value to set. + * @return the DeploymentExtensionSpec object itself. + */ + public DeploymentExtensionSpec withProtectedSettings(Object protectedSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new DeploymentExtensionSpecProperties(); + } + this.innerProperties().withProtectedSettings(protectedSettings); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property name in model DeploymentExtensionSpec")); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeploymentExtensionSpec.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeploymentExtensionSpec from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeploymentExtensionSpec if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DeploymentExtensionSpec. + */ + public static DeploymentExtensionSpec fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeploymentExtensionSpec deserializedDeploymentExtensionSpec = new DeploymentExtensionSpec(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedDeploymentExtensionSpec.name = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedDeploymentExtensionSpec.innerProperties + = DeploymentExtensionSpecProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDeploymentExtensionSpec; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/DnsConfiguration.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/DnsConfiguration.java new file mode 100644 index 000000000000..9999ddc879f0 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/DnsConfiguration.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.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * DNS configuration for the container group. + */ +@Fluent +public final class DnsConfiguration implements JsonSerializable { + /* + * The DNS servers for the container group. + */ + private List nameServers; + + /* + * The DNS search domains for hostname lookup in the container group. + */ + private String searchDomains; + + /* + * The DNS options for the container group. + */ + private String options; + + /** + * Creates an instance of DnsConfiguration class. + */ + public DnsConfiguration() { + } + + /** + * Get the nameServers property: The DNS servers for the container group. + * + * @return the nameServers value. + */ + public List nameServers() { + return this.nameServers; + } + + /** + * Set the nameServers property: The DNS servers for the container group. + * + * @param nameServers the nameServers value to set. + * @return the DnsConfiguration object itself. + */ + public DnsConfiguration withNameServers(List nameServers) { + this.nameServers = nameServers; + return this; + } + + /** + * Get the searchDomains property: The DNS search domains for hostname lookup in the container group. + * + * @return the searchDomains value. + */ + public String searchDomains() { + return this.searchDomains; + } + + /** + * Set the searchDomains property: The DNS search domains for hostname lookup in the container group. + * + * @param searchDomains the searchDomains value to set. + * @return the DnsConfiguration object itself. + */ + public DnsConfiguration withSearchDomains(String searchDomains) { + this.searchDomains = searchDomains; + return this; + } + + /** + * Get the options property: The DNS options for the container group. + * + * @return the options value. + */ + public String options() { + return this.options; + } + + /** + * Set the options property: The DNS options for the container group. + * + * @param options the options value to set. + * @return the DnsConfiguration object itself. + */ + public DnsConfiguration withOptions(String options) { + this.options = options; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (nameServers() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property nameServers in model DnsConfiguration")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DnsConfiguration.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("nameServers", this.nameServers, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("searchDomains", this.searchDomains); + jsonWriter.writeStringField("options", this.options); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DnsConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DnsConfiguration if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DnsConfiguration. + */ + public static DnsConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DnsConfiguration deserializedDnsConfiguration = new DnsConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nameServers".equals(fieldName)) { + List nameServers = reader.readArray(reader1 -> reader1.getString()); + deserializedDnsConfiguration.nameServers = nameServers; + } else if ("searchDomains".equals(fieldName)) { + deserializedDnsConfiguration.searchDomains = reader.getString(); + } else if ("options".equals(fieldName)) { + deserializedDnsConfiguration.options = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDnsConfiguration; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/DnsNameLabelReusePolicy.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/DnsNameLabelReusePolicy.java new file mode 100644 index 000000000000..8888d32db82a --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/DnsNameLabelReusePolicy.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The value representing the security enum. The 'Unsecure' value is the default value if not selected and means the + * object's domain name label is not secured against subdomain takeover. The 'TenantReuse' value is the default value if + * selected and means the object's domain name label can be reused within the same tenant. The 'SubscriptionReuse' value + * means the object's domain name label can be reused within the same subscription. The 'ResourceGroupReuse' value means + * the object's domain name label can be reused within the same resource group. The 'NoReuse' value means the object's + * domain name label cannot be reused within the same resource group, subscription, or tenant. + */ +public final class DnsNameLabelReusePolicy extends ExpandableStringEnum { + /** + * Static value Unsecure for DnsNameLabelReusePolicy. + */ + public static final DnsNameLabelReusePolicy UNSECURE = fromString("Unsecure"); + + /** + * Static value TenantReuse for DnsNameLabelReusePolicy. + */ + public static final DnsNameLabelReusePolicy TENANT_REUSE = fromString("TenantReuse"); + + /** + * Static value SubscriptionReuse for DnsNameLabelReusePolicy. + */ + public static final DnsNameLabelReusePolicy SUBSCRIPTION_REUSE = fromString("SubscriptionReuse"); + + /** + * Static value ResourceGroupReuse for DnsNameLabelReusePolicy. + */ + public static final DnsNameLabelReusePolicy RESOURCE_GROUP_REUSE = fromString("ResourceGroupReuse"); + + /** + * Static value Noreuse for DnsNameLabelReusePolicy. + */ + public static final DnsNameLabelReusePolicy NOREUSE = fromString("Noreuse"); + + /** + * Creates a new instance of DnsNameLabelReusePolicy value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DnsNameLabelReusePolicy() { + } + + /** + * Creates or finds a DnsNameLabelReusePolicy from its string representation. + * + * @param name a name to look for. + * @return the corresponding DnsNameLabelReusePolicy. + */ + public static DnsNameLabelReusePolicy fromString(String name) { + return fromString(name, DnsNameLabelReusePolicy.class); + } + + /** + * Gets known DnsNameLabelReusePolicy values. + * + * @return known DnsNameLabelReusePolicy values. + */ + public static Collection values() { + return values(DnsNameLabelReusePolicy.class); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ElasticProfile.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ElasticProfile.java new file mode 100644 index 000000000000..42075536a617 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ElasticProfile.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.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Describes the elastic profile of the NGroup. + */ +@Fluent +public final class ElasticProfile implements JsonSerializable { + /* + * The desiredCount property. + */ + private Integer desiredCount; + + /* + * Flag that indicates whether desiredCount should be maintained when customer deletes SPECIFIC container groups + * (CGs) from the NGroups. In this case, new CGs will be created by NGroup to compensate for the specific deleted + * ones. + */ + private Boolean maintainDesiredCount; + + /* + * Container Groups are named on a generic guid based naming scheme/policy. Customer can modify naming policy to add + * prefix to CG names during scale out operation. + */ + private ElasticProfileContainerGroupNamingPolicy containerGroupNamingPolicy; + + /** + * Creates an instance of ElasticProfile class. + */ + public ElasticProfile() { + } + + /** + * Get the desiredCount property: The desiredCount property. + * + * @return the desiredCount value. + */ + public Integer desiredCount() { + return this.desiredCount; + } + + /** + * Set the desiredCount property: The desiredCount property. + * + * @param desiredCount the desiredCount value to set. + * @return the ElasticProfile object itself. + */ + public ElasticProfile withDesiredCount(Integer desiredCount) { + this.desiredCount = desiredCount; + return this; + } + + /** + * Get the maintainDesiredCount property: Flag that indicates whether desiredCount should be maintained when + * customer deletes SPECIFIC container groups (CGs) from the NGroups. In this case, new CGs will be created by + * NGroup to compensate for the specific deleted ones. + * + * @return the maintainDesiredCount value. + */ + public Boolean maintainDesiredCount() { + return this.maintainDesiredCount; + } + + /** + * Set the maintainDesiredCount property: Flag that indicates whether desiredCount should be maintained when + * customer deletes SPECIFIC container groups (CGs) from the NGroups. In this case, new CGs will be created by + * NGroup to compensate for the specific deleted ones. + * + * @param maintainDesiredCount the maintainDesiredCount value to set. + * @return the ElasticProfile object itself. + */ + public ElasticProfile withMaintainDesiredCount(Boolean maintainDesiredCount) { + this.maintainDesiredCount = maintainDesiredCount; + return this; + } + + /** + * Get the containerGroupNamingPolicy property: Container Groups are named on a generic guid based naming + * scheme/policy. Customer can modify naming policy to add prefix to CG names during scale out operation. + * + * @return the containerGroupNamingPolicy value. + */ + public ElasticProfileContainerGroupNamingPolicy containerGroupNamingPolicy() { + return this.containerGroupNamingPolicy; + } + + /** + * Set the containerGroupNamingPolicy property: Container Groups are named on a generic guid based naming + * scheme/policy. Customer can modify naming policy to add prefix to CG names during scale out operation. + * + * @param containerGroupNamingPolicy the containerGroupNamingPolicy value to set. + * @return the ElasticProfile object itself. + */ + public ElasticProfile + withContainerGroupNamingPolicy(ElasticProfileContainerGroupNamingPolicy containerGroupNamingPolicy) { + this.containerGroupNamingPolicy = containerGroupNamingPolicy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (containerGroupNamingPolicy() != null) { + containerGroupNamingPolicy().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("desiredCount", this.desiredCount); + jsonWriter.writeBooleanField("maintainDesiredCount", this.maintainDesiredCount); + jsonWriter.writeJsonField("containerGroupNamingPolicy", this.containerGroupNamingPolicy); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ElasticProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ElasticProfile if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ElasticProfile. + */ + public static ElasticProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ElasticProfile deserializedElasticProfile = new ElasticProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("desiredCount".equals(fieldName)) { + deserializedElasticProfile.desiredCount = reader.getNullable(JsonReader::getInt); + } else if ("maintainDesiredCount".equals(fieldName)) { + deserializedElasticProfile.maintainDesiredCount = reader.getNullable(JsonReader::getBoolean); + } else if ("containerGroupNamingPolicy".equals(fieldName)) { + deserializedElasticProfile.containerGroupNamingPolicy + = ElasticProfileContainerGroupNamingPolicy.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedElasticProfile; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ElasticProfileContainerGroupNamingPolicy.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ElasticProfileContainerGroupNamingPolicy.java new file mode 100644 index 000000000000..371bffb5578a --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ElasticProfileContainerGroupNamingPolicy.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Container Groups are named on a generic guid based naming scheme/policy. Customer can modify naming policy to add + * prefix to CG names during scale out operation. + */ +@Fluent +public final class ElasticProfileContainerGroupNamingPolicy + implements JsonSerializable { + /* + * The guidNamingPolicy property. + */ + private ElasticProfileContainerGroupNamingPolicyGuidNamingPolicy guidNamingPolicy; + + /** + * Creates an instance of ElasticProfileContainerGroupNamingPolicy class. + */ + public ElasticProfileContainerGroupNamingPolicy() { + } + + /** + * Get the guidNamingPolicy property: The guidNamingPolicy property. + * + * @return the guidNamingPolicy value. + */ + public ElasticProfileContainerGroupNamingPolicyGuidNamingPolicy guidNamingPolicy() { + return this.guidNamingPolicy; + } + + /** + * Set the guidNamingPolicy property: The guidNamingPolicy property. + * + * @param guidNamingPolicy the guidNamingPolicy value to set. + * @return the ElasticProfileContainerGroupNamingPolicy object itself. + */ + public ElasticProfileContainerGroupNamingPolicy + withGuidNamingPolicy(ElasticProfileContainerGroupNamingPolicyGuidNamingPolicy guidNamingPolicy) { + this.guidNamingPolicy = guidNamingPolicy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (guidNamingPolicy() != null) { + guidNamingPolicy().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("guidNamingPolicy", this.guidNamingPolicy); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ElasticProfileContainerGroupNamingPolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ElasticProfileContainerGroupNamingPolicy if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ElasticProfileContainerGroupNamingPolicy. + */ + public static ElasticProfileContainerGroupNamingPolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ElasticProfileContainerGroupNamingPolicy deserializedElasticProfileContainerGroupNamingPolicy + = new ElasticProfileContainerGroupNamingPolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("guidNamingPolicy".equals(fieldName)) { + deserializedElasticProfileContainerGroupNamingPolicy.guidNamingPolicy + = ElasticProfileContainerGroupNamingPolicyGuidNamingPolicy.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedElasticProfileContainerGroupNamingPolicy; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ElasticProfileContainerGroupNamingPolicyGuidNamingPolicy.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ElasticProfileContainerGroupNamingPolicyGuidNamingPolicy.java new file mode 100644 index 000000000000..771721b3c5f7 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ElasticProfileContainerGroupNamingPolicyGuidNamingPolicy.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The ElasticProfileContainerGroupNamingPolicyGuidNamingPolicy model. + */ +@Fluent +public final class ElasticProfileContainerGroupNamingPolicyGuidNamingPolicy + implements JsonSerializable { + /* + * The prefix can be used when there are tooling limitations (e.g. on the Azure portal where CGs from multiple + * NGroups exist in the same RG). The prefix with the suffixed resource name must still follow Azure resource naming + * guidelines. + */ + private String prefix; + + /** + * Creates an instance of ElasticProfileContainerGroupNamingPolicyGuidNamingPolicy class. + */ + public ElasticProfileContainerGroupNamingPolicyGuidNamingPolicy() { + } + + /** + * Get the prefix property: The prefix can be used when there are tooling limitations (e.g. on the Azure portal + * where CGs from multiple NGroups exist in the same RG). The prefix with the suffixed resource name must still + * follow Azure resource naming guidelines. + * + * @return the prefix value. + */ + public String prefix() { + return this.prefix; + } + + /** + * Set the prefix property: The prefix can be used when there are tooling limitations (e.g. on the Azure portal + * where CGs from multiple NGroups exist in the same RG). The prefix with the suffixed resource name must still + * follow Azure resource naming guidelines. + * + * @param prefix the prefix value to set. + * @return the ElasticProfileContainerGroupNamingPolicyGuidNamingPolicy object itself. + */ + public ElasticProfileContainerGroupNamingPolicyGuidNamingPolicy withPrefix(String prefix) { + this.prefix = prefix; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("prefix", this.prefix); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ElasticProfileContainerGroupNamingPolicyGuidNamingPolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ElasticProfileContainerGroupNamingPolicyGuidNamingPolicy if the JsonReader was pointing to + * an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the + * ElasticProfileContainerGroupNamingPolicyGuidNamingPolicy. + */ + public static ElasticProfileContainerGroupNamingPolicyGuidNamingPolicy fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + ElasticProfileContainerGroupNamingPolicyGuidNamingPolicy deserializedElasticProfileContainerGroupNamingPolicyGuidNamingPolicy + = new ElasticProfileContainerGroupNamingPolicyGuidNamingPolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("prefix".equals(fieldName)) { + deserializedElasticProfileContainerGroupNamingPolicyGuidNamingPolicy.prefix = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedElasticProfileContainerGroupNamingPolicyGuidNamingPolicy; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/EncryptionProperties.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/EncryptionProperties.java new file mode 100644 index 000000000000..d2a1e54c466e --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/EncryptionProperties.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The container group encryption properties. + */ +@Fluent +public final class EncryptionProperties implements JsonSerializable { + /* + * The keyvault base url. + */ + private String vaultBaseUrl; + + /* + * The encryption key name. + */ + private String keyName; + + /* + * The encryption key version. + */ + private String keyVersion; + + /* + * The keyvault managed identity. + */ + private String identity; + + /** + * Creates an instance of EncryptionProperties class. + */ + public EncryptionProperties() { + } + + /** + * Get the vaultBaseUrl property: The keyvault base url. + * + * @return the vaultBaseUrl value. + */ + public String vaultBaseUrl() { + return this.vaultBaseUrl; + } + + /** + * Set the vaultBaseUrl property: The keyvault base url. + * + * @param vaultBaseUrl the vaultBaseUrl value to set. + * @return the EncryptionProperties object itself. + */ + public EncryptionProperties withVaultBaseUrl(String vaultBaseUrl) { + this.vaultBaseUrl = vaultBaseUrl; + return this; + } + + /** + * Get the keyName property: The encryption key name. + * + * @return the keyName value. + */ + public String keyName() { + return this.keyName; + } + + /** + * Set the keyName property: The encryption key name. + * + * @param keyName the keyName value to set. + * @return the EncryptionProperties object itself. + */ + public EncryptionProperties withKeyName(String keyName) { + this.keyName = keyName; + return this; + } + + /** + * Get the keyVersion property: The encryption key version. + * + * @return the keyVersion value. + */ + public String keyVersion() { + return this.keyVersion; + } + + /** + * Set the keyVersion property: The encryption key version. + * + * @param keyVersion the keyVersion value to set. + * @return the EncryptionProperties object itself. + */ + public EncryptionProperties withKeyVersion(String keyVersion) { + this.keyVersion = keyVersion; + return this; + } + + /** + * Get the identity property: The keyvault managed identity. + * + * @return the identity value. + */ + public String identity() { + return this.identity; + } + + /** + * Set the identity property: The keyvault managed identity. + * + * @param identity the identity value to set. + * @return the EncryptionProperties object itself. + */ + public EncryptionProperties withIdentity(String identity) { + this.identity = identity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (vaultBaseUrl() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property vaultBaseUrl in model EncryptionProperties")); + } + if (keyName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property keyName in model EncryptionProperties")); + } + if (keyVersion() == null) { + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property keyVersion in model EncryptionProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(EncryptionProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("vaultBaseUrl", this.vaultBaseUrl); + jsonWriter.writeStringField("keyName", this.keyName); + jsonWriter.writeStringField("keyVersion", this.keyVersion); + jsonWriter.writeStringField("identity", this.identity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EncryptionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EncryptionProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EncryptionProperties. + */ + public static EncryptionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EncryptionProperties deserializedEncryptionProperties = new EncryptionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("vaultBaseUrl".equals(fieldName)) { + deserializedEncryptionProperties.vaultBaseUrl = reader.getString(); + } else if ("keyName".equals(fieldName)) { + deserializedEncryptionProperties.keyName = reader.getString(); + } else if ("keyVersion".equals(fieldName)) { + deserializedEncryptionProperties.keyVersion = reader.getString(); + } else if ("identity".equals(fieldName)) { + deserializedEncryptionProperties.identity = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEncryptionProperties; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/EnvironmentVariable.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/EnvironmentVariable.java new file mode 100644 index 000000000000..cafecb6b12d3 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/EnvironmentVariable.java @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The environment variable to set within the container instance. + */ +@Fluent +public final class EnvironmentVariable implements JsonSerializable { + /* + * The name of the environment variable. + */ + private String name; + + /* + * The value of the environment variable. + */ + private String value; + + /* + * The value of the secure environment variable. + */ + private String secureValue; + + /* + * The reference of the secure environment variable. + */ + private String secureValueReference; + + /** + * Creates an instance of EnvironmentVariable class. + */ + public EnvironmentVariable() { + } + + /** + * Get the name property: The name of the environment variable. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the environment variable. + * + * @param name the name value to set. + * @return the EnvironmentVariable object itself. + */ + public EnvironmentVariable withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value property: The value of the environment variable. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The value of the environment variable. + * + * @param value the value value to set. + * @return the EnvironmentVariable object itself. + */ + public EnvironmentVariable withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the secureValue property: The value of the secure environment variable. + * + * @return the secureValue value. + */ + public String secureValue() { + return this.secureValue; + } + + /** + * Set the secureValue property: The value of the secure environment variable. + * + * @param secureValue the secureValue value to set. + * @return the EnvironmentVariable object itself. + */ + public EnvironmentVariable withSecureValue(String secureValue) { + this.secureValue = secureValue; + return this; + } + + /** + * Get the secureValueReference property: The reference of the secure environment variable. + * + * @return the secureValueReference value. + */ + public String secureValueReference() { + return this.secureValueReference; + } + + /** + * Set the secureValueReference property: The reference of the secure environment variable. + * + * @param secureValueReference the secureValueReference value to set. + * @return the EnvironmentVariable object itself. + */ + public EnvironmentVariable withSecureValueReference(String secureValueReference) { + this.secureValueReference = secureValueReference; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property name in model EnvironmentVariable")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(EnvironmentVariable.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("value", this.value); + jsonWriter.writeStringField("secureValue", this.secureValue); + jsonWriter.writeStringField("secureValueReference", this.secureValueReference); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EnvironmentVariable from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EnvironmentVariable if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EnvironmentVariable. + */ + public static EnvironmentVariable fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EnvironmentVariable deserializedEnvironmentVariable = new EnvironmentVariable(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedEnvironmentVariable.name = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedEnvironmentVariable.value = reader.getString(); + } else if ("secureValue".equals(fieldName)) { + deserializedEnvironmentVariable.secureValue = reader.getString(); + } else if ("secureValueReference".equals(fieldName)) { + deserializedEnvironmentVariable.secureValueReference = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEnvironmentVariable; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Event.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Event.java new file mode 100644 index 000000000000..03e847336b1b --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Event.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * A container group or container instance event. + */ +@Immutable +public final class Event implements JsonSerializable { + /* + * The count of the event. + */ + private Integer count; + + /* + * The date-time of the earliest logged event. + */ + private OffsetDateTime firstTimestamp; + + /* + * The date-time of the latest logged event. + */ + private OffsetDateTime lastTimestamp; + + /* + * The event name. + */ + private String name; + + /* + * The event message. + */ + private String message; + + /* + * The event type. + */ + private String type; + + /** + * Creates an instance of Event class. + */ + public Event() { + } + + /** + * Get the count property: The count of the event. + * + * @return the count value. + */ + public Integer count() { + return this.count; + } + + /** + * Get the firstTimestamp property: The date-time of the earliest logged event. + * + * @return the firstTimestamp value. + */ + public OffsetDateTime firstTimestamp() { + return this.firstTimestamp; + } + + /** + * Get the lastTimestamp property: The date-time of the latest logged event. + * + * @return the lastTimestamp value. + */ + public OffsetDateTime lastTimestamp() { + return this.lastTimestamp; + } + + /** + * Get the name property: The event name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the message property: The event message. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Get the type property: The event type. + * + * @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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Event from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Event if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Event. + */ + public static Event fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Event deserializedEvent = new Event(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("count".equals(fieldName)) { + deserializedEvent.count = reader.getNullable(JsonReader::getInt); + } else if ("firstTimestamp".equals(fieldName)) { + deserializedEvent.firstTimestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastTimestamp".equals(fieldName)) { + deserializedEvent.lastTimestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("name".equals(fieldName)) { + deserializedEvent.name = reader.getString(); + } else if ("message".equals(fieldName)) { + deserializedEvent.message = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedEvent.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEvent; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/FileShare.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/FileShare.java new file mode 100644 index 000000000000..3976c751eaf9 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/FileShare.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.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * File shares that can be mounted on container groups. + */ +@Fluent +public final class FileShare implements JsonSerializable { + /* + * The name property. + */ + private String name; + + /* + * The resourceGroupName property. + */ + private String resourceGroupName; + + /* + * The storageAccountName property. + */ + private String storageAccountName; + + /* + * The properties property. + */ + private FileShareProperties properties; + + /** + * Creates an instance of FileShare class. + */ + public FileShare() { + } + + /** + * Get the name property: The name property. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name property. + * + * @param name the name value to set. + * @return the FileShare object itself. + */ + public FileShare withName(String name) { + this.name = name; + return this; + } + + /** + * Get the resourceGroupName property: The resourceGroupName property. + * + * @return the resourceGroupName value. + */ + public String resourceGroupName() { + return this.resourceGroupName; + } + + /** + * Set the resourceGroupName property: The resourceGroupName property. + * + * @param resourceGroupName the resourceGroupName value to set. + * @return the FileShare object itself. + */ + public FileShare withResourceGroupName(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + /** + * Get the storageAccountName property: The storageAccountName property. + * + * @return the storageAccountName value. + */ + public String storageAccountName() { + return this.storageAccountName; + } + + /** + * Set the storageAccountName property: The storageAccountName property. + * + * @param storageAccountName the storageAccountName value to set. + * @return the FileShare object itself. + */ + public FileShare withStorageAccountName(String storageAccountName) { + this.storageAccountName = storageAccountName; + return this; + } + + /** + * Get the properties property: The properties property. + * + * @return the properties value. + */ + public FileShareProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The properties property. + * + * @param properties the properties value to set. + * @return the FileShare object itself. + */ + public FileShare withProperties(FileShareProperties 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("resourceGroupName", this.resourceGroupName); + jsonWriter.writeStringField("storageAccountName", this.storageAccountName); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FileShare from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FileShare if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the FileShare. + */ + public static FileShare fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FileShare deserializedFileShare = new FileShare(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedFileShare.name = reader.getString(); + } else if ("resourceGroupName".equals(fieldName)) { + deserializedFileShare.resourceGroupName = reader.getString(); + } else if ("storageAccountName".equals(fieldName)) { + deserializedFileShare.storageAccountName = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedFileShare.properties = FileShareProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFileShare; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/FileShareProperties.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/FileShareProperties.java new file mode 100644 index 000000000000..45959940dc42 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/FileShareProperties.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The FileShareProperties model. + */ +@Fluent +public final class FileShareProperties implements JsonSerializable { + /* + * Specifies how Container Groups can access the Azure file share i.e. all CG will share same Azure file share or + * going to have exclusive file share. + */ + private AzureFileShareAccessType shareAccessType; + + /* + * Access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. + * FileStorage account can choose Premium. Learn more at: + * https://learn.microsoft.com/en-us/rest/api/storagerp/file-shares/create?tabs=HTTP#shareaccesstier + */ + private AzureFileShareAccessTier shareAccessTier; + + /** + * Creates an instance of FileShareProperties class. + */ + public FileShareProperties() { + } + + /** + * Get the shareAccessType property: Specifies how Container Groups can access the Azure file share i.e. all CG will + * share same Azure file share or going to have exclusive file share. + * + * @return the shareAccessType value. + */ + public AzureFileShareAccessType shareAccessType() { + return this.shareAccessType; + } + + /** + * Set the shareAccessType property: Specifies how Container Groups can access the Azure file share i.e. all CG will + * share same Azure file share or going to have exclusive file share. + * + * @param shareAccessType the shareAccessType value to set. + * @return the FileShareProperties object itself. + */ + public FileShareProperties withShareAccessType(AzureFileShareAccessType shareAccessType) { + this.shareAccessType = shareAccessType; + return this; + } + + /** + * Get the shareAccessTier property: Access tier for specific share. GpV2 account can choose between + * TransactionOptimized (default), Hot, and Cool. FileStorage account can choose Premium. Learn more at: + * https://learn.microsoft.com/en-us/rest/api/storagerp/file-shares/create?tabs=HTTP#shareaccesstier. + * + * @return the shareAccessTier value. + */ + public AzureFileShareAccessTier shareAccessTier() { + return this.shareAccessTier; + } + + /** + * Set the shareAccessTier property: Access tier for specific share. GpV2 account can choose between + * TransactionOptimized (default), Hot, and Cool. FileStorage account can choose Premium. Learn more at: + * https://learn.microsoft.com/en-us/rest/api/storagerp/file-shares/create?tabs=HTTP#shareaccesstier. + * + * @param shareAccessTier the shareAccessTier value to set. + * @return the FileShareProperties object itself. + */ + public FileShareProperties withShareAccessTier(AzureFileShareAccessTier shareAccessTier) { + this.shareAccessTier = shareAccessTier; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("shareAccessType", + this.shareAccessType == null ? null : this.shareAccessType.toString()); + jsonWriter.writeStringField("shareAccessTier", + this.shareAccessTier == null ? null : this.shareAccessTier.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FileShareProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FileShareProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the FileShareProperties. + */ + public static FileShareProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FileShareProperties deserializedFileShareProperties = new FileShareProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("shareAccessType".equals(fieldName)) { + deserializedFileShareProperties.shareAccessType + = AzureFileShareAccessType.fromString(reader.getString()); + } else if ("shareAccessTier".equals(fieldName)) { + deserializedFileShareProperties.shareAccessTier + = AzureFileShareAccessTier.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedFileShareProperties; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/GitRepoVolume.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/GitRepoVolume.java new file mode 100644 index 000000000000..cff2ed057a65 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/GitRepoVolume.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.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents a volume that is populated with the contents of a git repository. + */ +@Fluent +public final class GitRepoVolume implements JsonSerializable { + /* + * Target directory name. Must not contain or start with '..'. If '.' is supplied, the volume directory will be the + * git repository. Otherwise, if specified, the volume will contain the git repository in the subdirectory with the + * given name. + */ + private String directory; + + /* + * Repository URL + */ + private String repository; + + /* + * Commit hash for the specified revision. + */ + private String revision; + + /** + * Creates an instance of GitRepoVolume class. + */ + public GitRepoVolume() { + } + + /** + * Get the directory property: Target directory name. Must not contain or start with '..'. If '.' is supplied, the + * volume directory will be the git repository. Otherwise, if specified, the volume will contain the git repository + * in the subdirectory with the given name. + * + * @return the directory value. + */ + public String directory() { + return this.directory; + } + + /** + * Set the directory property: Target directory name. Must not contain or start with '..'. If '.' is supplied, the + * volume directory will be the git repository. Otherwise, if specified, the volume will contain the git repository + * in the subdirectory with the given name. + * + * @param directory the directory value to set. + * @return the GitRepoVolume object itself. + */ + public GitRepoVolume withDirectory(String directory) { + this.directory = directory; + return this; + } + + /** + * Get the repository property: Repository URL. + * + * @return the repository value. + */ + public String repository() { + return this.repository; + } + + /** + * Set the repository property: Repository URL. + * + * @param repository the repository value to set. + * @return the GitRepoVolume object itself. + */ + public GitRepoVolume withRepository(String repository) { + this.repository = repository; + return this; + } + + /** + * Get the revision property: Commit hash for the specified revision. + * + * @return the revision value. + */ + public String revision() { + return this.revision; + } + + /** + * Set the revision property: Commit hash for the specified revision. + * + * @param revision the revision value to set. + * @return the GitRepoVolume object itself. + */ + public GitRepoVolume withRevision(String revision) { + this.revision = revision; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (repository() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property repository in model GitRepoVolume")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GitRepoVolume.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("repository", this.repository); + jsonWriter.writeStringField("directory", this.directory); + jsonWriter.writeStringField("revision", this.revision); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GitRepoVolume from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GitRepoVolume if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GitRepoVolume. + */ + public static GitRepoVolume fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GitRepoVolume deserializedGitRepoVolume = new GitRepoVolume(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("repository".equals(fieldName)) { + deserializedGitRepoVolume.repository = reader.getString(); + } else if ("directory".equals(fieldName)) { + deserializedGitRepoVolume.directory = reader.getString(); + } else if ("revision".equals(fieldName)) { + deserializedGitRepoVolume.revision = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedGitRepoVolume; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/GpuResource.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/GpuResource.java new file mode 100644 index 000000000000..e129dbbd0760 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/GpuResource.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The GPU resource. + */ +@Fluent +public final class GpuResource implements JsonSerializable { + /* + * The count of the GPU resource. + */ + private int count; + + /* + * The SKU of the GPU resource. + */ + private GpuSku sku; + + /** + * Creates an instance of GpuResource class. + */ + public GpuResource() { + } + + /** + * Get the count property: The count of the GPU resource. + * + * @return the count value. + */ + public int count() { + return this.count; + } + + /** + * Set the count property: The count of the GPU resource. + * + * @param count the count value to set. + * @return the GpuResource object itself. + */ + public GpuResource withCount(int count) { + this.count = count; + return this; + } + + /** + * Get the sku property: The SKU of the GPU resource. + * + * @return the sku value. + */ + public GpuSku sku() { + return this.sku; + } + + /** + * Set the sku property: The SKU of the GPU resource. + * + * @param sku the sku value to set. + * @return the GpuResource object itself. + */ + public GpuResource withSku(GpuSku sku) { + this.sku = sku; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property sku in model GpuResource")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GpuResource.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("count", this.count); + jsonWriter.writeStringField("sku", this.sku == null ? null : this.sku.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GpuResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GpuResource if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GpuResource. + */ + public static GpuResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GpuResource deserializedGpuResource = new GpuResource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("count".equals(fieldName)) { + deserializedGpuResource.count = reader.getInt(); + } else if ("sku".equals(fieldName)) { + deserializedGpuResource.sku = GpuSku.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedGpuResource; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/GpuSku.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/GpuSku.java new file mode 100644 index 000000000000..3e6bd2804703 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/GpuSku.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The SKU of the GPU resource. + */ +public final class GpuSku extends ExpandableStringEnum { + /** + * Static value K80 for GpuSku. + */ + public static final GpuSku K80 = fromString("K80"); + + /** + * Static value P100 for GpuSku. + */ + public static final GpuSku P100 = fromString("P100"); + + /** + * Static value V100 for GpuSku. + */ + public static final GpuSku V100 = fromString("V100"); + + /** + * Creates a new instance of GpuSku value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public GpuSku() { + } + + /** + * Creates or finds a GpuSku from its string representation. + * + * @param name a name to look for. + * @return the corresponding GpuSku. + */ + public static GpuSku fromString(String name) { + return fromString(name, GpuSku.class); + } + + /** + * Gets known GpuSku values. + * + * @return known GpuSku values. + */ + public static Collection values() { + return values(GpuSku.class); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/HttpHeader.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/HttpHeader.java new file mode 100644 index 000000000000..fbae49aca1cd --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/HttpHeader.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The HTTP header. + */ +@Fluent +public final class HttpHeader implements JsonSerializable { + /* + * The header name. + */ + private String name; + + /* + * The header value. + */ + private String value; + + /** + * Creates an instance of HttpHeader class. + */ + public HttpHeader() { + } + + /** + * Get the name property: The header name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The header name. + * + * @param name the name value to set. + * @return the HttpHeader object itself. + */ + public HttpHeader withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value property: The header value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The header value. + * + * @param value the value value to set. + * @return the HttpHeader object itself. + */ + public HttpHeader withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HttpHeader from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HttpHeader if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the HttpHeader. + */ + public static HttpHeader fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HttpHeader deserializedHttpHeader = new HttpHeader(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedHttpHeader.name = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedHttpHeader.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedHttpHeader; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/IdentityAccessControl.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/IdentityAccessControl.java new file mode 100644 index 000000000000..7e9b15d276c3 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/IdentityAccessControl.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The access control for an identity. + */ +@Fluent +public final class IdentityAccessControl implements JsonSerializable { + /* + * The access level of the identity. + */ + private IdentityAccessLevel access; + + /* + * An identity. + */ + private String identity; + + /** + * Creates an instance of IdentityAccessControl class. + */ + public IdentityAccessControl() { + } + + /** + * Get the access property: The access level of the identity. + * + * @return the access value. + */ + public IdentityAccessLevel access() { + return this.access; + } + + /** + * Set the access property: The access level of the identity. + * + * @param access the access value to set. + * @return the IdentityAccessControl object itself. + */ + public IdentityAccessControl withAccess(IdentityAccessLevel access) { + this.access = access; + return this; + } + + /** + * Get the identity property: An identity. + * + * @return the identity value. + */ + public String identity() { + return this.identity; + } + + /** + * Set the identity property: An identity. + * + * @param identity the identity value to set. + * @return the IdentityAccessControl object itself. + */ + public IdentityAccessControl withIdentity(String identity) { + this.identity = identity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("access", this.access == null ? null : this.access.toString()); + jsonWriter.writeStringField("identity", this.identity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IdentityAccessControl from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IdentityAccessControl if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the IdentityAccessControl. + */ + public static IdentityAccessControl fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IdentityAccessControl deserializedIdentityAccessControl = new IdentityAccessControl(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("access".equals(fieldName)) { + deserializedIdentityAccessControl.access = IdentityAccessLevel.fromString(reader.getString()); + } else if ("identity".equals(fieldName)) { + deserializedIdentityAccessControl.identity = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedIdentityAccessControl; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/IdentityAccessLevel.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/IdentityAccessLevel.java new file mode 100644 index 000000000000..ffe6b1b9d2d6 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/IdentityAccessLevel.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The access level of an identity. + */ +public final class IdentityAccessLevel extends ExpandableStringEnum { + /** + * Static value All for IdentityAccessLevel. + */ + public static final IdentityAccessLevel ALL = fromString("All"); + + /** + * Static value System for IdentityAccessLevel. + */ + public static final IdentityAccessLevel SYSTEM = fromString("System"); + + /** + * Static value User for IdentityAccessLevel. + */ + public static final IdentityAccessLevel USER = fromString("User"); + + /** + * Creates a new instance of IdentityAccessLevel value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IdentityAccessLevel() { + } + + /** + * Creates or finds a IdentityAccessLevel from its string representation. + * + * @param name a name to look for. + * @return the corresponding IdentityAccessLevel. + */ + public static IdentityAccessLevel fromString(String name) { + return fromString(name, IdentityAccessLevel.class); + } + + /** + * Gets known IdentityAccessLevel values. + * + * @return known IdentityAccessLevel values. + */ + public static Collection values() { + return values(IdentityAccessLevel.class); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/IdentityAcls.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/IdentityAcls.java new file mode 100644 index 000000000000..30646eb235ae --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/IdentityAcls.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The access control levels of the identities. + */ +@Fluent +public final class IdentityAcls implements JsonSerializable { + /* + * The default access level. + */ + private IdentityAccessLevel defaultAccess; + + /* + * The access control levels for each identity. + */ + private List acls; + + /** + * Creates an instance of IdentityAcls class. + */ + public IdentityAcls() { + } + + /** + * Get the defaultAccess property: The default access level. + * + * @return the defaultAccess value. + */ + public IdentityAccessLevel defaultAccess() { + return this.defaultAccess; + } + + /** + * Set the defaultAccess property: The default access level. + * + * @param defaultAccess the defaultAccess value to set. + * @return the IdentityAcls object itself. + */ + public IdentityAcls withDefaultAccess(IdentityAccessLevel defaultAccess) { + this.defaultAccess = defaultAccess; + return this; + } + + /** + * Get the acls property: The access control levels for each identity. + * + * @return the acls value. + */ + public List acls() { + return this.acls; + } + + /** + * Set the acls property: The access control levels for each identity. + * + * @param acls the acls value to set. + * @return the IdentityAcls object itself. + */ + public IdentityAcls withAcls(List acls) { + this.acls = acls; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (acls() != null) { + acls().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("defaultAccess", this.defaultAccess == null ? null : this.defaultAccess.toString()); + jsonWriter.writeArrayField("acls", this.acls, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IdentityAcls from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IdentityAcls if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the IdentityAcls. + */ + public static IdentityAcls fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IdentityAcls deserializedIdentityAcls = new IdentityAcls(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("defaultAccess".equals(fieldName)) { + deserializedIdentityAcls.defaultAccess = IdentityAccessLevel.fromString(reader.getString()); + } else if ("acls".equals(fieldName)) { + List acls + = reader.readArray(reader1 -> IdentityAccessControl.fromJson(reader1)); + deserializedIdentityAcls.acls = acls; + } else { + reader.skipChildren(); + } + } + + return deserializedIdentityAcls; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ImageRegistryCredential.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ImageRegistryCredential.java new file mode 100644 index 000000000000..102313684aa6 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ImageRegistryCredential.java @@ -0,0 +1,241 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Image registry credential. + */ +@Fluent +public final class ImageRegistryCredential implements JsonSerializable { + /* + * The Docker image registry server without a protocol such as "http" and "https". + */ + private String server; + + /* + * The username for the private registry. + */ + private String username; + + /* + * The password for the private registry. + */ + private String password; + + /* + * The reference for the private registry password. + */ + private String passwordReference; + + /* + * The identity for the private registry. + */ + private String identity; + + /* + * The identity URL for the private registry. + */ + private String identityUrl; + + /** + * Creates an instance of ImageRegistryCredential class. + */ + public ImageRegistryCredential() { + } + + /** + * Get the server property: The Docker image registry server without a protocol such as "http" and "https". + * + * @return the server value. + */ + public String server() { + return this.server; + } + + /** + * Set the server property: The Docker image registry server without a protocol such as "http" and "https". + * + * @param server the server value to set. + * @return the ImageRegistryCredential object itself. + */ + public ImageRegistryCredential withServer(String server) { + this.server = server; + return this; + } + + /** + * Get the username property: The username for the private registry. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: The username for the private registry. + * + * @param username the username value to set. + * @return the ImageRegistryCredential object itself. + */ + public ImageRegistryCredential withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the password property: The password for the private registry. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Set the password property: The password for the private registry. + * + * @param password the password value to set. + * @return the ImageRegistryCredential object itself. + */ + public ImageRegistryCredential withPassword(String password) { + this.password = password; + return this; + } + + /** + * Get the passwordReference property: The reference for the private registry password. + * + * @return the passwordReference value. + */ + public String passwordReference() { + return this.passwordReference; + } + + /** + * Set the passwordReference property: The reference for the private registry password. + * + * @param passwordReference the passwordReference value to set. + * @return the ImageRegistryCredential object itself. + */ + public ImageRegistryCredential withPasswordReference(String passwordReference) { + this.passwordReference = passwordReference; + return this; + } + + /** + * Get the identity property: The identity for the private registry. + * + * @return the identity value. + */ + public String identity() { + return this.identity; + } + + /** + * Set the identity property: The identity for the private registry. + * + * @param identity the identity value to set. + * @return the ImageRegistryCredential object itself. + */ + public ImageRegistryCredential withIdentity(String identity) { + this.identity = identity; + return this; + } + + /** + * Get the identityUrl property: The identity URL for the private registry. + * + * @return the identityUrl value. + */ + public String identityUrl() { + return this.identityUrl; + } + + /** + * Set the identityUrl property: The identity URL for the private registry. + * + * @param identityUrl the identityUrl value to set. + * @return the ImageRegistryCredential object itself. + */ + public ImageRegistryCredential withIdentityUrl(String identityUrl) { + this.identityUrl = identityUrl; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (server() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property server in model ImageRegistryCredential")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ImageRegistryCredential.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("server", this.server); + jsonWriter.writeStringField("username", this.username); + jsonWriter.writeStringField("password", this.password); + jsonWriter.writeStringField("passwordReference", this.passwordReference); + jsonWriter.writeStringField("identity", this.identity); + jsonWriter.writeStringField("identityUrl", this.identityUrl); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImageRegistryCredential from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImageRegistryCredential if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ImageRegistryCredential. + */ + public static ImageRegistryCredential fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImageRegistryCredential deserializedImageRegistryCredential = new ImageRegistryCredential(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("server".equals(fieldName)) { + deserializedImageRegistryCredential.server = reader.getString(); + } else if ("username".equals(fieldName)) { + deserializedImageRegistryCredential.username = reader.getString(); + } else if ("password".equals(fieldName)) { + deserializedImageRegistryCredential.password = reader.getString(); + } else if ("passwordReference".equals(fieldName)) { + deserializedImageRegistryCredential.passwordReference = reader.getString(); + } else if ("identity".equals(fieldName)) { + deserializedImageRegistryCredential.identity = reader.getString(); + } else if ("identityUrl".equals(fieldName)) { + deserializedImageRegistryCredential.identityUrl = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedImageRegistryCredential; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/InitContainerDefinition.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/InitContainerDefinition.java new file mode 100644 index 000000000000..f034bc8b3959 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/InitContainerDefinition.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.InitContainerPropertiesDefinition; +import java.io.IOException; +import java.util.List; + +/** + * The init container definition. + */ +@Fluent +public final class InitContainerDefinition implements JsonSerializable { + /* + * The name for the init container. + */ + private String name; + + /* + * The properties for the init container. + */ + private InitContainerPropertiesDefinition innerProperties = new InitContainerPropertiesDefinition(); + + /** + * Creates an instance of InitContainerDefinition class. + */ + public InitContainerDefinition() { + } + + /** + * Get the name property: The name for the init container. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name for the init container. + * + * @param name the name value to set. + * @return the InitContainerDefinition object itself. + */ + public InitContainerDefinition withName(String name) { + this.name = name; + return this; + } + + /** + * Get the innerProperties property: The properties for the init container. + * + * @return the innerProperties value. + */ + private InitContainerPropertiesDefinition innerProperties() { + return this.innerProperties; + } + + /** + * Get the image property: The image of the init container. + * + * @return the image value. + */ + public String image() { + return this.innerProperties() == null ? null : this.innerProperties().image(); + } + + /** + * Set the image property: The image of the init container. + * + * @param image the image value to set. + * @return the InitContainerDefinition object itself. + */ + public InitContainerDefinition withImage(String image) { + if (this.innerProperties() == null) { + this.innerProperties = new InitContainerPropertiesDefinition(); + } + this.innerProperties().withImage(image); + return this; + } + + /** + * Get the command property: The command to execute within the init container in exec form. + * + * @return the command value. + */ + public List command() { + return this.innerProperties() == null ? null : this.innerProperties().command(); + } + + /** + * Set the command property: The command to execute within the init container in exec form. + * + * @param command the command value to set. + * @return the InitContainerDefinition object itself. + */ + public InitContainerDefinition withCommand(List command) { + if (this.innerProperties() == null) { + this.innerProperties = new InitContainerPropertiesDefinition(); + } + this.innerProperties().withCommand(command); + return this; + } + + /** + * Get the environmentVariables property: The environment variables to set in the init container. + * + * @return the environmentVariables value. + */ + public List environmentVariables() { + return this.innerProperties() == null ? null : this.innerProperties().environmentVariables(); + } + + /** + * Set the environmentVariables property: The environment variables to set in the init container. + * + * @param environmentVariables the environmentVariables value to set. + * @return the InitContainerDefinition object itself. + */ + public InitContainerDefinition withEnvironmentVariables(List environmentVariables) { + if (this.innerProperties() == null) { + this.innerProperties = new InitContainerPropertiesDefinition(); + } + this.innerProperties().withEnvironmentVariables(environmentVariables); + return this; + } + + /** + * Get the instanceView property: The instance view of the init container. Only valid in response. + * + * @return the instanceView value. + */ + public InitContainerPropertiesDefinitionInstanceView instanceView() { + return this.innerProperties() == null ? null : this.innerProperties().instanceView(); + } + + /** + * Get the volumeMounts property: The volume mounts available to the init container. + * + * @return the volumeMounts value. + */ + public List volumeMounts() { + return this.innerProperties() == null ? null : this.innerProperties().volumeMounts(); + } + + /** + * Set the volumeMounts property: The volume mounts available to the init container. + * + * @param volumeMounts the volumeMounts value to set. + * @return the InitContainerDefinition object itself. + */ + public InitContainerDefinition withVolumeMounts(List volumeMounts) { + if (this.innerProperties() == null) { + this.innerProperties = new InitContainerPropertiesDefinition(); + } + this.innerProperties().withVolumeMounts(volumeMounts); + return this; + } + + /** + * Get the securityContext property: The container security properties. + * + * @return the securityContext value. + */ + public SecurityContextDefinition securityContext() { + return this.innerProperties() == null ? null : this.innerProperties().securityContext(); + } + + /** + * Set the securityContext property: The container security properties. + * + * @param securityContext the securityContext value to set. + * @return the InitContainerDefinition object itself. + */ + public InitContainerDefinition withSecurityContext(SecurityContextDefinition securityContext) { + if (this.innerProperties() == null) { + this.innerProperties = new InitContainerPropertiesDefinition(); + } + this.innerProperties().withSecurityContext(securityContext); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property name in model InitContainerDefinition")); + } + if (innerProperties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model InitContainerDefinition")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(InitContainerDefinition.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InitContainerDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InitContainerDefinition if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the InitContainerDefinition. + */ + public static InitContainerDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InitContainerDefinition deserializedInitContainerDefinition = new InitContainerDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedInitContainerDefinition.name = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedInitContainerDefinition.innerProperties + = InitContainerPropertiesDefinition.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedInitContainerDefinition; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/InitContainerPropertiesDefinitionInstanceView.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/InitContainerPropertiesDefinitionInstanceView.java new file mode 100644 index 000000000000..d5006427d5cc --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/InitContainerPropertiesDefinitionInstanceView.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The instance view of the init container. Only valid in response. + */ +@Immutable +public final class InitContainerPropertiesDefinitionInstanceView + implements JsonSerializable { + /* + * The number of times that the init container has been restarted. + */ + private Integer restartCount; + + /* + * The current state of the init container. + */ + private ContainerState currentState; + + /* + * The previous state of the init container. + */ + private ContainerState previousState; + + /* + * The events of the init container. + */ + private List events; + + /** + * Creates an instance of InitContainerPropertiesDefinitionInstanceView class. + */ + public InitContainerPropertiesDefinitionInstanceView() { + } + + /** + * Get the restartCount property: The number of times that the init container has been restarted. + * + * @return the restartCount value. + */ + public Integer restartCount() { + return this.restartCount; + } + + /** + * Get the currentState property: The current state of the init container. + * + * @return the currentState value. + */ + public ContainerState currentState() { + return this.currentState; + } + + /** + * Get the previousState property: The previous state of the init container. + * + * @return the previousState value. + */ + public ContainerState previousState() { + return this.previousState; + } + + /** + * Get the events property: The events of the init container. + * + * @return the events value. + */ + public List events() { + return this.events; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (currentState() != null) { + currentState().validate(); + } + if (previousState() != null) { + previousState().validate(); + } + if (events() != null) { + events().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InitContainerPropertiesDefinitionInstanceView from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InitContainerPropertiesDefinitionInstanceView if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the InitContainerPropertiesDefinitionInstanceView. + */ + public static InitContainerPropertiesDefinitionInstanceView fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InitContainerPropertiesDefinitionInstanceView deserializedInitContainerPropertiesDefinitionInstanceView + = new InitContainerPropertiesDefinitionInstanceView(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("restartCount".equals(fieldName)) { + deserializedInitContainerPropertiesDefinitionInstanceView.restartCount + = reader.getNullable(JsonReader::getInt); + } else if ("currentState".equals(fieldName)) { + deserializedInitContainerPropertiesDefinitionInstanceView.currentState + = ContainerState.fromJson(reader); + } else if ("previousState".equals(fieldName)) { + deserializedInitContainerPropertiesDefinitionInstanceView.previousState + = ContainerState.fromJson(reader); + } else if ("events".equals(fieldName)) { + List events = reader.readArray(reader1 -> Event.fromJson(reader1)); + deserializedInitContainerPropertiesDefinitionInstanceView.events = events; + } else { + reader.skipChildren(); + } + } + + return deserializedInitContainerPropertiesDefinitionInstanceView; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/IpAddress.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/IpAddress.java new file mode 100644 index 000000000000..943f166b1808 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/IpAddress.java @@ -0,0 +1,257 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * IP address for the container group. + */ +@Fluent +public final class IpAddress implements JsonSerializable { + /* + * The list of ports exposed on the container group. + */ + private List ports; + + /* + * Specifies if the IP is exposed to the public internet or private VNET. + */ + private ContainerGroupIpAddressType type; + + /* + * The IP exposed to the public internet. + */ + private String ip; + + /* + * The Dns name label for the IP. + */ + private String dnsNameLabel; + + /* + * The value representing the security enum. The 'Unsecure' value is the default value if not selected and means the + * object's domain name label is not secured against subdomain takeover. The 'TenantReuse' value is the default + * value if selected and means the object's domain name label can be reused within the same tenant. The + * 'SubscriptionReuse' value means the object's domain name label can be reused within the same subscription. The + * 'ResourceGroupReuse' value means the object's domain name label can be reused within the same resource group. The + * 'NoReuse' value means the object's domain name label cannot be reused within the same resource group, + * subscription, or tenant. + */ + private DnsNameLabelReusePolicy autoGeneratedDomainNameLabelScope; + + /* + * The FQDN for the IP. + */ + private String fqdn; + + /** + * Creates an instance of IpAddress class. + */ + public IpAddress() { + } + + /** + * Get the ports property: The list of ports exposed on the container group. + * + * @return the ports value. + */ + public List ports() { + return this.ports; + } + + /** + * Set the ports property: The list of ports exposed on the container group. + * + * @param ports the ports value to set. + * @return the IpAddress object itself. + */ + public IpAddress withPorts(List ports) { + this.ports = ports; + return this; + } + + /** + * Get the type property: Specifies if the IP is exposed to the public internet or private VNET. + * + * @return the type value. + */ + public ContainerGroupIpAddressType type() { + return this.type; + } + + /** + * Set the type property: Specifies if the IP is exposed to the public internet or private VNET. + * + * @param type the type value to set. + * @return the IpAddress object itself. + */ + public IpAddress withType(ContainerGroupIpAddressType type) { + this.type = type; + return this; + } + + /** + * Get the ip property: The IP exposed to the public internet. + * + * @return the ip value. + */ + public String ip() { + return this.ip; + } + + /** + * Set the ip property: The IP exposed to the public internet. + * + * @param ip the ip value to set. + * @return the IpAddress object itself. + */ + public IpAddress withIp(String ip) { + this.ip = ip; + return this; + } + + /** + * Get the dnsNameLabel property: The Dns name label for the IP. + * + * @return the dnsNameLabel value. + */ + public String dnsNameLabel() { + return this.dnsNameLabel; + } + + /** + * Set the dnsNameLabel property: The Dns name label for the IP. + * + * @param dnsNameLabel the dnsNameLabel value to set. + * @return the IpAddress object itself. + */ + public IpAddress withDnsNameLabel(String dnsNameLabel) { + this.dnsNameLabel = dnsNameLabel; + return this; + } + + /** + * Get the autoGeneratedDomainNameLabelScope property: The value representing the security enum. The 'Unsecure' + * value is the default value if not selected and means the object's domain name label is not secured against + * subdomain takeover. The 'TenantReuse' value is the default value if selected and means the object's domain name + * label can be reused within the same tenant. The 'SubscriptionReuse' value means the object's domain name label + * can be reused within the same subscription. The 'ResourceGroupReuse' value means the object's domain name label + * can be reused within the same resource group. The 'NoReuse' value means the object's domain name label cannot be + * reused within the same resource group, subscription, or tenant. + * + * @return the autoGeneratedDomainNameLabelScope value. + */ + public DnsNameLabelReusePolicy autoGeneratedDomainNameLabelScope() { + return this.autoGeneratedDomainNameLabelScope; + } + + /** + * Set the autoGeneratedDomainNameLabelScope property: The value representing the security enum. The 'Unsecure' + * value is the default value if not selected and means the object's domain name label is not secured against + * subdomain takeover. The 'TenantReuse' value is the default value if selected and means the object's domain name + * label can be reused within the same tenant. The 'SubscriptionReuse' value means the object's domain name label + * can be reused within the same subscription. The 'ResourceGroupReuse' value means the object's domain name label + * can be reused within the same resource group. The 'NoReuse' value means the object's domain name label cannot be + * reused within the same resource group, subscription, or tenant. + * + * @param autoGeneratedDomainNameLabelScope the autoGeneratedDomainNameLabelScope value to set. + * @return the IpAddress object itself. + */ + public IpAddress withAutoGeneratedDomainNameLabelScope(DnsNameLabelReusePolicy autoGeneratedDomainNameLabelScope) { + this.autoGeneratedDomainNameLabelScope = autoGeneratedDomainNameLabelScope; + return this; + } + + /** + * Get the fqdn property: The FQDN for the IP. + * + * @return the fqdn value. + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ports() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property ports in model IpAddress")); + } else { + ports().forEach(e -> e.validate()); + } + if (type() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property type in model IpAddress")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(IpAddress.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("ports", this.ports, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("ip", this.ip); + jsonWriter.writeStringField("dnsNameLabel", this.dnsNameLabel); + jsonWriter.writeStringField("autoGeneratedDomainNameLabelScope", + this.autoGeneratedDomainNameLabelScope == null ? null : this.autoGeneratedDomainNameLabelScope.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IpAddress from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IpAddress if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the IpAddress. + */ + public static IpAddress fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IpAddress deserializedIpAddress = new IpAddress(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ports".equals(fieldName)) { + List ports = reader.readArray(reader1 -> Port.fromJson(reader1)); + deserializedIpAddress.ports = ports; + } else if ("type".equals(fieldName)) { + deserializedIpAddress.type = ContainerGroupIpAddressType.fromString(reader.getString()); + } else if ("ip".equals(fieldName)) { + deserializedIpAddress.ip = reader.getString(); + } else if ("dnsNameLabel".equals(fieldName)) { + deserializedIpAddress.dnsNameLabel = reader.getString(); + } else if ("autoGeneratedDomainNameLabelScope".equals(fieldName)) { + deserializedIpAddress.autoGeneratedDomainNameLabelScope + = DnsNameLabelReusePolicy.fromString(reader.getString()); + } else if ("fqdn".equals(fieldName)) { + deserializedIpAddress.fqdn = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedIpAddress; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ListResultContainerGroup.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ListResultContainerGroup.java new file mode 100644 index 000000000000..79b2fd01b612 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ListResultContainerGroup.java @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.resourcemanager.containerinstance.generated.fluent.models.ListResultContainerGroupInner; +import java.util.List; +import java.util.Map; + +/** + * An immutable client-side representation of ListResultContainerGroup. + */ +public interface ListResultContainerGroup { + /** + * 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 zones property: The zones for the container group. + * + * @return the zones value. + */ + List zones(); + + /** + * Gets the identity property: The identity of the container group, if configured. + * + * @return the identity value. + */ + ContainerGroupIdentity identity(); + + /** + * Gets the provisioningState property: The provisioning state of the container group. This only appears in the + * response. + * + * @return the provisioningState value. + */ + ContainerGroupProvisioningState provisioningState(); + + /** + * Gets the secretReferences property: The secret references that will be referenced within the container group. + * + * @return the secretReferences value. + */ + List secretReferences(); + + /** + * Gets the containers property: The containers within the container group. + * + * @return the containers value. + */ + List containers(); + + /** + * Gets the imageRegistryCredentials property: The image registry credentials by which the container group is + * created from. + * + * @return the imageRegistryCredentials value. + */ + List imageRegistryCredentials(); + + /** + * Gets the restartPolicy property: Restart policy for all containers within the container group. + * - `Always` Always restart + * - `OnFailure` Restart on failure + * - `Never` Never restart. + * + * @return the restartPolicy value. + */ + ContainerGroupRestartPolicy restartPolicy(); + + /** + * Gets the ipAddress property: The IP address type of the container group. + * + * @return the ipAddress value. + */ + IpAddress ipAddress(); + + /** + * Gets the osType property: The operating system type required by the containers in the container group. + * + * @return the osType value. + */ + OperatingSystemTypes osType(); + + /** + * Gets the volumes property: The list of volumes that can be mounted by containers in this container group. + * + * @return the volumes value. + */ + List volumes(); + + /** + * Gets the diagnostics property: The diagnostic information for a container group. + * + * @return the diagnostics value. + */ + ContainerGroupDiagnostics diagnostics(); + + /** + * Gets the subnetIds property: The subnet resource IDs for a container group. + * + * @return the subnetIds value. + */ + List subnetIds(); + + /** + * Gets the dnsConfig property: The DNS config information for a container group. + * + * @return the dnsConfig value. + */ + DnsConfiguration dnsConfig(); + + /** + * Gets the sku property: The SKU for a container group. + * + * @return the sku value. + */ + ContainerGroupSku sku(); + + /** + * Gets the encryptionProperties property: The encryption properties for a container group. + * + * @return the encryptionProperties value. + */ + EncryptionProperties encryptionProperties(); + + /** + * Gets the initContainers property: The init containers for a container group. + * + * @return the initContainers value. + */ + List initContainers(); + + /** + * Gets the extensions property: extensions used by virtual kubelet. + * + * @return the extensions value. + */ + List extensions(); + + /** + * Gets the confidentialComputeProperties property: The properties for confidential container group. + * + * @return the confidentialComputeProperties value. + */ + ConfidentialComputeProperties confidentialComputeProperties(); + + /** + * Gets the priority property: The priority of the container group. + * + * @return the priority value. + */ + ContainerGroupPriority priority(); + + /** + * Gets the identityAcls property: The access control levels of the identities. + * + * @return the identityAcls value. + */ + IdentityAcls identityAcls(); + + /** + * Gets the inner com.azure.resourcemanager.containerinstance.generated.fluent.models.ListResultContainerGroupInner + * object. + * + * @return the inner object. + */ + ListResultContainerGroupInner innerModel(); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ListResultContainerGroupProperties.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ListResultContainerGroupProperties.java new file mode 100644 index 000000000000..e035368f3e0e --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ListResultContainerGroupProperties.java @@ -0,0 +1,552 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.ListResultContainerGroupPropertiesProperties; +import java.io.IOException; +import java.util.List; + +/** + * Properties of container group part of list result. + */ +@Fluent +public class ListResultContainerGroupProperties implements JsonSerializable { + /* + * The identity of the container group, if configured. + */ + private ContainerGroupIdentity identity; + + /* + * The container group properties + */ + private ListResultContainerGroupPropertiesProperties innerProperties + = new ListResultContainerGroupPropertiesProperties(); + + /** + * Creates an instance of ListResultContainerGroupProperties class. + */ + public ListResultContainerGroupProperties() { + } + + /** + * Get the identity property: The identity of the container group, if configured. + * + * @return the identity value. + */ + public ContainerGroupIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The identity of the container group, if configured. + * + * @param identity the identity value to set. + * @return the ListResultContainerGroupProperties object itself. + */ + public ListResultContainerGroupProperties withIdentity(ContainerGroupIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the innerProperties property: The container group properties. + * + * @return the innerProperties value. + */ + private ListResultContainerGroupPropertiesProperties innerProperties() { + return this.innerProperties; + } + + /** + * Set the innerProperties property: The container group properties. + * + * @param innerProperties the innerProperties value to set. + * @return the ListResultContainerGroupProperties object itself. + */ + ListResultContainerGroupProperties + withInnerProperties(ListResultContainerGroupPropertiesProperties innerProperties) { + this.innerProperties = innerProperties; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the container group. This only appears in the + * response. + * + * @return the provisioningState value. + */ + public ContainerGroupProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the secretReferences property: The secret references that will be referenced within the container group. + * + * @return the secretReferences value. + */ + public List secretReferences() { + return this.innerProperties() == null ? null : this.innerProperties().secretReferences(); + } + + /** + * Set the secretReferences property: The secret references that will be referenced within the container group. + * + * @param secretReferences the secretReferences value to set. + * @return the ListResultContainerGroupProperties object itself. + */ + public ListResultContainerGroupProperties withSecretReferences(List secretReferences) { + if (this.innerProperties() == null) { + this.innerProperties = new ListResultContainerGroupPropertiesProperties(); + } + this.innerProperties().withSecretReferences(secretReferences); + return this; + } + + /** + * Get the containers property: The containers within the container group. + * + * @return the containers value. + */ + public List containers() { + return this.innerProperties() == null ? null : this.innerProperties().containers(); + } + + /** + * Set the containers property: The containers within the container group. + * + * @param containers the containers value to set. + * @return the ListResultContainerGroupProperties object itself. + */ + public ListResultContainerGroupProperties withContainers(List containers) { + if (this.innerProperties() == null) { + this.innerProperties = new ListResultContainerGroupPropertiesProperties(); + } + this.innerProperties().withContainers(containers); + return this; + } + + /** + * Get the imageRegistryCredentials property: The image registry credentials by which the container group is created + * from. + * + * @return the imageRegistryCredentials value. + */ + public List imageRegistryCredentials() { + return this.innerProperties() == null ? null : this.innerProperties().imageRegistryCredentials(); + } + + /** + * Set the imageRegistryCredentials property: The image registry credentials by which the container group is created + * from. + * + * @param imageRegistryCredentials the imageRegistryCredentials value to set. + * @return the ListResultContainerGroupProperties object itself. + */ + public ListResultContainerGroupProperties + withImageRegistryCredentials(List imageRegistryCredentials) { + if (this.innerProperties() == null) { + this.innerProperties = new ListResultContainerGroupPropertiesProperties(); + } + this.innerProperties().withImageRegistryCredentials(imageRegistryCredentials); + return this; + } + + /** + * Get the restartPolicy property: Restart policy for all containers within the container group. + * - `Always` Always restart + * - `OnFailure` Restart on failure + * - `Never` Never restart. + * + * @return the restartPolicy value. + */ + public ContainerGroupRestartPolicy restartPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().restartPolicy(); + } + + /** + * Set the restartPolicy property: Restart policy for all containers within the container group. + * - `Always` Always restart + * - `OnFailure` Restart on failure + * - `Never` Never restart. + * + * @param restartPolicy the restartPolicy value to set. + * @return the ListResultContainerGroupProperties object itself. + */ + public ListResultContainerGroupProperties withRestartPolicy(ContainerGroupRestartPolicy restartPolicy) { + if (this.innerProperties() == null) { + this.innerProperties = new ListResultContainerGroupPropertiesProperties(); + } + this.innerProperties().withRestartPolicy(restartPolicy); + return this; + } + + /** + * Get the ipAddress property: The IP address type of the container group. + * + * @return the ipAddress value. + */ + public IpAddress ipAddress() { + return this.innerProperties() == null ? null : this.innerProperties().ipAddress(); + } + + /** + * Set the ipAddress property: The IP address type of the container group. + * + * @param ipAddress the ipAddress value to set. + * @return the ListResultContainerGroupProperties object itself. + */ + public ListResultContainerGroupProperties withIpAddress(IpAddress ipAddress) { + if (this.innerProperties() == null) { + this.innerProperties = new ListResultContainerGroupPropertiesProperties(); + } + this.innerProperties().withIpAddress(ipAddress); + return this; + } + + /** + * Get the osType property: The operating system type required by the containers in the container group. + * + * @return the osType value. + */ + public OperatingSystemTypes osType() { + return this.innerProperties() == null ? null : this.innerProperties().osType(); + } + + /** + * Set the osType property: The operating system type required by the containers in the container group. + * + * @param osType the osType value to set. + * @return the ListResultContainerGroupProperties object itself. + */ + public ListResultContainerGroupProperties withOsType(OperatingSystemTypes osType) { + if (this.innerProperties() == null) { + this.innerProperties = new ListResultContainerGroupPropertiesProperties(); + } + this.innerProperties().withOsType(osType); + return this; + } + + /** + * Get the volumes property: The list of volumes that can be mounted by containers in this container group. + * + * @return the volumes value. + */ + public List volumes() { + return this.innerProperties() == null ? null : this.innerProperties().volumes(); + } + + /** + * Set the volumes property: The list of volumes that can be mounted by containers in this container group. + * + * @param volumes the volumes value to set. + * @return the ListResultContainerGroupProperties object itself. + */ + public ListResultContainerGroupProperties withVolumes(List volumes) { + if (this.innerProperties() == null) { + this.innerProperties = new ListResultContainerGroupPropertiesProperties(); + } + this.innerProperties().withVolumes(volumes); + return this; + } + + /** + * Get the diagnostics property: The diagnostic information for a container group. + * + * @return the diagnostics value. + */ + public ContainerGroupDiagnostics diagnostics() { + return this.innerProperties() == null ? null : this.innerProperties().diagnostics(); + } + + /** + * Set the diagnostics property: The diagnostic information for a container group. + * + * @param diagnostics the diagnostics value to set. + * @return the ListResultContainerGroupProperties object itself. + */ + public ListResultContainerGroupProperties withDiagnostics(ContainerGroupDiagnostics diagnostics) { + if (this.innerProperties() == null) { + this.innerProperties = new ListResultContainerGroupPropertiesProperties(); + } + this.innerProperties().withDiagnostics(diagnostics); + return this; + } + + /** + * Get the subnetIds property: The subnet resource IDs for a container group. + * + * @return the subnetIds value. + */ + public List subnetIds() { + return this.innerProperties() == null ? null : this.innerProperties().subnetIds(); + } + + /** + * Set the subnetIds property: The subnet resource IDs for a container group. + * + * @param subnetIds the subnetIds value to set. + * @return the ListResultContainerGroupProperties object itself. + */ + public ListResultContainerGroupProperties withSubnetIds(List subnetIds) { + if (this.innerProperties() == null) { + this.innerProperties = new ListResultContainerGroupPropertiesProperties(); + } + this.innerProperties().withSubnetIds(subnetIds); + return this; + } + + /** + * Get the dnsConfig property: The DNS config information for a container group. + * + * @return the dnsConfig value. + */ + public DnsConfiguration dnsConfig() { + return this.innerProperties() == null ? null : this.innerProperties().dnsConfig(); + } + + /** + * Set the dnsConfig property: The DNS config information for a container group. + * + * @param dnsConfig the dnsConfig value to set. + * @return the ListResultContainerGroupProperties object itself. + */ + public ListResultContainerGroupProperties withDnsConfig(DnsConfiguration dnsConfig) { + if (this.innerProperties() == null) { + this.innerProperties = new ListResultContainerGroupPropertiesProperties(); + } + this.innerProperties().withDnsConfig(dnsConfig); + return this; + } + + /** + * Get the sku property: The SKU for a container group. + * + * @return the sku value. + */ + public ContainerGroupSku sku() { + return this.innerProperties() == null ? null : this.innerProperties().sku(); + } + + /** + * Set the sku property: The SKU for a container group. + * + * @param sku the sku value to set. + * @return the ListResultContainerGroupProperties object itself. + */ + public ListResultContainerGroupProperties withSku(ContainerGroupSku sku) { + if (this.innerProperties() == null) { + this.innerProperties = new ListResultContainerGroupPropertiesProperties(); + } + this.innerProperties().withSku(sku); + return this; + } + + /** + * Get the encryptionProperties property: The encryption properties for a container group. + * + * @return the encryptionProperties value. + */ + public EncryptionProperties encryptionProperties() { + return this.innerProperties() == null ? null : this.innerProperties().encryptionProperties(); + } + + /** + * Set the encryptionProperties property: The encryption properties for a container group. + * + * @param encryptionProperties the encryptionProperties value to set. + * @return the ListResultContainerGroupProperties object itself. + */ + public ListResultContainerGroupProperties withEncryptionProperties(EncryptionProperties encryptionProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new ListResultContainerGroupPropertiesProperties(); + } + this.innerProperties().withEncryptionProperties(encryptionProperties); + return this; + } + + /** + * Get the initContainers property: The init containers for a container group. + * + * @return the initContainers value. + */ + public List initContainers() { + return this.innerProperties() == null ? null : this.innerProperties().initContainers(); + } + + /** + * Set the initContainers property: The init containers for a container group. + * + * @param initContainers the initContainers value to set. + * @return the ListResultContainerGroupProperties object itself. + */ + public ListResultContainerGroupProperties withInitContainers(List initContainers) { + if (this.innerProperties() == null) { + this.innerProperties = new ListResultContainerGroupPropertiesProperties(); + } + this.innerProperties().withInitContainers(initContainers); + return this; + } + + /** + * Get the extensions property: extensions used by virtual kubelet. + * + * @return the extensions value. + */ + public List extensions() { + return this.innerProperties() == null ? null : this.innerProperties().extensions(); + } + + /** + * Set the extensions property: extensions used by virtual kubelet. + * + * @param extensions the extensions value to set. + * @return the ListResultContainerGroupProperties object itself. + */ + public ListResultContainerGroupProperties withExtensions(List extensions) { + if (this.innerProperties() == null) { + this.innerProperties = new ListResultContainerGroupPropertiesProperties(); + } + this.innerProperties().withExtensions(extensions); + return this; + } + + /** + * Get the confidentialComputeProperties property: The properties for confidential container group. + * + * @return the confidentialComputeProperties value. + */ + public ConfidentialComputeProperties confidentialComputeProperties() { + return this.innerProperties() == null ? null : this.innerProperties().confidentialComputeProperties(); + } + + /** + * Set the confidentialComputeProperties property: The properties for confidential container group. + * + * @param confidentialComputeProperties the confidentialComputeProperties value to set. + * @return the ListResultContainerGroupProperties object itself. + */ + public ListResultContainerGroupProperties + withConfidentialComputeProperties(ConfidentialComputeProperties confidentialComputeProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new ListResultContainerGroupPropertiesProperties(); + } + this.innerProperties().withConfidentialComputeProperties(confidentialComputeProperties); + return this; + } + + /** + * Get the priority property: The priority of the container group. + * + * @return the priority value. + */ + public ContainerGroupPriority priority() { + return this.innerProperties() == null ? null : this.innerProperties().priority(); + } + + /** + * Set the priority property: The priority of the container group. + * + * @param priority the priority value to set. + * @return the ListResultContainerGroupProperties object itself. + */ + public ListResultContainerGroupProperties withPriority(ContainerGroupPriority priority) { + if (this.innerProperties() == null) { + this.innerProperties = new ListResultContainerGroupPropertiesProperties(); + } + this.innerProperties().withPriority(priority); + return this; + } + + /** + * Get the identityAcls property: The access control levels of the identities. + * + * @return the identityAcls value. + */ + public IdentityAcls identityAcls() { + return this.innerProperties() == null ? null : this.innerProperties().identityAcls(); + } + + /** + * Set the identityAcls property: The access control levels of the identities. + * + * @param identityAcls the identityAcls value to set. + * @return the ListResultContainerGroupProperties object itself. + */ + public ListResultContainerGroupProperties withIdentityAcls(IdentityAcls identityAcls) { + if (this.innerProperties() == null) { + this.innerProperties = new ListResultContainerGroupPropertiesProperties(); + } + this.innerProperties().withIdentityAcls(identityAcls); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (innerProperties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model ListResultContainerGroupProperties")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ListResultContainerGroupProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("identity", this.identity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListResultContainerGroupProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListResultContainerGroupProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ListResultContainerGroupProperties. + */ + public static ListResultContainerGroupProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListResultContainerGroupProperties deserializedListResultContainerGroupProperties + = new ListResultContainerGroupProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedListResultContainerGroupProperties.innerProperties + = ListResultContainerGroupPropertiesProperties.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedListResultContainerGroupProperties.identity = ContainerGroupIdentity.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedListResultContainerGroupProperties; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/LoadBalancer.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/LoadBalancer.java new file mode 100644 index 000000000000..5c6962c37f42 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/LoadBalancer.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * LoadBalancer the CG profile will use to interact with CGs in a backend pool. + */ +@Fluent +public final class LoadBalancer implements JsonSerializable { + /* + * List of Load Balancer Backend Address Pools. + */ + private List backendAddressPools; + + /** + * Creates an instance of LoadBalancer class. + */ + public LoadBalancer() { + } + + /** + * Get the backendAddressPools property: List of Load Balancer Backend Address Pools. + * + * @return the backendAddressPools value. + */ + public List backendAddressPools() { + return this.backendAddressPools; + } + + /** + * Set the backendAddressPools property: List of Load Balancer Backend Address Pools. + * + * @param backendAddressPools the backendAddressPools value to set. + * @return the LoadBalancer object itself. + */ + public LoadBalancer withBackendAddressPools(List backendAddressPools) { + this.backendAddressPools = backendAddressPools; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (backendAddressPools() != null) { + backendAddressPools().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("backendAddressPools", this.backendAddressPools, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LoadBalancer from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LoadBalancer if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the LoadBalancer. + */ + public static LoadBalancer fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LoadBalancer deserializedLoadBalancer = new LoadBalancer(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("backendAddressPools".equals(fieldName)) { + List backendAddressPools + = reader.readArray(reader1 -> LoadBalancerBackendAddressPool.fromJson(reader1)); + deserializedLoadBalancer.backendAddressPools = backendAddressPools; + } else { + reader.skipChildren(); + } + } + + return deserializedLoadBalancer; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/LoadBalancerBackendAddressPool.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/LoadBalancerBackendAddressPool.java new file mode 100644 index 000000000000..2e721efcb0aa --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/LoadBalancerBackendAddressPool.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.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * NGroups load balancer backend address pool. + */ +@Fluent +public final class LoadBalancerBackendAddressPool implements JsonSerializable { + /* + * The Load Balancer backend address pool ARM resource Id. + */ + private String resource; + + /** + * Creates an instance of LoadBalancerBackendAddressPool class. + */ + public LoadBalancerBackendAddressPool() { + } + + /** + * Get the resource property: The Load Balancer backend address pool ARM resource Id. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource property: The Load Balancer backend address pool ARM resource Id. + * + * @param resource the resource value to set. + * @return the LoadBalancerBackendAddressPool object itself. + */ + public LoadBalancerBackendAddressPool withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resource", this.resource); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LoadBalancerBackendAddressPool from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LoadBalancerBackendAddressPool if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the LoadBalancerBackendAddressPool. + */ + public static LoadBalancerBackendAddressPool fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LoadBalancerBackendAddressPool deserializedLoadBalancerBackendAddressPool + = new LoadBalancerBackendAddressPool(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resource".equals(fieldName)) { + deserializedLoadBalancerBackendAddressPool.resource = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLoadBalancerBackendAddressPool; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Locations.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Locations.java new file mode 100644 index 000000000000..431ede517ee8 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Locations.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** + * Resource collection API of Locations. + */ +public interface Locations { + /** + * Get the usage for a subscription. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the usage for a subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable listUsage(String location); + + /** + * Get the usage for a subscription. + * + * @param location The name of the Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the usage for a subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable listUsage(String location, Context context); + + /** + * Get the list of cached images. + * + * Get the list of cached images on specific OS type for a subscription in a region. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of cached images on specific OS type for a subscription in a region as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listCachedImages(String location); + + /** + * Get the list of cached images. + * + * Get the list of cached images on specific OS type for a subscription in a region. + * + * @param location The name of the Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of cached images on specific OS type for a subscription in a region as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listCachedImages(String location, Context context); + + /** + * Get the list of capabilities of the location. + * + * Get the list of CPU/memory/GPU capabilities of a region. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of CPU/memory/GPU capabilities of a region as paginated response with {@link PagedIterable}. + */ + PagedIterable listCapabilities(String location); + + /** + * Get the list of capabilities of the location. + * + * Get the list of CPU/memory/GPU capabilities of a region. + * + * @param location The name of the Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of CPU/memory/GPU capabilities of a region as paginated response with {@link PagedIterable}. + */ + PagedIterable listCapabilities(String location, Context context); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/LogAnalytics.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/LogAnalytics.java new file mode 100644 index 000000000000..6b7c073f2245 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/LogAnalytics.java @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Container group log analytics information. + */ +@Fluent +public final class LogAnalytics implements JsonSerializable { + /* + * The workspace id for log analytics + */ + private String workspaceId; + + /* + * The workspace key for log analytics + */ + private String workspaceKey; + + /* + * The log type to be used. + */ + private LogAnalyticsLogType logType; + + /* + * Metadata for log analytics. + */ + private Map metadata; + + /* + * The workspace resource id for log analytics + */ + private String workspaceResourceId; + + /** + * Creates an instance of LogAnalytics class. + */ + public LogAnalytics() { + } + + /** + * Get the workspaceId property: The workspace id for log analytics. + * + * @return the workspaceId value. + */ + public String workspaceId() { + return this.workspaceId; + } + + /** + * Set the workspaceId property: The workspace id for log analytics. + * + * @param workspaceId the workspaceId value to set. + * @return the LogAnalytics object itself. + */ + public LogAnalytics withWorkspaceId(String workspaceId) { + this.workspaceId = workspaceId; + return this; + } + + /** + * Get the workspaceKey property: The workspace key for log analytics. + * + * @return the workspaceKey value. + */ + public String workspaceKey() { + return this.workspaceKey; + } + + /** + * Set the workspaceKey property: The workspace key for log analytics. + * + * @param workspaceKey the workspaceKey value to set. + * @return the LogAnalytics object itself. + */ + public LogAnalytics withWorkspaceKey(String workspaceKey) { + this.workspaceKey = workspaceKey; + return this; + } + + /** + * Get the logType property: The log type to be used. + * + * @return the logType value. + */ + public LogAnalyticsLogType logType() { + return this.logType; + } + + /** + * Set the logType property: The log type to be used. + * + * @param logType the logType value to set. + * @return the LogAnalytics object itself. + */ + public LogAnalytics withLogType(LogAnalyticsLogType logType) { + this.logType = logType; + return this; + } + + /** + * Get the metadata property: Metadata for log analytics. + * + * @return the metadata value. + */ + public Map metadata() { + return this.metadata; + } + + /** + * Set the metadata property: Metadata for log analytics. + * + * @param metadata the metadata value to set. + * @return the LogAnalytics object itself. + */ + public LogAnalytics withMetadata(Map metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get the workspaceResourceId property: The workspace resource id for log analytics. + * + * @return the workspaceResourceId value. + */ + public String workspaceResourceId() { + return this.workspaceResourceId; + } + + /** + * Set the workspaceResourceId property: The workspace resource id for log analytics. + * + * @param workspaceResourceId the workspaceResourceId value to set. + * @return the LogAnalytics object itself. + */ + public LogAnalytics withWorkspaceResourceId(String workspaceResourceId) { + this.workspaceResourceId = workspaceResourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (workspaceId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property workspaceId in model LogAnalytics")); + } + if (workspaceKey() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property workspaceKey in model LogAnalytics")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(LogAnalytics.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("workspaceId", this.workspaceId); + jsonWriter.writeStringField("workspaceKey", this.workspaceKey); + jsonWriter.writeStringField("logType", this.logType == null ? null : this.logType.toString()); + jsonWriter.writeMapField("metadata", this.metadata, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("workspaceResourceId", this.workspaceResourceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LogAnalytics from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LogAnalytics if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LogAnalytics. + */ + public static LogAnalytics fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LogAnalytics deserializedLogAnalytics = new LogAnalytics(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("workspaceId".equals(fieldName)) { + deserializedLogAnalytics.workspaceId = reader.getString(); + } else if ("workspaceKey".equals(fieldName)) { + deserializedLogAnalytics.workspaceKey = reader.getString(); + } else if ("logType".equals(fieldName)) { + deserializedLogAnalytics.logType = LogAnalyticsLogType.fromString(reader.getString()); + } else if ("metadata".equals(fieldName)) { + Map metadata = reader.readMap(reader1 -> reader1.getString()); + deserializedLogAnalytics.metadata = metadata; + } else if ("workspaceResourceId".equals(fieldName)) { + deserializedLogAnalytics.workspaceResourceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLogAnalytics; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/LogAnalyticsLogType.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/LogAnalyticsLogType.java new file mode 100644 index 000000000000..cec9c0600f4e --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/LogAnalyticsLogType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The log type to be used. + */ +public final class LogAnalyticsLogType extends ExpandableStringEnum { + /** + * Static value ContainerInsights for LogAnalyticsLogType. + */ + public static final LogAnalyticsLogType CONTAINER_INSIGHTS = fromString("ContainerInsights"); + + /** + * Static value ContainerInstanceLogs for LogAnalyticsLogType. + */ + public static final LogAnalyticsLogType CONTAINER_INSTANCE_LOGS = fromString("ContainerInstanceLogs"); + + /** + * Creates a new instance of LogAnalyticsLogType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LogAnalyticsLogType() { + } + + /** + * Creates or finds a LogAnalyticsLogType from its string representation. + * + * @param name a name to look for. + * @return the corresponding LogAnalyticsLogType. + */ + public static LogAnalyticsLogType fromString(String name) { + return fromString(name, LogAnalyticsLogType.class); + } + + /** + * Gets known LogAnalyticsLogType values. + * + * @return known LogAnalyticsLogType values. + */ + public static Collection values() { + return values(LogAnalyticsLogType.class); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Logs.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Logs.java new file mode 100644 index 000000000000..94a68d884682 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Logs.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.resourcemanager.containerinstance.generated.fluent.models.LogsInner; + +/** + * An immutable client-side representation of Logs. + */ +public interface Logs { + /** + * Gets the content property: The content of the log. + * + * @return the content value. + */ + String content(); + + /** + * Gets the inner com.azure.resourcemanager.containerinstance.generated.fluent.models.LogsInner object. + * + * @return the inner object. + */ + LogsInner innerModel(); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/NGroup.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/NGroup.java new file mode 100644 index 000000000000..58815cbc3b88 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/NGroup.java @@ -0,0 +1,536 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.NGroupInner; +import java.util.List; +import java.util.Map; + +/** + * An immutable client-side representation of NGroup. + */ +public interface NGroup { + /** + * 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 tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the identity property: The identity of the NGroup, if configured. + * + * @return the identity value. + */ + NGroupIdentity identity(); + + /** + * Gets the zones property: The NGroups zones. NOTE: Availability zones can only be set when you create the scale + * set. + * + * @return the zones value. + */ + List zones(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the elasticProfile property: The elastic profile. + * + * @return the elasticProfile value. + */ + ElasticProfile elasticProfile(); + + /** + * Gets the placementProfile property: Provides options w.r.t allocation and management w.r.t certain placement + * policies. These utilize capabilities provided by the underlying Azure infrastructure. They are typically used for + * high availability scenarios. E.g., distributing CGs across fault domains. + * + * @return the placementProfile value. + */ + PlacementProfile placementProfile(); + + /** + * Gets the containerGroupProfiles property: The Container Group Profiles that could be used in the NGroups + * resource. + * + * @return the containerGroupProfiles value. + */ + List containerGroupProfiles(); + + /** + * Gets the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + NGroupProvisioningState provisioningState(); + + /** + * Gets the updateProfile property: Used by the customer to specify the way to update the Container Groups in + * NGroup. + * + * @return the updateProfile value. + */ + UpdateProfile updateProfile(); + + /** + * 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.containerinstance.generated.fluent.models.NGroupInner object. + * + * @return the inner object. + */ + NGroupInner innerModel(); + + /** + * The entirety of the NGroup definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The NGroup definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the NGroup definition. + */ + interface Blank extends WithResourceGroup { + } + + /** + * The stage of the NGroup definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the NGroup 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.WithLocation, DefinitionStages.WithTags, DefinitionStages.WithIdentity, + DefinitionStages.WithZones, DefinitionStages.WithElasticProfile, DefinitionStages.WithPlacementProfile, + DefinitionStages.WithContainerGroupProfiles, DefinitionStages.WithUpdateProfile { + /** + * Executes the create request. + * + * @return the created resource. + */ + NGroup create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + NGroup create(Context context); + } + + /** + * The stage of the NGroup definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithCreate withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithCreate withRegion(String location); + } + + /** + * The stage of the NGroup 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 NGroup definition allowing to specify identity. + */ + interface WithIdentity { + /** + * Specifies the identity property: The identity of the NGroup, if configured.. + * + * @param identity The identity of the NGroup, if configured. + * @return the next definition stage. + */ + WithCreate withIdentity(NGroupIdentity identity); + } + + /** + * The stage of the NGroup definition allowing to specify zones. + */ + interface WithZones { + /** + * Specifies the zones property: The NGroups zones. NOTE: Availability zones can only be set when you create + * the scale set. + * + * @param zones The NGroups zones. NOTE: Availability zones can only be set when you create the scale set. + * @return the next definition stage. + */ + WithCreate withZones(List zones); + } + + /** + * The stage of the NGroup definition allowing to specify elasticProfile. + */ + interface WithElasticProfile { + /** + * Specifies the elasticProfile property: The elastic profile.. + * + * @param elasticProfile The elastic profile. + * @return the next definition stage. + */ + WithCreate withElasticProfile(ElasticProfile elasticProfile); + } + + /** + * The stage of the NGroup definition allowing to specify placementProfile. + */ + interface WithPlacementProfile { + /** + * Specifies the placementProfile property: Provides options w.r.t allocation and management w.r.t certain + * placement policies. These utilize capabilities provided by the underlying Azure infrastructure. They are + * typically used for high availability scenarios. E.g., distributing CGs across fault domains.. + * + * @param placementProfile Provides options w.r.t allocation and management w.r.t certain placement + * policies. These utilize capabilities provided by the underlying Azure infrastructure. They are typically + * used for high availability scenarios. E.g., distributing CGs across fault domains. + * @return the next definition stage. + */ + WithCreate withPlacementProfile(PlacementProfile placementProfile); + } + + /** + * The stage of the NGroup definition allowing to specify containerGroupProfiles. + */ + interface WithContainerGroupProfiles { + /** + * Specifies the containerGroupProfiles property: The Container Group Profiles that could be used in the + * NGroups resource.. + * + * @param containerGroupProfiles The Container Group Profiles that could be used in the NGroups resource. + * @return the next definition stage. + */ + WithCreate withContainerGroupProfiles(List containerGroupProfiles); + } + + /** + * The stage of the NGroup definition allowing to specify updateProfile. + */ + interface WithUpdateProfile { + /** + * Specifies the updateProfile property: Used by the customer to specify the way to update the Container + * Groups in NGroup.. + * + * @param updateProfile Used by the customer to specify the way to update the Container Groups in NGroup. + * @return the next definition stage. + */ + WithCreate withUpdateProfile(UpdateProfile updateProfile); + } + } + + /** + * Begins update for the NGroup resource. + * + * @return the stage of resource update. + */ + NGroup.Update update(); + + /** + * The template for NGroup update. + */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity, UpdateStages.WithZones, + UpdateStages.WithElasticProfile, UpdateStages.WithPlacementProfile, UpdateStages.WithContainerGroupProfiles, + UpdateStages.WithUpdateProfile { + /** + * Executes the update request. + * + * @return the updated resource. + */ + NGroup apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + NGroup apply(Context context); + } + + /** + * The NGroup update stages. + */ + interface UpdateStages { + /** + * The stage of the NGroup update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + + /** + * The stage of the NGroup update allowing to specify identity. + */ + interface WithIdentity { + /** + * Specifies the identity property: The identity of the NGroup, if configured.. + * + * @param identity The identity of the NGroup, if configured. + * @return the next definition stage. + */ + Update withIdentity(NGroupIdentity identity); + } + + /** + * The stage of the NGroup update allowing to specify zones. + */ + interface WithZones { + /** + * Specifies the zones property: The NGroups zones. NOTE: Availability zones can only be set when you create + * the scale set. + * + * @param zones The NGroups zones. NOTE: Availability zones can only be set when you create the scale set. + * @return the next definition stage. + */ + Update withZones(List zones); + } + + /** + * The stage of the NGroup update allowing to specify elasticProfile. + */ + interface WithElasticProfile { + /** + * Specifies the elasticProfile property: The elastic profile.. + * + * @param elasticProfile The elastic profile. + * @return the next definition stage. + */ + Update withElasticProfile(ElasticProfile elasticProfile); + } + + /** + * The stage of the NGroup update allowing to specify placementProfile. + */ + interface WithPlacementProfile { + /** + * Specifies the placementProfile property: Provides options w.r.t allocation and management w.r.t certain + * placement policies. These utilize capabilities provided by the underlying Azure infrastructure. They are + * typically used for high availability scenarios. E.g., distributing CGs across fault domains.. + * + * @param placementProfile Provides options w.r.t allocation and management w.r.t certain placement + * policies. These utilize capabilities provided by the underlying Azure infrastructure. They are typically + * used for high availability scenarios. E.g., distributing CGs across fault domains. + * @return the next definition stage. + */ + Update withPlacementProfile(PlacementProfile placementProfile); + } + + /** + * The stage of the NGroup update allowing to specify containerGroupProfiles. + */ + interface WithContainerGroupProfiles { + /** + * Specifies the containerGroupProfiles property: The Container Group Profiles that could be used in the + * NGroups resource.. + * + * @param containerGroupProfiles The Container Group Profiles that could be used in the NGroups resource. + * @return the next definition stage. + */ + Update withContainerGroupProfiles(List containerGroupProfiles); + } + + /** + * The stage of the NGroup update allowing to specify updateProfile. + */ + interface WithUpdateProfile { + /** + * Specifies the updateProfile property: Used by the customer to specify the way to update the Container + * Groups in NGroup.. + * + * @param updateProfile Used by the customer to specify the way to update the Container Groups in NGroup. + * @return the next definition stage. + */ + Update withUpdateProfile(UpdateProfile updateProfile); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + NGroup refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + NGroup refresh(Context context); + + /** + * Starts all container groups in the specified NGroups resource. + * + * Starts all container groups in the specified NGroups resource. Compute resources will be allocated and billing + * will start. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(); + + /** + * Starts all container groups in the specified NGroups resource. + * + * Starts all container groups in the specified NGroups resource. Compute resources will be allocated and billing + * will start. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(Context context); + + /** + * Stops all container groups in the specified NGroups resource. + * + * Stops all container groups in the specified NGroups resource. Compute resources will be deallocated and billing + * will stop. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response stopWithResponse(Context context); + + /** + * Stops all container groups in the specified NGroups resource. + * + * Stops all container groups in the specified NGroups resource. Compute resources will be deallocated and billing + * will stop. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stop(); + + /** + * Restarts all container groups in the specified NGroups resource. + * + * Restarts all container groups in the specified NGroups resource in place. If container image has updates, new + * image will be downloaded. + * + * @throws com.azure.core.management.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 restart(); + + /** + * Restarts all container groups in the specified NGroups resource. + * + * Restarts all container groups in the specified NGroups resource in place. If container image has updates, new + * image will be downloaded. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 restart(Context context); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/NGroupCGPropertyContainer.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/NGroupCGPropertyContainer.java new file mode 100644 index 000000000000..a3d761de46cc --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/NGroupCGPropertyContainer.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Container properties that can be provided with NGroups object. + */ +@Fluent +public final class NGroupCGPropertyContainer implements JsonSerializable { + /* + * container name + */ + private String name; + + /* + * container properties + */ + private NGroupCGPropertyContainerProperties properties; + + /** + * Creates an instance of NGroupCGPropertyContainer class. + */ + public NGroupCGPropertyContainer() { + } + + /** + * Get the name property: container name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: container name. + * + * @param name the name value to set. + * @return the NGroupCGPropertyContainer object itself. + */ + public NGroupCGPropertyContainer withName(String name) { + this.name = name; + return this; + } + + /** + * Get the properties property: container properties. + * + * @return the properties value. + */ + public NGroupCGPropertyContainerProperties properties() { + return this.properties; + } + + /** + * Set the properties property: container properties. + * + * @param properties the properties value to set. + * @return the NGroupCGPropertyContainer object itself. + */ + public NGroupCGPropertyContainer withProperties(NGroupCGPropertyContainerProperties 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NGroupCGPropertyContainer from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NGroupCGPropertyContainer if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NGroupCGPropertyContainer. + */ + public static NGroupCGPropertyContainer fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NGroupCGPropertyContainer deserializedNGroupCGPropertyContainer = new NGroupCGPropertyContainer(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedNGroupCGPropertyContainer.name = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedNGroupCGPropertyContainer.properties + = NGroupCGPropertyContainerProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNGroupCGPropertyContainer; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/NGroupCGPropertyContainerProperties.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/NGroupCGPropertyContainerProperties.java new file mode 100644 index 000000000000..7c99b2bbfef5 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/NGroupCGPropertyContainerProperties.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * container properties. + */ +@Fluent +public final class NGroupCGPropertyContainerProperties + implements JsonSerializable { + /* + * The volumeMounts property. + */ + private List volumeMounts; + + /** + * Creates an instance of NGroupCGPropertyContainerProperties class. + */ + public NGroupCGPropertyContainerProperties() { + } + + /** + * Get the volumeMounts property: The volumeMounts property. + * + * @return the volumeMounts value. + */ + public List volumeMounts() { + return this.volumeMounts; + } + + /** + * Set the volumeMounts property: The volumeMounts property. + * + * @param volumeMounts the volumeMounts value to set. + * @return the NGroupCGPropertyContainerProperties object itself. + */ + public NGroupCGPropertyContainerProperties withVolumeMounts(List volumeMounts) { + this.volumeMounts = volumeMounts; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (volumeMounts() != null) { + volumeMounts().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("volumeMounts", this.volumeMounts, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NGroupCGPropertyContainerProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NGroupCGPropertyContainerProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NGroupCGPropertyContainerProperties. + */ + public static NGroupCGPropertyContainerProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NGroupCGPropertyContainerProperties deserializedNGroupCGPropertyContainerProperties + = new NGroupCGPropertyContainerProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("volumeMounts".equals(fieldName)) { + List volumeMounts = reader.readArray(reader1 -> VolumeMount.fromJson(reader1)); + deserializedNGroupCGPropertyContainerProperties.volumeMounts = volumeMounts; + } else { + reader.skipChildren(); + } + } + + return deserializedNGroupCGPropertyContainerProperties; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/NGroupCGPropertyVolume.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/NGroupCGPropertyVolume.java new file mode 100644 index 000000000000..d7dede8dc23a --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/NGroupCGPropertyVolume.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.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Contains information about the volumes that can be mounted by Containers in the Container Groups. + */ +@Fluent +public final class NGroupCGPropertyVolume implements JsonSerializable { + /* + * The name of the volume. + */ + private String name; + + /* + * The Azure File volume. + */ + private AzureFileVolume azureFile; + + /** + * Creates an instance of NGroupCGPropertyVolume class. + */ + public NGroupCGPropertyVolume() { + } + + /** + * Get the name property: The name of the volume. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the volume. + * + * @param name the name value to set. + * @return the NGroupCGPropertyVolume object itself. + */ + public NGroupCGPropertyVolume withName(String name) { + this.name = name; + return this; + } + + /** + * Get the azureFile property: The Azure File volume. + * + * @return the azureFile value. + */ + public AzureFileVolume azureFile() { + return this.azureFile; + } + + /** + * Set the azureFile property: The Azure File volume. + * + * @param azureFile the azureFile value to set. + * @return the NGroupCGPropertyVolume object itself. + */ + public NGroupCGPropertyVolume withAzureFile(AzureFileVolume azureFile) { + this.azureFile = azureFile; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property name in model NGroupCGPropertyVolume")); + } + if (azureFile() != null) { + azureFile().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(NGroupCGPropertyVolume.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeJsonField("azureFile", this.azureFile); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NGroupCGPropertyVolume from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NGroupCGPropertyVolume if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the NGroupCGPropertyVolume. + */ + public static NGroupCGPropertyVolume fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NGroupCGPropertyVolume deserializedNGroupCGPropertyVolume = new NGroupCGPropertyVolume(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedNGroupCGPropertyVolume.name = reader.getString(); + } else if ("azureFile".equals(fieldName)) { + deserializedNGroupCGPropertyVolume.azureFile = AzureFileVolume.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNGroupCGPropertyVolume; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/NGroupContainerGroupProperties.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/NGroupContainerGroupProperties.java new file mode 100644 index 000000000000..7bee745e13da --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/NGroupContainerGroupProperties.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Container Group properties which can be set while creating or updating the NGroups. + */ +@Fluent +public final class NGroupContainerGroupProperties implements JsonSerializable { + /* + * Contains information about Virtual Network Subnet ARM Resource + */ + private List subnetIds; + + /* + * Contains information about the volumes that can be mounted by Containers in the Container Groups. + */ + private List volumes; + + /* + * Contains information about Container which can be set while creating or updating the NGroups. + */ + private List containers; + + /** + * Creates an instance of NGroupContainerGroupProperties class. + */ + public NGroupContainerGroupProperties() { + } + + /** + * Get the subnetIds property: Contains information about Virtual Network Subnet ARM Resource. + * + * @return the subnetIds value. + */ + public List subnetIds() { + return this.subnetIds; + } + + /** + * Set the subnetIds property: Contains information about Virtual Network Subnet ARM Resource. + * + * @param subnetIds the subnetIds value to set. + * @return the NGroupContainerGroupProperties object itself. + */ + public NGroupContainerGroupProperties withSubnetIds(List subnetIds) { + this.subnetIds = subnetIds; + return this; + } + + /** + * Get the volumes property: Contains information about the volumes that can be mounted by Containers in the + * Container Groups. + * + * @return the volumes value. + */ + public List volumes() { + return this.volumes; + } + + /** + * Set the volumes property: Contains information about the volumes that can be mounted by Containers in the + * Container Groups. + * + * @param volumes the volumes value to set. + * @return the NGroupContainerGroupProperties object itself. + */ + public NGroupContainerGroupProperties withVolumes(List volumes) { + this.volumes = volumes; + return this; + } + + /** + * Get the containers property: Contains information about Container which can be set while creating or updating the + * NGroups. + * + * @return the containers value. + */ + public List containers() { + return this.containers; + } + + /** + * Set the containers property: Contains information about Container which can be set while creating or updating the + * NGroups. + * + * @param containers the containers value to set. + * @return the NGroupContainerGroupProperties object itself. + */ + public NGroupContainerGroupProperties withContainers(List containers) { + this.containers = containers; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (subnetIds() != null) { + subnetIds().forEach(e -> e.validate()); + } + if (volumes() != null) { + volumes().forEach(e -> e.validate()); + } + if (containers() != null) { + containers().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("subnetIds", this.subnetIds, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("volumes", this.volumes, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("containers", this.containers, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NGroupContainerGroupProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NGroupContainerGroupProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NGroupContainerGroupProperties. + */ + public static NGroupContainerGroupProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NGroupContainerGroupProperties deserializedNGroupContainerGroupProperties + = new NGroupContainerGroupProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("subnetIds".equals(fieldName)) { + List subnetIds + = reader.readArray(reader1 -> ContainerGroupSubnetId.fromJson(reader1)); + deserializedNGroupContainerGroupProperties.subnetIds = subnetIds; + } else if ("volumes".equals(fieldName)) { + List volumes + = reader.readArray(reader1 -> NGroupCGPropertyVolume.fromJson(reader1)); + deserializedNGroupContainerGroupProperties.volumes = volumes; + } else if ("containers".equals(fieldName)) { + List containers + = reader.readArray(reader1 -> NGroupCGPropertyContainer.fromJson(reader1)); + deserializedNGroupContainerGroupProperties.containers = containers; + } else { + reader.skipChildren(); + } + } + + return deserializedNGroupContainerGroupProperties; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/NGroupIdentity.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/NGroupIdentity.java new file mode 100644 index 000000000000..5799b741e8b9 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/NGroupIdentity.java @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Identity for the NGroup. + */ +@Fluent +public final class NGroupIdentity implements JsonSerializable { + /* + * The principal id of the NGroup identity. This property will only be provided for a system assigned identity. + */ + private String principalId; + + /* + * The tenant id associated with the NGroup. This property will only be provided for a system assigned identity. + */ + private String tenantId; + + /* + * The type of identity used for the NGroup. The type 'SystemAssigned, UserAssigned' includes both an implicitly + * created identity and a set of user assigned identities. The type 'None' will remove any identities from the + * NGroup. + */ + private ResourceIdentityType type; + + /* + * The list of user identities associated with the NGroup. + */ + private Map userAssignedIdentities; + + /** + * Creates an instance of NGroupIdentity class. + */ + public NGroupIdentity() { + } + + /** + * Get the principalId property: The principal id of the NGroup identity. This property will only be provided for a + * system assigned identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: The tenant id associated with the NGroup. This property will only be provided for a + * system assigned identity. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the type property: The type of identity used for the NGroup. The type 'SystemAssigned, UserAssigned' includes + * both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any + * identities from the NGroup. + * + * @return the type value. + */ + public ResourceIdentityType type() { + return this.type; + } + + /** + * Set the type property: The type of identity used for the NGroup. The type 'SystemAssigned, UserAssigned' includes + * both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any + * identities from the NGroup. + * + * @param type the type value to set. + * @return the NGroupIdentity object itself. + */ + public NGroupIdentity withType(ResourceIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the userAssignedIdentities property: The list of user identities associated with the NGroup. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: The list of user identities associated with the NGroup. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the NGroupIdentity object itself. + */ + public NGroupIdentity withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (userAssignedIdentities() != null) { + userAssignedIdentities().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeMapField("userAssignedIdentities", this.userAssignedIdentities, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NGroupIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NGroupIdentity if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the NGroupIdentity. + */ + public static NGroupIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NGroupIdentity deserializedNGroupIdentity = new NGroupIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("principalId".equals(fieldName)) { + deserializedNGroupIdentity.principalId = reader.getString(); + } else if ("tenantId".equals(fieldName)) { + deserializedNGroupIdentity.tenantId = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedNGroupIdentity.type = ResourceIdentityType.fromString(reader.getString()); + } else if ("userAssignedIdentities".equals(fieldName)) { + Map userAssignedIdentities + = reader.readMap(reader1 -> UserAssignedIdentities.fromJson(reader1)); + deserializedNGroupIdentity.userAssignedIdentities = userAssignedIdentities; + } else { + reader.skipChildren(); + } + } + + return deserializedNGroupIdentity; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/NGroupProvisioningState.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/NGroupProvisioningState.java new file mode 100644 index 000000000000..269566f0b5a3 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/NGroupProvisioningState.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.containerinstance.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The provisioning state, which only appears in the response. + */ +public final class NGroupProvisioningState extends ExpandableStringEnum { + /** + * Static value Creating for NGroupProvisioningState. + */ + public static final NGroupProvisioningState CREATING = fromString("Creating"); + + /** + * Static value Updating for NGroupProvisioningState. + */ + public static final NGroupProvisioningState UPDATING = fromString("Updating"); + + /** + * Static value Failed for NGroupProvisioningState. + */ + public static final NGroupProvisioningState FAILED = fromString("Failed"); + + /** + * Static value Succeeded for NGroupProvisioningState. + */ + public static final NGroupProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Canceled for NGroupProvisioningState. + */ + public static final NGroupProvisioningState CANCELED = fromString("Canceled"); + + /** + * Static value Deleting for NGroupProvisioningState. + */ + public static final NGroupProvisioningState DELETING = fromString("Deleting"); + + /** + * Static value Migrating for NGroupProvisioningState. + */ + public static final NGroupProvisioningState MIGRATING = fromString("Migrating"); + + /** + * Creates a new instance of NGroupProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NGroupProvisioningState() { + } + + /** + * Creates or finds a NGroupProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding NGroupProvisioningState. + */ + public static NGroupProvisioningState fromString(String name) { + return fromString(name, NGroupProvisioningState.class); + } + + /** + * Gets known NGroupProvisioningState values. + * + * @return known NGroupProvisioningState values. + */ + public static Collection values() { + return values(NGroupProvisioningState.class); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/NGroupUpdateMode.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/NGroupUpdateMode.java new file mode 100644 index 000000000000..97683ef60f9b --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/NGroupUpdateMode.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for NGroupUpdateMode. + */ +public final class NGroupUpdateMode extends ExpandableStringEnum { + /** + * Static value Manual for NGroupUpdateMode. + */ + public static final NGroupUpdateMode MANUAL = fromString("Manual"); + + /** + * Static value Rolling for NGroupUpdateMode. + */ + public static final NGroupUpdateMode ROLLING = fromString("Rolling"); + + /** + * Creates a new instance of NGroupUpdateMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NGroupUpdateMode() { + } + + /** + * Creates or finds a NGroupUpdateMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding NGroupUpdateMode. + */ + public static NGroupUpdateMode fromString(String name) { + return fromString(name, NGroupUpdateMode.class); + } + + /** + * Gets known NGroupUpdateMode values. + * + * @return known NGroupUpdateMode values. + */ + public static Collection values() { + return values(NGroupUpdateMode.class); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/NGroups.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/NGroups.java new file mode 100644 index 000000000000..f125aa5bb2b3 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/NGroups.java @@ -0,0 +1,269 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.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 NGroups. + */ +public interface NGroups { + /** + * NGroups GET REST API + * + * Get the properties of the specified NGroups resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified NGroups resource along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String ngroupsName, Context context); + + /** + * NGroups GET REST API + * + * Get the properties of the specified NGroups resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified NGroups resource. + */ + NGroup getByResourceGroup(String resourceGroupName, String ngroupsName); + + /** + * NGroups Delete REST API + * + * Deletes the NGroups resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String ngroupsName); + + /** + * NGroups Delete REST API + * + * Deletes the NGroups resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 ngroupsName, Context context); + + /** + * Starts all container groups in the specified NGroups resource. + * + * Starts all container groups in the specified NGroups resource. Compute resources will be allocated and billing + * will start. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(String resourceGroupName, String ngroupsName); + + /** + * Starts all container groups in the specified NGroups resource. + * + * Starts all container groups in the specified NGroups resource. Compute resources will be allocated and billing + * will start. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(String resourceGroupName, String ngroupsName, Context context); + + /** + * Stops all container groups in the specified NGroups resource. + * + * Stops all container groups in the specified NGroups resource. Compute resources will be deallocated and billing + * will stop. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response stopWithResponse(String resourceGroupName, String ngroupsName, Context context); + + /** + * Stops all container groups in the specified NGroups resource. + * + * Stops all container groups in the specified NGroups resource. Compute resources will be deallocated and billing + * will stop. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stop(String resourceGroupName, String ngroupsName); + + /** + * Restarts all container groups in the specified NGroups resource. + * + * Restarts all container groups in the specified NGroups resource in place. If container image has updates, new + * image will be downloaded. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 restart(String resourceGroupName, String ngroupsName); + + /** + * Restarts all container groups in the specified NGroups resource. + * + * Restarts all container groups in the specified NGroups resource in place. If container image has updates, new + * image will be downloaded. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ngroupsName The NGroups name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 restart(String resourceGroupName, String ngroupsName, Context context); + + /** + * GET NGroups under a resource group REST API. + * + * Gets a list of all NGroups resources under a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all NGroups resources under a resource group as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * GET NGroups under a resource group REST API. + * + * Gets a list of all NGroups resources under a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all NGroups resources under a resource group as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * List NGroups in a subscription. + * + * Gets a list of all NGroups resources under a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all NGroups resources under a subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List NGroups in a subscription. + * + * Gets a list of all NGroups resources under a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all NGroups resources under a subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * NGroups GET REST API + * + * Get the properties of the specified NGroups resource. + * + * @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 the properties of the specified NGroups resource along with {@link Response}. + */ + NGroup getById(String id); + + /** + * NGroups GET REST API + * + * Get the properties of the specified NGroups resource. + * + * @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 the properties of the specified NGroups resource along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * NGroups Delete REST API + * + * Deletes the NGroups resource. + * + * @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); + + /** + * NGroups Delete REST API + * + * Deletes the NGroups resource. + * + * @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 NGroup resource. + * + * @param name resource name. + * @return the first stage of the new NGroup definition. + */ + NGroup.DefinitionStages.Blank define(String name); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/NGroupsListResult.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/NGroupsListResult.java new file mode 100644 index 000000000000..c7fb8207d9d7 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/NGroupsListResult.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.NGroupInner; +import java.io.IOException; +import java.util.List; + +/** + * The NGroups list response that contains the NGroups properties. + */ +@Fluent +public final class NGroupsListResult implements JsonSerializable { + /* + * The list of NGroups. + */ + private List value; + + /* + * The URI to fetch the next page of NGroups. + */ + private String nextLink; + + /** + * Creates an instance of NGroupsListResult class. + */ + public NGroupsListResult() { + } + + /** + * Get the value property: The list of NGroups. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of NGroups. + * + * @param value the value value to set. + * @return the NGroupsListResult object itself. + */ + public NGroupsListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI to fetch the next page of NGroups. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI to fetch the next page of NGroups. + * + * @param nextLink the nextLink value to set. + * @return the NGroupsListResult object itself. + */ + public NGroupsListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NGroupsListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NGroupsListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the NGroupsListResult. + */ + public static NGroupsListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NGroupsListResult deserializedNGroupsListResult = new NGroupsListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> NGroupInner.fromJson(reader1)); + deserializedNGroupsListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedNGroupsListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNGroupsListResult; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/NetworkProfile.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/NetworkProfile.java new file mode 100644 index 000000000000..c239920608d7 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/NetworkProfile.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A network profile for network settings of a ContainerGroupProfile. Used to manage load balancer and application + * gateway backend pools, specifically updating the IP addresses of CGs within the backend pool. + */ +@Fluent +public final class NetworkProfile implements JsonSerializable { + /* + * LoadBalancer the CG profile will use to interact with CGs in a backend pool + */ + private LoadBalancer loadBalancer; + + /* + * Application Gateway the CG profile will use to interact with CGs in a backend pool + */ + private ApplicationGateway applicationGateway; + + /** + * Creates an instance of NetworkProfile class. + */ + public NetworkProfile() { + } + + /** + * Get the loadBalancer property: LoadBalancer the CG profile will use to interact with CGs in a backend pool. + * + * @return the loadBalancer value. + */ + public LoadBalancer loadBalancer() { + return this.loadBalancer; + } + + /** + * Set the loadBalancer property: LoadBalancer the CG profile will use to interact with CGs in a backend pool. + * + * @param loadBalancer the loadBalancer value to set. + * @return the NetworkProfile object itself. + */ + public NetworkProfile withLoadBalancer(LoadBalancer loadBalancer) { + this.loadBalancer = loadBalancer; + return this; + } + + /** + * Get the applicationGateway property: Application Gateway the CG profile will use to interact with CGs in a + * backend pool. + * + * @return the applicationGateway value. + */ + public ApplicationGateway applicationGateway() { + return this.applicationGateway; + } + + /** + * Set the applicationGateway property: Application Gateway the CG profile will use to interact with CGs in a + * backend pool. + * + * @param applicationGateway the applicationGateway value to set. + * @return the NetworkProfile object itself. + */ + public NetworkProfile withApplicationGateway(ApplicationGateway applicationGateway) { + this.applicationGateway = applicationGateway; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (loadBalancer() != null) { + loadBalancer().validate(); + } + if (applicationGateway() != null) { + applicationGateway().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("loadBalancer", this.loadBalancer); + jsonWriter.writeJsonField("applicationGateway", this.applicationGateway); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkProfile if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkProfile. + */ + public static NetworkProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkProfile deserializedNetworkProfile = new NetworkProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("loadBalancer".equals(fieldName)) { + deserializedNetworkProfile.loadBalancer = LoadBalancer.fromJson(reader); + } else if ("applicationGateway".equals(fieldName)) { + deserializedNetworkProfile.applicationGateway = ApplicationGateway.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkProfile; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/OperatingSystemTypes.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/OperatingSystemTypes.java new file mode 100644 index 000000000000..99c66d22f113 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/OperatingSystemTypes.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The operating system type required by the containers in the container group. + */ +public final class OperatingSystemTypes extends ExpandableStringEnum { + /** + * Static value Windows for OperatingSystemTypes. + */ + public static final OperatingSystemTypes WINDOWS = fromString("Windows"); + + /** + * Static value Linux for OperatingSystemTypes. + */ + public static final OperatingSystemTypes LINUX = fromString("Linux"); + + /** + * Creates a new instance of OperatingSystemTypes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public OperatingSystemTypes() { + } + + /** + * Creates or finds a OperatingSystemTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding OperatingSystemTypes. + */ + public static OperatingSystemTypes fromString(String name) { + return fromString(name, OperatingSystemTypes.class); + } + + /** + * Gets known OperatingSystemTypes values. + * + * @return known OperatingSystemTypes values. + */ + public static Collection values() { + return values(OperatingSystemTypes.class); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Operation.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Operation.java new file mode 100644 index 000000000000..891320f365e4 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Operation.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.containerinstance.generated.models; + +import com.azure.resourcemanager.containerinstance.generated.fluent.models.OperationInner; + +/** + * An immutable client-side representation of Operation. + */ +public interface Operation { + /** + * Gets the name property: The name of the operation. + * + * @return the name value. + */ + String name(); + + /** + * Gets the display property: The display information of the operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the properties property: The additional properties. + * + * @return the properties value. + */ + Object properties(); + + /** + * Gets the origin property: The intended executor of the operation. + * + * @return the origin value. + */ + ContainerInstanceOperationsOrigin origin(); + + /** + * Gets the inner com.azure.resourcemanager.containerinstance.generated.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/OperationDisplay.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/OperationDisplay.java new file mode 100644 index 000000000000..6389092ece94 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/OperationDisplay.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The display information of the operation. + */ +@Fluent +public final class OperationDisplay implements JsonSerializable { + /* + * The name of the provider of the operation. + */ + private String provider; + + /* + * The name of the resource type of the operation. + */ + private String resource; + + /* + * The friendly name of the operation. + */ + private String operation; + + /* + * The description of the operation. + */ + private String description; + + /** + * Creates an instance of OperationDisplay class. + */ + public OperationDisplay() { + } + + /** + * Get the provider property: The name of the provider of the operation. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider property: The name of the provider of the operation. + * + * @param provider the provider value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the resource property: The name of the resource type of the operation. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource property: The name of the resource type of the operation. + * + * @param resource the resource value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the operation property: The friendly name of the operation. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation property: The friendly name of the operation. + * + * @param operation the operation value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the description property: The description of the operation. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description of the operation. + * + * @param description the description value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("provider", this.provider); + jsonWriter.writeStringField("resource", this.resource); + jsonWriter.writeStringField("operation", this.operation); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationDisplay from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationDisplay if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationDisplay. + */ + public static OperationDisplay fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationDisplay deserializedOperationDisplay = new OperationDisplay(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provider".equals(fieldName)) { + deserializedOperationDisplay.provider = reader.getString(); + } else if ("resource".equals(fieldName)) { + deserializedOperationDisplay.resource = reader.getString(); + } else if ("operation".equals(fieldName)) { + deserializedOperationDisplay.operation = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedOperationDisplay.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationDisplay; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/OperationListResult.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/OperationListResult.java new file mode 100644 index 000000000000..2ef74134eeb6 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/OperationListResult.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.OperationInner; +import java.io.IOException; +import java.util.List; + +/** + * The operation list response that contains all operations for Azure Container Instance service. + */ +@Fluent +public final class OperationListResult implements JsonSerializable { + /* + * The list of operations. + */ + private List value; + + /* + * The URI to fetch the next page of operations. + */ + private String nextLink; + + /** + * Creates an instance of OperationListResult class. + */ + public OperationListResult() { + } + + /** + * Get the value property: The list of operations. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of operations. + * + * @param value the value value to set. + * @return the OperationListResult object itself. + */ + public OperationListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI to fetch the next page of operations. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI to fetch the next page of operations. + * + * @param nextLink the nextLink value to set. + * @return the OperationListResult object itself. + */ + public OperationListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationListResult. + */ + public static OperationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationListResult deserializedOperationListResult = new OperationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> OperationInner.fromJson(reader1)); + deserializedOperationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedOperationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationListResult; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Operations.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Operations.java new file mode 100644 index 000000000000..65e83a9a4a0f --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Operations.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** + * Resource collection API of Operations. + */ +public interface Operations { + /** + * List the operations for Azure Container Instance service. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation list response that contains all operations for Azure Container Instance service as + * paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List the operations for Azure Container Instance service. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation list response that contains all operations for Azure Container Instance service as + * paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/PlacementProfile.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/PlacementProfile.java new file mode 100644 index 000000000000..52133a13ccec --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/PlacementProfile.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.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Provides options w.r.t allocation and management w.r.t certain placement policies. These utilize capabilities + * provided by the underlying Azure infrastructure. They are typically used for high availability scenarios. E.g., + * distributing CGs across fault domains. + */ +@Fluent +public final class PlacementProfile implements JsonSerializable { + /* + * The number of fault domains to be used to spread CGs in the NGroups resource. This can only be specified during + * NGroup creation and is immutable after that. + */ + private Integer faultDomainCount; + + /** + * Creates an instance of PlacementProfile class. + */ + public PlacementProfile() { + } + + /** + * Get the faultDomainCount property: The number of fault domains to be used to spread CGs in the NGroups resource. + * This can only be specified during NGroup creation and is immutable after that. + * + * @return the faultDomainCount value. + */ + public Integer faultDomainCount() { + return this.faultDomainCount; + } + + /** + * Set the faultDomainCount property: The number of fault domains to be used to spread CGs in the NGroups resource. + * This can only be specified during NGroup creation and is immutable after that. + * + * @param faultDomainCount the faultDomainCount value to set. + * @return the PlacementProfile object itself. + */ + public PlacementProfile withFaultDomainCount(Integer faultDomainCount) { + this.faultDomainCount = faultDomainCount; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("faultDomainCount", this.faultDomainCount); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PlacementProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PlacementProfile if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the PlacementProfile. + */ + public static PlacementProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PlacementProfile deserializedPlacementProfile = new PlacementProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("faultDomainCount".equals(fieldName)) { + deserializedPlacementProfile.faultDomainCount = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedPlacementProfile; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Port.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Port.java new file mode 100644 index 000000000000..cf661365aa75 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Port.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The port exposed on the container group. + */ +@Fluent +public final class Port implements JsonSerializable { + /* + * The protocol associated with the port. + */ + private ContainerGroupNetworkProtocol protocol; + + /* + * The port number. + */ + private int port; + + /** + * Creates an instance of Port class. + */ + public Port() { + } + + /** + * Get the protocol property: The protocol associated with the port. + * + * @return the protocol value. + */ + public ContainerGroupNetworkProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol property: The protocol associated with the port. + * + * @param protocol the protocol value to set. + * @return the Port object itself. + */ + public Port withProtocol(ContainerGroupNetworkProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the port property: The port number. + * + * @return the port value. + */ + public int port() { + return this.port; + } + + /** + * Set the port property: The port number. + * + * @param port the port value to set. + * @return the Port object itself. + */ + public Port withPort(int port) { + this.port = port; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("port", this.port); + jsonWriter.writeStringField("protocol", this.protocol == null ? null : this.protocol.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Port from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Port if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Port. + */ + public static Port fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Port deserializedPort = new Port(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("port".equals(fieldName)) { + deserializedPort.port = reader.getInt(); + } else if ("protocol".equals(fieldName)) { + deserializedPort.protocol = ContainerGroupNetworkProtocol.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedPort; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ResourceIdentityType.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ResourceIdentityType.java new file mode 100644 index 000000000000..35eb3ba1cfae --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ResourceIdentityType.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +/** + * The type of identity used for the container group. The type 'SystemAssigned, UserAssigned' includes both an + * implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from + * the container group. + */ +public enum ResourceIdentityType { + /** + * Enum value SystemAssigned. + */ + SYSTEM_ASSIGNED("SystemAssigned"), + + /** + * Enum value UserAssigned. + */ + USER_ASSIGNED("UserAssigned"), + + /** + * Enum value SystemAssigned, UserAssigned. + */ + SYSTEM_ASSIGNED_USER_ASSIGNED("SystemAssigned, UserAssigned"), + + /** + * Enum value None. + */ + NONE("None"); + + /** + * The actual serialized value for a ResourceIdentityType instance. + */ + private final String value; + + ResourceIdentityType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ResourceIdentityType instance. + * + * @param value the serialized value to parse. + * @return the parsed ResourceIdentityType object, or null if unable to parse. + */ + public static ResourceIdentityType fromString(String value) { + if (value == null) { + return null; + } + ResourceIdentityType[] items = ResourceIdentityType.values(); + for (ResourceIdentityType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ResourceLimits.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ResourceLimits.java new file mode 100644 index 000000000000..189977610cda --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ResourceLimits.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.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The resource limits. + */ +@Fluent +public final class ResourceLimits implements JsonSerializable { + /* + * The memory limit in GB of this container instance. + */ + private Double memoryInGB; + + /* + * The CPU limit of this container instance. + */ + private Double cpu; + + /* + * The GPU limit of this container instance. + */ + private GpuResource gpu; + + /** + * Creates an instance of ResourceLimits class. + */ + public ResourceLimits() { + } + + /** + * Get the memoryInGB property: The memory limit in GB of this container instance. + * + * @return the memoryInGB value. + */ + public Double memoryInGB() { + return this.memoryInGB; + } + + /** + * Set the memoryInGB property: The memory limit in GB of this container instance. + * + * @param memoryInGB the memoryInGB value to set. + * @return the ResourceLimits object itself. + */ + public ResourceLimits withMemoryInGB(Double memoryInGB) { + this.memoryInGB = memoryInGB; + return this; + } + + /** + * Get the cpu property: The CPU limit of this container instance. + * + * @return the cpu value. + */ + public Double cpu() { + return this.cpu; + } + + /** + * Set the cpu property: The CPU limit of this container instance. + * + * @param cpu the cpu value to set. + * @return the ResourceLimits object itself. + */ + public ResourceLimits withCpu(Double cpu) { + this.cpu = cpu; + return this; + } + + /** + * Get the gpu property: The GPU limit of this container instance. + * + * @return the gpu value. + */ + public GpuResource gpu() { + return this.gpu; + } + + /** + * Set the gpu property: The GPU limit of this container instance. + * + * @param gpu the gpu value to set. + * @return the ResourceLimits object itself. + */ + public ResourceLimits withGpu(GpuResource gpu) { + this.gpu = gpu; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (gpu() != null) { + gpu().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("memoryInGB", this.memoryInGB); + jsonWriter.writeNumberField("cpu", this.cpu); + jsonWriter.writeJsonField("gpu", this.gpu); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceLimits from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceLimits if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ResourceLimits. + */ + public static ResourceLimits fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceLimits deserializedResourceLimits = new ResourceLimits(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("memoryInGB".equals(fieldName)) { + deserializedResourceLimits.memoryInGB = reader.getNullable(JsonReader::getDouble); + } else if ("cpu".equals(fieldName)) { + deserializedResourceLimits.cpu = reader.getNullable(JsonReader::getDouble); + } else if ("gpu".equals(fieldName)) { + deserializedResourceLimits.gpu = GpuResource.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceLimits; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ResourceRequests.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ResourceRequests.java new file mode 100644 index 000000000000..2f30e28d0415 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ResourceRequests.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The resource requests. + */ +@Fluent +public final class ResourceRequests implements JsonSerializable { + /* + * The memory request in GB of this container instance. + */ + private double memoryInGB; + + /* + * The CPU request of this container instance. + */ + private double cpu; + + /* + * The GPU request of this container instance. + */ + private GpuResource gpu; + + /** + * Creates an instance of ResourceRequests class. + */ + public ResourceRequests() { + } + + /** + * Get the memoryInGB property: The memory request in GB of this container instance. + * + * @return the memoryInGB value. + */ + public double memoryInGB() { + return this.memoryInGB; + } + + /** + * Set the memoryInGB property: The memory request in GB of this container instance. + * + * @param memoryInGB the memoryInGB value to set. + * @return the ResourceRequests object itself. + */ + public ResourceRequests withMemoryInGB(double memoryInGB) { + this.memoryInGB = memoryInGB; + return this; + } + + /** + * Get the cpu property: The CPU request of this container instance. + * + * @return the cpu value. + */ + public double cpu() { + return this.cpu; + } + + /** + * Set the cpu property: The CPU request of this container instance. + * + * @param cpu the cpu value to set. + * @return the ResourceRequests object itself. + */ + public ResourceRequests withCpu(double cpu) { + this.cpu = cpu; + return this; + } + + /** + * Get the gpu property: The GPU request of this container instance. + * + * @return the gpu value. + */ + public GpuResource gpu() { + return this.gpu; + } + + /** + * Set the gpu property: The GPU request of this container instance. + * + * @param gpu the gpu value to set. + * @return the ResourceRequests object itself. + */ + public ResourceRequests withGpu(GpuResource gpu) { + this.gpu = gpu; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (gpu() != null) { + gpu().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeDoubleField("memoryInGB", this.memoryInGB); + jsonWriter.writeDoubleField("cpu", this.cpu); + jsonWriter.writeJsonField("gpu", this.gpu); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceRequests from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceRequests if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ResourceRequests. + */ + public static ResourceRequests fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceRequests deserializedResourceRequests = new ResourceRequests(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("memoryInGB".equals(fieldName)) { + deserializedResourceRequests.memoryInGB = reader.getDouble(); + } else if ("cpu".equals(fieldName)) { + deserializedResourceRequests.cpu = reader.getDouble(); + } else if ("gpu".equals(fieldName)) { + deserializedResourceRequests.gpu = GpuResource.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceRequests; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ResourceRequirements.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ResourceRequirements.java new file mode 100644 index 000000000000..09581aa3257b --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ResourceRequirements.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The resource requirements. + */ +@Fluent +public final class ResourceRequirements implements JsonSerializable { + /* + * The resource requests of this container instance. + */ + private ResourceRequests requests; + + /* + * The resource limits of this container instance. + */ + private ResourceLimits limits; + + /** + * Creates an instance of ResourceRequirements class. + */ + public ResourceRequirements() { + } + + /** + * Get the requests property: The resource requests of this container instance. + * + * @return the requests value. + */ + public ResourceRequests requests() { + return this.requests; + } + + /** + * Set the requests property: The resource requests of this container instance. + * + * @param requests the requests value to set. + * @return the ResourceRequirements object itself. + */ + public ResourceRequirements withRequests(ResourceRequests requests) { + this.requests = requests; + return this; + } + + /** + * Get the limits property: The resource limits of this container instance. + * + * @return the limits value. + */ + public ResourceLimits limits() { + return this.limits; + } + + /** + * Set the limits property: The resource limits of this container instance. + * + * @param limits the limits value to set. + * @return the ResourceRequirements object itself. + */ + public ResourceRequirements withLimits(ResourceLimits limits) { + this.limits = limits; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (requests() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property requests in model ResourceRequirements")); + } else { + requests().validate(); + } + if (limits() != null) { + limits().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ResourceRequirements.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("requests", this.requests); + jsonWriter.writeJsonField("limits", this.limits); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceRequirements from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceRequirements if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ResourceRequirements. + */ + public static ResourceRequirements fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceRequirements deserializedResourceRequirements = new ResourceRequirements(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("requests".equals(fieldName)) { + deserializedResourceRequirements.requests = ResourceRequests.fromJson(reader); + } else if ("limits".equals(fieldName)) { + deserializedResourceRequirements.limits = ResourceLimits.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceRequirements; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Scheme.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Scheme.java new file mode 100644 index 000000000000..ff1e09c267ad --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Scheme.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The scheme. + */ +public final class Scheme extends ExpandableStringEnum { + /** + * Static value http for Scheme. + */ + public static final Scheme HTTP = fromString("http"); + + /** + * Static value https for Scheme. + */ + public static final Scheme HTTPS = fromString("https"); + + /** + * Creates a new instance of Scheme value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Scheme() { + } + + /** + * Creates or finds a Scheme from its string representation. + * + * @param name a name to look for. + * @return the corresponding Scheme. + */ + public static Scheme fromString(String name) { + return fromString(name, Scheme.class); + } + + /** + * Gets known Scheme values. + * + * @return known Scheme values. + */ + public static Collection values() { + return values(Scheme.class); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/SecretReference.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/SecretReference.java new file mode 100644 index 000000000000..4ef032cec876 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/SecretReference.java @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A secret reference. + */ +@Fluent +public final class SecretReference implements JsonSerializable { + /* + * The identifier of the secret reference + */ + private String name; + + /* + * The ARM resource id of the managed identity that has access to the secret in the key vault + */ + private String identity; + + /* + * The URI to the secret in key vault + */ + private String secretReferenceUri; + + /** + * Creates an instance of SecretReference class. + */ + public SecretReference() { + } + + /** + * Get the name property: The identifier of the secret reference. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The identifier of the secret reference. + * + * @param name the name value to set. + * @return the SecretReference object itself. + */ + public SecretReference withName(String name) { + this.name = name; + return this; + } + + /** + * Get the identity property: The ARM resource id of the managed identity that has access to the secret in the key + * vault. + * + * @return the identity value. + */ + public String identity() { + return this.identity; + } + + /** + * Set the identity property: The ARM resource id of the managed identity that has access to the secret in the key + * vault. + * + * @param identity the identity value to set. + * @return the SecretReference object itself. + */ + public SecretReference withIdentity(String identity) { + this.identity = identity; + return this; + } + + /** + * Get the secretReferenceUri property: The URI to the secret in key vault. + * + * @return the secretReferenceUri value. + */ + public String secretReferenceUri() { + return this.secretReferenceUri; + } + + /** + * Set the secretReferenceUri property: The URI to the secret in key vault. + * + * @param secretReferenceUri the secretReferenceUri value to set. + * @return the SecretReference object itself. + */ + public SecretReference withSecretReferenceUri(String secretReferenceUri) { + this.secretReferenceUri = secretReferenceUri; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property name in model SecretReference")); + } + if (identity() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property identity in model SecretReference")); + } + if (secretReferenceUri() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property secretReferenceUri in model SecretReference")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SecretReference.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("identity", this.identity); + jsonWriter.writeStringField("secretReferenceUri", this.secretReferenceUri); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecretReference from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecretReference if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SecretReference. + */ + public static SecretReference fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecretReference deserializedSecretReference = new SecretReference(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedSecretReference.name = reader.getString(); + } else if ("identity".equals(fieldName)) { + deserializedSecretReference.identity = reader.getString(); + } else if ("secretReferenceUri".equals(fieldName)) { + deserializedSecretReference.secretReferenceUri = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSecretReference; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/SecurityContextCapabilitiesDefinition.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/SecurityContextCapabilitiesDefinition.java new file mode 100644 index 000000000000..d28809ff427b --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/SecurityContextCapabilitiesDefinition.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The capabilities to add or drop from a container. + */ +@Fluent +public final class SecurityContextCapabilitiesDefinition + implements JsonSerializable { + /* + * The capabilities to add to the container. + */ + private List add; + + /* + * The capabilities to drop from the container. + */ + private List drop; + + /** + * Creates an instance of SecurityContextCapabilitiesDefinition class. + */ + public SecurityContextCapabilitiesDefinition() { + } + + /** + * Get the add property: The capabilities to add to the container. + * + * @return the add value. + */ + public List add() { + return this.add; + } + + /** + * Set the add property: The capabilities to add to the container. + * + * @param add the add value to set. + * @return the SecurityContextCapabilitiesDefinition object itself. + */ + public SecurityContextCapabilitiesDefinition withAdd(List add) { + this.add = add; + return this; + } + + /** + * Get the drop property: The capabilities to drop from the container. + * + * @return the drop value. + */ + public List drop() { + return this.drop; + } + + /** + * Set the drop property: The capabilities to drop from the container. + * + * @param drop the drop value to set. + * @return the SecurityContextCapabilitiesDefinition object itself. + */ + public SecurityContextCapabilitiesDefinition withDrop(List drop) { + this.drop = drop; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("add", this.add, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("drop", this.drop, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecurityContextCapabilitiesDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecurityContextCapabilitiesDefinition if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SecurityContextCapabilitiesDefinition. + */ + public static SecurityContextCapabilitiesDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecurityContextCapabilitiesDefinition deserializedSecurityContextCapabilitiesDefinition + = new SecurityContextCapabilitiesDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("add".equals(fieldName)) { + List add = reader.readArray(reader1 -> reader1.getString()); + deserializedSecurityContextCapabilitiesDefinition.add = add; + } else if ("drop".equals(fieldName)) { + List drop = reader.readArray(reader1 -> reader1.getString()); + deserializedSecurityContextCapabilitiesDefinition.drop = drop; + } else { + reader.skipChildren(); + } + } + + return deserializedSecurityContextCapabilitiesDefinition; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/SecurityContextDefinition.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/SecurityContextDefinition.java new file mode 100644 index 000000000000..cd681446d942 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/SecurityContextDefinition.java @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The security context for the container. + */ +@Fluent +public final class SecurityContextDefinition implements JsonSerializable { + /* + * The flag to determine if the container permissions is elevated to Privileged. + */ + private Boolean privileged; + + /* + * A boolean value indicating whether the init process can elevate its privileges + */ + private Boolean allowPrivilegeEscalation; + + /* + * The capabilities to add or drop from a container. + */ + private SecurityContextCapabilitiesDefinition capabilities; + + /* + * Sets the User GID for the container. + */ + private Integer runAsGroup; + + /* + * Sets the User UID for the container. + */ + private Integer runAsUser; + + /* + * a base64 encoded string containing the contents of the JSON in the seccomp profile + */ + private String seccompProfile; + + /** + * Creates an instance of SecurityContextDefinition class. + */ + public SecurityContextDefinition() { + } + + /** + * Get the privileged property: The flag to determine if the container permissions is elevated to Privileged. + * + * @return the privileged value. + */ + public Boolean privileged() { + return this.privileged; + } + + /** + * Set the privileged property: The flag to determine if the container permissions is elevated to Privileged. + * + * @param privileged the privileged value to set. + * @return the SecurityContextDefinition object itself. + */ + public SecurityContextDefinition withPrivileged(Boolean privileged) { + this.privileged = privileged; + return this; + } + + /** + * Get the allowPrivilegeEscalation property: A boolean value indicating whether the init process can elevate its + * privileges. + * + * @return the allowPrivilegeEscalation value. + */ + public Boolean allowPrivilegeEscalation() { + return this.allowPrivilegeEscalation; + } + + /** + * Set the allowPrivilegeEscalation property: A boolean value indicating whether the init process can elevate its + * privileges. + * + * @param allowPrivilegeEscalation the allowPrivilegeEscalation value to set. + * @return the SecurityContextDefinition object itself. + */ + public SecurityContextDefinition withAllowPrivilegeEscalation(Boolean allowPrivilegeEscalation) { + this.allowPrivilegeEscalation = allowPrivilegeEscalation; + return this; + } + + /** + * Get the capabilities property: The capabilities to add or drop from a container. + * + * @return the capabilities value. + */ + public SecurityContextCapabilitiesDefinition capabilities() { + return this.capabilities; + } + + /** + * Set the capabilities property: The capabilities to add or drop from a container. + * + * @param capabilities the capabilities value to set. + * @return the SecurityContextDefinition object itself. + */ + public SecurityContextDefinition withCapabilities(SecurityContextCapabilitiesDefinition capabilities) { + this.capabilities = capabilities; + return this; + } + + /** + * Get the runAsGroup property: Sets the User GID for the container. + * + * @return the runAsGroup value. + */ + public Integer runAsGroup() { + return this.runAsGroup; + } + + /** + * Set the runAsGroup property: Sets the User GID for the container. + * + * @param runAsGroup the runAsGroup value to set. + * @return the SecurityContextDefinition object itself. + */ + public SecurityContextDefinition withRunAsGroup(Integer runAsGroup) { + this.runAsGroup = runAsGroup; + return this; + } + + /** + * Get the runAsUser property: Sets the User UID for the container. + * + * @return the runAsUser value. + */ + public Integer runAsUser() { + return this.runAsUser; + } + + /** + * Set the runAsUser property: Sets the User UID for the container. + * + * @param runAsUser the runAsUser value to set. + * @return the SecurityContextDefinition object itself. + */ + public SecurityContextDefinition withRunAsUser(Integer runAsUser) { + this.runAsUser = runAsUser; + return this; + } + + /** + * Get the seccompProfile property: a base64 encoded string containing the contents of the JSON in the seccomp + * profile. + * + * @return the seccompProfile value. + */ + public String seccompProfile() { + return this.seccompProfile; + } + + /** + * Set the seccompProfile property: a base64 encoded string containing the contents of the JSON in the seccomp + * profile. + * + * @param seccompProfile the seccompProfile value to set. + * @return the SecurityContextDefinition object itself. + */ + public SecurityContextDefinition withSeccompProfile(String seccompProfile) { + this.seccompProfile = seccompProfile; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (capabilities() != null) { + capabilities().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("privileged", this.privileged); + jsonWriter.writeBooleanField("allowPrivilegeEscalation", this.allowPrivilegeEscalation); + jsonWriter.writeJsonField("capabilities", this.capabilities); + jsonWriter.writeNumberField("runAsGroup", this.runAsGroup); + jsonWriter.writeNumberField("runAsUser", this.runAsUser); + jsonWriter.writeStringField("seccompProfile", this.seccompProfile); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecurityContextDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecurityContextDefinition if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SecurityContextDefinition. + */ + public static SecurityContextDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecurityContextDefinition deserializedSecurityContextDefinition = new SecurityContextDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("privileged".equals(fieldName)) { + deserializedSecurityContextDefinition.privileged = reader.getNullable(JsonReader::getBoolean); + } else if ("allowPrivilegeEscalation".equals(fieldName)) { + deserializedSecurityContextDefinition.allowPrivilegeEscalation + = reader.getNullable(JsonReader::getBoolean); + } else if ("capabilities".equals(fieldName)) { + deserializedSecurityContextDefinition.capabilities + = SecurityContextCapabilitiesDefinition.fromJson(reader); + } else if ("runAsGroup".equals(fieldName)) { + deserializedSecurityContextDefinition.runAsGroup = reader.getNullable(JsonReader::getInt); + } else if ("runAsUser".equals(fieldName)) { + deserializedSecurityContextDefinition.runAsUser = reader.getNullable(JsonReader::getInt); + } else if ("seccompProfile".equals(fieldName)) { + deserializedSecurityContextDefinition.seccompProfile = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSecurityContextDefinition; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/StorageProfile.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/StorageProfile.java new file mode 100644 index 000000000000..5e1d8061a270 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/StorageProfile.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.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Storage profile for storage related settings of a container group profile. + */ +@Fluent +public final class StorageProfile implements JsonSerializable { + /* + * The fileShares property. + */ + private List fileShares; + + /** + * Creates an instance of StorageProfile class. + */ + public StorageProfile() { + } + + /** + * Get the fileShares property: The fileShares property. + * + * @return the fileShares value. + */ + public List fileShares() { + return this.fileShares; + } + + /** + * Set the fileShares property: The fileShares property. + * + * @param fileShares the fileShares value to set. + * @return the StorageProfile object itself. + */ + public StorageProfile withFileShares(List fileShares) { + this.fileShares = fileShares; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (fileShares() != null) { + fileShares().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("fileShares", this.fileShares, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageProfile if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the StorageProfile. + */ + public static StorageProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageProfile deserializedStorageProfile = new StorageProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("fileShares".equals(fieldName)) { + List fileShares = reader.readArray(reader1 -> FileShare.fromJson(reader1)); + deserializedStorageProfile.fileShares = fileShares; + } else { + reader.skipChildren(); + } + } + + return deserializedStorageProfile; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/SubnetServiceAssociationLinks.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/SubnetServiceAssociationLinks.java new file mode 100644 index 000000000000..cf84d45de4d6 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/SubnetServiceAssociationLinks.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.containerinstance.generated.models; + +import com.azure.core.util.Context; + +/** + * Resource collection API of SubnetServiceAssociationLinks. + */ +public interface SubnetServiceAssociationLinks { + /** + * Delete container group virtual network association links. + * + * Delete container group virtual network association links. The operation does not delete other resources provided + * by the user. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 virtualNetworkName, String subnetName); + + /** + * Delete container group virtual network association links. + * + * Delete container group virtual network association links. The operation does not delete other resources provided + * by the user. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 virtualNetworkName, String subnetName, Context context); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/UpdateProfile.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/UpdateProfile.java new file mode 100644 index 000000000000..0109c35af778 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/UpdateProfile.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Used by the customer to specify the way to update the Container Groups in NGroup. + */ +@Fluent +public final class UpdateProfile implements JsonSerializable { + /* + * The updateMode property. + */ + private NGroupUpdateMode updateMode; + + /* + * This profile allows the customers to customize the rolling update. + */ + private UpdateProfileRollingUpdateProfile rollingUpdateProfile; + + /** + * Creates an instance of UpdateProfile class. + */ + public UpdateProfile() { + } + + /** + * Get the updateMode property: The updateMode property. + * + * @return the updateMode value. + */ + public NGroupUpdateMode updateMode() { + return this.updateMode; + } + + /** + * Set the updateMode property: The updateMode property. + * + * @param updateMode the updateMode value to set. + * @return the UpdateProfile object itself. + */ + public UpdateProfile withUpdateMode(NGroupUpdateMode updateMode) { + this.updateMode = updateMode; + return this; + } + + /** + * Get the rollingUpdateProfile property: This profile allows the customers to customize the rolling update. + * + * @return the rollingUpdateProfile value. + */ + public UpdateProfileRollingUpdateProfile rollingUpdateProfile() { + return this.rollingUpdateProfile; + } + + /** + * Set the rollingUpdateProfile property: This profile allows the customers to customize the rolling update. + * + * @param rollingUpdateProfile the rollingUpdateProfile value to set. + * @return the UpdateProfile object itself. + */ + public UpdateProfile withRollingUpdateProfile(UpdateProfileRollingUpdateProfile rollingUpdateProfile) { + this.rollingUpdateProfile = rollingUpdateProfile; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (rollingUpdateProfile() != null) { + rollingUpdateProfile().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("updateMode", this.updateMode == null ? null : this.updateMode.toString()); + jsonWriter.writeJsonField("rollingUpdateProfile", this.rollingUpdateProfile); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UpdateProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UpdateProfile if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the UpdateProfile. + */ + public static UpdateProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UpdateProfile deserializedUpdateProfile = new UpdateProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("updateMode".equals(fieldName)) { + deserializedUpdateProfile.updateMode = NGroupUpdateMode.fromString(reader.getString()); + } else if ("rollingUpdateProfile".equals(fieldName)) { + deserializedUpdateProfile.rollingUpdateProfile = UpdateProfileRollingUpdateProfile.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedUpdateProfile; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/UpdateProfileRollingUpdateProfile.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/UpdateProfileRollingUpdateProfile.java new file mode 100644 index 000000000000..c72ff2c4a0d0 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/UpdateProfileRollingUpdateProfile.java @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * This profile allows the customers to customize the rolling update. + */ +@Fluent +public final class UpdateProfileRollingUpdateProfile implements JsonSerializable { + /* + * Maximum percentage of total Container Groups which can be updated simultaneously by rolling update in one batch. + */ + private Integer maxBatchPercent; + + /* + * Maximum percentage of the updated Container Groups which can be in unhealthy state after each batch is updated. + */ + private Integer maxUnhealthyPercent; + + /* + * The wait time between batches after completing the one batch of the rolling update and starting the next batch. + * The time duration should be specified in ISO 8601 format for duration. + */ + private String pauseTimeBetweenBatches; + + /* + * Default is false. If set to true, the CGs will be updated in-place instead of creating new CG and deleting old + * ones. + */ + private Boolean inPlaceUpdate; + + /** + * Creates an instance of UpdateProfileRollingUpdateProfile class. + */ + public UpdateProfileRollingUpdateProfile() { + } + + /** + * Get the maxBatchPercent property: Maximum percentage of total Container Groups which can be updated + * simultaneously by rolling update in one batch. + * + * @return the maxBatchPercent value. + */ + public Integer maxBatchPercent() { + return this.maxBatchPercent; + } + + /** + * Set the maxBatchPercent property: Maximum percentage of total Container Groups which can be updated + * simultaneously by rolling update in one batch. + * + * @param maxBatchPercent the maxBatchPercent value to set. + * @return the UpdateProfileRollingUpdateProfile object itself. + */ + public UpdateProfileRollingUpdateProfile withMaxBatchPercent(Integer maxBatchPercent) { + this.maxBatchPercent = maxBatchPercent; + return this; + } + + /** + * Get the maxUnhealthyPercent property: Maximum percentage of the updated Container Groups which can be in + * unhealthy state after each batch is updated. + * + * @return the maxUnhealthyPercent value. + */ + public Integer maxUnhealthyPercent() { + return this.maxUnhealthyPercent; + } + + /** + * Set the maxUnhealthyPercent property: Maximum percentage of the updated Container Groups which can be in + * unhealthy state after each batch is updated. + * + * @param maxUnhealthyPercent the maxUnhealthyPercent value to set. + * @return the UpdateProfileRollingUpdateProfile object itself. + */ + public UpdateProfileRollingUpdateProfile withMaxUnhealthyPercent(Integer maxUnhealthyPercent) { + this.maxUnhealthyPercent = maxUnhealthyPercent; + return this; + } + + /** + * Get the pauseTimeBetweenBatches property: The wait time between batches after completing the one batch of the + * rolling update and starting the next batch. The time duration should be specified in ISO 8601 format for + * duration. + * + * @return the pauseTimeBetweenBatches value. + */ + public String pauseTimeBetweenBatches() { + return this.pauseTimeBetweenBatches; + } + + /** + * Set the pauseTimeBetweenBatches property: The wait time between batches after completing the one batch of the + * rolling update and starting the next batch. The time duration should be specified in ISO 8601 format for + * duration. + * + * @param pauseTimeBetweenBatches the pauseTimeBetweenBatches value to set. + * @return the UpdateProfileRollingUpdateProfile object itself. + */ + public UpdateProfileRollingUpdateProfile withPauseTimeBetweenBatches(String pauseTimeBetweenBatches) { + this.pauseTimeBetweenBatches = pauseTimeBetweenBatches; + return this; + } + + /** + * Get the inPlaceUpdate property: Default is false. If set to true, the CGs will be updated in-place instead of + * creating new CG and deleting old ones. + * + * @return the inPlaceUpdate value. + */ + public Boolean inPlaceUpdate() { + return this.inPlaceUpdate; + } + + /** + * Set the inPlaceUpdate property: Default is false. If set to true, the CGs will be updated in-place instead of + * creating new CG and deleting old ones. + * + * @param inPlaceUpdate the inPlaceUpdate value to set. + * @return the UpdateProfileRollingUpdateProfile object itself. + */ + public UpdateProfileRollingUpdateProfile withInPlaceUpdate(Boolean inPlaceUpdate) { + this.inPlaceUpdate = inPlaceUpdate; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("maxBatchPercent", this.maxBatchPercent); + jsonWriter.writeNumberField("maxUnhealthyPercent", this.maxUnhealthyPercent); + jsonWriter.writeStringField("pauseTimeBetweenBatches", this.pauseTimeBetweenBatches); + jsonWriter.writeBooleanField("inPlaceUpdate", this.inPlaceUpdate); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UpdateProfileRollingUpdateProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UpdateProfileRollingUpdateProfile if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the UpdateProfileRollingUpdateProfile. + */ + public static UpdateProfileRollingUpdateProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UpdateProfileRollingUpdateProfile deserializedUpdateProfileRollingUpdateProfile + = new UpdateProfileRollingUpdateProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("maxBatchPercent".equals(fieldName)) { + deserializedUpdateProfileRollingUpdateProfile.maxBatchPercent + = reader.getNullable(JsonReader::getInt); + } else if ("maxUnhealthyPercent".equals(fieldName)) { + deserializedUpdateProfileRollingUpdateProfile.maxUnhealthyPercent + = reader.getNullable(JsonReader::getInt); + } else if ("pauseTimeBetweenBatches".equals(fieldName)) { + deserializedUpdateProfileRollingUpdateProfile.pauseTimeBetweenBatches = reader.getString(); + } else if ("inPlaceUpdate".equals(fieldName)) { + deserializedUpdateProfileRollingUpdateProfile.inPlaceUpdate + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedUpdateProfileRollingUpdateProfile; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Usage.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Usage.java new file mode 100644 index 000000000000..4693ff1b2956 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Usage.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.containerinstance.generated.models; + +import com.azure.resourcemanager.containerinstance.generated.fluent.models.UsageInner; + +/** + * An immutable client-side representation of Usage. + */ +public interface Usage { + /** + * Gets the id property: Id of the usage result. + * + * @return the id value. + */ + String id(); + + /** + * Gets the unit property: Unit of the usage result. + * + * @return the unit value. + */ + String unit(); + + /** + * Gets the currentValue property: The current usage of the resource. + * + * @return the currentValue value. + */ + Integer currentValue(); + + /** + * Gets the limit property: The maximum permitted usage of the resource. + * + * @return the limit value. + */ + Integer limit(); + + /** + * Gets the name property: The name object of the resource. + * + * @return the name value. + */ + UsageName name(); + + /** + * Gets the inner com.azure.resourcemanager.containerinstance.generated.fluent.models.UsageInner object. + * + * @return the inner object. + */ + UsageInner innerModel(); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/UsageListResult.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/UsageListResult.java new file mode 100644 index 000000000000..183bb14c243a --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/UsageListResult.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.UsageInner; +import java.io.IOException; +import java.util.List; + +/** + * The response containing the usage data. + */ +@Immutable +public final class UsageListResult implements JsonSerializable { + /* + * The usage data. + */ + private List value; + + /** + * Creates an instance of UsageListResult class. + */ + public UsageListResult() { + } + + /** + * Get the value property: The usage data. + * + * @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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UsageListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UsageListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the UsageListResult. + */ + public static UsageListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UsageListResult deserializedUsageListResult = new UsageListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> UsageInner.fromJson(reader1)); + deserializedUsageListResult.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedUsageListResult; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/UsageName.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/UsageName.java new file mode 100644 index 000000000000..83ebf4397337 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/UsageName.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The name object of the resource. + */ +@Immutable +public final class UsageName implements JsonSerializable { + /* + * The name of the resource + */ + private String value; + + /* + * The localized name of the resource + */ + private String localizedValue; + + /** + * Creates an instance of UsageName class. + */ + public UsageName() { + } + + /** + * Get the value property: The name of the resource. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Get the localizedValue property: The localized name of the resource. + * + * @return the localizedValue value. + */ + public String localizedValue() { + return this.localizedValue; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UsageName from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UsageName if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the UsageName. + */ + public static UsageName fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UsageName deserializedUsageName = new UsageName(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedUsageName.value = reader.getString(); + } else if ("localizedValue".equals(fieldName)) { + deserializedUsageName.localizedValue = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedUsageName; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/UserAssignedIdentities.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/UserAssignedIdentities.java new file mode 100644 index 000000000000..9d621184c2f7 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/UserAssignedIdentities.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The list of user identities associated with the container group. The user identity dictionary key references will be + * ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + */ +@Immutable +public final class UserAssignedIdentities implements JsonSerializable { + /* + * The principal id of user assigned identity. + */ + private String principalId; + + /* + * The client id of user assigned identity. + */ + private String clientId; + + /** + * Creates an instance of UserAssignedIdentities class. + */ + public UserAssignedIdentities() { + } + + /** + * Get the principalId property: The principal id of user assigned identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the clientId property: The client id of user assigned identity. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserAssignedIdentities from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserAssignedIdentities if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the UserAssignedIdentities. + */ + public static UserAssignedIdentities fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UserAssignedIdentities deserializedUserAssignedIdentities = new UserAssignedIdentities(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("principalId".equals(fieldName)) { + deserializedUserAssignedIdentities.principalId = reader.getString(); + } else if ("clientId".equals(fieldName)) { + deserializedUserAssignedIdentities.clientId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedUserAssignedIdentities; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Volume.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Volume.java new file mode 100644 index 000000000000..79d00ebe69dc --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Volume.java @@ -0,0 +1,250 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The properties of the volume. + */ +@Fluent +public final class Volume implements JsonSerializable { + /* + * The name of the volume. + */ + private String name; + + /* + * The Azure File volume. + */ + private AzureFileVolume azureFile; + + /* + * The empty directory volume. + */ + private Object emptyDir; + + /* + * The secret volume. + */ + private Map secret; + + /* + * The secret reference volume. + */ + private Map secretReference; + + /* + * The git repo volume. + */ + private GitRepoVolume gitRepo; + + /** + * Creates an instance of Volume class. + */ + public Volume() { + } + + /** + * Get the name property: The name of the volume. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the volume. + * + * @param name the name value to set. + * @return the Volume object itself. + */ + public Volume withName(String name) { + this.name = name; + return this; + } + + /** + * Get the azureFile property: The Azure File volume. + * + * @return the azureFile value. + */ + public AzureFileVolume azureFile() { + return this.azureFile; + } + + /** + * Set the azureFile property: The Azure File volume. + * + * @param azureFile the azureFile value to set. + * @return the Volume object itself. + */ + public Volume withAzureFile(AzureFileVolume azureFile) { + this.azureFile = azureFile; + return this; + } + + /** + * Get the emptyDir property: The empty directory volume. + * + * @return the emptyDir value. + */ + public Object emptyDir() { + return this.emptyDir; + } + + /** + * Set the emptyDir property: The empty directory volume. + * + * @param emptyDir the emptyDir value to set. + * @return the Volume object itself. + */ + public Volume withEmptyDir(Object emptyDir) { + this.emptyDir = emptyDir; + return this; + } + + /** + * Get the secret property: The secret volume. + * + * @return the secret value. + */ + public Map secret() { + return this.secret; + } + + /** + * Set the secret property: The secret volume. + * + * @param secret the secret value to set. + * @return the Volume object itself. + */ + public Volume withSecret(Map secret) { + this.secret = secret; + return this; + } + + /** + * Get the secretReference property: The secret reference volume. + * + * @return the secretReference value. + */ + public Map secretReference() { + return this.secretReference; + } + + /** + * Set the secretReference property: The secret reference volume. + * + * @param secretReference the secretReference value to set. + * @return the Volume object itself. + */ + public Volume withSecretReference(Map secretReference) { + this.secretReference = secretReference; + return this; + } + + /** + * Get the gitRepo property: The git repo volume. + * + * @return the gitRepo value. + */ + public GitRepoVolume gitRepo() { + return this.gitRepo; + } + + /** + * Set the gitRepo property: The git repo volume. + * + * @param gitRepo the gitRepo value to set. + * @return the Volume object itself. + */ + public Volume withGitRepo(GitRepoVolume gitRepo) { + this.gitRepo = gitRepo; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER.atError().log(new IllegalArgumentException("Missing required property name in model Volume")); + } + if (azureFile() != null) { + azureFile().validate(); + } + if (gitRepo() != null) { + gitRepo().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(Volume.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeJsonField("azureFile", this.azureFile); + jsonWriter.writeUntypedField("emptyDir", this.emptyDir); + jsonWriter.writeMapField("secret", this.secret, (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("secretReference", this.secretReference, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("gitRepo", this.gitRepo); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Volume from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Volume if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Volume. + */ + public static Volume fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Volume deserializedVolume = new Volume(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedVolume.name = reader.getString(); + } else if ("azureFile".equals(fieldName)) { + deserializedVolume.azureFile = AzureFileVolume.fromJson(reader); + } else if ("emptyDir".equals(fieldName)) { + deserializedVolume.emptyDir = reader.readUntyped(); + } else if ("secret".equals(fieldName)) { + Map secret = reader.readMap(reader1 -> reader1.getString()); + deserializedVolume.secret = secret; + } else if ("secretReference".equals(fieldName)) { + Map secretReference = reader.readMap(reader1 -> reader1.getString()); + deserializedVolume.secretReference = secretReference; + } else if ("gitRepo".equals(fieldName)) { + deserializedVolume.gitRepo = GitRepoVolume.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedVolume; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/VolumeMount.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/VolumeMount.java new file mode 100644 index 000000000000..bfbcdfded27e --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/VolumeMount.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.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The properties of the volume mount. + */ +@Fluent +public final class VolumeMount implements JsonSerializable { + /* + * The name of the volume mount. + */ + private String name; + + /* + * The path within the container where the volume should be mounted. Must not contain colon (:). + */ + private String mountPath; + + /* + * The flag indicating whether the volume mount is read-only. + */ + private Boolean readOnly; + + /** + * Creates an instance of VolumeMount class. + */ + public VolumeMount() { + } + + /** + * Get the name property: The name of the volume mount. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the volume mount. + * + * @param name the name value to set. + * @return the VolumeMount object itself. + */ + public VolumeMount withName(String name) { + this.name = name; + return this; + } + + /** + * Get the mountPath property: The path within the container where the volume should be mounted. Must not contain + * colon (:). + * + * @return the mountPath value. + */ + public String mountPath() { + return this.mountPath; + } + + /** + * Set the mountPath property: The path within the container where the volume should be mounted. Must not contain + * colon (:). + * + * @param mountPath the mountPath value to set. + * @return the VolumeMount object itself. + */ + public VolumeMount withMountPath(String mountPath) { + this.mountPath = mountPath; + return this; + } + + /** + * Get the readOnly property: The flag indicating whether the volume mount is read-only. + * + * @return the readOnly value. + */ + public Boolean readOnly() { + return this.readOnly; + } + + /** + * Set the readOnly property: The flag indicating whether the volume mount is read-only. + * + * @param readOnly the readOnly value to set. + * @return the VolumeMount object itself. + */ + public VolumeMount withReadOnly(Boolean readOnly) { + this.readOnly = readOnly; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property name in model VolumeMount")); + } + if (mountPath() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property mountPath in model VolumeMount")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VolumeMount.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("mountPath", this.mountPath); + jsonWriter.writeBooleanField("readOnly", this.readOnly); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VolumeMount from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VolumeMount if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the VolumeMount. + */ + public static VolumeMount fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VolumeMount deserializedVolumeMount = new VolumeMount(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedVolumeMount.name = reader.getString(); + } else if ("mountPath".equals(fieldName)) { + deserializedVolumeMount.mountPath = reader.getString(); + } else if ("readOnly".equals(fieldName)) { + deserializedVolumeMount.readOnly = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedVolumeMount; + }); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/package-info.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/package-info.java new file mode 100644 index 000000000000..e9b96f44e874 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the data models for ContainerInstanceManagementClient. + * null. + */ +package com.azure.resourcemanager.containerinstance.generated.models; diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/package-info.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/package-info.java new file mode 100644 index 000000000000..7f3dbecd3a75 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the classes for ContainerInstanceManagementClient. + * null. + */ +package com.azure.resourcemanager.containerinstance.generated; diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/module-info.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/module-info.java new file mode 100644 index 000000000000..037f68c9a61b --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/module-info.java @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +module com.azure.resourcemanager.containerinstance.generated { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.containerinstance.generated; + exports com.azure.resourcemanager.containerinstance.generated.fluent; + exports com.azure.resourcemanager.containerinstance.generated.fluent.models; + exports com.azure.resourcemanager.containerinstance.generated.models; + + opens com.azure.resourcemanager.containerinstance.generated.fluent.models to com.azure.core; + opens com.azure.resourcemanager.containerinstance.generated.models to com.azure.core; +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-containerinstance-generated/proxy-config.json b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-containerinstance-generated/proxy-config.json new file mode 100644 index 000000000000..11a6b788344c --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-containerinstance-generated/proxy-config.json @@ -0,0 +1 @@ +[["com.azure.resourcemanager.containerinstance.generated.implementation.CGProfileOperationsClientImpl$CGProfileOperationsService"],["com.azure.resourcemanager.containerinstance.generated.implementation.CGProfilesClientImpl$CGProfilesService"],["com.azure.resourcemanager.containerinstance.generated.implementation.ContainerGroupsClientImpl$ContainerGroupsService"],["com.azure.resourcemanager.containerinstance.generated.implementation.ContainersClientImpl$ContainersService"],["com.azure.resourcemanager.containerinstance.generated.implementation.LocationsClientImpl$LocationsService"],["com.azure.resourcemanager.containerinstance.generated.implementation.NGroupsClientImpl$NGroupsService"],["com.azure.resourcemanager.containerinstance.generated.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.containerinstance.generated.implementation.SubnetServiceAssociationLinksClientImpl$SubnetServiceAssociationLinksService"]] \ No newline at end of file diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-containerinstance-generated/reflect-config.json b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-containerinstance-generated/reflect-config.json new file mode 100644 index 000000000000..0637a088a01e --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-containerinstance-generated/reflect-config.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/resources/azure-resourcemanager-containerinstance-generated.properties b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/resources/azure-resourcemanager-containerinstance-generated.properties new file mode 100644 index 000000000000..defbd48204e4 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/resources/azure-resourcemanager-containerinstance-generated.properties @@ -0,0 +1 @@ +version=${project.version} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/CGProfileOperationCreateOrUpdateSamples.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/CGProfileOperationCreateOrUpdateSamples.java new file mode 100644 index 000000000000..694bd2088018 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/CGProfileOperationCreateOrUpdateSamples.java @@ -0,0 +1,232 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.generated; + +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.containerinstance.generated.models.AzureFileVolume; +import com.azure.resourcemanager.containerinstance.generated.models.ConfidentialComputeProperties; +import com.azure.resourcemanager.containerinstance.generated.models.Container; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupDiagnostics; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupIpAddressType; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupNetworkProtocol; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupSku; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerPort; +import com.azure.resourcemanager.containerinstance.generated.models.DeploymentExtensionSpec; +import com.azure.resourcemanager.containerinstance.generated.models.EncryptionProperties; +import com.azure.resourcemanager.containerinstance.generated.models.GpuResource; +import com.azure.resourcemanager.containerinstance.generated.models.GpuSku; +import com.azure.resourcemanager.containerinstance.generated.models.IpAddress; +import com.azure.resourcemanager.containerinstance.generated.models.LogAnalytics; +import com.azure.resourcemanager.containerinstance.generated.models.LogAnalyticsLogType; +import com.azure.resourcemanager.containerinstance.generated.models.OperatingSystemTypes; +import com.azure.resourcemanager.containerinstance.generated.models.Port; +import com.azure.resourcemanager.containerinstance.generated.models.ResourceRequests; +import com.azure.resourcemanager.containerinstance.generated.models.ResourceRequirements; +import com.azure.resourcemanager.containerinstance.generated.models.SecurityContextCapabilitiesDefinition; +import com.azure.resourcemanager.containerinstance.generated.models.SecurityContextDefinition; +import com.azure.resourcemanager.containerinstance.generated.models.Volume; +import com.azure.resourcemanager.containerinstance.generated.models.VolumeMount; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for CGProfileOperation CreateOrUpdate. + */ +public final class CGProfileOperationCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * ContainerGroupProfileCreateOrUpdate_CreateConfidential.json + */ + /** + * Sample code: ConfidentialContainerGroupProfile. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void confidentialContainerGroupProfile( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.cGProfileOperations() + .define("demo1") + .withRegion("westeurope") + .withExistingResourceGroup("demo") + .withZones(Arrays.asList("1")) + .withSku(ContainerGroupSku.CONFIDENTIAL) + .withContainers( + Arrays + .asList( + new Container().withName("accdemo") + .withImage("confiimage") + .withCommand(Arrays.asList()) + .withPorts(Arrays.asList(new ContainerPort().withPort(8000))) + .withEnvironmentVariables(Arrays.asList()) + .withResources(new ResourceRequirements() + .withRequests(new ResourceRequests().withMemoryInGB(1.5).withCpu(1.0))) + .withSecurityContext(new SecurityContextDefinition().withPrivileged(false) + .withCapabilities(new SecurityContextCapabilitiesDefinition() + .withAdd(Arrays.asList("CAP_NET_ADMIN")))))) + .withImageRegistryCredentials(Arrays.asList()) + .withIpAddress(new IpAddress() + .withPorts(Arrays.asList(new Port().withProtocol(ContainerGroupNetworkProtocol.TCP).withPort(8000))) + .withType(ContainerGroupIpAddressType.PUBLIC)) + .withOsType(OperatingSystemTypes.LINUX) + .withConfidentialComputeProperties(new ConfidentialComputeProperties().withCcePolicy( + "eyJhbGxvd19hbGwiOiB0cnVlLCAiY29udGFpbmVycyI6IHsibGVuZ3RoIjogMCwgImVsZW1lbnRzIjogbnVsbH19")) + .create(); + } + + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * ContainerGroupProfileCreateOrUpdate_EncryptionProperties.json + */ + /** + * Sample code: ContainerGroupProfileWithEncryptionProperties. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerGroupProfileWithEncryptionProperties( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.cGProfileOperations() + .define("demo1") + .withRegion("eastus2") + .withExistingResourceGroup("demo") + .withZones(Arrays.asList("1")) + .withEncryptionProperties(new EncryptionProperties() + .withVaultBaseUrl("https://testkeyvault.vault.azure.net") + .withKeyName("fakeTokenPlaceholder") + .withKeyVersion("fakeTokenPlaceholder") + .withIdentity( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/container-group-identity")) + .withContainers( + Arrays.asList(new Container().withName("demo1") + .withImage("nginx") + .withCommand(Arrays.asList()) + .withPorts(Arrays.asList(new ContainerPort().withPort(80))) + .withEnvironmentVariables(Arrays.asList()) + .withResources(new ResourceRequirements() + .withRequests(new ResourceRequests().withMemoryInGB(1.5).withCpu(1.0))))) + .withImageRegistryCredentials(Arrays.asList()) + .withIpAddress(new IpAddress() + .withPorts(Arrays.asList(new Port().withProtocol(ContainerGroupNetworkProtocol.TCP).withPort(80))) + .withType(ContainerGroupIpAddressType.PUBLIC)) + .withOsType(OperatingSystemTypes.LINUX) + .create(); + } + + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * ContainerGroupProfileCreateOrUpdate_Extensions.json + */ + /** + * Sample code: ContainerGroupProfileCreateWithExtensions. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerGroupProfileCreateWithExtensions( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) throws IOException { + manager.cGProfileOperations() + .define("demo1") + .withRegion("eastus2") + .withExistingResourceGroup("demo") + .withZones(Arrays.asList("1")) + .withContainers( + Arrays.asList(new Container().withName("demo1") + .withImage("nginx") + .withCommand(Arrays.asList()) + .withPorts(Arrays.asList(new ContainerPort().withPort(80))) + .withEnvironmentVariables(Arrays.asList()) + .withResources(new ResourceRequirements() + .withRequests(new ResourceRequests().withMemoryInGB(1.5).withCpu(1.0))))) + .withExtensions(Arrays.asList( + new DeploymentExtensionSpec().withName("kube-proxy") + .withExtensionType("kube-proxy") + .withVersion("1.0") + .withSettings(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{\"clusterCidr\":\"10.240.0.0/16\",\"kubeVersion\":\"v1.9.10\"}", Object.class, + SerializerEncoding.JSON)) + .withProtectedSettings(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{\"kubeConfig\":\"\"}", Object.class, + SerializerEncoding.JSON)), + new DeploymentExtensionSpec().withName("vk-realtime-metrics") + .withExtensionType("realtime-metrics") + .withVersion("1.0"))) + .withImageRegistryCredentials(Arrays.asList()) + .withIpAddress(new IpAddress() + .withPorts(Arrays.asList(new Port().withProtocol(ContainerGroupNetworkProtocol.TCP).withPort(80))) + .withType(ContainerGroupIpAddressType.PRIVATE)) + .withOsType(OperatingSystemTypes.LINUX) + .create(); + } + + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * ContainerGroupProfilesCreateOrUpdate.json + */ + /** + * Sample code: ContainerGroupProfilesCreateOrUpdate. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerGroupProfilesCreateOrUpdate( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) throws IOException { + manager.cGProfileOperations() + .define("demo1") + .withRegion("west us") + .withExistingResourceGroup("demo") + .withZones(Arrays.asList("1")) + .withContainers(Arrays.asList(new Container().withName("demo1") + .withImage("nginx") + .withCommand(Arrays.asList()) + .withPorts(Arrays.asList(new ContainerPort().withPort(80))) + .withEnvironmentVariables(Arrays.asList()) + .withResources(new ResourceRequirements().withRequests(new ResourceRequests().withMemoryInGB(1.5) + .withCpu(1.0) + .withGpu(new GpuResource().withCount(1).withSku(GpuSku.K80)))) + .withVolumeMounts(Arrays.asList( + new VolumeMount().withName("volume1").withMountPath("/mnt/volume1").withReadOnly(false), + new VolumeMount().withName("volume2").withMountPath("/mnt/volume2").withReadOnly(false), + new VolumeMount().withName("volume3").withMountPath("/mnt/volume3").withReadOnly(true))))) + .withImageRegistryCredentials(Arrays.asList()) + .withIpAddress(new IpAddress() + .withPorts(Arrays.asList(new Port().withProtocol(ContainerGroupNetworkProtocol.TCP).withPort(80))) + .withType(ContainerGroupIpAddressType.PUBLIC)) + .withOsType(OperatingSystemTypes.LINUX) + .withVolumes(Arrays.asList( + new Volume().withName("volume1") + .withAzureFile(new AzureFileVolume().withShareName("shareName") + .withStorageAccountName("accountName") + .withStorageAccountKey("fakeTokenPlaceholder")), + new Volume().withName("volume2") + .withEmptyDir(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)), + new Volume().withName("volume3") + .withSecret(mapOf("secretKey1", "fakeTokenPlaceholder", "secretKey2", "fakeTokenPlaceholder")))) + .withDiagnostics(new ContainerGroupDiagnostics().withLogAnalytics(new LogAnalytics() + .withWorkspaceId("workspaceid") + .withWorkspaceKey("fakeTokenPlaceholder") + .withLogType(LogAnalyticsLogType.CONTAINER_INSIGHTS) + .withMetadata(mapOf("pod-uuid", "test-metadata-value")) + .withWorkspaceResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/microsoft.operationalinsights/workspaces/workspace"))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/CGProfileOperationDeleteSamples.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/CGProfileOperationDeleteSamples.java new file mode 100644 index 000000000000..10fbb2b7ae75 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/CGProfileOperationDeleteSamples.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.containerinstance.generated.generated; + +/** + * Samples for CGProfileOperation Delete. + */ +public final class CGProfileOperationDeleteSamples { + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * ContainerGroupProfilesDelete.json + */ + /** + * Sample code: ContainerGroupProfilesDelete. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerGroupProfilesDelete( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.cGProfileOperations().delete("demo", "demo1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/CGProfileOperationGetByResourceGroupSamples.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/CGProfileOperationGetByResourceGroupSamples.java new file mode 100644 index 000000000000..5f52150ae787 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/CGProfileOperationGetByResourceGroupSamples.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.containerinstance.generated.generated; + +/** + * Samples for CGProfileOperation GetByResourceGroup. + */ +public final class CGProfileOperationGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * ContainerGroupProfilesGet.json + */ + /** + * Sample code: ContainerGroupProfilesGet_Succeeded. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerGroupProfilesGetSucceeded( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.cGProfileOperations().getByResourceGroupWithResponse("demo", "demo1", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * ContainerGroupProfilesGetPriority.json + */ + /** + * Sample code: ContainerGroupProfilesGetWithPriority. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerGroupProfilesGetWithPriority( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.cGProfileOperations().getByResourceGroupWithResponse("demo", "demo1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/CGProfileOperationGetByRevisionNumberSamples.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/CGProfileOperationGetByRevisionNumberSamples.java new file mode 100644 index 000000000000..6740f1a1dba0 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/CGProfileOperationGetByRevisionNumberSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.generated; + +/** + * Samples for CGProfileOperation GetByRevisionNumber. + */ +public final class CGProfileOperationGetByRevisionNumberSamples { + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * ContainerGroupProfileGetByRevisionNumber.json + */ + /** + * Sample code: ContainerGroupProfileGetByRevisionNumber. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerGroupProfileGetByRevisionNumber( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.cGProfileOperations() + .getByRevisionNumberWithResponse("demo", "demo1", "1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/CGProfileOperationListAllRevisionsSamples.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/CGProfileOperationListAllRevisionsSamples.java new file mode 100644 index 000000000000..8b98c2463335 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/CGProfileOperationListAllRevisionsSamples.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.containerinstance.generated.generated; + +/** + * Samples for CGProfileOperation ListAllRevisions. + */ +public final class CGProfileOperationListAllRevisionsSamples { + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * ContainerGroupProfileListAllRevisions.json + */ + /** + * Sample code: ContainerGroupProfileListAllRevisions. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerGroupProfileListAllRevisions( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.cGProfileOperations().listAllRevisions("demo", "demo1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/CGProfileOperationUpdateSamples.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/CGProfileOperationUpdateSamples.java new file mode 100644 index 000000000000..e523f672fee6 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/CGProfileOperationUpdateSamples.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.containerinstance.generated.generated; + +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupProfile; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for CGProfileOperation Update. + */ +public final class CGProfileOperationUpdateSamples { + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * ContainerGroupProfilesPatch.json + */ + /** + * Sample code: ContainerGroupProfilesPatch. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerGroupProfilesPatch( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + ContainerGroupProfile resource = manager.cGProfileOperations() + .getByResourceGroupWithResponse("demoResource", "demo1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1key", "fakeTokenPlaceholder", "tag2key", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/CGProfilesListByResourceGroupSamples.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/CGProfilesListByResourceGroupSamples.java new file mode 100644 index 000000000000..fcbdfcdcadc6 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/CGProfilesListByResourceGroupSamples.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.containerinstance.generated.generated; + +/** + * Samples for CGProfiles ListByResourceGroup. + */ +public final class CGProfilesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * ContainerGroupProfilesListByResourceGroup.json + */ + /** + * Sample code: ContainerGroupProfilesListByResourceGroup. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerGroupProfilesListByResourceGroup( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.cGProfiles().listByResourceGroup("demo", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/CGProfilesListSamples.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/CGProfilesListSamples.java new file mode 100644 index 000000000000..a42a1b295af7 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/CGProfilesListSamples.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.containerinstance.generated.generated; + +/** + * Samples for CGProfiles List. + */ +public final class CGProfilesListSamples { + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * ContainerGroupProfilesList.json + */ + /** + * Sample code: ContainerGroupProfilesList. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerGroupProfilesList( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.cGProfiles().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsCreateOrUpdateSamples.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..70b5e142d9ca --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsCreateOrUpdateSamples.java @@ -0,0 +1,370 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.generated; + +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.containerinstance.generated.models.AzureFileVolume; +import com.azure.resourcemanager.containerinstance.generated.models.ConfidentialComputeProperties; +import com.azure.resourcemanager.containerinstance.generated.models.Container; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupDiagnostics; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupIdentity; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupIpAddressType; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupNetworkProtocol; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupPriority; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupRestartPolicy; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupSku; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupSubnetId; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerPort; +import com.azure.resourcemanager.containerinstance.generated.models.DeploymentExtensionSpec; +import com.azure.resourcemanager.containerinstance.generated.models.DnsConfiguration; +import com.azure.resourcemanager.containerinstance.generated.models.DnsNameLabelReusePolicy; +import com.azure.resourcemanager.containerinstance.generated.models.EncryptionProperties; +import com.azure.resourcemanager.containerinstance.generated.models.EnvironmentVariable; +import com.azure.resourcemanager.containerinstance.generated.models.GpuResource; +import com.azure.resourcemanager.containerinstance.generated.models.GpuSku; +import com.azure.resourcemanager.containerinstance.generated.models.ImageRegistryCredential; +import com.azure.resourcemanager.containerinstance.generated.models.IpAddress; +import com.azure.resourcemanager.containerinstance.generated.models.LogAnalytics; +import com.azure.resourcemanager.containerinstance.generated.models.LogAnalyticsLogType; +import com.azure.resourcemanager.containerinstance.generated.models.OperatingSystemTypes; +import com.azure.resourcemanager.containerinstance.generated.models.Port; +import com.azure.resourcemanager.containerinstance.generated.models.ResourceIdentityType; +import com.azure.resourcemanager.containerinstance.generated.models.ResourceRequests; +import com.azure.resourcemanager.containerinstance.generated.models.ResourceRequirements; +import com.azure.resourcemanager.containerinstance.generated.models.SecretReference; +import com.azure.resourcemanager.containerinstance.generated.models.SecurityContextCapabilitiesDefinition; +import com.azure.resourcemanager.containerinstance.generated.models.SecurityContextDefinition; +import com.azure.resourcemanager.containerinstance.generated.models.UserAssignedIdentities; +import com.azure.resourcemanager.containerinstance.generated.models.Volume; +import com.azure.resourcemanager.containerinstance.generated.models.VolumeMount; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ContainerGroups CreateOrUpdate. + */ +public final class ContainerGroupsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * ContainerGroupExtensions.json + */ + /** + * Sample code: ContainerGroupCreateWithExtensions. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerGroupCreateWithExtensions( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) throws IOException { + manager.containerGroups() + .define("demo1") + .withRegion("eastus2") + .withExistingResourceGroup("demo") + .withContainers( + Arrays.asList(new Container().withName("demo1") + .withImage("nginx") + .withCommand(Arrays.asList()) + .withPorts(Arrays.asList(new ContainerPort().withPort(80))) + .withEnvironmentVariables(Arrays.asList()) + .withResources(new ResourceRequirements() + .withRequests(new ResourceRequests().withMemoryInGB(1.5).withCpu(1.0))))) + .withOsType(OperatingSystemTypes.LINUX) + .withImageRegistryCredentials(Arrays.asList()) + .withIpAddress(new IpAddress() + .withPorts(Arrays.asList(new Port().withProtocol(ContainerGroupNetworkProtocol.TCP).withPort(80))) + .withType(ContainerGroupIpAddressType.PRIVATE)) + .withSubnetIds(Arrays.asList(new ContainerGroupSubnetId().withId( + "/subscriptions/00000000-0000-0000-0000-00000000/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-rg-vnet/subnets/test-subnet"))) + .withExtensions(Arrays.asList( + new DeploymentExtensionSpec().withName("kube-proxy") + .withExtensionType("kube-proxy") + .withVersion("1.0") + .withSettings(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{\"clusterCidr\":\"10.240.0.0/16\",\"kubeVersion\":\"v1.9.10\"}", Object.class, + SerializerEncoding.JSON)) + .withProtectedSettings(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{\"kubeConfig\":\"\"}", Object.class, + SerializerEncoding.JSON)), + new DeploymentExtensionSpec().withName("vk-realtime-metrics") + .withExtensionType("realtime-metrics") + .withVersion("1.0"))) + .create(); + } + + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * ContainerGroupEncryptionProperties.json + */ + /** + * Sample code: ContainerGroupWithEncryptionProperties. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerGroupWithEncryptionProperties( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.containerGroups() + .define("demo1") + .withRegion("eastus2") + .withExistingResourceGroup("demo") + .withContainers( + Arrays.asList(new Container().withName("demo1") + .withImage("nginx") + .withCommand(Arrays.asList()) + .withPorts(Arrays.asList(new ContainerPort().withPort(80))) + .withEnvironmentVariables(Arrays.asList()) + .withResources(new ResourceRequirements() + .withRequests(new ResourceRequests().withMemoryInGB(1.5).withCpu(1.0))))) + .withOsType(OperatingSystemTypes.LINUX) + .withIdentity(new ContainerGroupIdentity().withType(ResourceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/container-group-identity", + new UserAssignedIdentities()))) + .withImageRegistryCredentials(Arrays.asList()) + .withIpAddress(new IpAddress() + .withPorts(Arrays.asList(new Port().withProtocol(ContainerGroupNetworkProtocol.TCP).withPort(80))) + .withType(ContainerGroupIpAddressType.PUBLIC)) + .withEncryptionProperties(new EncryptionProperties() + .withVaultBaseUrl("https://testkeyvault.vault.azure.net") + .withKeyName("fakeTokenPlaceholder") + .withKeyVersion("fakeTokenPlaceholder") + .withIdentity( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/container-group-identity")) + .create(); + } + + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * ContainerGroupsCreateOrUpdateSecretReference.json + */ + /** + * Sample code: ContainerGroupsCreateOrUpdateSecretReference. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerGroupsCreateOrUpdateSecretReference( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) throws IOException { + manager.containerGroups() + .define("demo1") + .withRegion("west us") + .withExistingResourceGroup("demo") + .withContainers(Arrays.asList(new Container().withName("demo1") + .withImage("privateRegistryImage") + .withCommand(Arrays.asList()) + .withPorts(Arrays.asList(new ContainerPort().withPort(80))) + .withEnvironmentVariables(Arrays + .asList(new EnvironmentVariable().withName("envSecret").withSecureValueReference("envSecretRef"))) + .withResources(new ResourceRequirements().withRequests(new ResourceRequests().withMemoryInGB(1.5) + .withCpu(1.0) + .withGpu(new GpuResource().withCount(1).withSku(GpuSku.K80)))) + .withVolumeMounts(Arrays.asList( + new VolumeMount().withName("volume1").withMountPath("/mnt/volume1").withReadOnly(false), + new VolumeMount().withName("volume2").withMountPath("/mnt/volume2").withReadOnly(false), + new VolumeMount().withName("volume3").withMountPath("/mnt/volume3").withReadOnly(true))))) + .withOsType(OperatingSystemTypes.LINUX) + .withIdentity(new ContainerGroupIdentity().withType(ResourceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-name", + new UserAssignedIdentities()))) + .withSecretReferences(Arrays.asList(new SecretReference().withName("envSecretRef") + .withIdentity( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-name") + .withSecretReferenceUri("fakeTokenPlaceholder"), + new SecretReference().withName("accountKeyRef") + .withIdentity( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-name") + .withSecretReferenceUri("fakeTokenPlaceholder"), + new SecretReference().withName("volumeSecretRef") + .withIdentity( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-name") + .withSecretReferenceUri("fakeTokenPlaceholder"), + new SecretReference().withName("privateRegistryKeyRef") + .withIdentity( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-name") + .withSecretReferenceUri("fakeTokenPlaceholder"))) + .withImageRegistryCredentials( + Arrays.asList(new ImageRegistryCredential().withServer("demoregistry.azurecr.io") + .withUsername("registryUserName") + .withPasswordReference("fakeTokenPlaceholder"))) + .withIpAddress(new IpAddress() + .withPorts(Arrays.asList(new Port().withProtocol(ContainerGroupNetworkProtocol.TCP).withPort(80))) + .withType(ContainerGroupIpAddressType.PUBLIC) + .withDnsNameLabel("dnsnamelabel1") + .withAutoGeneratedDomainNameLabelScope(DnsNameLabelReusePolicy.UNSECURE)) + .withVolumes(Arrays.asList( + new Volume().withName("volume1") + .withAzureFile(new AzureFileVolume().withShareName("shareName") + .withStorageAccountName("accountName") + .withStorageAccountKeyReference("fakeTokenPlaceholder")), + new Volume().withName("volume2") + .withEmptyDir(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)), + new Volume().withName("volume3") + .withSecret(mapOf("secretKey1", "fakeTokenPlaceholder")) + .withSecretReference(mapOf("secretKey2", "fakeTokenPlaceholder")))) + .withDiagnostics(new ContainerGroupDiagnostics().withLogAnalytics(new LogAnalytics() + .withWorkspaceId("workspaceid") + .withWorkspaceKey("fakeTokenPlaceholder") + .withLogType(LogAnalyticsLogType.CONTAINER_INSIGHTS) + .withMetadata(mapOf("test-key", "fakeTokenPlaceholder")) + .withWorkspaceResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/microsoft.operationalinsights/workspaces/workspace"))) + .withSubnetIds(Arrays.asList(new ContainerGroupSubnetId().withId( + "[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('vnetName'), parameters('subnetName'))]"))) + .withDnsConfig(new DnsConfiguration().withNameServers(Arrays.asList("1.1.1.1")) + .withSearchDomains("cluster.local svc.cluster.local") + .withOptions("ndots:2")) + .create(); + } + + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * ContainerGroupCreateConfidential.json + */ + /** + * Sample code: ConfidentialContainerGroup. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void confidentialContainerGroup( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.containerGroups() + .define("demo1") + .withRegion("westeurope") + .withExistingResourceGroup("demo") + .withContainers( + Arrays + .asList( + new Container().withName("accdemo") + .withImage("confiimage") + .withCommand(Arrays.asList()) + .withPorts(Arrays.asList(new ContainerPort().withPort(8000))) + .withEnvironmentVariables(Arrays.asList()) + .withResources(new ResourceRequirements() + .withRequests(new ResourceRequests().withMemoryInGB(1.5).withCpu(1.0))) + .withSecurityContext(new SecurityContextDefinition().withPrivileged(false) + .withCapabilities(new SecurityContextCapabilitiesDefinition() + .withAdd(Arrays.asList("CAP_NET_ADMIN")))))) + .withOsType(OperatingSystemTypes.LINUX) + .withImageRegistryCredentials(Arrays.asList()) + .withIpAddress(new IpAddress() + .withPorts(Arrays.asList(new Port().withProtocol(ContainerGroupNetworkProtocol.TCP).withPort(8000))) + .withType(ContainerGroupIpAddressType.PUBLIC)) + .withSku(ContainerGroupSku.CONFIDENTIAL) + .withConfidentialComputeProperties(new ConfidentialComputeProperties().withCcePolicy( + "eyJhbGxvd19hbGwiOiB0cnVlLCAiY29udGFpbmVycyI6IHsibGVuZ3RoIjogMCwgImVsZW1lbnRzIjogbnVsbH19")) + .create(); + } + + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * ContainerGroupsCreateOrUpdate.json + */ + /** + * Sample code: ContainerGroupsCreateOrUpdate. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerGroupsCreateOrUpdate( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) throws IOException { + manager.containerGroups() + .define("demo1") + .withRegion("west us") + .withExistingResourceGroup("demo") + .withContainers(Arrays.asList(new Container().withName("demo1") + .withImage("nginx") + .withCommand(Arrays.asList()) + .withPorts(Arrays.asList(new ContainerPort().withPort(80))) + .withEnvironmentVariables(Arrays.asList()) + .withResources(new ResourceRequirements().withRequests(new ResourceRequests().withMemoryInGB(1.5) + .withCpu(1.0) + .withGpu(new GpuResource().withCount(1).withSku(GpuSku.K80)))) + .withVolumeMounts(Arrays.asList( + new VolumeMount().withName("volume1").withMountPath("/mnt/volume1").withReadOnly(false), + new VolumeMount().withName("volume2").withMountPath("/mnt/volume2").withReadOnly(false), + new VolumeMount().withName("volume3").withMountPath("/mnt/volume3").withReadOnly(true))))) + .withOsType(OperatingSystemTypes.LINUX) + .withIdentity(new ContainerGroupIdentity().withType(ResourceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-name", + new UserAssignedIdentities()))) + .withImageRegistryCredentials(Arrays.asList()) + .withIpAddress(new IpAddress() + .withPorts(Arrays.asList(new Port().withProtocol(ContainerGroupNetworkProtocol.TCP).withPort(80))) + .withType(ContainerGroupIpAddressType.PUBLIC) + .withDnsNameLabel("dnsnamelabel1") + .withAutoGeneratedDomainNameLabelScope(DnsNameLabelReusePolicy.UNSECURE)) + .withVolumes(Arrays.asList( + new Volume().withName("volume1") + .withAzureFile(new AzureFileVolume().withShareName("shareName") + .withStorageAccountName("accountName") + .withStorageAccountKey("fakeTokenPlaceholder")), + new Volume().withName("volume2") + .withEmptyDir(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)), + new Volume().withName("volume3") + .withSecret(mapOf("secretKey1", "fakeTokenPlaceholder", "secretKey2", "fakeTokenPlaceholder")))) + .withDiagnostics(new ContainerGroupDiagnostics().withLogAnalytics(new LogAnalytics() + .withWorkspaceId("workspaceid") + .withWorkspaceKey("fakeTokenPlaceholder") + .withLogType(LogAnalyticsLogType.CONTAINER_INSIGHTS) + .withMetadata(mapOf("test-key", "fakeTokenPlaceholder")) + .withWorkspaceResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/microsoft.operationalinsights/workspaces/workspace"))) + .withSubnetIds(Arrays.asList(new ContainerGroupSubnetId().withId( + "[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('vnetName'), parameters('subnetName'))]"))) + .withDnsConfig(new DnsConfiguration().withNameServers(Arrays.asList("1.1.1.1")) + .withSearchDomains("cluster.local svc.cluster.local") + .withOptions("ndots:2")) + .create(); + } + + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * ContainerGroupsCreatePriority.json + */ + /** + * Sample code: ContainerGroupsCreateWithPriority. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerGroupsCreateWithPriority( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.containerGroups() + .define("demo1") + .withRegion("eastus") + .withExistingResourceGroup("demo") + .withContainers( + Arrays.asList(new Container().withName("test-container-001") + .withImage("alpine:latest") + .withCommand(Arrays.asList("/bin/sh", "-c", "sleep 10")) + .withResources(new ResourceRequirements() + .withRequests(new ResourceRequests().withMemoryInGB(1.0).withCpu(1.0))))) + .withOsType(OperatingSystemTypes.LINUX) + .withRestartPolicy(ContainerGroupRestartPolicy.NEVER) + .withSku(ContainerGroupSku.STANDARD) + .withPriority(ContainerGroupPriority.SPOT) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsDeleteSamples.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsDeleteSamples.java new file mode 100644 index 000000000000..61a2823626f8 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsDeleteSamples.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.containerinstance.generated.generated; + +/** + * Samples for ContainerGroups Delete. + */ +public final class ContainerGroupsDeleteSamples { + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * ContainerGroupsDelete.json + */ + /** + * Sample code: ContainerGroupsDelete. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void + containerGroupsDelete(com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.containerGroups().delete("demo", "demo1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsGetByResourceGroupSamples.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..1e5ad04d1f2a --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsGetByResourceGroupSamples.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.containerinstance.generated.generated; + +/** + * Samples for ContainerGroups GetByResourceGroup. + */ +public final class ContainerGroupsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * ContainerGroupsGetPriority.json + */ + /** + * Sample code: ContainerGroupsGetWithPriority. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerGroupsGetWithPriority( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.containerGroups().getByResourceGroupWithResponse("demo", "demo1", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * ContainerGroupsGet_Succeeded.json + */ + /** + * Sample code: ContainerGroupsGet_Succeeded. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerGroupsGetSucceeded( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.containerGroups().getByResourceGroupWithResponse("demo", "demo1", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * ContainerGroupsGet_Failed.json + */ + /** + * Sample code: ContainerGroupsGet_Failed. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerGroupsGetFailed( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.containerGroups().getByResourceGroupWithResponse("demo", "demo1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsListByResourceGroupSamples.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsListByResourceGroupSamples.java new file mode 100644 index 000000000000..93e34f2727cd --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsListByResourceGroupSamples.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.containerinstance.generated.generated; + +/** + * Samples for ContainerGroups ListByResourceGroup. + */ +public final class ContainerGroupsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * ContainerGroupsListByResourceGroup.json + */ + /** + * Sample code: ContainerGroupsListByResourceGroup. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerGroupsListByResourceGroup( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.containerGroups().listByResourceGroup("demo", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsListSamples.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsListSamples.java new file mode 100644 index 000000000000..e05dccb924fe --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsListSamples.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.containerinstance.generated.generated; + +/** + * Samples for ContainerGroups List. + */ +public final class ContainerGroupsListSamples { + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * ContainerGroupsList.json + */ + /** + * Sample code: ContainerGroupsList. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void + containerGroupsList(com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.containerGroups().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsRestartSamples.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsRestartSamples.java new file mode 100644 index 000000000000..d59306d2f4b0 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsRestartSamples.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.containerinstance.generated.generated; + +/** + * Samples for ContainerGroups Restart. + */ +public final class ContainerGroupsRestartSamples { + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * ContainerGroupsRestart.json + */ + /** + * Sample code: ContainerRestart. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void + containerRestart(com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.containerGroups().restart("demo", "demo1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsStartSamples.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsStartSamples.java new file mode 100644 index 000000000000..457517b8bf2d --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsStartSamples.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.containerinstance.generated.generated; + +/** + * Samples for ContainerGroups Start. + */ +public final class ContainerGroupsStartSamples { + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * ContainerGroupsStart.json + */ + /** + * Sample code: ContainerStart. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void + containerStart(com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.containerGroups().start("demo", "demo1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsStopSamples.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsStopSamples.java new file mode 100644 index 000000000000..350d6a20c0b1 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsStopSamples.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.containerinstance.generated.generated; + +/** + * Samples for ContainerGroups Stop. + */ +public final class ContainerGroupsStopSamples { + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * ContainerGroupsStop.json + */ + /** + * Sample code: ContainerStop. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void + containerStop(com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.containerGroups().stopWithResponse("demo", "demo1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsUpdateSamples.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsUpdateSamples.java new file mode 100644 index 000000000000..2d8c287931f5 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsUpdateSamples.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.containerinstance.generated.generated; + +import com.azure.core.management.Resource; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ContainerGroups Update. + */ +public final class ContainerGroupsUpdateSamples { + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * ContainerGroupsUpdate.json + */ + /** + * Sample code: ContainerGroupsUpdate. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void + containerGroupsUpdate(com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.containerGroups() + .updateWithResponse("demoResource", "demo1", + new Resource().withTags(mapOf("tag1key", "fakeTokenPlaceholder", "tag2key", "fakeTokenPlaceholder")), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainersAttachSamples.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainersAttachSamples.java new file mode 100644 index 000000000000..e98917774d57 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainersAttachSamples.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.containerinstance.generated.generated; + +/** + * Samples for Containers Attach. + */ +public final class ContainersAttachSamples { + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * ContainerAttach.json + */ + /** + * Sample code: ContainerAttach. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void + containerAttach(com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.containers().attachWithResponse("demo", "demo1", "container1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainersExecuteCommandSamples.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainersExecuteCommandSamples.java new file mode 100644 index 000000000000..212a61531ccc --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainersExecuteCommandSamples.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.containerinstance.generated.generated; + +import com.azure.resourcemanager.containerinstance.generated.models.ContainerExecRequest; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerExecRequestTerminalSize; + +/** + * Samples for Containers ExecuteCommand. + */ +public final class ContainersExecuteCommandSamples { + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * ContainerExec.json + */ + /** + * Sample code: ContainerExec. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void + containerExec(com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.containers() + .executeCommandWithResponse("demo", "demo1", "container1", + new ContainerExecRequest().withCommand("/bin/bash") + .withTerminalSize(new ContainerExecRequestTerminalSize().withRows(12).withCols(12)), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainersListLogsSamples.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainersListLogsSamples.java new file mode 100644 index 000000000000..7e4e5711895d --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainersListLogsSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.generated; + +/** + * Samples for Containers ListLogs. + */ +public final class ContainersListLogsSamples { + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * ContainerListLogs.json + */ + /** + * Sample code: ContainerListLogs. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void + containerListLogs(com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.containers() + .listLogsWithResponse("demo", "demo1", "container1", 10, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/LocationListCachedImagesSamples.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/LocationListCachedImagesSamples.java new file mode 100644 index 000000000000..a2166a28e8b3 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/LocationListCachedImagesSamples.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.containerinstance.generated.generated; + +/** + * Samples for Location ListCachedImages. + */ +public final class LocationListCachedImagesSamples { + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * CachedImagesList.json + */ + /** + * Sample code: CachedImages. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void + cachedImages(com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.locations().listCachedImages("westcentralus", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/LocationListCapabilitiesSamples.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/LocationListCapabilitiesSamples.java new file mode 100644 index 000000000000..f6cb16be6962 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/LocationListCapabilitiesSamples.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.containerinstance.generated.generated; + +/** + * Samples for Location ListCapabilities. + */ +public final class LocationListCapabilitiesSamples { + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * CapabilitiesList.json + */ + /** + * Sample code: GetCapabilities. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void + getCapabilities(com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.locations().listCapabilities("westus", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/LocationListUsageSamples.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/LocationListUsageSamples.java new file mode 100644 index 000000000000..c55a1293293c --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/LocationListUsageSamples.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.containerinstance.generated.generated; + +/** + * Samples for Location ListUsage. + */ +public final class LocationListUsageSamples { + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * ContainerGroupUsage.json + */ + /** + * Sample code: ContainerUsage. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void + containerUsage(com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.locations().listUsage("westcentralus", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/OperationsListSamples.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/OperationsListSamples.java new file mode 100644 index 000000000000..f63dd1a549aa --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/OperationsListSamples.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.containerinstance.generated.generated; + +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * OperationsList.json + */ + /** + * Sample code: OperationsList. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void + operationsList(com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/SubnetServiceAssociationLinkDeleteSamples.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/SubnetServiceAssociationLinkDeleteSamples.java new file mode 100644 index 000000000000..1c094626fca4 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/SubnetServiceAssociationLinkDeleteSamples.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.containerinstance.generated.generated; + +/** + * Samples for SubnetServiceAssociationLink Delete. + */ +public final class SubnetServiceAssociationLinkDeleteSamples { + /* + * x-ms-original-file: + * specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ + * SubnetServiceAssociationLinkDelete.json + */ + /** + * Sample code: SubnetServiceAssociationLinkDelete. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void subnetServiceAssociationLinkDelete( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.subnetServiceAssociationLinks().delete("demo", "demo2", "demo3", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerinstance/ci.yml b/sdk/containerinstance/ci.yml new file mode 100644 index 000000000000..904cdf02c648 --- /dev/null +++ b/sdk/containerinstance/ci.yml @@ -0,0 +1,46 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/containerinstance/ci.yml + - sdk/containerinstance/azure-resourcemanager-containerinstance-generated/ + exclude: + - sdk/containerinstance/pom.xml + - sdk/containerinstance/azure-resourcemanager-containerinstance-generated/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/containerinstance/ci.yml + - sdk/containerinstance/azure-resourcemanager-containerinstance-generated/ + exclude: + - sdk/containerinstance/pom.xml + - sdk/containerinstance/azure-resourcemanager-containerinstance-generated/pom.xml + +parameters: + - name: release_azureresourcemanagercontainerinstancegenerated + displayName: azure-resourcemanager-containerinstance-generated + type: boolean + default: false + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: containerinstance + Artifacts: + - name: azure-resourcemanager-containerinstance-generated + groupId: com.azure.resourcemanager + safeName: azureresourcemanagercontainerinstancegenerated + releaseInBatch: ${{ parameters.release_azureresourcemanagercontainerinstancegenerated }} diff --git a/sdk/containerinstance/pom.xml b/sdk/containerinstance/pom.xml new file mode 100644 index 000000000000..dcfd797bafab --- /dev/null +++ b/sdk/containerinstance/pom.xml @@ -0,0 +1,15 @@ + + + 4.0.0 + com.azure + azure-containerinstance-service + pom + 1.0.0 + + + azure-resourcemanager-containerinstance-generated + +