From 3df001344277f4b746b90567064ae075cb373ca7 Mon Sep 17 00:00:00 2001 From: Xiaolu Dai <31124698+saragluna@users.noreply.github.com> Date: Tue, 6 Dec 2022 11:10:48 +0800 Subject: [PATCH 1/3] fix ua in kv property source (#32458) --- .../KeyVaultEnvironmentPostProcessor.java | 5 +- ...ultSecretPropertySourceUserAgentTests.java | 47 +++++++++++++++++++ 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/keyvault/environment/KeyVaultSecretPropertySourceUserAgentTests.java diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/keyvault/environment/KeyVaultEnvironmentPostProcessor.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/keyvault/environment/KeyVaultEnvironmentPostProcessor.java index a9a25f572d42..a9159f2f3364 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/keyvault/environment/KeyVaultEnvironmentPostProcessor.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/keyvault/environment/KeyVaultEnvironmentPostProcessor.java @@ -8,6 +8,7 @@ import com.azure.spring.cloud.autoconfigure.implementation.keyvault.secrets.properties.AzureKeyVaultPropertySourceProperties; import com.azure.spring.cloud.autoconfigure.implementation.keyvault.secrets.properties.AzureKeyVaultSecretProperties; import com.azure.spring.cloud.core.implementation.util.AzurePropertiesUtils; +import com.azure.spring.cloud.core.implementation.util.AzureSpringIdentifier; import com.azure.spring.cloud.service.implementation.keyvault.secrets.SecretClientBuilderFactory; import org.apache.commons.logging.Log; import org.springframework.boot.SpringApplication; @@ -151,7 +152,9 @@ private AzureKeyVaultSecretProperties toAzureKeyVaultSecretProperties( * @return secret client */ SecretClient buildSecretClient(AzureKeyVaultSecretProperties secretProperties) { - return new SecretClientBuilderFactory(secretProperties).build().buildClient(); + SecretClientBuilderFactory factory = new SecretClientBuilderFactory(secretProperties); + factory.setSpringIdentifier(AzureSpringIdentifier.AZURE_SPRING_KEY_VAULT_SECRETS); + return factory.build().buildClient(); } AzureKeyVaultSecretProperties loadProperties(ConfigurableEnvironment environment) { diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/keyvault/environment/KeyVaultSecretPropertySourceUserAgentTests.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/keyvault/environment/KeyVaultSecretPropertySourceUserAgentTests.java new file mode 100644 index 000000000000..9f64cb491049 --- /dev/null +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/keyvault/environment/KeyVaultSecretPropertySourceUserAgentTests.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.spring.cloud.autoconfigure.keyvault.environment; + +import com.azure.core.http.policy.HttpLogDetailLevel; +import com.azure.security.keyvault.secrets.SecretClient; +import com.azure.spring.cloud.autoconfigure.implementation.keyvault.secrets.properties.AzureKeyVaultSecretProperties; +import com.azure.spring.cloud.core.implementation.util.AzureSpringIdentifier; +import com.azure.spring.cloud.core.provider.RetryOptionsProvider; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.junit.jupiter.api.parallel.Isolated; +import org.springframework.boot.test.system.CapturedOutput; +import org.springframework.boot.test.system.OutputCaptureExtension; + +import java.time.Duration; + +import static org.junit.jupiter.api.Assertions.assertTrue; + +@Isolated("Run this by itself as it captures System.out") +@ExtendWith(OutputCaptureExtension.class) +class KeyVaultSecretPropertySourceUserAgentTests { + + @Test + public void userAgentTest(CapturedOutput output) { + AzureKeyVaultSecretProperties properties = new AzureKeyVaultSecretProperties(); + properties.setEndpoint("https://sample-propertysource.vault.azure.net/"); + properties.getClient().getLogging().setLevel(HttpLogDetailLevel.HEADERS); + properties.getClient().getLogging().getAllowedHeaderNames().add("User-Agent"); + properties.getRetry().setMode(RetryOptionsProvider.RetryMode.FIXED); + properties.getRetry().getFixed().setDelay(Duration.ofSeconds(1)); + properties.getRetry().getFixed().setMaxRetries(0); + + KeyVaultEnvironmentPostProcessor environmentPostProcessor = new KeyVaultEnvironmentPostProcessor(); + SecretClient secretClient = environmentPostProcessor.buildSecretClient(properties); + try { + secretClient.getSecret("property-source-name1"); + } catch (Exception exception) { + // Eat it because we just want the log. + } + String allOutput = output.getAll(); + String format1 = String.format("User-Agent:%s", AzureSpringIdentifier.AZURE_SPRING_KEY_VAULT_SECRETS); + String format2 = String.format("\"User-Agent\":\"%s", AzureSpringIdentifier.AZURE_SPRING_KEY_VAULT_SECRETS); + assertTrue(allOutput.contains(format1) || allOutput.contains(format2)); + } +} From dc962cea6ed55d3ec39252e5a9cbbbdde889b7a7 Mon Sep 17 00:00:00 2001 From: Moary Chen Date: Tue, 6 Dec 2022 11:14:04 +0800 Subject: [PATCH 2/3] Enhance the token authentication converter to accept the custom jwt granted authorities converter (#32335) --- .../checkstyle/checkstyle-suppressions.xml | 1 + sdk/spring/CHANGELOG.md | 7 +- ...JwtBearerTokenAuthenticationConverter.java | 32 +++++++-- ...rceServerWebSecurityConfigurerAdapter.java | 49 ++++++++++++-- .../AadResourceServerConfiguration.java | 2 +- ...arerTokenAuthenticationConverterTests.java | 42 ++++++++++-- .../AadResourceServerConfigurationTests.java | 65 +++++++++++++++++++ 7 files changed, 180 insertions(+), 18 deletions(-) diff --git a/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml b/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml index 8f9e07c62893..69d055f7475f 100755 --- a/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml +++ b/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml @@ -399,6 +399,7 @@ the main ServiceBusClientBuilder. --> + diff --git a/sdk/spring/CHANGELOG.md b/sdk/spring/CHANGELOG.md index 1ae273aaa133..23298c8401b5 100644 --- a/sdk/spring/CHANGELOG.md +++ b/sdk/spring/CHANGELOG.md @@ -7,11 +7,12 @@ Upgrade Spring Boot dependencies version to 2.7.4 and Spring Cloud dependencies ### Spring Cloud Azure Autoconfigure This section includes changes in `spring-cloud-azure-autoconfigure` module. -#### Dependency Updates -- Upgrade spring-security to 5.7.5 to address [CVE-2022-31690](https://tanzu.vmware.com/security/cve-2022-31690) [#32145](https://github.com/Azure/azure-sdk-for-java/pull/32145). - #### Features Added - Remove warning logs of Kafka passwordless autoconfiguration. [#31182](https://github.com/Azure/azure-sdk-for-java/issues/31182) +- Enhance the token authentication converter and Azure AD Resource Server configurer adapter to accept the custom jwt granted authorities converter. [#28665](https://github.com/Azure/azure-sdk-for-java/issues/28665) + +#### Dependency Updates +- Upgrade spring-security to 5.7.5 to address [CVE-2022-31690](https://tanzu.vmware.com/security/cve-2022-31690) [#32145](https://github.com/Azure/azure-sdk-for-java/pull/32145). ## 4.4.1 (2022-10-31) diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/aad/AadJwtBearerTokenAuthenticationConverter.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/aad/AadJwtBearerTokenAuthenticationConverter.java index d9dd09d67346..e95ed67e8903 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/aad/AadJwtBearerTokenAuthenticationConverter.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/aad/AadJwtBearerTokenAuthenticationConverter.java @@ -30,7 +30,7 @@ @Deprecated public class AadJwtBearerTokenAuthenticationConverter implements Converter { - private final Converter> converter; + private final Converter> jwtGrantedAuthoritiesConverter; private final String principalClaimName; /** @@ -58,20 +58,42 @@ public AadJwtBearerTokenAuthenticationConverter(String authoritiesClaimName) { */ public AadJwtBearerTokenAuthenticationConverter(String authoritiesClaimName, String authorityPrefix) { - this(null, buildClaimToAuthorityPrefixMap(authoritiesClaimName, authorityPrefix)); + this(AadJwtClaimNames.SUB, buildClaimToAuthorityPrefixMap(authoritiesClaimName, authorityPrefix)); } /** * Using spring security provides JwtGrantedAuthoritiesConverter, it can resolve the access token of scp or roles. * - * @param principalClaimName authorities claim name + * @param principalClaimName the claim name for the principal * @param claimToAuthorityPrefixMap the authority name and prefix map */ public AadJwtBearerTokenAuthenticationConverter(String principalClaimName, Map claimToAuthorityPrefixMap) { Assert.notNull(claimToAuthorityPrefixMap, "claimToAuthorityPrefixMap cannot be null"); this.principalClaimName = principalClaimName; - this.converter = new AadJwtGrantedAuthoritiesConverter(claimToAuthorityPrefixMap); + this.jwtGrantedAuthoritiesConverter = new AadJwtGrantedAuthoritiesConverter(claimToAuthorityPrefixMap); + } + + /** + * Using the custom JwtGrantedAuthoritiesConverter. + * + * @param jwtGrantedAuthoritiesConverter the custom granted authority converter + */ + public AadJwtBearerTokenAuthenticationConverter(Converter> jwtGrantedAuthoritiesConverter) { + this(AadJwtClaimNames.SUB, jwtGrantedAuthoritiesConverter); + } + + /** + * Using the principal claim name and the custom JwtGrantedAuthoritiesConverter. + * + * @param principalClaimName the claim name for the principal + * @param jwtGrantedAuthoritiesConverter the custom granted authority converter + */ + public AadJwtBearerTokenAuthenticationConverter(String principalClaimName, + Converter> jwtGrantedAuthoritiesConverter) { + Assert.notNull(jwtGrantedAuthoritiesConverter, "jwtGrantedAuthoritiesConverter cannot be null"); + this.principalClaimName = principalClaimName; + this.jwtGrantedAuthoritiesConverter = jwtGrantedAuthoritiesConverter; } /** @@ -85,7 +107,7 @@ public AbstractAuthenticationToken convert(Jwt jwt) { OAuth2AccessToken accessToken = new OAuth2AccessToken( OAuth2AccessToken.TokenType.BEARER, jwt.getTokenValue(), jwt.getIssuedAt(), jwt.getExpiresAt()); Map claims = jwt.getClaims(); - Collection authorities = converter.convert(jwt); + Collection authorities = jwtGrantedAuthoritiesConverter.convert(jwt); OAuth2AuthenticatedPrincipal principal = new AadOAuth2AuthenticatedPrincipal( jwt.getHeaders(), claims, authorities, jwt.getTokenValue(), (String) claims.get(principalClaimName)); return new BearerTokenAuthentication(principal, accessToken, authorities); diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/aad/AadResourceServerWebSecurityConfigurerAdapter.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/aad/AadResourceServerWebSecurityConfigurerAdapter.java index c4d7123dbdb2..fb67cd6afedf 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/aad/AadResourceServerWebSecurityConfigurerAdapter.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/aad/AadResourceServerWebSecurityConfigurerAdapter.java @@ -10,10 +10,15 @@ import org.springframework.security.authentication.AbstractAuthenticationToken; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; +import org.springframework.security.config.annotation.web.configurers.oauth2.server.resource.OAuth2ResourceServerConfigurer; +import org.springframework.security.core.GrantedAuthority; import org.springframework.security.oauth2.jwt.Jwt; import org.springframework.security.oauth2.server.resource.authentication.JwtAuthenticationConverter; +import org.springframework.util.Assert; import org.springframework.util.StringUtils; +import java.util.Collection; + /** * Abstract configuration class, used to make JwtConfigurer and AADJwtBearerTokenAuthenticationConverter take effect. * @@ -22,10 +27,32 @@ public abstract class AadResourceServerWebSecurityConfigurerAdapter extends WebSecurityConfigurerAdapter { @Autowired - AadResourceServerProperties properties; + private AadResourceServerProperties properties; + + private Converter> jwtGrantedAuthoritiesConverter; /** - * configure + * Creates a new instance with the default configuration. + */ + public AadResourceServerWebSecurityConfigurerAdapter() { + } + + /** + * Sets the Azure AD properties and custom granted authority converter to creates a new instance, + * the custom granted authority converter can be null. + * + * @param properties the Azure AD properties for Resource Server + * @param jwtGrantedAuthoritiesConverter the custom converter for JWT granted authority + */ + public AadResourceServerWebSecurityConfigurerAdapter(AadResourceServerProperties properties, + Converter> jwtGrantedAuthoritiesConverter) { + Assert.notNull(jwtGrantedAuthoritiesConverter, "jwtGrantedAuthoritiesConverter cannot be null"); + this.properties = properties; + this.jwtGrantedAuthoritiesConverter = jwtGrantedAuthoritiesConverter; + } + + /** + * Apply the {@link OAuth2ResourceServerConfigurer} for Azure AD OAuth2 Resource Server scenario. * * @param http the {@link HttpSecurity} to use * @throws Exception Configuration failed @@ -45,8 +72,22 @@ private Converter jwtAuthenticationConverter() if (StringUtils.hasText(properties.getPrincipalClaimName())) { converter.setPrincipalClaimName(properties.getPrincipalClaimName()); } - converter.setJwtGrantedAuthoritiesConverter( - new AadJwtGrantedAuthoritiesConverter(properties.getClaimToAuthorityPrefixMap())); + + this.jwtGrantedAuthoritiesConverter = jwtGrantedAuthoritiesConverter(); + if (this.jwtGrantedAuthoritiesConverter != null) { + converter.setJwtGrantedAuthoritiesConverter(jwtGrantedAuthoritiesConverter); + } else { + converter.setJwtGrantedAuthoritiesConverter( + new AadJwtGrantedAuthoritiesConverter(properties.getClaimToAuthorityPrefixMap())); + } return converter; } + + /** + * Customize the Jwt granted authority converter, and return the {@link AadResourceServerWebSecurityConfigurerAdapter#jwtGrantedAuthoritiesConverter} by default. + * @return the Jwt granted authority converter. + */ + protected Converter> jwtGrantedAuthoritiesConverter() { + return this.jwtGrantedAuthoritiesConverter; + } } diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/aad/configuration/AadResourceServerConfiguration.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/aad/configuration/AadResourceServerConfiguration.java index a1c1d770d9af..d4979f464c1f 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/aad/configuration/AadResourceServerConfiguration.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/aad/configuration/AadResourceServerConfiguration.java @@ -109,7 +109,7 @@ public static class DefaultAadResourceServerWebSecurityConfigurerAdapter extends AadResourceServerWebSecurityConfigurerAdapter { /** - * configure + * Configure the default Resource Server for Azure AD. * * @param http the {@link HttpSecurity} to use * @throws Exception Configuration failed diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/aad/AadJwtBearerTokenAuthenticationConverterTests.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/aad/AadJwtBearerTokenAuthenticationConverterTests.java index 0f75a64b6b15..3bd970539919 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/aad/AadJwtBearerTokenAuthenticationConverterTests.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/aad/AadJwtBearerTokenAuthenticationConverterTests.java @@ -2,23 +2,29 @@ // Licensed under the MIT License. package com.azure.spring.cloud.autoconfigure.aad; +import com.azure.spring.cloud.autoconfigure.aad.implementation.constants.AadJwtClaimNames; import com.azure.spring.cloud.autoconfigure.aad.implementation.oauth2.AadOAuth2AuthenticatedPrincipal; import net.minidev.json.JSONArray; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; +import org.springframework.core.convert.converter.Converter; import org.springframework.security.authentication.AbstractAuthenticationToken; +import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.security.oauth2.jwt.Jwt; import java.time.Instant; +import java.util.Collection; import java.util.HashMap; import java.util.Map; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; +import static org.mockito.internal.verification.VerificationModeFactory.times; @TestInstance(TestInstance.Lifecycle.PER_CLASS) class AadJwtBearerTokenAuthenticationConverterTests { @@ -32,6 +38,7 @@ class AadJwtBearerTokenAuthenticationConverterTests { void init() { claims.put("iss", "fake-issuer"); claims.put("tid", "fake-tid"); + claims.put("name", "fake-user"); headers.put("kid", "kg2LYs2T0CTjIfj4rt6JIynen38"); when(jwt.getClaim("scp")).thenReturn("Order.read Order.write"); when(jwt.getClaim("roles")).thenReturn(jsonArray); @@ -62,7 +69,7 @@ void testNoArgumentsConstructorDefaultScopeAndRoleAuthorities() { AadOAuth2AuthenticatedPrincipal principal = (AadOAuth2AuthenticatedPrincipal) authenticationToken .getPrincipal(); assertThat(principal.getAttributes()).isNotEmpty(); - assertThat(principal.getAttributes()).hasSize(2); + assertThat(principal.getAttributes()).hasSize(3); assertThat(principal.getAuthorities()).hasSize(4); } @@ -74,7 +81,7 @@ void testNoArgumentsConstructorExtractScopeAuthorities() { AadOAuth2AuthenticatedPrincipal principal = (AadOAuth2AuthenticatedPrincipal) authenticationToken .getPrincipal(); assertThat(principal.getAttributes()).isNotEmpty(); - assertThat(principal.getAttributes()).hasSize(2); + assertThat(principal.getAttributes()).hasSize(3); assertThat(principal.getAuthorities()).hasSize(4); } @@ -86,7 +93,7 @@ void testParameterConstructorExtractScopeAuthorities() { AadOAuth2AuthenticatedPrincipal principal = (AadOAuth2AuthenticatedPrincipal) authenticationToken .getPrincipal(); assertThat(principal.getAttributes()).isNotEmpty(); - assertThat(principal.getAttributes()).hasSize(2); + assertThat(principal.getAttributes()).hasSize(3); assertThat(principal.getAuthorities()).hasSize(2); } @@ -99,7 +106,7 @@ void testParameterConstructorExtractRoleAuthorities() { AadOAuth2AuthenticatedPrincipal principal = (AadOAuth2AuthenticatedPrincipal) authenticationToken .getPrincipal(); assertThat(principal.getAttributes()).isNotEmpty(); - assertThat(principal.getAttributes()).hasSize(2); + assertThat(principal.getAttributes()).hasSize(3); assertThat(principal.getAuthorities()).hasSize(2); } @@ -113,9 +120,34 @@ void testConstructorExtractRoleAuthoritiesWithAuthorityPrefixMapParameter() { AadOAuth2AuthenticatedPrincipal principal = (AadOAuth2AuthenticatedPrincipal) authenticationToken .getPrincipal(); assertThat(principal.getAttributes()).isNotEmpty(); - assertThat(principal.getAttributes()).hasSize(2); + assertThat(principal.getAttributes()).hasSize(3); assertThat(principal.getAuthorities()).hasSize(2); Assertions.assertTrue(principal.getAuthorities().contains(new SimpleGrantedAuthority("APPROLE_User.read"))); Assertions.assertTrue(principal.getAuthorities().contains(new SimpleGrantedAuthority("APPROLE_User.write"))); } + + @Test + void createTokenAuthenticationConverterWithGrantedAuthorityConverter() { + Converter> grantedAuthorityConverter = mock(TestJwtGrantedAuthoritiesConverter.class); + AadJwtBearerTokenAuthenticationConverter tokenAuthenticationConverter = new AadJwtBearerTokenAuthenticationConverter(grantedAuthorityConverter); + tokenAuthenticationConverter.convert(jwt); + verify(grantedAuthorityConverter, times(1)).convert(this.jwt); + } + + @Test + void createTokenAuthenticationConverterWithClaimNameAndGrantedAuthorityConverter() { + Converter> grantedAuthorityConverter = mock(TestJwtGrantedAuthoritiesConverter.class); + AadJwtBearerTokenAuthenticationConverter tokenAuthenticationConverter = new AadJwtBearerTokenAuthenticationConverter(AadJwtClaimNames.NAME, grantedAuthorityConverter); + AbstractAuthenticationToken abstractAuthenticationToken = tokenAuthenticationConverter.convert(jwt); + AadOAuth2AuthenticatedPrincipal principal = (AadOAuth2AuthenticatedPrincipal) abstractAuthenticationToken.getPrincipal(); + Assertions.assertEquals(principal.getName(), "fake-user"); + verify(grantedAuthorityConverter, times(1)).convert(this.jwt); + } + + class TestJwtGrantedAuthoritiesConverter implements Converter> { + @Override + public Collection convert(Jwt source) { + return null; + } + } } diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/aad/implementation/webapi/AadResourceServerConfigurationTests.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/aad/implementation/webapi/AadResourceServerConfigurationTests.java index d92496cd5e59..65451ed3aaf9 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/aad/implementation/webapi/AadResourceServerConfigurationTests.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/aad/implementation/webapi/AadResourceServerConfigurationTests.java @@ -2,23 +2,34 @@ // Licensed under the MIT License. package com.azure.spring.cloud.autoconfigure.aad.implementation.webapi; +import com.azure.spring.cloud.autoconfigure.aad.AadResourceServerWebSecurityConfigurerAdapter; import com.azure.spring.cloud.autoconfigure.aad.configuration.AadResourceServerConfiguration; import com.azure.spring.cloud.autoconfigure.aad.properties.AadAuthenticationProperties; import com.nimbusds.jwt.proc.JWTClaimsSetAwareJWSKeySelector; import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.ValueSource; import org.springframework.boot.test.context.FilteredClassLoader; +import org.springframework.core.convert.converter.Converter; +import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; +import org.springframework.security.core.GrantedAuthority; import org.springframework.security.oauth2.core.OAuth2TokenValidator; import org.springframework.security.oauth2.jwt.Jwt; import org.springframework.security.oauth2.jwt.JwtDecoder; import org.springframework.security.oauth2.jwt.NimbusJwtDecoder; import org.springframework.security.oauth2.server.resource.BearerTokenAuthenticationToken; +import org.springframework.test.util.ReflectionTestUtils; +import java.util.Collection; import java.util.List; import static com.azure.spring.cloud.autoconfigure.aad.implementation.WebApplicationContextRunnerUtils.resourceServerContextRunner; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.mockito.Mockito.mock; class AadResourceServerConfigurationTests { @@ -79,4 +90,58 @@ void testCreateWebSecurityConfigurerAdapter() { assertThat(webSecurityConfigurerAdapter).isNotNull(); }); } + @ParameterizedTest + @ValueSource(classes = { TestResourceServerConfigurationUsingConstructor.class, TestResourceServerConfigurationUsingMethod.class }) + @SuppressWarnings("unchecked") + void useCustomJwtGrantedAuthoritiesConverterUsingConstructor(Class configurationClass) { + resourceServerContextRunner() + .withPropertyValues("spring.cloud.azure.active-directory.enabled=true") + .withUserConfiguration(configurationClass) + .run(context -> { + WebSecurityConfigurerAdapter webSecurityConfigurerAdapter = (WebSecurityConfigurerAdapter) context.getBean(configurationClass); + Converter> converter = + (Converter) ReflectionTestUtils.getField(webSecurityConfigurerAdapter, "jwtGrantedAuthoritiesConverter"); + assertThat(converter).isNotNull(); + assertThat(converter).isInstanceOfAny(TestJwtGrantedAuthoritiesConverter.class); + assertThat(webSecurityConfigurerAdapter).isNotNull(); + }); + } + + @EnableWebSecurity + @EnableGlobalMethodSecurity(prePostEnabled = true) + static class TestResourceServerConfigurationUsingConstructor extends + AadResourceServerWebSecurityConfigurerAdapter { + + TestResourceServerConfigurationUsingConstructor() { + super(null, mock(TestJwtGrantedAuthoritiesConverter.class)); + } + + @Override + protected void configure(HttpSecurity http) throws Exception { + super.configure(http); + } + } + + @EnableWebSecurity + @EnableGlobalMethodSecurity(prePostEnabled = true) + static class TestResourceServerConfigurationUsingMethod extends + AadResourceServerWebSecurityConfigurerAdapter { + + @Override + protected void configure(HttpSecurity http) throws Exception { + super.configure(http); + } + + @Override + protected Converter> jwtGrantedAuthoritiesConverter() { + return mock(TestJwtGrantedAuthoritiesConverter.class); + } + } + + class TestJwtGrantedAuthoritiesConverter implements Converter> { + @Override + public Collection convert(Jwt source) { + return null; + } + } } From a50b35c70bb740e29571e0aba89ddd393c1834b8 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 6 Dec 2022 03:26:27 +0000 Subject: [PATCH 3/3] CodeGen from PR 21717 in Azure/azure-rest-api-specs Merge 394161d52b39c8e4437a91e7d15bd356e6b48259 into 166543cc0a1061e063c8db2e9bfeb3c57658eb1d --- .../CHANGELOG.md | 4 +- .../README.md | 27 +- .../SAMPLE.md | 636 ++++++++- .../pom.xml | 2 +- .../azurestackhci/AzureStackHciManager.java | 99 +- .../fluent/ArcSettingsClient.java | 58 +- .../fluent/AzureStackHciClient.java | 42 + .../azurestackhci/fluent/ClustersClient.java | 105 +- .../fluent/ExtensionsClient.java | 12 +- .../azurestackhci/fluent/OffersClient.java | 116 ++ .../fluent/OperationsClient.java | 12 +- .../fluent/PublishersClient.java | 72 + .../azurestackhci/fluent/SkusClient.java | 97 ++ .../fluent/UpdateRunsClient.java | 185 +++ .../UpdateSummariesOperationsClient.java | 154 ++ .../azurestackhci/fluent/UpdatesClient.java | 220 +++ .../models/ArcIdentityResponseInner.java | 4 + .../models/ArcIdentityResponseProperties.java | 4 + .../fluent/models/ArcSettingInner.java | 28 +- .../fluent/models/ArcSettingProperties.java | 7 +- .../models/ArcSettingsPatchProperties.java | 4 + .../models/ClusterIdentityResponseInner.java | 4 + .../ClusterIdentityResponseProperties.java | 4 + .../fluent/models/ClusterInner.java | 146 +- .../fluent/models/ClusterPatchProperties.java | 4 + .../fluent/models/ClusterProperties.java | 49 + .../fluent/models/ExtensionInner.java | 53 +- .../fluent/models/ExtensionParameters.java | 46 +- .../fluent/models/ExtensionProperties.java | 31 + .../fluent/models/ManagedServiceIdentity.java | 145 ++ .../fluent/models/OfferInner.java | 162 +++ .../fluent/models/OfferProperties.java | 148 ++ .../models/OperationListResultInner.java | 4 + .../models/PasswordCredentialInner.java | 4 + .../fluent/models/PublisherInner.java | 68 + .../fluent/models/PublisherProperties.java | 39 + .../azurestackhci/fluent/models/SkuInner.java | 185 +++ .../fluent/models/SkuProperties.java | 174 +++ .../azurestackhci/fluent/models/Step.java | 240 ++++ .../fluent/models/UpdateInner.java | 578 ++++++++ .../fluent/models/UpdateProperties.java | 611 ++++++++ .../fluent/models/UpdateRunInner.java | 376 +++++ .../fluent/models/UpdateRunProperties.java | 351 +++++ .../fluent/models/UpdateStateProperties.java | 84 ++ .../fluent/models/UpdateSummariesInner.java | 331 +++++ .../models/UpdateSummariesProperties.java | 312 +++++ .../implementation/ArcSettingImpl.java | 8 +- .../implementation/ArcSettingsClientImpl.java | 94 +- .../implementation/ArcSettingsImpl.java | 38 +- .../AzureStackHciClientBuilder.java | 34 +- .../AzureStackHciClientImpl.java | 86 +- .../implementation/ClusterImpl.java | 72 + .../implementation/ClustersClientImpl.java | 372 ++++- .../implementation/ClustersImpl.java | 49 +- .../implementation/ExtensionImpl.java | 9 + .../implementation/ExtensionsClientImpl.java | 26 +- .../implementation/ExtensionsImpl.java | 18 +- .../implementation/OfferImpl.java | 72 + .../implementation/OffersClientImpl.java | 916 ++++++++++++ .../implementation/OffersImpl.java | 93 ++ .../implementation/OperationsClientImpl.java | 18 +- .../implementation/OperationsImpl.java | 18 +- .../implementation/PublisherImpl.java | 49 + .../implementation/PublishersClientImpl.java | 513 +++++++ .../implementation/PublishersImpl.java | 72 + .../azurestackhci/implementation/SkuImpl.java | 76 + .../implementation/SkusClientImpl.java | 656 +++++++++ .../implementation/SkusImpl.java | 89 ++ .../implementation/UpdateImpl.java | 375 +++++ .../implementation/UpdateRunImpl.java | 287 ++++ .../implementation/UpdateRunsClientImpl.java | 1071 ++++++++++++++ .../implementation/UpdateRunsImpl.java | 218 +++ .../implementation/UpdateSummariesImpl.java | 111 ++ .../UpdateSummariesOperationsClientImpl.java | 926 ++++++++++++ .../UpdateSummariesOperationsImpl.java | 104 ++ .../implementation/UpdatesClientImpl.java | 1247 +++++++++++++++++ .../implementation/UpdatesImpl.java | 195 +++ .../azurestackhci/models/ActionType.java | 2 +- .../azurestackhci/models/ArcSetting.java | 14 +- .../models/ArcSettingAggregateState.java | 11 +- .../azurestackhci/models/ArcSettingList.java | 4 + .../azurestackhci/models/ArcSettings.java | 24 +- .../models/ArcSettingsPatch.java | 4 + .../models/AvailabilityType.java | 41 + .../azurestackhci/models/Cluster.java | 146 +- .../models/ClusterDesiredProperties.java | 4 + .../azurestackhci/models/ClusterList.java | 4 + .../azurestackhci/models/ClusterNode.java | 49 + .../azurestackhci/models/ClusterNodeType.java | 38 + .../azurestackhci/models/ClusterPatch.java | 98 ++ .../models/ClusterReportedProperties.java | 19 + .../azurestackhci/models/Clusters.java | 42 +- .../azurestackhci/models/DiagnosticLevel.java | 2 +- .../azurestackhci/models/Extension.java | 40 +- .../models/ExtensionAggregateState.java | 8 +- .../azurestackhci/models/ExtensionList.java | 4 + .../azurestackhci/models/Extensions.java | 12 +- .../azurestackhci/models/HealthState.java | 50 + .../azurestackhci/models/ImdsAttestation.java | 2 +- .../models/ManagedServiceIdentityType.java | 45 + .../azurestackhci/models/NodeArcState.java | 20 +- .../models/NodeExtensionState.java | 17 +- .../azurestackhci/models/Offer.java | 82 ++ .../azurestackhci/models/OfferList.java | 59 + .../azurestackhci/models/Offers.java | 106 ++ .../azurestackhci/models/Operation.java | 26 +- .../models/OperationDisplay.java | 20 +- .../azurestackhci/models/Operations.java | 12 +- .../azurestackhci/models/Origin.java | 5 +- .../models/PackageVersionInfo.java | 103 ++ .../models/PerNodeExtensionState.java | 7 +- .../azurestackhci/models/PerNodeState.java | 4 + .../azurestackhci/models/PrecheckResult.java | 350 +++++ .../models/PrecheckResultTags.java | 76 + .../models/ProvisioningState.java | 41 +- .../azurestackhci/models/Publisher.java | 53 + .../azurestackhci/models/PublisherList.java | 59 + .../azurestackhci/models/Publishers.java | 65 + .../models/RawCertificateData.java | 4 + .../models/RebootRequirement.java | 41 + .../azurestackhci/models/Severity.java | 47 + .../azurestackhci/models/Sku.java | 89 ++ .../azurestackhci/models/SkuList.java | 59 + .../azurestackhci/models/SkuMappings.java | 103 ++ .../azurestackhci/models/Skus.java | 90 ++ .../SoftwareAssuranceChangeRequest.java | 53 + ...twareAssuranceChangeRequestProperties.java | 51 + .../models/SoftwareAssuranceIntent.java | 38 + .../models/SoftwareAssuranceProperties.java | 92 ++ .../models/SoftwareAssuranceStatus.java | 38 + .../azurestackhci/models/State.java | 87 ++ .../azurestackhci/models/Status.java | 14 +- .../azurestackhci/models/Update.java | 822 +++++++++++ .../azurestackhci/models/UpdateList.java | 70 + .../models/UpdatePrerequisite.java | 105 ++ .../azurestackhci/models/UpdateRun.java | 542 +++++++ .../azurestackhci/models/UpdateRunList.java | 70 + .../models/UpdateRunPropertiesState.java | 44 + .../azurestackhci/models/UpdateRuns.java | 148 ++ .../azurestackhci/models/UpdateSummaries.java | 132 ++ .../models/UpdateSummariesList.java | 70 + .../models/UpdateSummariesOperations.java | 114 ++ .../UpdateSummariesPropertiesState.java | 56 + .../azurestackhci/models/Updates.java | 166 +++ .../models/UploadCertificateRequest.java | 4 + .../models/UserAssignedIdentity.java | 55 + .../models/WindowsServerSubscription.java | 2 +- .../ArcSettingsCreateIdentitySamples.java | 2 +- .../generated/ArcSettingsCreateSamples.java | 2 +- .../generated/ArcSettingsDeleteSamples.java | 2 +- .../ArcSettingsGeneratePasswordSamples.java | 2 +- .../generated/ArcSettingsGetSamples.java | 2 +- .../ArcSettingsListByClusterSamples.java | 2 +- .../generated/ArcSettingsUpdateSamples.java | 2 +- .../ClustersCreateIdentitySamples.java | 2 +- .../generated/ClustersCreateSamples.java | 5 +- .../generated/ClustersDeleteSamples.java | 2 +- ...ExtendSoftwareAssuranceBenefitSamples.java | 34 + .../ClustersGetByResourceGroupSamples.java | 2 +- .../ClustersListByResourceGroupSamples.java | 2 +- .../generated/ClustersListSamples.java | 2 +- .../generated/ClustersUpdateSamples.java | 4 +- .../ClustersUploadCertificateSamples.java | 2 +- .../generated/ExtensionsCreateSamples.java | 2 +- .../generated/ExtensionsDeleteSamples.java | 2 +- .../generated/ExtensionsGetSamples.java | 2 +- .../ExtensionsListByArcSettingSamples.java | 2 +- .../generated/ExtensionsUpdateSamples.java | 2 +- .../generated/OffersGetSamples.java | 22 + .../generated/OffersListByClusterSamples.java | 23 + .../OffersListByPublisherSamples.java | 23 + .../generated/OperationsListSamples.java | 2 +- .../generated/PublishersGetSamples.java | 22 + .../PublishersListByClusterSamples.java | 23 + .../generated/SkusGetSamples.java | 22 + .../generated/SkusListByOfferSamples.java | 23 + .../generated/UpdateRunsDeleteSamples.java | 25 + .../generated/UpdateRunsGetSamples.java | 26 + .../generated/UpdateRunsListSamples.java | 23 + .../generated/UpdateRunsPutSamples.java | 58 + ...UpdateSummariesOperationDeleteSamples.java | 22 + .../UpdateSummariesOperationGetSamples.java | 23 + .../UpdateSummariesOperationListSamples.java | 23 + .../UpdateSummariesOperationPutSamples.java | 38 + .../generated/UpdatesDeleteSamples.java | 22 + .../generated/UpdatesGetSamples.java | 22 + .../generated/UpdatesListSamples.java | 22 + .../generated/UpdatesPostSamples.java | 22 + .../generated/UpdatesPutSamples.java | 53 + 189 files changed, 19149 insertions(+), 392 deletions(-) create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/OffersClient.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/PublishersClient.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/SkusClient.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/UpdateRunsClient.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/UpdateSummariesOperationsClient.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/UpdatesClient.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ManagedServiceIdentity.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/OfferInner.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/OfferProperties.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/PublisherInner.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/PublisherProperties.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/SkuInner.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/SkuProperties.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/Step.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateInner.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateProperties.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateRunInner.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateRunProperties.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateStateProperties.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateSummariesInner.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateSummariesProperties.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OfferImpl.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OffersClientImpl.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OffersImpl.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/PublisherImpl.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/PublishersClientImpl.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/PublishersImpl.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/SkuImpl.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/SkusClientImpl.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/SkusImpl.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateImpl.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateRunImpl.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateRunsClientImpl.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateRunsImpl.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateSummariesImpl.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateSummariesOperationsClientImpl.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateSummariesOperationsImpl.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdatesClientImpl.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdatesImpl.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/AvailabilityType.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterNodeType.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HealthState.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ManagedServiceIdentityType.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Offer.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OfferList.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Offers.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PackageVersionInfo.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PrecheckResult.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PrecheckResultTags.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Publisher.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PublisherList.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Publishers.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/RebootRequirement.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Severity.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Sku.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SkuList.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SkuMappings.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Skus.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SoftwareAssuranceChangeRequest.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SoftwareAssuranceChangeRequestProperties.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SoftwareAssuranceIntent.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SoftwareAssuranceProperties.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SoftwareAssuranceStatus.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/State.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Update.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateList.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdatePrerequisite.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateRun.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateRunList.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateRunPropertiesState.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateRuns.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateSummaries.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateSummariesList.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateSummariesOperations.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateSummariesPropertiesState.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Updates.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UserAssignedIdentity.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersExtendSoftwareAssuranceBenefitSamples.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/OffersGetSamples.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/OffersListByClusterSamples.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/OffersListByPublisherSamples.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/PublishersGetSamples.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/PublishersListByClusterSamples.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/SkusGetSamples.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/SkusListByOfferSamples.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsDeleteSamples.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsGetSamples.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsListSamples.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsPutSamples.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateSummariesOperationDeleteSamples.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateSummariesOperationGetSamples.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateSummariesOperationListSamples.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateSummariesOperationPutSamples.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesDeleteSamples.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesGetSamples.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesListSamples.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesPostSamples.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesPutSamples.java diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/CHANGELOG.md b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/CHANGELOG.md index 3ccd02fadd6f..55324962a6c0 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/CHANGELOG.md +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.0.0-beta.4 (Unreleased) +## 1.0.0-beta.1 (2022-12-06) + +- Azure Resource Manager AzureStackHci client library for Java. This package contains Microsoft Azure SDK for AzureStackHci Management SDK. Azure Stack HCI management service. Package tag package-2022-12. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/README.md b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/README.md index 49c5a0968a06..34834f1d5259 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/README.md +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/README.md @@ -2,7 +2,7 @@ Azure Resource Manager AzureStackHci client library for Java. -This package contains Microsoft Azure SDK for AzureStackHci Management SDK. Azure Stack HCI management service. Package tag package-2022-05. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for AzureStackHci Management SDK. Azure Stack HCI management service. Package tag package-2022-12. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-azurestackhci - 1.0.0-beta.3 + 1.0.0-beta.4 ``` [//]: # ({x-version-update-end}) @@ -41,19 +41,19 @@ Various documentation is available to help you get started Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. -[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. +[Azure Identity][azure_identity] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation. ### Authentication -By default, Azure Active Directory token authentication depends on correct configure of following environment variables. +By default, Azure Active Directory token authentication depends on correct configuration of the following environment variables. - `AZURE_CLIENT_ID` for Azure client ID. - `AZURE_TENANT_ID` for Azure tenant ID. - `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. -In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. +In addition, Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. -With above configuration, `azure` client can be authenticated by following code: +With above configuration, `azure` client can be authenticated using the following code: ```java AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); @@ -83,13 +83,13 @@ See [API design][design] for general introduction on design and key concepts on ## Contributing -For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). +For details on contributing to this repository, see the [contributing guide][cg]. -1. Fork it -1. Create your feature branch (`git checkout -b my-new-feature`) -1. Commit your changes (`git commit -am 'Add some feature'`) -1. Push to the branch (`git push origin my-new-feature`) -1. Create new Pull Request +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 @@ -100,3 +100,6 @@ For details on contributing to this repository, see the [contributing guide](htt [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/azurestackhci/azure-resourcemanager-azurestackhci/SAMPLE.md b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/SAMPLE.md index 949f72862f79..2966ec0bbbdb 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/SAMPLE.md +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/SAMPLE.md @@ -16,6 +16,7 @@ - [Create](#clusters_create) - [CreateIdentity](#clusters_createidentity) - [Delete](#clusters_delete) +- [ExtendSoftwareAssuranceBenefit](#clusters_extendsoftwareassurancebenefit) - [GetByResourceGroup](#clusters_getbyresourcegroup) - [List](#clusters_list) - [ListByResourceGroup](#clusters_listbyresourcegroup) @@ -30,16 +31,54 @@ - [ListByArcSetting](#extensions_listbyarcsetting) - [Update](#extensions_update) +## Offers + +- [Get](#offers_get) +- [ListByCluster](#offers_listbycluster) +- [ListByPublisher](#offers_listbypublisher) + ## Operations - [List](#operations_list) + +## Publishers + +- [Get](#publishers_get) +- [ListByCluster](#publishers_listbycluster) + +## Skus + +- [Get](#skus_get) +- [ListByOffer](#skus_listbyoffer) + +## UpdateRuns + +- [Delete](#updateruns_delete) +- [Get](#updateruns_get) +- [List](#updateruns_list) +- [Put](#updateruns_put) + +## UpdateSummariesOperation + +- [Delete](#updatesummariesoperation_delete) +- [Get](#updatesummariesoperation_get) +- [List](#updatesummariesoperation_list) +- [Put](#updatesummariesoperation_put) + +## Updates + +- [Delete](#updates_delete) +- [Get](#updates_get) +- [List](#updates_list) +- [Post](#updates_post) +- [Put](#updates_put) ### ArcSettings_Create ```java /** Samples for ArcSettings Create. */ public final class ArcSettingsCreateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/PutArcSetting.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/PutArcSetting.json */ /** * Sample code: Create ArcSetting. @@ -60,7 +99,7 @@ import com.azure.core.util.Context; /** Samples for ArcSettings CreateIdentity. */ public final class ArcSettingsCreateIdentitySamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/CreateArcIdentity.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/CreateArcIdentity.json */ /** * Sample code: Create Arc Identity. @@ -81,7 +120,7 @@ import com.azure.core.util.Context; /** Samples for ArcSettings Delete. */ public final class ArcSettingsDeleteSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/DeleteArcSetting.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/DeleteArcSetting.json */ /** * Sample code: Delete ArcSetting. @@ -102,7 +141,7 @@ import com.azure.core.util.Context; /** Samples for ArcSettings GeneratePassword. */ public final class ArcSettingsGeneratePasswordSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/GeneratePassword.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/GeneratePassword.json */ /** * Sample code: Generate Password. @@ -123,7 +162,7 @@ import com.azure.core.util.Context; /** Samples for ArcSettings Get. */ public final class ArcSettingsGetSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/GetArcSetting.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/GetArcSetting.json */ /** * Sample code: Get ArcSetting. @@ -144,7 +183,7 @@ import com.azure.core.util.Context; /** Samples for ArcSettings ListByCluster. */ public final class ArcSettingsListByClusterSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/ListArcSettingsByCluster.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/ListArcSettingsByCluster.json */ /** * Sample code: List ArcSetting resources by HCI Cluster. @@ -170,7 +209,7 @@ import java.io.IOException; /** Samples for ArcSettings Update. */ public final class ArcSettingsUpdateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/PatchArcSetting.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/PatchArcSetting.json */ /** * Sample code: Patch ArcSetting. @@ -195,10 +234,12 @@ public final class ArcSettingsUpdateSamples { ### Clusters_Create ```java +import com.azure.resourcemanager.azurestackhci.models.ManagedServiceIdentityType; + /** Samples for Clusters Create. */ public final class ClustersCreateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/CreateCluster.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/CreateCluster.json */ /** * Sample code: Create cluster. @@ -211,6 +252,7 @@ public final class ClustersCreateSamples { .define("myCluster") .withRegion("East US") .withExistingResourceGroup("test-rg") + .withTypeIdentityType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) .withCloudManagementEndpoint("https://98294836-31be-4668-aeae-698667faf99b.waconazure.com") .withAadClientId("24a6e53d-04e5-44d2-b7cc-1b732a847dfc") .withAadTenantId("7e589cc1-a8b6-4dff-91bd-5ec0fa18db94") @@ -227,7 +269,7 @@ import com.azure.core.util.Context; /** Samples for Clusters CreateIdentity. */ public final class ClustersCreateIdentitySamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/CreateClusterIdentity.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/CreateClusterIdentity.json */ /** * Sample code: Create cluster Identity. @@ -248,7 +290,7 @@ import com.azure.core.util.Context; /** Samples for Clusters Delete. */ public final class ClustersDeleteSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/DeleteCluster.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/DeleteCluster.json */ /** * Sample code: Delete cluster. @@ -261,6 +303,39 @@ public final class ClustersDeleteSamples { } ``` +### Clusters_ExtendSoftwareAssuranceBenefit + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.models.SoftwareAssuranceChangeRequest; +import com.azure.resourcemanager.azurestackhci.models.SoftwareAssuranceChangeRequestProperties; +import com.azure.resourcemanager.azurestackhci.models.SoftwareAssuranceIntent; + +/** Samples for Clusters ExtendSoftwareAssuranceBenefit. */ +public final class ClustersExtendSoftwareAssuranceBenefitSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/ExtendSoftwareAssuranceBenefit.json + */ + /** + * Sample code: Create cluster Identity. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void createClusterIdentity(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .clusters() + .extendSoftwareAssuranceBenefit( + "test-rg", + "myCluster", + new SoftwareAssuranceChangeRequest() + .withProperties( + new SoftwareAssuranceChangeRequestProperties() + .withSoftwareAssuranceIntent(SoftwareAssuranceIntent.ENABLE)), + Context.NONE); + } +} +``` + ### Clusters_GetByResourceGroup ```java @@ -269,7 +344,7 @@ import com.azure.core.util.Context; /** Samples for Clusters GetByResourceGroup. */ public final class ClustersGetByResourceGroupSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/GetCluster.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/GetCluster.json */ /** * Sample code: Get cluster. @@ -290,7 +365,7 @@ import com.azure.core.util.Context; /** Samples for Clusters List. */ public final class ClustersListSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/ListClustersBySubscription.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/ListClustersBySubscription.json */ /** * Sample code: List clusters in a given subscription. @@ -312,7 +387,7 @@ import com.azure.core.util.Context; /** Samples for Clusters ListByResourceGroup. */ public final class ClustersListByResourceGroupSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/ListClustersByResourceGroup.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/ListClustersByResourceGroup.json */ /** * Sample code: List clusters in a given resource group. @@ -333,6 +408,7 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.azurestackhci.models.Cluster; import com.azure.resourcemanager.azurestackhci.models.ClusterDesiredProperties; import com.azure.resourcemanager.azurestackhci.models.DiagnosticLevel; +import com.azure.resourcemanager.azurestackhci.models.ManagedServiceIdentityType; import com.azure.resourcemanager.azurestackhci.models.WindowsServerSubscription; import java.util.HashMap; import java.util.Map; @@ -340,7 +416,7 @@ import java.util.Map; /** Samples for Clusters Update. */ public final class ClustersUpdateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/UpdateCluster.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/UpdateCluster.json */ /** * Sample code: Update cluster. @@ -353,6 +429,7 @@ public final class ClustersUpdateSamples { resource .update() .withTags(mapOf("tag1", "value1", "tag2", "value2")) + .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) .withCloudManagementEndpoint("https://98294836-31be-4668-aeae-698667faf99b.waconazure.com") .withDesiredProperties( new ClusterDesiredProperties() @@ -385,7 +462,7 @@ import java.util.Arrays; /** Samples for Clusters UploadCertificate. */ public final class ClustersUploadCertificateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/UploadCertificate.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/UploadCertificate.json */ /** * Sample code: Upload certificate. @@ -416,7 +493,7 @@ import java.io.IOException; /** Samples for Extensions Create. */ public final class ExtensionsCreateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/PutExtension.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/PutExtension.json */ /** * Sample code: Create Arc Extension. @@ -453,7 +530,7 @@ import com.azure.core.util.Context; /** Samples for Extensions Delete. */ public final class ExtensionsDeleteSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/DeleteExtension.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/DeleteExtension.json */ /** * Sample code: Delete Arc Extension. @@ -474,7 +551,7 @@ import com.azure.core.util.Context; /** Samples for Extensions Get. */ public final class ExtensionsGetSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/GetExtension.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/GetExtension.json */ /** * Sample code: Get ArcSettings Extension. @@ -497,7 +574,7 @@ import com.azure.core.util.Context; /** Samples for Extensions ListByArcSetting. */ public final class ExtensionsListByArcSettingSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/ListExtensionsByArcSetting.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/ListExtensionsByArcSetting.json */ /** * Sample code: List Extensions under ArcSetting resource. @@ -523,7 +600,7 @@ import java.io.IOException; /** Samples for Extensions Update. */ public final class ExtensionsUpdateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/PatchExtension.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/PatchExtension.json */ /** * Sample code: Update Arc Extension. @@ -551,6 +628,71 @@ public final class ExtensionsUpdateSamples { } ``` +### Offers_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Offers Get. */ +public final class OffersGetSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/GetOffer.json + */ + /** + * Sample code: Get Offer. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getOffer(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.offers().getWithResponse("test-rg", "myCluster", "publisher1", "offer1", null, Context.NONE); + } +} +``` + +### Offers_ListByCluster + +```java +import com.azure.core.util.Context; + +/** Samples for Offers ListByCluster. */ +public final class OffersListByClusterSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/ListOffersByCluster.json + */ + /** + * Sample code: List Offer resources by HCI Cluster. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listOfferResourcesByHCICluster( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.offers().listByCluster("test-rg", "myCluster", null, Context.NONE); + } +} +``` + +### Offers_ListByPublisher + +```java +import com.azure.core.util.Context; + +/** Samples for Offers ListByPublisher. */ +public final class OffersListByPublisherSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/ListOffersByPublisher.json + */ + /** + * Sample code: List Offer resources by publisher for the HCI Cluster. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listOfferResourcesByPublisherForTheHCICluster( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.offers().listByPublisher("test-rg", "myCluster", "publisher1", null, Context.NONE); + } +} +``` + ### Operations_List ```java @@ -559,7 +701,7 @@ import com.azure.core.util.Context; /** Samples for Operations List. */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/ListOperations.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/ListOperations.json */ /** * Sample code: Create cluster. @@ -572,3 +714,455 @@ public final class OperationsListSamples { } ``` +### Publishers_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Publishers Get. */ +public final class PublishersGetSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/GetPublisher.json + */ + /** + * Sample code: Get Publisher. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getPublisher(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.publishers().getWithResponse("test-rg", "myCluster", "publisher1", Context.NONE); + } +} +``` + +### Publishers_ListByCluster + +```java +import com.azure.core.util.Context; + +/** Samples for Publishers ListByCluster. */ +public final class PublishersListByClusterSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/ListPublishersByCluster.json + */ + /** + * Sample code: List Publisher resources by HCI Cluster. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listPublisherResourcesByHCICluster( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.publishers().listByCluster("test-rg", "myCluster", Context.NONE); + } +} +``` + +### Skus_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Skus Get. */ +public final class SkusGetSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/GetSku.json + */ + /** + * Sample code: Get Sku. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getSku(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.skus().getWithResponse("test-rg", "myCluster", "publisher1", "offer1", "sku1", null, Context.NONE); + } +} +``` + +### Skus_ListByOffer + +```java +import com.azure.core.util.Context; + +/** Samples for Skus ListByOffer. */ +public final class SkusListByOfferSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/ListSkusByOffer.json + */ + /** + * Sample code: List SKU resources by offer for the HCI Cluster. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listSKUResourcesByOfferForTheHCICluster( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.skus().listByOffer("test-rg", "myCluster", "publisher1", "offer1", null, Context.NONE); + } +} +``` + +### UpdateRuns_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for UpdateRuns Delete. */ +public final class UpdateRunsDeleteSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/DeleteUpdateRuns.json + */ + /** + * Sample code: Delete an Update. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void deleteAnUpdate(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .updateRuns() + .delete( + "testrg", "testcluster", "Microsoft4.2203.2.32", "23b779ba-0d52-4a80-8571-45ca74664ec3", Context.NONE); + } +} +``` + +### UpdateRuns_Get + +```java +import com.azure.core.util.Context; + +/** Samples for UpdateRuns Get. */ +public final class UpdateRunsGetSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/GetUpdateRuns.json + */ + /** + * Sample code: Get Update runs under cluster resource. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getUpdateRunsUnderClusterResource( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .updateRuns() + .getWithResponse( + "testrg", "testcluster", "Microsoft4.2203.2.32", "23b779ba-0d52-4a80-8571-45ca74664ec3", Context.NONE); + } +} +``` + +### UpdateRuns_List + +```java +import com.azure.core.util.Context; + +/** Samples for UpdateRuns List. */ +public final class UpdateRunsListSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/ListUpdateRuns.json + */ + /** + * Sample code: List Update runs under cluster resource. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listUpdateRunsUnderClusterResource( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.updateRuns().list("testrg", "testcluster", "Microsoft4.2203.2.32", Context.NONE); + } +} +``` + +### UpdateRuns_Put + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.Step; +import com.azure.resourcemanager.azurestackhci.models.UpdateRun; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** Samples for UpdateRuns Put. */ +public final class UpdateRunsPutSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/PutUpdateRuns.json + */ + /** + * Sample code: Get Update runs under cluster resource. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getUpdateRunsUnderClusterResource( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + UpdateRun resource = + manager + .updateRuns() + .getWithResponse( + "testrg", + "testcluster", + "Microsoft4.2203.2.32", + "23b779ba-0d52-4a80-8571-45ca74664ec3", + Context.NONE) + .getValue(); + resource + .update() + .withNamePropertiesName("Unnamed step") + .withDescription("Update Azure Stack.") + .withErrorMessage("") + .withStatus("Success") + .withStartTimeUtc(OffsetDateTime.parse("2022-04-06T01:36:33.3876751+00:00")) + .withEndTimeUtc(OffsetDateTime.parse("2022-04-06T13:58:42.969006+00:00")) + .withLastUpdatedTimeUtc(OffsetDateTime.parse("2022-04-06T13:58:42.969006+00:00")) + .withSteps( + Arrays + .asList( + new Step() + .withName("PreUpdate Cloud") + .withDescription("Prepare for SSU update") + .withErrorMessage("") + .withStatus("Success") + .withStartTimeUtc(OffsetDateTime.parse("2022-04-06T01:36:33.3876751+00:00")) + .withEndTimeUtc(OffsetDateTime.parse("2022-04-06T01:37:16.8728314+00:00")) + .withLastUpdatedTimeUtc(OffsetDateTime.parse("2022-04-06T01:37:16.8728314+00:00")) + .withSteps(Arrays.asList()))) + .apply(); + } +} +``` + +### UpdateSummariesOperation_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for UpdateSummariesOperation Delete. */ +public final class UpdateSummariesOperationDeleteSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/DeleteUpdateSummaries.json + */ + /** + * Sample code: Delete an Update. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void deleteAnUpdate(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.updateSummariesOperations().delete("testrg", "testcluster", Context.NONE); + } +} +``` + +### UpdateSummariesOperation_Get + +```java +import com.azure.core.util.Context; + +/** Samples for UpdateSummariesOperation Get. */ +public final class UpdateSummariesOperationGetSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/GetUpdateSummaries.json + */ + /** + * Sample code: Get Update summaries under cluster resource. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getUpdateSummariesUnderClusterResource( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.updateSummariesOperations().getWithResponse("testrg", "testcluster", Context.NONE); + } +} +``` + +### UpdateSummariesOperation_List + +```java +import com.azure.core.util.Context; + +/** Samples for UpdateSummariesOperation List. */ +public final class UpdateSummariesOperationListSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/ListUpdateSummaries.json + */ + /** + * Sample code: Get Update summaries under cluster resource. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getUpdateSummariesUnderClusterResource( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.updateSummariesOperations().list("testrg", "testcluster", Context.NONE); + } +} +``` + +### UpdateSummariesOperation_Put + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.UpdateSummariesInner; +import com.azure.resourcemanager.azurestackhci.models.UpdateSummariesPropertiesState; +import java.time.OffsetDateTime; + +/** Samples for UpdateSummariesOperation Put. */ +public final class UpdateSummariesOperationPutSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/PutUpdateSummaries.json + */ + /** + * Sample code: Put Update summaries under cluster resource. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void putUpdateSummariesUnderClusterResource( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .updateSummariesOperations() + .putWithResponse( + "testrg", + "testcluster", + new UpdateSummariesInner() + .withOemFamily("DellEMC") + .withHardwareModel("PowerEdge R730xd") + .withCurrentVersion("4.2203.2.32") + .withLastUpdated(OffsetDateTime.parse("2022-04-06T14:08:18.254Z")) + .withLastChecked(OffsetDateTime.parse("2022-04-07T18:04:07Z")) + .withState(UpdateSummariesPropertiesState.APPLIED_SUCCESSFULLY), + Context.NONE); + } +} +``` + +### Updates_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Updates Delete. */ +public final class UpdatesDeleteSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/DeleteUpdates.json + */ + /** + * Sample code: Delete an Update. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void deleteAnUpdate(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.updates().delete("testrg", "testcluster", "Microsoft4.2203.2.32", Context.NONE); + } +} +``` + +### Updates_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Updates Get. */ +public final class UpdatesGetSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/GetUpdates.json + */ + /** + * Sample code: Get a specific update. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getASpecificUpdate(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.updates().getWithResponse("testrg", "testcluster", "Microsoft4.2203.2.32", Context.NONE); + } +} +``` + +### Updates_List + +```java +import com.azure.core.util.Context; + +/** Samples for Updates List. */ +public final class UpdatesListSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/ListUpdates.json + */ + /** + * Sample code: List available updates. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listAvailableUpdates(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.updates().list("testrg", "testcluster", Context.NONE); + } +} +``` + +### Updates_Post + +```java +import com.azure.core.util.Context; + +/** Samples for Updates Post. */ +public final class UpdatesPostSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/PostUpdates.json + */ + /** + * Sample code: List available updates. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listAvailableUpdates(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.updates().post("testrg", "testcluster", "Microsoft4.2203.2.32", Context.NONE); + } +} +``` + +### Updates_Put + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.models.AvailabilityType; +import com.azure.resourcemanager.azurestackhci.models.State; +import com.azure.resourcemanager.azurestackhci.models.Update; +import com.azure.resourcemanager.azurestackhci.models.UpdatePrerequisite; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** Samples for Updates Put. */ +public final class UpdatesPutSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/PutUpdates.json + */ + /** + * Sample code: Put a specific update. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void putASpecificUpdate(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + Update resource = + manager.updates().getWithResponse("testrg", "testcluster", "Microsoft4.2203.2.32", Context.NONE).getValue(); + resource + .update() + .withInstalledDate(OffsetDateTime.parse("2022-04-06T14:08:18.254Z")) + .withDescription("AzS Update 4.2203.2.32") + .withState(State.INSTALLED) + .withPrerequisites( + Arrays + .asList( + new UpdatePrerequisite() + .withUpdateType("update type") + .withVersion("prerequisite version") + .withPackageName("update package name"))) + .withPackagePath("\\\\SU1FileServer\\SU1_Infrastructure_2\\Updates\\Packages\\Microsoft4.2203.2.32") + .withPackageSizeInMb(18858.0F) + .withDisplayName("AzS Update - 4.2203.2.32") + .withVersion("4.2203.2.32") + .withPublisher("Microsoft") + .withReleaseLink("https://docs.microsoft.com/azure-stack/operator/release-notes?view=azs-2203") + .withAvailabilityType(AvailabilityType.LOCAL) + .withPackageType("Infrastructure") + .withAdditionalProperties("additional properties") + .withProgressPercentage(0.0F) + .withNotifyMessage("Brief message with instructions for updates of AvailabilityType Notify") + .apply(); + } +} +``` + diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/pom.xml b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/pom.xml index e17982fc4ab1..c2498cf5d101 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/pom.xml +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/pom.xml @@ -13,7 +13,7 @@ jar Microsoft Azure SDK for AzureStackHci Management - This package contains Microsoft Azure SDK for AzureStackHci Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Stack HCI management service. Package tag package-2022-05. + This package contains Microsoft Azure SDK for AzureStackHci Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Stack HCI management service. Package tag package-2022-12. https://github.com/Azure/azure-sdk-for-java diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/AzureStackHciManager.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/AzureStackHciManager.java index 7fa8e3fcf096..449aa3ae4514 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/AzureStackHciManager.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/AzureStackHciManager.java @@ -28,11 +28,23 @@ import com.azure.resourcemanager.azurestackhci.implementation.AzureStackHciClientBuilder; import com.azure.resourcemanager.azurestackhci.implementation.ClustersImpl; import com.azure.resourcemanager.azurestackhci.implementation.ExtensionsImpl; +import com.azure.resourcemanager.azurestackhci.implementation.OffersImpl; import com.azure.resourcemanager.azurestackhci.implementation.OperationsImpl; +import com.azure.resourcemanager.azurestackhci.implementation.PublishersImpl; +import com.azure.resourcemanager.azurestackhci.implementation.SkusImpl; +import com.azure.resourcemanager.azurestackhci.implementation.UpdateRunsImpl; +import com.azure.resourcemanager.azurestackhci.implementation.UpdateSummariesOperationsImpl; +import com.azure.resourcemanager.azurestackhci.implementation.UpdatesImpl; import com.azure.resourcemanager.azurestackhci.models.ArcSettings; import com.azure.resourcemanager.azurestackhci.models.Clusters; import com.azure.resourcemanager.azurestackhci.models.Extensions; +import com.azure.resourcemanager.azurestackhci.models.Offers; import com.azure.resourcemanager.azurestackhci.models.Operations; +import com.azure.resourcemanager.azurestackhci.models.Publishers; +import com.azure.resourcemanager.azurestackhci.models.Skus; +import com.azure.resourcemanager.azurestackhci.models.UpdateRuns; +import com.azure.resourcemanager.azurestackhci.models.UpdateSummariesOperations; +import com.azure.resourcemanager.azurestackhci.models.Updates; import java.time.Duration; import java.time.temporal.ChronoUnit; import java.util.ArrayList; @@ -48,8 +60,20 @@ public final class AzureStackHciManager { private Extensions extensions; + private Offers offers; + private Operations operations; + private Publishers publishers; + + private Skus skus; + + private UpdateRuns updateRuns; + + private UpdateSummariesOperations updateSummariesOperations; + + private Updates updates; + private final AzureStackHciClient clientObject; private AzureStackHciManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { @@ -215,7 +239,7 @@ public AzureStackHciManager authenticate(TokenCredential credential, AzureProfil .append("-") .append("com.azure.resourcemanager.azurestackhci") .append("/") - .append("1.0.0-beta.3"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -308,6 +332,18 @@ public Extensions extensions() { return extensions; } + /** + * Gets the resource collection API of Offers. + * + * @return Resource collection API of Offers. + */ + public Offers offers() { + if (this.offers == null) { + this.offers = new OffersImpl(clientObject.getOffers(), this); + } + return offers; + } + /** * Gets the resource collection API of Operations. * @@ -320,6 +356,67 @@ public Operations operations() { return operations; } + /** + * Gets the resource collection API of Publishers. + * + * @return Resource collection API of Publishers. + */ + public Publishers publishers() { + if (this.publishers == null) { + this.publishers = new PublishersImpl(clientObject.getPublishers(), this); + } + return publishers; + } + + /** + * Gets the resource collection API of Skus. + * + * @return Resource collection API of Skus. + */ + public Skus skus() { + if (this.skus == null) { + this.skus = new SkusImpl(clientObject.getSkus(), this); + } + return skus; + } + + /** + * Gets the resource collection API of UpdateRuns. It manages UpdateRun. + * + * @return Resource collection API of UpdateRuns. + */ + public UpdateRuns updateRuns() { + if (this.updateRuns == null) { + this.updateRuns = new UpdateRunsImpl(clientObject.getUpdateRuns(), this); + } + return updateRuns; + } + + /** + * Gets the resource collection API of UpdateSummariesOperations. + * + * @return Resource collection API of UpdateSummariesOperations. + */ + public UpdateSummariesOperations updateSummariesOperations() { + if (this.updateSummariesOperations == null) { + this.updateSummariesOperations = + new UpdateSummariesOperationsImpl(clientObject.getUpdateSummariesOperations(), this); + } + return updateSummariesOperations; + } + + /** + * Gets the resource collection API of Updates. It manages Update. + * + * @return Resource collection API of Updates. + */ + public Updates updates() { + if (this.updates == null) { + this.updates = new UpdatesImpl(clientObject.getUpdates(), this); + } + return updates; + } + /** * @return Wrapped service client AzureStackHciClient providing direct access to the underlying auto-generated API * implementation, based on Azure REST API. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ArcSettingsClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ArcSettingsClient.java index e7dd0a66b848..3031ce182d54 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ArcSettingsClient.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ArcSettingsClient.java @@ -45,20 +45,6 @@ public interface ArcSettingsClient { @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByCluster(String resourceGroupName, String clusterName, Context context); - /** - * Get ArcSetting resource details of HCI Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return arcSetting resource details of HCI Cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ArcSettingInner get(String resourceGroupName, String clusterName, String arcSettingName); - /** * Get ArcSetting resource details of HCI Cluster. * @@ -76,20 +62,18 @@ Response getWithResponse( String resourceGroupName, String clusterName, String arcSettingName, Context context); /** - * Create ArcSetting for HCI cluster. + * Get ArcSetting resource details of HCI Cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param arcSetting Parameters supplied to the Create ArcSetting resource for this HCI cluster. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return arcSetting details. + * @return arcSetting resource details of HCI Cluster. */ @ServiceMethod(returns = ReturnType.SINGLE) - ArcSettingInner create( - String resourceGroupName, String clusterName, String arcSettingName, ArcSettingInner arcSetting); + ArcSettingInner get(String resourceGroupName, String clusterName, String arcSettingName); /** * Create ArcSetting for HCI cluster. @@ -113,20 +97,20 @@ Response createWithResponse( Context context); /** - * Update ArcSettings for HCI cluster. + * Create ArcSetting for HCI cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param arcSetting ArcSettings parameters that needs to be updated. + * @param arcSetting Parameters supplied to the Create ArcSetting resource for this HCI cluster. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return arcSetting details. */ @ServiceMethod(returns = ReturnType.SINGLE) - ArcSettingInner update( - String resourceGroupName, String clusterName, String arcSettingName, ArcSettingsPatch arcSetting); + ArcSettingInner create( + String resourceGroupName, String clusterName, String arcSettingName, ArcSettingInner arcSetting); /** * Update ArcSettings for HCI cluster. @@ -149,6 +133,22 @@ Response updateWithResponse( ArcSettingsPatch arcSetting, Context context); + /** + * Update ArcSettings for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param arcSetting ArcSettings parameters that needs 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 arcSetting details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ArcSettingInner update( + String resourceGroupName, String clusterName, String arcSettingName, ArcSettingsPatch arcSetting); + /** * Delete ArcSetting resource details of HCI Cluster. * @@ -212,13 +212,15 @@ SyncPoller, Void> beginDelete( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - PasswordCredentialInner generatePassword(String resourceGroupName, String clusterName, String arcSettingName); + Response generatePasswordWithResponse( + String resourceGroupName, String clusterName, String arcSettingName, Context context); /** * Generate password for arc settings. @@ -226,15 +228,13 @@ SyncPoller, Void> beginDelete( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response generatePasswordWithResponse( - String resourceGroupName, String clusterName, String arcSettingName, Context context); + PasswordCredentialInner generatePassword(String resourceGroupName, String clusterName, String arcSettingName); /** * Create Aad identity for arc settings. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/AzureStackHciClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/AzureStackHciClient.java index bb51fe0bea47..a66992173354 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/AzureStackHciClient.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/AzureStackHciClient.java @@ -65,10 +65,52 @@ public interface AzureStackHciClient { */ ExtensionsClient getExtensions(); + /** + * Gets the OffersClient object to access its operations. + * + * @return the OffersClient object. + */ + OffersClient getOffers(); + /** * Gets the OperationsClient object to access its operations. * * @return the OperationsClient object. */ OperationsClient getOperations(); + + /** + * Gets the PublishersClient object to access its operations. + * + * @return the PublishersClient object. + */ + PublishersClient getPublishers(); + + /** + * Gets the SkusClient object to access its operations. + * + * @return the SkusClient object. + */ + SkusClient getSkus(); + + /** + * Gets the UpdateRunsClient object to access its operations. + * + * @return the UpdateRunsClient object. + */ + UpdateRunsClient getUpdateRuns(); + + /** + * Gets the UpdateSummariesOperationsClient object to access its operations. + * + * @return the UpdateSummariesOperationsClient object. + */ + UpdateSummariesOperationsClient getUpdateSummariesOperations(); + + /** + * Gets the UpdatesClient object to access its operations. + * + * @return the UpdatesClient object. + */ + UpdatesClient getUpdates(); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ClustersClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ClustersClient.java index 625ccd127e93..506c21053cc4 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ClustersClient.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ClustersClient.java @@ -14,6 +14,7 @@ import com.azure.resourcemanager.azurestackhci.fluent.models.ClusterIdentityResponseInner; import com.azure.resourcemanager.azurestackhci.fluent.models.ClusterInner; import com.azure.resourcemanager.azurestackhci.models.ClusterPatch; +import com.azure.resourcemanager.azurestackhci.models.SoftwareAssuranceChangeRequest; import com.azure.resourcemanager.azurestackhci.models.UploadCertificateRequest; /** An instance of this class provides access to all the operations defined in ClustersClient. */ @@ -70,28 +71,28 @@ public interface ClustersClient { * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hCI cluster. + * @return hCI cluster along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - ClusterInner getByResourceGroup(String resourceGroupName, String clusterName); + Response getByResourceGroupWithResponse( + String resourceGroupName, String clusterName, Context context); /** * Get HCI cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hCI cluster along with {@link Response}. + * @return hCI cluster. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String clusterName, Context context); + ClusterInner getByResourceGroup(String resourceGroupName, String clusterName); /** * Create an HCI cluster. @@ -99,13 +100,15 @@ Response getByResourceGroupWithResponse( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param cluster Details of the HCI cluster. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster details. + * @return cluster details along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - ClusterInner create(String resourceGroupName, String clusterName, ClusterInner cluster); + Response createWithResponse( + String resourceGroupName, String clusterName, ClusterInner cluster, Context context); /** * Create an HCI cluster. @@ -113,15 +116,13 @@ Response getByResourceGroupWithResponse( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param cluster Details of the HCI cluster. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster details along with {@link Response}. + * @return cluster details. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse( - String resourceGroupName, String clusterName, ClusterInner cluster, Context context); + ClusterInner create(String resourceGroupName, String clusterName, ClusterInner cluster); /** * Update an HCI cluster. @@ -129,13 +130,15 @@ Response createWithResponse( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param cluster Details of the HCI cluster. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster details. + * @return cluster details along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - ClusterInner update(String resourceGroupName, String clusterName, ClusterPatch cluster); + Response updateWithResponse( + String resourceGroupName, String clusterName, ClusterPatch cluster, Context context); /** * Update an HCI cluster. @@ -143,15 +146,13 @@ Response createWithResponse( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param cluster Details of the HCI cluster. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster details along with {@link Response}. + * @return cluster details. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, String clusterName, ClusterPatch cluster, Context context); + ClusterInner update(String resourceGroupName, String clusterName, ClusterPatch cluster); /** * Delete an HCI cluster. @@ -326,4 +327,72 @@ SyncPoller, ClusterIdentityResponseInne */ @ServiceMethod(returns = ReturnType.SINGLE) ClusterIdentityResponseInner createIdentity(String resourceGroupName, String clusterName, Context context); + + /** + * Extends Software Assurance Benefit to a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param softwareAssuranceChangeRequest Software Assurance Change Request Payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 cluster details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ClusterInner> beginExtendSoftwareAssuranceBenefit( + String resourceGroupName, String clusterName, SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest); + + /** + * Extends Software Assurance Benefit to a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param softwareAssuranceChangeRequest Software Assurance Change Request Payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 cluster details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ClusterInner> beginExtendSoftwareAssuranceBenefit( + String resourceGroupName, + String clusterName, + SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest, + Context context); + + /** + * Extends Software Assurance Benefit to a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param softwareAssuranceChangeRequest Software Assurance Change Request Payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterInner extendSoftwareAssuranceBenefit( + String resourceGroupName, String clusterName, SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest); + + /** + * Extends Software Assurance Benefit to a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param softwareAssuranceChangeRequest Software Assurance Change Request Payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterInner extendSoftwareAssuranceBenefit( + String resourceGroupName, + String clusterName, + SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest, + Context context); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ExtensionsClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ExtensionsClient.java index d9662370c2a3..7b1b2221720d 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ExtensionsClient.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ExtensionsClient.java @@ -52,13 +52,15 @@ PagedIterable listByArcSetting( * @param clusterName The name of the cluster. * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. * @param extensionName The name of the machine extension. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return particular Arc Extension of HCI Cluster. + * @return particular Arc Extension of HCI Cluster along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - ExtensionInner get(String resourceGroupName, String clusterName, String arcSettingName, String extensionName); + Response getWithResponse( + String resourceGroupName, String clusterName, String arcSettingName, String extensionName, Context context); /** * Get particular Arc Extension of HCI Cluster. @@ -67,15 +69,13 @@ PagedIterable listByArcSetting( * @param clusterName The name of the cluster. * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. * @param extensionName The name of the machine extension. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return particular Arc Extension of HCI Cluster along with {@link Response}. + * @return particular Arc Extension of HCI Cluster. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String clusterName, String arcSettingName, String extensionName, Context context); + ExtensionInner get(String resourceGroupName, String clusterName, String arcSettingName, String extensionName); /** * Create Extension for HCI cluster. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/OffersClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/OffersClient.java new file mode 100644 index 000000000000..de2d0e4575c7 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/OffersClient.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.OfferInner; + +/** An instance of this class provides access to all the operations defined in OffersClient. */ +public interface OffersClient { + /** + * List Offers available for a publisher within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Offer proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByPublisher(String resourceGroupName, String clusterName, String publisherName); + + /** + * List Offers available for a publisher within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Offer proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByPublisher( + String resourceGroupName, String clusterName, String publisherName, String expand, Context context); + + /** + * List Offers available across publishers for the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Offer proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByCluster(String resourceGroupName, String clusterName); + + /** + * List Offers available across publishers for the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Offer proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByCluster( + String resourceGroupName, String clusterName, String expand, Context context); + + /** + * Get Offer resource details within a publisher of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return offer resource details within a publisher of HCI Cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String clusterName, + String publisherName, + String offerName, + String expand, + Context context); + + /** + * Get Offer resource details within a publisher of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return offer resource details within a publisher of HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OfferInner get(String resourceGroupName, String clusterName, String publisherName, String offerName); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/OperationsClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/OperationsClient.java index 0b8e907abe68..f0b6560317b0 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/OperationsClient.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/OperationsClient.java @@ -15,22 +15,22 @@ public interface OperationsClient { /** * List all available Microsoft.AzureStackHCI provider operations. * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - OperationListResultInner list(); + Response listWithResponse(Context context); /** * List all available Microsoft.AzureStackHCI provider operations. * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider along with {@link Response}. + * @return a list of REST API operations supported by an Azure Resource Provider. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse(Context context); + OperationListResultInner list(); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/PublishersClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/PublishersClient.java new file mode 100644 index 000000000000..4848319e64a2 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/PublishersClient.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.PublisherInner; + +/** An instance of this class provides access to all the operations defined in PublishersClient. */ +public interface PublishersClient { + /** + * List Publishers available for the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Publisher proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByCluster(String resourceGroupName, String clusterName); + + /** + * List Publishers available for the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Publisher proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByCluster(String resourceGroupName, String clusterName, Context context); + + /** + * Get Publisher resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher resource details of HCI Cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String clusterName, String publisherName, Context context); + + /** + * Get Publisher resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher resource details of HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PublisherInner get(String resourceGroupName, String clusterName, String publisherName); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/SkusClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/SkusClient.java new file mode 100644 index 000000000000..1966f641671b --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/SkusClient.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.azurestackhci.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.SkuInner; + +/** An instance of this class provides access to all the operations defined in SkusClient. */ +public interface SkusClient { + /** + * List Skus available for a offer within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SKU proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByOffer( + String resourceGroupName, String clusterName, String publisherName, String offerName); + + /** + * List Skus available for a offer within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SKU proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByOffer( + String resourceGroupName, + String clusterName, + String publisherName, + String offerName, + String expand, + Context context); + + /** + * Get SKU resource details within a offer of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @param skuName The name of the SKU available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sKU resource details within a offer of HCI Cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String clusterName, + String publisherName, + String offerName, + String skuName, + String expand, + Context context); + + /** + * Get SKU resource details within a offer of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @param skuName The name of the SKU available within HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sKU resource details within a offer of HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SkuInner get(String resourceGroupName, String clusterName, String publisherName, String offerName, String skuName); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/UpdateRunsClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/UpdateRunsClient.java new file mode 100644 index 000000000000..b858b8dd7ae7 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/UpdateRunsClient.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.azurestackhci.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.azurestackhci.fluent.models.UpdateRunInner; + +/** An instance of this class provides access to all the operations defined in UpdateRunsClient. */ +public interface UpdateRunsClient { + /** + * List all Update runs for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Update runs as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String clusterName, String updateName); + + /** + * List all Update runs for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Update runs as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String clusterName, String updateName, Context context); + + /** + * Delete specified Update Run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 clusterName, String updateName, String updateRunName); + + /** + * Delete specified Update Run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 clusterName, String updateName, String updateRunName, Context context); + + /** + * Delete specified Update Run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 clusterName, String updateName, String updateRunName); + + /** + * Delete specified Update Run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 clusterName, String updateName, String updateRunName, Context context); + + /** + * Put Update runs for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @param updateRunsProperties Properties of the updateRuns 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 details of an Update run along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response putWithResponse( + String resourceGroupName, + String clusterName, + String updateName, + String updateRunName, + UpdateRunInner updateRunsProperties, + Context context); + + /** + * Put Update runs for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @param updateRunsProperties Properties of the updateRuns 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 details of an Update run. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + UpdateRunInner put( + String resourceGroupName, + String clusterName, + String updateName, + String updateRunName, + UpdateRunInner updateRunsProperties); + + /** + * Get the Update run for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Update run for a specified update along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String clusterName, String updateName, String updateRunName, Context context); + + /** + * Get the Update run for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Update run for a specified update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + UpdateRunInner get(String resourceGroupName, String clusterName, String updateName, String updateRunName); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/UpdateSummariesOperationsClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/UpdateSummariesOperationsClient.java new file mode 100644 index 000000000000..97d1cf58e764 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/UpdateSummariesOperationsClient.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.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.azurestackhci.fluent.models.UpdateSummariesInner; + +/** An instance of this class provides access to all the operations defined in UpdateSummariesOperationsClient. */ +public interface UpdateSummariesOperationsClient { + /** + * List all Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Update Summaries as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String clusterName); + + /** + * List all Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Update Summaries as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String clusterName, Context context); + + /** + * Delete Update Summaries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 clusterName); + + /** + * Delete Update Summaries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 clusterName, Context context); + + /** + * Delete Update Summaries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 clusterName); + + /** + * Delete Update Summaries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 clusterName, Context context); + + /** + * Put Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateLocationProperties Properties of the UpdateSummaries resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return get the update summaries for the cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response putWithResponse( + String resourceGroupName, String clusterName, UpdateSummariesInner updateLocationProperties, Context context); + + /** + * Put Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateLocationProperties Properties of the UpdateSummaries resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return get the update summaries for the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + UpdateSummariesInner put( + String resourceGroupName, String clusterName, UpdateSummariesInner updateLocationProperties); + + /** + * Get all Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Update summaries under the HCI cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String clusterName, Context context); + + /** + * Get all Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Update summaries under the HCI cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + UpdateSummariesInner get(String resourceGroupName, String clusterName); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/UpdatesClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/UpdatesClient.java new file mode 100644 index 000000000000..80aca699d73e --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/UpdatesClient.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.azurestackhci.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.azurestackhci.fluent.models.UpdateInner; + +/** An instance of this class provides access to all the operations defined in UpdatesClient. */ +public interface UpdatesClient { + /** + * Apply Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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> beginPost(String resourceGroupName, String clusterName, String updateName); + + /** + * Apply Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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> beginPost( + String resourceGroupName, String clusterName, String updateName, Context context); + + /** + * Apply Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 post(String resourceGroupName, String clusterName, String updateName); + + /** + * Apply Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 post(String resourceGroupName, String clusterName, String updateName, Context context); + + /** + * List all Updates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Updates as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String clusterName); + + /** + * List all Updates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Updates as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String clusterName, Context context); + + /** + * Delete specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 clusterName, String updateName); + + /** + * Delete specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 clusterName, String updateName, Context context); + + /** + * Delete specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 clusterName, String updateName); + + /** + * Delete specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 clusterName, String updateName, Context context); + + /** + * Put specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateProperties Properties of the Updates 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 update details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response putWithResponse( + String resourceGroupName, String clusterName, String updateName, UpdateInner updateProperties, Context context); + + /** + * Put specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateProperties Properties of the Updates 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 update details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + UpdateInner put(String resourceGroupName, String clusterName, String updateName, UpdateInner updateProperties); + + /** + * Get specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specified Update along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String clusterName, String updateName, Context context); + + /** + * Get specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specified Update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + UpdateInner get(String resourceGroupName, String clusterName, String updateName); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcIdentityResponseInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcIdentityResponseInner.java index 909acd05b51e..b78ef3f98986 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcIdentityResponseInner.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcIdentityResponseInner.java @@ -16,6 +16,10 @@ public final class ArcIdentityResponseInner { @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) private ArcIdentityResponseProperties innerProperties; + /** Creates an instance of ArcIdentityResponseInner class. */ + public ArcIdentityResponseInner() { + } + /** * Get the innerProperties property: ArcIdentity properties. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcIdentityResponseProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcIdentityResponseProperties.java index 5b20f4848fb7..5ab585ca46e1 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcIdentityResponseProperties.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcIdentityResponseProperties.java @@ -34,6 +34,10 @@ public final class ArcIdentityResponseProperties { @JsonProperty(value = "arcApplicationObjectId") private String arcApplicationObjectId; + /** Creates an instance of ArcIdentityResponseProperties class. */ + public ArcIdentityResponseProperties() { + } + /** * Get the arcApplicationClientId property: The arcApplicationClientId property. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcSettingInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcSettingInner.java index cfdbb16c5d22..74b89bc342f4 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcSettingInner.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcSettingInner.java @@ -16,25 +16,20 @@ /** ArcSetting details. */ @Fluent public final class ArcSettingInner extends ProxyResource { - /* - * System data of ArcSetting resource - */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) - private SystemData systemData; - /* * ArcSetting properties. */ @JsonProperty(value = "properties") private ArcSettingProperties innerProperties; - /** - * Get the systemData property: System data of ArcSetting resource. - * - * @return the systemData value. + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - public SystemData systemData() { - return this.systemData; + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of ArcSettingInner class. */ + public ArcSettingInner() { } /** @@ -46,6 +41,15 @@ private ArcSettingProperties innerProperties() { return this.innerProperties; } + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the provisioningState property: Provisioning state of the ArcSetting proxy resource. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcSettingProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcSettingProperties.java index e628ec8d6f03..5b7a98227889 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcSettingProperties.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcSettingProperties.java @@ -21,8 +21,7 @@ public final class ArcSettingProperties { private ProvisioningState provisioningState; /* - * The resource group that hosts the Arc agents, ie. Hybrid Compute Machine - * resources. + * The resource group that hosts the Arc agents, ie. Hybrid Compute Machine resources. */ @JsonProperty(value = "arcInstanceResourceGroup") private String arcInstanceResourceGroup; @@ -69,6 +68,10 @@ public final class ArcSettingProperties { @JsonProperty(value = "connectivityProperties") private Object connectivityProperties; + /** Creates an instance of ArcSettingProperties class. */ + public ArcSettingProperties() { + } + /** * Get the provisioningState property: Provisioning state of the ArcSetting proxy resource. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcSettingsPatchProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcSettingsPatchProperties.java index ea8247835231..bbd2f95830e2 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcSettingsPatchProperties.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcSettingsPatchProperties.java @@ -16,6 +16,10 @@ public final class ArcSettingsPatchProperties { @JsonProperty(value = "connectivityProperties") private Object connectivityProperties; + /** Creates an instance of ArcSettingsPatchProperties class. */ + public ArcSettingsPatchProperties() { + } + /** * Get the connectivityProperties property: contains connectivity related configuration for ARC resources. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterIdentityResponseInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterIdentityResponseInner.java index be934a9d5d35..0e602f5ca269 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterIdentityResponseInner.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterIdentityResponseInner.java @@ -16,6 +16,10 @@ public final class ClusterIdentityResponseInner { @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) private ClusterIdentityResponseProperties innerProperties; + /** Creates an instance of ClusterIdentityResponseInner class. */ + public ClusterIdentityResponseInner() { + } + /** * Get the innerProperties property: Cluster identity properties. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterIdentityResponseProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterIdentityResponseProperties.java index 745b333748ae..56a135b5b73d 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterIdentityResponseProperties.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterIdentityResponseProperties.java @@ -34,6 +34,10 @@ public final class ClusterIdentityResponseProperties { @JsonProperty(value = "aadApplicationObjectId") private String aadApplicationObjectId; + /** Creates an instance of ClusterIdentityResponseProperties class. */ + public ClusterIdentityResponseProperties() { + } + /** * Get the aadClientId property: The aadClientId property. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterInner.java index 90830dc5dd72..5e0205992943 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterInner.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterInner.java @@ -9,20 +9,24 @@ import com.azure.core.management.SystemData; import com.azure.resourcemanager.azurestackhci.models.ClusterDesiredProperties; import com.azure.resourcemanager.azurestackhci.models.ClusterReportedProperties; +import com.azure.resourcemanager.azurestackhci.models.ManagedServiceIdentityType; import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; +import com.azure.resourcemanager.azurestackhci.models.SoftwareAssuranceProperties; import com.azure.resourcemanager.azurestackhci.models.Status; +import com.azure.resourcemanager.azurestackhci.models.UserAssignedIdentity; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; import java.util.Map; +import java.util.UUID; /** Cluster details. */ @Fluent public final class ClusterInner extends Resource { /* - * System data of Cluster resource + * Identity of Cluster resource */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) - private SystemData systemData; + @JsonProperty(value = "identity") + private ManagedServiceIdentity innerIdentity; /* * Cluster properties. @@ -30,13 +34,23 @@ public final class ClusterInner extends Resource { @JsonProperty(value = "properties") private ClusterProperties innerProperties; + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of ClusterInner class. */ + public ClusterInner() { + } + /** - * Get the systemData property: System data of Cluster resource. + * Get the innerIdentity property: Identity of Cluster resource. * - * @return the systemData value. + * @return the innerIdentity value. */ - public SystemData systemData() { - return this.systemData; + private ManagedServiceIdentity innerIdentity() { + return this.innerIdentity; } /** @@ -48,6 +62,15 @@ private ClusterProperties innerProperties() { return this.innerProperties; } + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** {@inheritDoc} */ @Override public ClusterInner withLocation(String location) { @@ -62,6 +85,80 @@ public ClusterInner withTags(Map tags) { return this; } + /** + * Get the principalId property: The service principal ID of the system assigned identity. This property will only + * be provided for a system assigned identity. + * + * @return the principalId value. + */ + public UUID principalId() { + return this.innerIdentity() == null ? null : this.innerIdentity().principalId(); + } + + /** + * Get the tenantId property: The tenant ID of the system assigned identity. This property will only be provided for + * a system assigned identity. + * + * @return the tenantId value. + */ + public UUID tenantId() { + return this.innerIdentity() == null ? null : this.innerIdentity().tenantId(); + } + + /** + * Get the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are + * allowed). + * + * @return the type value. + */ + public ManagedServiceIdentityType typeIdentityType() { + return this.innerIdentity() == null ? null : this.innerIdentity().type(); + } + + /** + * Set the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are + * allowed). + * + * @param type the type value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withTypeIdentityType(ManagedServiceIdentityType type) { + if (this.innerIdentity() == null) { + this.innerIdentity = new ManagedServiceIdentity(); + } + this.innerIdentity().withType(type); + return this; + } + + /** + * Get the userAssignedIdentities property: The set of user assigned identities associated with the resource. The + * userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.innerIdentity() == null ? null : this.innerIdentity().userAssignedIdentities(); + } + + /** + * Set the userAssignedIdentities property: The set of user assigned identities associated with the resource. The + * userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withUserAssignedIdentities(Map userAssignedIdentities) { + if (this.innerIdentity() == null) { + this.innerIdentity = new ManagedServiceIdentity(); + } + this.innerIdentity().withUserAssignedIdentities(userAssignedIdentities); + return this; + } + /** * Get the provisioningState property: Provisioning state. * @@ -204,6 +301,29 @@ public ClusterInner withAadServicePrincipalObjectId(String aadServicePrincipalOb return this; } + /** + * Get the softwareAssuranceProperties property: Software Assurance properties of the cluster. + * + * @return the softwareAssuranceProperties value. + */ + public SoftwareAssuranceProperties softwareAssuranceProperties() { + return this.innerProperties() == null ? null : this.innerProperties().softwareAssuranceProperties(); + } + + /** + * Set the softwareAssuranceProperties property: Software Assurance properties of the cluster. + * + * @param softwareAssuranceProperties the softwareAssuranceProperties value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withSoftwareAssuranceProperties(SoftwareAssuranceProperties softwareAssuranceProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterProperties(); + } + this.innerProperties().withSoftwareAssuranceProperties(softwareAssuranceProperties); + return this; + } + /** * Get the desiredProperties property: Desired properties of the cluster. * @@ -290,12 +410,24 @@ public String serviceEndpoint() { return this.innerProperties() == null ? null : this.innerProperties().serviceEndpoint(); } + /** + * Get the resourceProviderObjectId property: Object id of RP Service Principal. + * + * @return the resourceProviderObjectId value. + */ + public String resourceProviderObjectId() { + return this.innerProperties() == null ? null : this.innerProperties().resourceProviderObjectId(); + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (innerIdentity() != null) { + innerIdentity().validate(); + } if (innerProperties() != null) { innerProperties().validate(); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterPatchProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterPatchProperties.java index 170d36a4d2b3..32e69e11ce96 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterPatchProperties.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterPatchProperties.java @@ -35,6 +35,10 @@ public final class ClusterPatchProperties { @JsonProperty(value = "desiredProperties") private ClusterDesiredProperties desiredProperties; + /** Creates an instance of ClusterPatchProperties class. */ + public ClusterPatchProperties() { + } + /** * Get the cloudManagementEndpoint property: Endpoint configured for management from the Azure portal. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterProperties.java index cb7310c87094..940ee197b5a7 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterProperties.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterProperties.java @@ -8,6 +8,7 @@ import com.azure.resourcemanager.azurestackhci.models.ClusterDesiredProperties; import com.azure.resourcemanager.azurestackhci.models.ClusterReportedProperties; import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; +import com.azure.resourcemanager.azurestackhci.models.SoftwareAssuranceProperties; import com.azure.resourcemanager.azurestackhci.models.Status; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; @@ -63,6 +64,12 @@ public final class ClusterProperties { @JsonProperty(value = "aadServicePrincipalObjectId") private String aadServicePrincipalObjectId; + /* + * Software Assurance properties of the cluster. + */ + @JsonProperty(value = "softwareAssuranceProperties") + private SoftwareAssuranceProperties softwareAssuranceProperties; + /* * Desired properties of the cluster. */ @@ -111,6 +118,16 @@ public final class ClusterProperties { @JsonProperty(value = "serviceEndpoint", access = JsonProperty.Access.WRITE_ONLY) private String serviceEndpoint; + /* + * Object id of RP Service Principal + */ + @JsonProperty(value = "resourceProviderObjectId", access = JsonProperty.Access.WRITE_ONLY) + private String resourceProviderObjectId; + + /** Creates an instance of ClusterProperties class. */ + public ClusterProperties() { + } + /** * Get the provisioningState property: Provisioning state. * @@ -238,6 +255,26 @@ public ClusterProperties withAadServicePrincipalObjectId(String aadServicePrinci return this; } + /** + * Get the softwareAssuranceProperties property: Software Assurance properties of the cluster. + * + * @return the softwareAssuranceProperties value. + */ + public SoftwareAssuranceProperties softwareAssuranceProperties() { + return this.softwareAssuranceProperties; + } + + /** + * Set the softwareAssuranceProperties property: Software Assurance properties of the cluster. + * + * @param softwareAssuranceProperties the softwareAssuranceProperties value to set. + * @return the ClusterProperties object itself. + */ + public ClusterProperties withSoftwareAssuranceProperties(SoftwareAssuranceProperties softwareAssuranceProperties) { + this.softwareAssuranceProperties = softwareAssuranceProperties; + return this; + } + /** * Get the desiredProperties property: Desired properties of the cluster. * @@ -321,12 +358,24 @@ public String serviceEndpoint() { return this.serviceEndpoint; } + /** + * Get the resourceProviderObjectId property: Object id of RP Service Principal. + * + * @return the resourceProviderObjectId value. + */ + public String resourceProviderObjectId() { + return this.resourceProviderObjectId; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (softwareAssuranceProperties() != null) { + softwareAssuranceProperties().validate(); + } if (desiredProperties() != null) { desiredProperties().validate(); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ExtensionInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ExtensionInner.java index 915af50280ef..2d10f362f451 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ExtensionInner.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ExtensionInner.java @@ -16,25 +16,20 @@ /** Details of a particular extension in HCI Cluster. */ @Fluent public final class ExtensionInner extends ProxyResource { - /* - * System data of Extension resource. - */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) - private SystemData systemData; - /* * Describes Machine Extension Properties. */ @JsonProperty(value = "properties") private ExtensionProperties innerProperties; - /** - * Get the systemData property: System data of Extension resource. - * - * @return the systemData value. + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - public SystemData systemData() { - return this.systemData; + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of ExtensionInner class. */ + public ExtensionInner() { } /** @@ -46,6 +41,15 @@ private ExtensionProperties innerProperties() { return this.innerProperties; } + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the provisioningState property: Provisioning state of the Extension proxy resource. * @@ -240,6 +244,31 @@ public ExtensionInner withProtectedSettings(Object protectedSettings) { return this; } + /** + * Get the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version available. + * + * @return the enableAutomaticUpgrade value. + */ + public Boolean enableAutomaticUpgrade() { + return this.innerProperties() == null ? null : this.innerProperties().enableAutomaticUpgrade(); + } + + /** + * Set the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version available. + * + * @param enableAutomaticUpgrade the enableAutomaticUpgrade value to set. + * @return the ExtensionInner object itself. + */ + public ExtensionInner withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { + if (this.innerProperties() == null) { + this.innerProperties = new ExtensionProperties(); + } + this.innerProperties().withEnableAutomaticUpgrade(enableAutomaticUpgrade); + return this; + } + /** * Validates the instance. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ExtensionParameters.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ExtensionParameters.java index 52eea9ddbd4a..f68ee1a4a966 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ExtensionParameters.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ExtensionParameters.java @@ -11,8 +11,7 @@ @Fluent public final class ExtensionParameters { /* - * How the extension handler should be forced to update even if the - * extension configuration has not changed. + * How the extension handler should be forced to update even if the extension configuration has not changed. */ @JsonProperty(value = "forceUpdateTag") private String forceUpdateTag; @@ -24,8 +23,7 @@ public final class ExtensionParameters { private String publisher; /* - * Specifies the type of the extension; an example is - * "CustomScriptExtension". + * Specifies the type of the extension; an example is "CustomScriptExtension". */ @JsonProperty(value = "type") private String type; @@ -37,10 +35,9 @@ public final class ExtensionParameters { private String typeHandlerVersion; /* - * Indicates whether the extension should use a newer minor version if one - * is available at deployment time. Once deployed, however, the extension - * will not upgrade minor versions unless redeployed, even with this - * property set to true. + * Indicates whether the extension should use a newer minor version if one is available at deployment time. Once + * deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set + * to true. */ @JsonProperty(value = "autoUpgradeMinorVersion") private Boolean autoUpgradeMinorVersion; @@ -57,6 +54,17 @@ public final class ExtensionParameters { @JsonProperty(value = "protectedSettings") private Object protectedSettings; + /* + * Indicates whether the extension should be automatically upgraded by the platform if there is a newer version + * available. + */ + @JsonProperty(value = "enableAutomaticUpgrade") + private Boolean enableAutomaticUpgrade; + + /** Creates an instance of ExtensionParameters class. */ + public ExtensionParameters() { + } + /** * Get the forceUpdateTag property: How the extension handler should be forced to update even if the extension * configuration has not changed. @@ -203,6 +211,28 @@ public ExtensionParameters withProtectedSettings(Object protectedSettings) { return this; } + /** + * Get the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version available. + * + * @return the enableAutomaticUpgrade value. + */ + public Boolean enableAutomaticUpgrade() { + return this.enableAutomaticUpgrade; + } + + /** + * Set the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version available. + * + * @param enableAutomaticUpgrade the enableAutomaticUpgrade value to set. + * @return the ExtensionParameters object itself. + */ + public ExtensionParameters withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { + this.enableAutomaticUpgrade = enableAutomaticUpgrade; + return this; + } + /** * Validates the instance. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ExtensionProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ExtensionProperties.java index 0a19e3a728d5..1fff92e17d7f 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ExtensionProperties.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ExtensionProperties.java @@ -38,6 +38,10 @@ public final class ExtensionProperties { @JsonProperty(value = "perNodeExtensionDetails", access = JsonProperty.Access.WRITE_ONLY) private List perNodeExtensionDetails; + /** Creates an instance of ExtensionProperties class. */ + public ExtensionProperties() { + } + /** * Get the provisioningState property: Provisioning state of the Extension proxy resource. * @@ -243,6 +247,33 @@ public ExtensionProperties withProtectedSettings(Object protectedSettings) { return this; } + /** + * Get the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version available. + * + * @return the enableAutomaticUpgrade value. + */ + public Boolean enableAutomaticUpgrade() { + return this.innerExtensionParameters() == null + ? null + : this.innerExtensionParameters().enableAutomaticUpgrade(); + } + + /** + * Set the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version available. + * + * @param enableAutomaticUpgrade the enableAutomaticUpgrade value to set. + * @return the ExtensionProperties object itself. + */ + public ExtensionProperties withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { + if (this.innerExtensionParameters() == null) { + this.innerExtensionParameters = new ExtensionParameters(); + } + this.innerExtensionParameters().withEnableAutomaticUpgrade(enableAutomaticUpgrade); + return this; + } + /** * Validates the instance. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ManagedServiceIdentity.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ManagedServiceIdentity.java new file mode 100644 index 000000000000..9ef26edc5be5 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ManagedServiceIdentity.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.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azurestackhci.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.azurestackhci.models.UserAssignedIdentity; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; +import java.util.UUID; + +/** Managed service identity (system assigned and/or user assigned identities). */ +@Fluent +public class ManagedServiceIdentity { + /* + * The service principal ID of the system assigned identity. This property will only be provided for a system + * assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private UUID principalId; + + /* + * The tenant ID of the system assigned identity. This property will only be provided for a system assigned + * identity. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private UUID tenantId; + + /* + * Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + */ + @JsonProperty(value = "type", required = true) + private ManagedServiceIdentityType type; + + /* + * The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys + * will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + */ + @JsonProperty(value = "userAssignedIdentities") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map userAssignedIdentities; + + /** Creates an instance of ManagedServiceIdentity class. */ + public ManagedServiceIdentity() { + } + + /** + * Get the principalId property: The service principal ID of the system assigned identity. This property will only + * be provided for a system assigned identity. + * + * @return the principalId value. + */ + public UUID principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: The tenant ID of the system assigned identity. This property will only be provided for + * a system assigned identity. + * + * @return the tenantId value. + */ + public UUID tenantId() { + return this.tenantId; + } + + /** + * Get the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are + * allowed). + * + * @return the type value. + */ + public ManagedServiceIdentityType type() { + return this.type; + } + + /** + * Set the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are + * allowed). + * + * @param type the type value to set. + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withType(ManagedServiceIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the userAssignedIdentities property: The set of user assigned identities associated with the resource. The + * userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: The set of user assigned identities associated with the resource. The + * userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (type() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property type in model ManagedServiceIdentity")); + } + if (userAssignedIdentities() != null) { + userAssignedIdentities() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagedServiceIdentity.class); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/OfferInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/OfferInner.java new file mode 100644 index 000000000000..650252e8d9f4 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/OfferInner.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.azurestackhci.models.SkuMappings; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Offer details. */ +@Fluent +public final class OfferInner extends ProxyResource { + /* + * Offer properties. + */ + @JsonProperty(value = "properties") + private OfferProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of OfferInner class. */ + public OfferInner() { + } + + /** + * Get the innerProperties property: Offer properties. + * + * @return the innerProperties value. + */ + private OfferProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the provisioningState property: Provisioning State. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the publisherId property: Identifier of the Publisher for the offer. + * + * @return the publisherId value. + */ + public String publisherId() { + return this.innerProperties() == null ? null : this.innerProperties().publisherId(); + } + + /** + * Set the publisherId property: Identifier of the Publisher for the offer. + * + * @param publisherId the publisherId value to set. + * @return the OfferInner object itself. + */ + public OfferInner withPublisherId(String publisherId) { + if (this.innerProperties() == null) { + this.innerProperties = new OfferProperties(); + } + this.innerProperties().withPublisherId(publisherId); + return this; + } + + /** + * Get the content property: JSON serialized catalog content of the offer. + * + * @return the content value. + */ + public String content() { + return this.innerProperties() == null ? null : this.innerProperties().content(); + } + + /** + * Set the content property: JSON serialized catalog content of the offer. + * + * @param content the content value to set. + * @return the OfferInner object itself. + */ + public OfferInner withContent(String content) { + if (this.innerProperties() == null) { + this.innerProperties = new OfferProperties(); + } + this.innerProperties().withContent(content); + return this; + } + + /** + * Get the contentVersion property: The API version of the catalog service used to serve the catalog content. + * + * @return the contentVersion value. + */ + public String contentVersion() { + return this.innerProperties() == null ? null : this.innerProperties().contentVersion(); + } + + /** + * Set the contentVersion property: The API version of the catalog service used to serve the catalog content. + * + * @param contentVersion the contentVersion value to set. + * @return the OfferInner object itself. + */ + public OfferInner withContentVersion(String contentVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new OfferProperties(); + } + this.innerProperties().withContentVersion(contentVersion); + return this; + } + + /** + * Get the skuMappings property: Array of SKU mappings. + * + * @return the skuMappings value. + */ + public List skuMappings() { + return this.innerProperties() == null ? null : this.innerProperties().skuMappings(); + } + + /** + * Set the skuMappings property: Array of SKU mappings. + * + * @param skuMappings the skuMappings value to set. + * @return the OfferInner object itself. + */ + public OfferInner withSkuMappings(List skuMappings) { + if (this.innerProperties() == null) { + this.innerProperties = new OfferProperties(); + } + this.innerProperties().withSkuMappings(skuMappings); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/OfferProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/OfferProperties.java new file mode 100644 index 000000000000..77872ea85b61 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/OfferProperties.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurestackhci.models.SkuMappings; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Publisher properties. */ +@Fluent +public final class OfferProperties { + /* + * Provisioning State + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * Identifier of the Publisher for the offer + */ + @JsonProperty(value = "publisherId") + private String publisherId; + + /* + * JSON serialized catalog content of the offer + */ + @JsonProperty(value = "content") + private String content; + + /* + * The API version of the catalog service used to serve the catalog content + */ + @JsonProperty(value = "contentVersion") + private String contentVersion; + + /* + * Array of SKU mappings + */ + @JsonProperty(value = "skuMappings") + private List skuMappings; + + /** Creates an instance of OfferProperties class. */ + public OfferProperties() { + } + + /** + * Get the provisioningState property: Provisioning State. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the publisherId property: Identifier of the Publisher for the offer. + * + * @return the publisherId value. + */ + public String publisherId() { + return this.publisherId; + } + + /** + * Set the publisherId property: Identifier of the Publisher for the offer. + * + * @param publisherId the publisherId value to set. + * @return the OfferProperties object itself. + */ + public OfferProperties withPublisherId(String publisherId) { + this.publisherId = publisherId; + return this; + } + + /** + * Get the content property: JSON serialized catalog content of the offer. + * + * @return the content value. + */ + public String content() { + return this.content; + } + + /** + * Set the content property: JSON serialized catalog content of the offer. + * + * @param content the content value to set. + * @return the OfferProperties object itself. + */ + public OfferProperties withContent(String content) { + this.content = content; + return this; + } + + /** + * Get the contentVersion property: The API version of the catalog service used to serve the catalog content. + * + * @return the contentVersion value. + */ + public String contentVersion() { + return this.contentVersion; + } + + /** + * Set the contentVersion property: The API version of the catalog service used to serve the catalog content. + * + * @param contentVersion the contentVersion value to set. + * @return the OfferProperties object itself. + */ + public OfferProperties withContentVersion(String contentVersion) { + this.contentVersion = contentVersion; + return this; + } + + /** + * Get the skuMappings property: Array of SKU mappings. + * + * @return the skuMappings value. + */ + public List skuMappings() { + return this.skuMappings; + } + + /** + * Set the skuMappings property: Array of SKU mappings. + * + * @param skuMappings the skuMappings value to set. + * @return the OfferProperties object itself. + */ + public OfferProperties withSkuMappings(List skuMappings) { + this.skuMappings = skuMappings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (skuMappings() != null) { + skuMappings().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/OperationListResultInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/OperationListResultInner.java index cd70af853a48..4c05d5ac2ed3 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/OperationListResultInner.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/OperationListResultInner.java @@ -27,6 +27,10 @@ public final class OperationListResultInner { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; + /** Creates an instance of OperationListResultInner class. */ + public OperationListResultInner() { + } + /** * Get the value property: List of operations supported by the resource provider. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/PasswordCredentialInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/PasswordCredentialInner.java index 92abc341b739..dffbc7e9a7de 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/PasswordCredentialInner.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/PasswordCredentialInner.java @@ -35,6 +35,10 @@ public final class PasswordCredentialInner { @JsonProperty(value = "endDateTime") private OffsetDateTime endDateTime; + /** Creates an instance of PasswordCredentialInner class. */ + public PasswordCredentialInner() { + } + /** * Get the secretText property: The secretText property. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/PublisherInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/PublisherInner.java new file mode 100644 index 000000000000..a1715a0f49a2 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/PublisherInner.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.azurestackhci.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Publisher details. */ +@Immutable +public final class PublisherInner extends ProxyResource { + /* + * Publisher properties. + */ + @JsonProperty(value = "properties") + private PublisherProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of PublisherInner class. */ + public PublisherInner() { + } + + /** + * Get the innerProperties property: Publisher properties. + * + * @return the innerProperties value. + */ + private PublisherProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the provisioningState property: Provisioning State. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/PublisherProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/PublisherProperties.java new file mode 100644 index 000000000000..8536c871c29e --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/PublisherProperties.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Publisher properties. */ +@Immutable +public final class PublisherProperties { + /* + * Provisioning State + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** Creates an instance of PublisherProperties class. */ + public PublisherProperties() { + } + + /** + * Get the provisioningState property: Provisioning State. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/SkuInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/SkuInner.java new file mode 100644 index 000000000000..7aa0fb06a66f --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/SkuInner.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.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.azurestackhci.models.SkuMappings; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Sku details. */ +@Fluent +public final class SkuInner extends ProxyResource { + /* + * SKU properties. + */ + @JsonProperty(value = "properties") + private SkuProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of SkuInner class. */ + public SkuInner() { + } + + /** + * Get the innerProperties property: SKU properties. + * + * @return the innerProperties value. + */ + private SkuProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the provisioningState property: Provisioning State. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the publisherId property: Identifier of the Publisher for the offer. + * + * @return the publisherId value. + */ + public String publisherId() { + return this.innerProperties() == null ? null : this.innerProperties().publisherId(); + } + + /** + * Set the publisherId property: Identifier of the Publisher for the offer. + * + * @param publisherId the publisherId value to set. + * @return the SkuInner object itself. + */ + public SkuInner withPublisherId(String publisherId) { + if (this.innerProperties() == null) { + this.innerProperties = new SkuProperties(); + } + this.innerProperties().withPublisherId(publisherId); + return this; + } + + /** + * Get the offerId property: Identifier of the Offer for the sku. + * + * @return the offerId value. + */ + public String offerId() { + return this.innerProperties() == null ? null : this.innerProperties().offerId(); + } + + /** + * Set the offerId property: Identifier of the Offer for the sku. + * + * @param offerId the offerId value to set. + * @return the SkuInner object itself. + */ + public SkuInner withOfferId(String offerId) { + if (this.innerProperties() == null) { + this.innerProperties = new SkuProperties(); + } + this.innerProperties().withOfferId(offerId); + return this; + } + + /** + * Get the content property: JSON serialized catalog content of the sku offer. + * + * @return the content value. + */ + public String content() { + return this.innerProperties() == null ? null : this.innerProperties().content(); + } + + /** + * Set the content property: JSON serialized catalog content of the sku offer. + * + * @param content the content value to set. + * @return the SkuInner object itself. + */ + public SkuInner withContent(String content) { + if (this.innerProperties() == null) { + this.innerProperties = new SkuProperties(); + } + this.innerProperties().withContent(content); + return this; + } + + /** + * Get the contentVersion property: The API version of the catalog service used to serve the catalog content. + * + * @return the contentVersion value. + */ + public String contentVersion() { + return this.innerProperties() == null ? null : this.innerProperties().contentVersion(); + } + + /** + * Set the contentVersion property: The API version of the catalog service used to serve the catalog content. + * + * @param contentVersion the contentVersion value to set. + * @return the SkuInner object itself. + */ + public SkuInner withContentVersion(String contentVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new SkuProperties(); + } + this.innerProperties().withContentVersion(contentVersion); + return this; + } + + /** + * Get the skuMappings property: Array of SKU mappings. + * + * @return the skuMappings value. + */ + public List skuMappings() { + return this.innerProperties() == null ? null : this.innerProperties().skuMappings(); + } + + /** + * Set the skuMappings property: Array of SKU mappings. + * + * @param skuMappings the skuMappings value to set. + * @return the SkuInner object itself. + */ + public SkuInner withSkuMappings(List skuMappings) { + if (this.innerProperties() == null) { + this.innerProperties = new SkuProperties(); + } + this.innerProperties().withSkuMappings(skuMappings); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/SkuProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/SkuProperties.java new file mode 100644 index 000000000000..faee73884437 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/SkuProperties.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurestackhci.models.SkuMappings; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** SKU properties. */ +@Fluent +public final class SkuProperties { + /* + * Provisioning State + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * Identifier of the Publisher for the offer + */ + @JsonProperty(value = "publisherId") + private String publisherId; + + /* + * Identifier of the Offer for the sku + */ + @JsonProperty(value = "offerId") + private String offerId; + + /* + * JSON serialized catalog content of the sku offer + */ + @JsonProperty(value = "content") + private String content; + + /* + * The API version of the catalog service used to serve the catalog content + */ + @JsonProperty(value = "contentVersion") + private String contentVersion; + + /* + * Array of SKU mappings + */ + @JsonProperty(value = "skuMappings") + private List skuMappings; + + /** Creates an instance of SkuProperties class. */ + public SkuProperties() { + } + + /** + * Get the provisioningState property: Provisioning State. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the publisherId property: Identifier of the Publisher for the offer. + * + * @return the publisherId value. + */ + public String publisherId() { + return this.publisherId; + } + + /** + * Set the publisherId property: Identifier of the Publisher for the offer. + * + * @param publisherId the publisherId value to set. + * @return the SkuProperties object itself. + */ + public SkuProperties withPublisherId(String publisherId) { + this.publisherId = publisherId; + return this; + } + + /** + * Get the offerId property: Identifier of the Offer for the sku. + * + * @return the offerId value. + */ + public String offerId() { + return this.offerId; + } + + /** + * Set the offerId property: Identifier of the Offer for the sku. + * + * @param offerId the offerId value to set. + * @return the SkuProperties object itself. + */ + public SkuProperties withOfferId(String offerId) { + this.offerId = offerId; + return this; + } + + /** + * Get the content property: JSON serialized catalog content of the sku offer. + * + * @return the content value. + */ + public String content() { + return this.content; + } + + /** + * Set the content property: JSON serialized catalog content of the sku offer. + * + * @param content the content value to set. + * @return the SkuProperties object itself. + */ + public SkuProperties withContent(String content) { + this.content = content; + return this; + } + + /** + * Get the contentVersion property: The API version of the catalog service used to serve the catalog content. + * + * @return the contentVersion value. + */ + public String contentVersion() { + return this.contentVersion; + } + + /** + * Set the contentVersion property: The API version of the catalog service used to serve the catalog content. + * + * @param contentVersion the contentVersion value to set. + * @return the SkuProperties object itself. + */ + public SkuProperties withContentVersion(String contentVersion) { + this.contentVersion = contentVersion; + return this; + } + + /** + * Get the skuMappings property: Array of SKU mappings. + * + * @return the skuMappings value. + */ + public List skuMappings() { + return this.skuMappings; + } + + /** + * Set the skuMappings property: Array of SKU mappings. + * + * @param skuMappings the skuMappings value to set. + * @return the SkuProperties object itself. + */ + public SkuProperties withSkuMappings(List skuMappings) { + this.skuMappings = skuMappings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (skuMappings() != null) { + skuMappings().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/Step.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/Step.java new file mode 100644 index 000000000000..e66ad1627fdc --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/Step.java @@ -0,0 +1,240 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Progress representation of the update run steps. */ +@Fluent +public final class Step { + /* + * Name of the step. + */ + @JsonProperty(value = "name") + private String name; + + /* + * More detailed description of the step. + */ + @JsonProperty(value = "description") + private String description; + + /* + * Error message, specified if the step is in a failed state. + */ + @JsonProperty(value = "errorMessage") + private String errorMessage; + + /* + * Status of the step, bubbled up from the ECE action plan for installation attempts. Values are: 'Success', + * 'Error', 'InProgress', and 'Unknown status'. + */ + @JsonProperty(value = "status") + private String status; + + /* + * When the step started, or empty if it has not started executing. + */ + @JsonProperty(value = "startTimeUtc") + private OffsetDateTime startTimeUtc; + + /* + * When the step reached a terminal state. + */ + @JsonProperty(value = "endTimeUtc") + private OffsetDateTime endTimeUtc; + + /* + * Completion time of this step or the last completed sub-step. + */ + @JsonProperty(value = "lastUpdatedTimeUtc") + private OffsetDateTime lastUpdatedTimeUtc; + + /* + * Recursive model for child steps of this step. + */ + @JsonProperty(value = "steps") + private List steps; + + /** Creates an instance of Step class. */ + public Step() { + } + + /** + * Get the name property: Name of the step. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the step. + * + * @param name the name value to set. + * @return the Step object itself. + */ + public Step withName(String name) { + this.name = name; + return this; + } + + /** + * Get the description property: More detailed description of the step. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: More detailed description of the step. + * + * @param description the description value to set. + * @return the Step object itself. + */ + public Step withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the errorMessage property: Error message, specified if the step is in a failed state. + * + * @return the errorMessage value. + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * Set the errorMessage property: Error message, specified if the step is in a failed state. + * + * @param errorMessage the errorMessage value to set. + * @return the Step object itself. + */ + public Step withErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + + /** + * Get the status property: Status of the step, bubbled up from the ECE action plan for installation attempts. + * Values are: 'Success', 'Error', 'InProgress', and 'Unknown status'. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Set the status property: Status of the step, bubbled up from the ECE action plan for installation attempts. + * Values are: 'Success', 'Error', 'InProgress', and 'Unknown status'. + * + * @param status the status value to set. + * @return the Step object itself. + */ + public Step withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the startTimeUtc property: When the step started, or empty if it has not started executing. + * + * @return the startTimeUtc value. + */ + public OffsetDateTime startTimeUtc() { + return this.startTimeUtc; + } + + /** + * Set the startTimeUtc property: When the step started, or empty if it has not started executing. + * + * @param startTimeUtc the startTimeUtc value to set. + * @return the Step object itself. + */ + public Step withStartTimeUtc(OffsetDateTime startTimeUtc) { + this.startTimeUtc = startTimeUtc; + return this; + } + + /** + * Get the endTimeUtc property: When the step reached a terminal state. + * + * @return the endTimeUtc value. + */ + public OffsetDateTime endTimeUtc() { + return this.endTimeUtc; + } + + /** + * Set the endTimeUtc property: When the step reached a terminal state. + * + * @param endTimeUtc the endTimeUtc value to set. + * @return the Step object itself. + */ + public Step withEndTimeUtc(OffsetDateTime endTimeUtc) { + this.endTimeUtc = endTimeUtc; + return this; + } + + /** + * Get the lastUpdatedTimeUtc property: Completion time of this step or the last completed sub-step. + * + * @return the lastUpdatedTimeUtc value. + */ + public OffsetDateTime lastUpdatedTimeUtc() { + return this.lastUpdatedTimeUtc; + } + + /** + * Set the lastUpdatedTimeUtc property: Completion time of this step or the last completed sub-step. + * + * @param lastUpdatedTimeUtc the lastUpdatedTimeUtc value to set. + * @return the Step object itself. + */ + public Step withLastUpdatedTimeUtc(OffsetDateTime lastUpdatedTimeUtc) { + this.lastUpdatedTimeUtc = lastUpdatedTimeUtc; + return this; + } + + /** + * Get the steps property: Recursive model for child steps of this step. + * + * @return the steps value. + */ + public List steps() { + return this.steps; + } + + /** + * Set the steps property: Recursive model for child steps of this step. + * + * @param steps the steps value to set. + * @return the Step object itself. + */ + public Step withSteps(List steps) { + this.steps = steps; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (steps() != null) { + steps().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateInner.java new file mode 100644 index 000000000000..b64492f7c89f --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateInner.java @@ -0,0 +1,578 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.azurestackhci.models.AvailabilityType; +import com.azure.resourcemanager.azurestackhci.models.HealthState; +import com.azure.resourcemanager.azurestackhci.models.PackageVersionInfo; +import com.azure.resourcemanager.azurestackhci.models.PrecheckResult; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; +import com.azure.resourcemanager.azurestackhci.models.RebootRequirement; +import com.azure.resourcemanager.azurestackhci.models.State; +import com.azure.resourcemanager.azurestackhci.models.UpdatePrerequisite; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Update details. */ +@Fluent +public final class UpdateInner extends ProxyResource { + /* + * The geo-location where the resource lives + */ + @JsonProperty(value = "location") + private String location; + + /* + * Update properties + */ + @JsonProperty(value = "properties") + private UpdateProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of UpdateInner class. */ + public UpdateInner() { + } + + /** + * 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 UpdateInner object itself. + */ + public UpdateInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the innerProperties property: Update properties. + * + * @return the innerProperties value. + */ + private UpdateProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the provisioningState property: Provisioning state of the Updates proxy resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the installedDate property: Date that the update was installed. + * + * @return the installedDate value. + */ + public OffsetDateTime installedDate() { + return this.innerProperties() == null ? null : this.innerProperties().installedDate(); + } + + /** + * Set the installedDate property: Date that the update was installed. + * + * @param installedDate the installedDate value to set. + * @return the UpdateInner object itself. + */ + public UpdateInner withInstalledDate(OffsetDateTime installedDate) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateProperties(); + } + this.innerProperties().withInstalledDate(installedDate); + return this; + } + + /** + * Get the description property: Description of the update. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: Description of the update. + * + * @param description the description value to set. + * @return the UpdateInner object itself. + */ + public UpdateInner withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the state property: State of the update as it relates to this stamp. + * + * @return the state value. + */ + public State state() { + return this.innerProperties() == null ? null : this.innerProperties().state(); + } + + /** + * Set the state property: State of the update as it relates to this stamp. + * + * @param state the state value to set. + * @return the UpdateInner object itself. + */ + public UpdateInner withState(State state) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateProperties(); + } + this.innerProperties().withState(state); + return this; + } + + /** + * Get the prerequisites property: If update State is HasPrerequisite, this property contains an array of objects + * describing prerequisite updates before installing this update. Otherwise, it is empty. + * + * @return the prerequisites value. + */ + public List prerequisites() { + return this.innerProperties() == null ? null : this.innerProperties().prerequisites(); + } + + /** + * Set the prerequisites property: If update State is HasPrerequisite, this property contains an array of objects + * describing prerequisite updates before installing this update. Otherwise, it is empty. + * + * @param prerequisites the prerequisites value to set. + * @return the UpdateInner object itself. + */ + public UpdateInner withPrerequisites(List prerequisites) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateProperties(); + } + this.innerProperties().withPrerequisites(prerequisites); + return this; + } + + /** + * Get the componentVersions property: An array of component versions for a Solution Bundle update, and an empty + * array otherwise. + * + * @return the componentVersions value. + */ + public List componentVersions() { + return this.innerProperties() == null ? null : this.innerProperties().componentVersions(); + } + + /** + * Set the componentVersions property: An array of component versions for a Solution Bundle update, and an empty + * array otherwise. + * + * @param componentVersions the componentVersions value to set. + * @return the UpdateInner object itself. + */ + public UpdateInner withComponentVersions(List componentVersions) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateProperties(); + } + this.innerProperties().withComponentVersions(componentVersions); + return this; + } + + /** + * Get the rebootRequired property: The rebootRequired property. + * + * @return the rebootRequired value. + */ + public RebootRequirement rebootRequired() { + return this.innerProperties() == null ? null : this.innerProperties().rebootRequired(); + } + + /** + * Set the rebootRequired property: The rebootRequired property. + * + * @param rebootRequired the rebootRequired value to set. + * @return the UpdateInner object itself. + */ + public UpdateInner withRebootRequired(RebootRequirement rebootRequired) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateProperties(); + } + this.innerProperties().withRebootRequired(rebootRequired); + return this; + } + + /** + * Get the healthState property: Overall health state for update-specific health checks. + * + * @return the healthState value. + */ + public HealthState healthState() { + return this.innerProperties() == null ? null : this.innerProperties().healthState(); + } + + /** + * Set the healthState property: Overall health state for update-specific health checks. + * + * @param healthState the healthState value to set. + * @return the UpdateInner object itself. + */ + public UpdateInner withHealthState(HealthState healthState) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateProperties(); + } + this.innerProperties().withHealthState(healthState); + return this; + } + + /** + * Get the healthCheckResult property: An array of PrecheckResult objects. + * + * @return the healthCheckResult value. + */ + public List healthCheckResult() { + return this.innerProperties() == null ? null : this.innerProperties().healthCheckResult(); + } + + /** + * Set the healthCheckResult property: An array of PrecheckResult objects. + * + * @param healthCheckResult the healthCheckResult value to set. + * @return the UpdateInner object itself. + */ + public UpdateInner withHealthCheckResult(List healthCheckResult) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateProperties(); + } + this.innerProperties().withHealthCheckResult(healthCheckResult); + return this; + } + + /** + * Get the healthCheckDate property: Last time the package-specific checks were run. + * + * @return the healthCheckDate value. + */ + public OffsetDateTime healthCheckDate() { + return this.innerProperties() == null ? null : this.innerProperties().healthCheckDate(); + } + + /** + * Set the healthCheckDate property: Last time the package-specific checks were run. + * + * @param healthCheckDate the healthCheckDate value to set. + * @return the UpdateInner object itself. + */ + public UpdateInner withHealthCheckDate(OffsetDateTime healthCheckDate) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateProperties(); + } + this.innerProperties().withHealthCheckDate(healthCheckDate); + return this; + } + + /** + * Get the packagePath property: Path where the update package is available. + * + * @return the packagePath value. + */ + public String packagePath() { + return this.innerProperties() == null ? null : this.innerProperties().packagePath(); + } + + /** + * Set the packagePath property: Path where the update package is available. + * + * @param packagePath the packagePath value to set. + * @return the UpdateInner object itself. + */ + public UpdateInner withPackagePath(String packagePath) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateProperties(); + } + this.innerProperties().withPackagePath(packagePath); + return this; + } + + /** + * Get the packageSizeInMb property: Size of the package. This value is a combination of the size from update + * metadata and size of the payload that results from the live scan operation for OS update content. + * + * @return the packageSizeInMb value. + */ + public Float packageSizeInMb() { + return this.innerProperties() == null ? null : this.innerProperties().packageSizeInMb(); + } + + /** + * Set the packageSizeInMb property: Size of the package. This value is a combination of the size from update + * metadata and size of the payload that results from the live scan operation for OS update content. + * + * @param packageSizeInMb the packageSizeInMb value to set. + * @return the UpdateInner object itself. + */ + public UpdateInner withPackageSizeInMb(Float packageSizeInMb) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateProperties(); + } + this.innerProperties().withPackageSizeInMb(packageSizeInMb); + return this; + } + + /** + * Get the displayName property: Display name of the Update. + * + * @return the displayName value. + */ + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); + } + + /** + * Set the displayName property: Display name of the Update. + * + * @param displayName the displayName value to set. + * @return the UpdateInner object itself. + */ + public UpdateInner withDisplayName(String displayName) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateProperties(); + } + this.innerProperties().withDisplayName(displayName); + return this; + } + + /** + * Get the version property: Version of the update. + * + * @return the version value. + */ + public String version() { + return this.innerProperties() == null ? null : this.innerProperties().version(); + } + + /** + * Set the version property: Version of the update. + * + * @param version the version value to set. + * @return the UpdateInner object itself. + */ + public UpdateInner withVersion(String version) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateProperties(); + } + this.innerProperties().withVersion(version); + return this; + } + + /** + * Get the publisher property: Publisher of the update package. + * + * @return the publisher value. + */ + public String publisher() { + return this.innerProperties() == null ? null : this.innerProperties().publisher(); + } + + /** + * Set the publisher property: Publisher of the update package. + * + * @param publisher the publisher value to set. + * @return the UpdateInner object itself. + */ + public UpdateInner withPublisher(String publisher) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateProperties(); + } + this.innerProperties().withPublisher(publisher); + return this; + } + + /** + * Get the releaseLink property: Link to release notes for the update. + * + * @return the releaseLink value. + */ + public String releaseLink() { + return this.innerProperties() == null ? null : this.innerProperties().releaseLink(); + } + + /** + * Set the releaseLink property: Link to release notes for the update. + * + * @param releaseLink the releaseLink value to set. + * @return the UpdateInner object itself. + */ + public UpdateInner withReleaseLink(String releaseLink) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateProperties(); + } + this.innerProperties().withReleaseLink(releaseLink); + return this; + } + + /** + * Get the availabilityType property: Indicates the way the update content can be downloaded. + * + * @return the availabilityType value. + */ + public AvailabilityType availabilityType() { + return this.innerProperties() == null ? null : this.innerProperties().availabilityType(); + } + + /** + * Set the availabilityType property: Indicates the way the update content can be downloaded. + * + * @param availabilityType the availabilityType value to set. + * @return the UpdateInner object itself. + */ + public UpdateInner withAvailabilityType(AvailabilityType availabilityType) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateProperties(); + } + this.innerProperties().withAvailabilityType(availabilityType); + return this; + } + + /** + * Get the packageType property: Customer-visible type of the update. + * + * @return the packageType value. + */ + public String packageType() { + return this.innerProperties() == null ? null : this.innerProperties().packageType(); + } + + /** + * Set the packageType property: Customer-visible type of the update. + * + * @param packageType the packageType value to set. + * @return the UpdateInner object itself. + */ + public UpdateInner withPackageType(String packageType) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateProperties(); + } + this.innerProperties().withPackageType(packageType); + return this; + } + + /** + * Get the additionalProperties property: Extensible KV pairs serialized as a string. This is currently used to + * report the stamp OEM family and hardware model information when an update is flagged as Invalid for the stamp + * based on OEM type. + * + * @return the additionalProperties value. + */ + public String additionalProperties() { + return this.innerProperties() == null ? null : this.innerProperties().additionalProperties(); + } + + /** + * Set the additionalProperties property: Extensible KV pairs serialized as a string. This is currently used to + * report the stamp OEM family and hardware model information when an update is flagged as Invalid for the stamp + * based on OEM type. + * + * @param additionalProperties the additionalProperties value to set. + * @return the UpdateInner object itself. + */ + public UpdateInner withAdditionalProperties(String additionalProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateProperties(); + } + this.innerProperties().withAdditionalProperties(additionalProperties); + return this; + } + + /** + * Get the progressPercentage property: Progress percentage of ongoing operation. Currently this property is only + * valid when the update is in the Downloading state, where it maps to how much of the update content has been + * downloaded. + * + * @return the progressPercentage value. + */ + public Float progressPercentage() { + return this.innerProperties() == null ? null : this.innerProperties().progressPercentage(); + } + + /** + * Set the progressPercentage property: Progress percentage of ongoing operation. Currently this property is only + * valid when the update is in the Downloading state, where it maps to how much of the update content has been + * downloaded. + * + * @param progressPercentage the progressPercentage value to set. + * @return the UpdateInner object itself. + */ + public UpdateInner withProgressPercentage(Float progressPercentage) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateProperties(); + } + this.innerProperties().withProgressPercentage(progressPercentage); + return this; + } + + /** + * Get the notifyMessage property: Brief message with instructions for updates of AvailabilityType Notify. + * + * @return the notifyMessage value. + */ + public String notifyMessage() { + return this.innerProperties() == null ? null : this.innerProperties().notifyMessage(); + } + + /** + * Set the notifyMessage property: Brief message with instructions for updates of AvailabilityType Notify. + * + * @param notifyMessage the notifyMessage value to set. + * @return the UpdateInner object itself. + */ + public UpdateInner withNotifyMessage(String notifyMessage) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateProperties(); + } + this.innerProperties().withNotifyMessage(notifyMessage); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateProperties.java new file mode 100644 index 000000000000..f3d71b6eae49 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateProperties.java @@ -0,0 +1,611 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurestackhci.models.AvailabilityType; +import com.azure.resourcemanager.azurestackhci.models.HealthState; +import com.azure.resourcemanager.azurestackhci.models.PackageVersionInfo; +import com.azure.resourcemanager.azurestackhci.models.PrecheckResult; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; +import com.azure.resourcemanager.azurestackhci.models.RebootRequirement; +import com.azure.resourcemanager.azurestackhci.models.State; +import com.azure.resourcemanager.azurestackhci.models.UpdatePrerequisite; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Details of a singular Update in HCI Cluster. */ +@Fluent +public final class UpdateProperties { + /* + * Provisioning state of the Updates proxy resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Date that the update was installed. + */ + @JsonProperty(value = "installedDate") + private OffsetDateTime installedDate; + + /* + * Description of the update. + */ + @JsonProperty(value = "description") + private String description; + + /* + * State of the update as it relates to this stamp. + */ + @JsonProperty(value = "state") + private State state; + + /* + * If update State is HasPrerequisite, this property contains an array of objects describing prerequisite updates + * before installing this update. Otherwise, it is empty. + */ + @JsonProperty(value = "prerequisites") + private List prerequisites; + + /* + * An array of component versions for a Solution Bundle update, and an empty array otherwise. + */ + @JsonProperty(value = "componentVersions") + private List componentVersions; + + /* + * The rebootRequired property. + */ + @JsonProperty(value = "rebootRequired") + private RebootRequirement rebootRequired; + + /* + * Overall health state for update-specific health checks. + */ + @JsonProperty(value = "healthState") + private HealthState healthState; + + /* + * An array of PrecheckResult objects. + */ + @JsonProperty(value = "healthCheckResult") + private List healthCheckResult; + + /* + * Last time the package-specific checks were run. + */ + @JsonProperty(value = "healthCheckDate") + private OffsetDateTime healthCheckDate; + + /* + * Path where the update package is available. + */ + @JsonProperty(value = "packagePath") + private String packagePath; + + /* + * Size of the package. This value is a combination of the size from update metadata and size of the payload that + * results from the live scan operation for OS update content. + */ + @JsonProperty(value = "packageSizeInMb") + private Float packageSizeInMb; + + /* + * Display name of the Update + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Version of the update. + */ + @JsonProperty(value = "version") + private String version; + + /* + * Publisher of the update package. + */ + @JsonProperty(value = "publisher") + private String publisher; + + /* + * Link to release notes for the update. + */ + @JsonProperty(value = "releaseLink") + private String releaseLink; + + /* + * Indicates the way the update content can be downloaded. + */ + @JsonProperty(value = "availabilityType") + private AvailabilityType availabilityType; + + /* + * Customer-visible type of the update. + */ + @JsonProperty(value = "packageType") + private String packageType; + + /* + * Extensible KV pairs serialized as a string. This is currently used to report the stamp OEM family and hardware + * model information when an update is flagged as Invalid for the stamp based on OEM type. + */ + @JsonProperty(value = "additionalProperties") + private String additionalProperties; + + /* + * Additional information regarding the state of the update. See definition of UpdateStateProperties type below for + * more details on this property. + */ + @JsonProperty(value = "updateStateProperties") + private UpdateStateProperties innerUpdateStateProperties; + + /** Creates an instance of UpdateProperties class. */ + public UpdateProperties() { + } + + /** + * Get the provisioningState property: Provisioning state of the Updates proxy resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the installedDate property: Date that the update was installed. + * + * @return the installedDate value. + */ + public OffsetDateTime installedDate() { + return this.installedDate; + } + + /** + * Set the installedDate property: Date that the update was installed. + * + * @param installedDate the installedDate value to set. + * @return the UpdateProperties object itself. + */ + public UpdateProperties withInstalledDate(OffsetDateTime installedDate) { + this.installedDate = installedDate; + return this; + } + + /** + * Get the description property: Description of the update. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of the update. + * + * @param description the description value to set. + * @return the UpdateProperties object itself. + */ + public UpdateProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the state property: State of the update as it relates to this stamp. + * + * @return the state value. + */ + public State state() { + return this.state; + } + + /** + * Set the state property: State of the update as it relates to this stamp. + * + * @param state the state value to set. + * @return the UpdateProperties object itself. + */ + public UpdateProperties withState(State state) { + this.state = state; + return this; + } + + /** + * Get the prerequisites property: If update State is HasPrerequisite, this property contains an array of objects + * describing prerequisite updates before installing this update. Otherwise, it is empty. + * + * @return the prerequisites value. + */ + public List prerequisites() { + return this.prerequisites; + } + + /** + * Set the prerequisites property: If update State is HasPrerequisite, this property contains an array of objects + * describing prerequisite updates before installing this update. Otherwise, it is empty. + * + * @param prerequisites the prerequisites value to set. + * @return the UpdateProperties object itself. + */ + public UpdateProperties withPrerequisites(List prerequisites) { + this.prerequisites = prerequisites; + return this; + } + + /** + * Get the componentVersions property: An array of component versions for a Solution Bundle update, and an empty + * array otherwise. + * + * @return the componentVersions value. + */ + public List componentVersions() { + return this.componentVersions; + } + + /** + * Set the componentVersions property: An array of component versions for a Solution Bundle update, and an empty + * array otherwise. + * + * @param componentVersions the componentVersions value to set. + * @return the UpdateProperties object itself. + */ + public UpdateProperties withComponentVersions(List componentVersions) { + this.componentVersions = componentVersions; + return this; + } + + /** + * Get the rebootRequired property: The rebootRequired property. + * + * @return the rebootRequired value. + */ + public RebootRequirement rebootRequired() { + return this.rebootRequired; + } + + /** + * Set the rebootRequired property: The rebootRequired property. + * + * @param rebootRequired the rebootRequired value to set. + * @return the UpdateProperties object itself. + */ + public UpdateProperties withRebootRequired(RebootRequirement rebootRequired) { + this.rebootRequired = rebootRequired; + return this; + } + + /** + * Get the healthState property: Overall health state for update-specific health checks. + * + * @return the healthState value. + */ + public HealthState healthState() { + return this.healthState; + } + + /** + * Set the healthState property: Overall health state for update-specific health checks. + * + * @param healthState the healthState value to set. + * @return the UpdateProperties object itself. + */ + public UpdateProperties withHealthState(HealthState healthState) { + this.healthState = healthState; + return this; + } + + /** + * Get the healthCheckResult property: An array of PrecheckResult objects. + * + * @return the healthCheckResult value. + */ + public List healthCheckResult() { + return this.healthCheckResult; + } + + /** + * Set the healthCheckResult property: An array of PrecheckResult objects. + * + * @param healthCheckResult the healthCheckResult value to set. + * @return the UpdateProperties object itself. + */ + public UpdateProperties withHealthCheckResult(List healthCheckResult) { + this.healthCheckResult = healthCheckResult; + return this; + } + + /** + * Get the healthCheckDate property: Last time the package-specific checks were run. + * + * @return the healthCheckDate value. + */ + public OffsetDateTime healthCheckDate() { + return this.healthCheckDate; + } + + /** + * Set the healthCheckDate property: Last time the package-specific checks were run. + * + * @param healthCheckDate the healthCheckDate value to set. + * @return the UpdateProperties object itself. + */ + public UpdateProperties withHealthCheckDate(OffsetDateTime healthCheckDate) { + this.healthCheckDate = healthCheckDate; + return this; + } + + /** + * Get the packagePath property: Path where the update package is available. + * + * @return the packagePath value. + */ + public String packagePath() { + return this.packagePath; + } + + /** + * Set the packagePath property: Path where the update package is available. + * + * @param packagePath the packagePath value to set. + * @return the UpdateProperties object itself. + */ + public UpdateProperties withPackagePath(String packagePath) { + this.packagePath = packagePath; + return this; + } + + /** + * Get the packageSizeInMb property: Size of the package. This value is a combination of the size from update + * metadata and size of the payload that results from the live scan operation for OS update content. + * + * @return the packageSizeInMb value. + */ + public Float packageSizeInMb() { + return this.packageSizeInMb; + } + + /** + * Set the packageSizeInMb property: Size of the package. This value is a combination of the size from update + * metadata and size of the payload that results from the live scan operation for OS update content. + * + * @param packageSizeInMb the packageSizeInMb value to set. + * @return the UpdateProperties object itself. + */ + public UpdateProperties withPackageSizeInMb(Float packageSizeInMb) { + this.packageSizeInMb = packageSizeInMb; + return this; + } + + /** + * Get the displayName property: Display name of the Update. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Display name of the Update. + * + * @param displayName the displayName value to set. + * @return the UpdateProperties object itself. + */ + public UpdateProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the version property: Version of the update. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: Version of the update. + * + * @param version the version value to set. + * @return the UpdateProperties object itself. + */ + public UpdateProperties withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get the publisher property: Publisher of the update package. + * + * @return the publisher value. + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the publisher property: Publisher of the update package. + * + * @param publisher the publisher value to set. + * @return the UpdateProperties object itself. + */ + public UpdateProperties withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get the releaseLink property: Link to release notes for the update. + * + * @return the releaseLink value. + */ + public String releaseLink() { + return this.releaseLink; + } + + /** + * Set the releaseLink property: Link to release notes for the update. + * + * @param releaseLink the releaseLink value to set. + * @return the UpdateProperties object itself. + */ + public UpdateProperties withReleaseLink(String releaseLink) { + this.releaseLink = releaseLink; + return this; + } + + /** + * Get the availabilityType property: Indicates the way the update content can be downloaded. + * + * @return the availabilityType value. + */ + public AvailabilityType availabilityType() { + return this.availabilityType; + } + + /** + * Set the availabilityType property: Indicates the way the update content can be downloaded. + * + * @param availabilityType the availabilityType value to set. + * @return the UpdateProperties object itself. + */ + public UpdateProperties withAvailabilityType(AvailabilityType availabilityType) { + this.availabilityType = availabilityType; + return this; + } + + /** + * Get the packageType property: Customer-visible type of the update. + * + * @return the packageType value. + */ + public String packageType() { + return this.packageType; + } + + /** + * Set the packageType property: Customer-visible type of the update. + * + * @param packageType the packageType value to set. + * @return the UpdateProperties object itself. + */ + public UpdateProperties withPackageType(String packageType) { + this.packageType = packageType; + return this; + } + + /** + * Get the additionalProperties property: Extensible KV pairs serialized as a string. This is currently used to + * report the stamp OEM family and hardware model information when an update is flagged as Invalid for the stamp + * based on OEM type. + * + * @return the additionalProperties value. + */ + public String additionalProperties() { + return this.additionalProperties; + } + + /** + * Set the additionalProperties property: Extensible KV pairs serialized as a string. This is currently used to + * report the stamp OEM family and hardware model information when an update is flagged as Invalid for the stamp + * based on OEM type. + * + * @param additionalProperties the additionalProperties value to set. + * @return the UpdateProperties object itself. + */ + public UpdateProperties withAdditionalProperties(String additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + + /** + * Get the innerUpdateStateProperties property: Additional information regarding the state of the update. See + * definition of UpdateStateProperties type below for more details on this property. + * + * @return the innerUpdateStateProperties value. + */ + private UpdateStateProperties innerUpdateStateProperties() { + return this.innerUpdateStateProperties; + } + + /** + * Get the progressPercentage property: Progress percentage of ongoing operation. Currently this property is only + * valid when the update is in the Downloading state, where it maps to how much of the update content has been + * downloaded. + * + * @return the progressPercentage value. + */ + public Float progressPercentage() { + return this.innerUpdateStateProperties() == null + ? null + : this.innerUpdateStateProperties().progressPercentage(); + } + + /** + * Set the progressPercentage property: Progress percentage of ongoing operation. Currently this property is only + * valid when the update is in the Downloading state, where it maps to how much of the update content has been + * downloaded. + * + * @param progressPercentage the progressPercentage value to set. + * @return the UpdateProperties object itself. + */ + public UpdateProperties withProgressPercentage(Float progressPercentage) { + if (this.innerUpdateStateProperties() == null) { + this.innerUpdateStateProperties = new UpdateStateProperties(); + } + this.innerUpdateStateProperties().withProgressPercentage(progressPercentage); + return this; + } + + /** + * Get the notifyMessage property: Brief message with instructions for updates of AvailabilityType Notify. + * + * @return the notifyMessage value. + */ + public String notifyMessage() { + return this.innerUpdateStateProperties() == null ? null : this.innerUpdateStateProperties().notifyMessage(); + } + + /** + * Set the notifyMessage property: Brief message with instructions for updates of AvailabilityType Notify. + * + * @param notifyMessage the notifyMessage value to set. + * @return the UpdateProperties object itself. + */ + public UpdateProperties withNotifyMessage(String notifyMessage) { + if (this.innerUpdateStateProperties() == null) { + this.innerUpdateStateProperties = new UpdateStateProperties(); + } + this.innerUpdateStateProperties().withNotifyMessage(notifyMessage); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (prerequisites() != null) { + prerequisites().forEach(e -> e.validate()); + } + if (componentVersions() != null) { + componentVersions().forEach(e -> e.validate()); + } + if (healthCheckResult() != null) { + healthCheckResult().forEach(e -> e.validate()); + } + if (innerUpdateStateProperties() != null) { + innerUpdateStateProperties().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateRunInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateRunInner.java new file mode 100644 index 000000000000..07fa8a2dab03 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateRunInner.java @@ -0,0 +1,376 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; +import com.azure.resourcemanager.azurestackhci.models.UpdateRunPropertiesState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Details of an Update run. */ +@Fluent +public final class UpdateRunInner extends ProxyResource { + /* + * The geo-location where the resource lives + */ + @JsonProperty(value = "location") + private String location; + + /* + * Describes Update Run Properties. + */ + @JsonProperty(value = "properties") + private UpdateRunProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of UpdateRunInner class. */ + public UpdateRunInner() { + } + + /** + * 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 UpdateRunInner object itself. + */ + public UpdateRunInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the innerProperties property: Describes Update Run Properties. + * + * @return the innerProperties value. + */ + private UpdateRunProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the provisioningState property: Provisioning state of the UpdateRuns proxy resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the timeStarted property: Timestamp of the update run was started. + * + * @return the timeStarted value. + */ + public OffsetDateTime timeStarted() { + return this.innerProperties() == null ? null : this.innerProperties().timeStarted(); + } + + /** + * Set the timeStarted property: Timestamp of the update run was started. + * + * @param timeStarted the timeStarted value to set. + * @return the UpdateRunInner object itself. + */ + public UpdateRunInner withTimeStarted(OffsetDateTime timeStarted) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateRunProperties(); + } + this.innerProperties().withTimeStarted(timeStarted); + return this; + } + + /** + * Get the lastUpdatedTime property: Timestamp of the most recently completed step in the update run. + * + * @return the lastUpdatedTime value. + */ + public OffsetDateTime lastUpdatedTime() { + return this.innerProperties() == null ? null : this.innerProperties().lastUpdatedTime(); + } + + /** + * Set the lastUpdatedTime property: Timestamp of the most recently completed step in the update run. + * + * @param lastUpdatedTime the lastUpdatedTime value to set. + * @return the UpdateRunInner object itself. + */ + public UpdateRunInner withLastUpdatedTime(OffsetDateTime lastUpdatedTime) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateRunProperties(); + } + this.innerProperties().withLastUpdatedTime(lastUpdatedTime); + return this; + } + + /** + * Get the duration property: Duration of the update run. + * + * @return the duration value. + */ + public String duration() { + return this.innerProperties() == null ? null : this.innerProperties().duration(); + } + + /** + * Set the duration property: Duration of the update run. + * + * @param duration the duration value to set. + * @return the UpdateRunInner object itself. + */ + public UpdateRunInner withDuration(String duration) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateRunProperties(); + } + this.innerProperties().withDuration(duration); + return this; + } + + /** + * Get the state property: State of the update run. + * + * @return the state value. + */ + public UpdateRunPropertiesState state() { + return this.innerProperties() == null ? null : this.innerProperties().state(); + } + + /** + * Set the state property: State of the update run. + * + * @param state the state value to set. + * @return the UpdateRunInner object itself. + */ + public UpdateRunInner withState(UpdateRunPropertiesState state) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateRunProperties(); + } + this.innerProperties().withState(state); + return this; + } + + /** + * Get the name property: Name of the step. + * + * @return the name value. + */ + public String namePropertiesName() { + return this.innerProperties() == null ? null : this.innerProperties().name(); + } + + /** + * Set the name property: Name of the step. + * + * @param name the name value to set. + * @return the UpdateRunInner object itself. + */ + public UpdateRunInner withNamePropertiesName(String name) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateRunProperties(); + } + this.innerProperties().withName(name); + return this; + } + + /** + * Get the description property: More detailed description of the step. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: More detailed description of the step. + * + * @param description the description value to set. + * @return the UpdateRunInner object itself. + */ + public UpdateRunInner withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateRunProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the errorMessage property: Error message, specified if the step is in a failed state. + * + * @return the errorMessage value. + */ + public String errorMessage() { + return this.innerProperties() == null ? null : this.innerProperties().errorMessage(); + } + + /** + * Set the errorMessage property: Error message, specified if the step is in a failed state. + * + * @param errorMessage the errorMessage value to set. + * @return the UpdateRunInner object itself. + */ + public UpdateRunInner withErrorMessage(String errorMessage) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateRunProperties(); + } + this.innerProperties().withErrorMessage(errorMessage); + return this; + } + + /** + * Get the status property: Status of the step, bubbled up from the ECE action plan for installation attempts. + * Values are: 'Success', 'Error', 'InProgress', and 'Unknown status'. + * + * @return the status value. + */ + public String status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Set the status property: Status of the step, bubbled up from the ECE action plan for installation attempts. + * Values are: 'Success', 'Error', 'InProgress', and 'Unknown status'. + * + * @param status the status value to set. + * @return the UpdateRunInner object itself. + */ + public UpdateRunInner withStatus(String status) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateRunProperties(); + } + this.innerProperties().withStatus(status); + return this; + } + + /** + * Get the startTimeUtc property: When the step started, or empty if it has not started executing. + * + * @return the startTimeUtc value. + */ + public OffsetDateTime startTimeUtc() { + return this.innerProperties() == null ? null : this.innerProperties().startTimeUtc(); + } + + /** + * Set the startTimeUtc property: When the step started, or empty if it has not started executing. + * + * @param startTimeUtc the startTimeUtc value to set. + * @return the UpdateRunInner object itself. + */ + public UpdateRunInner withStartTimeUtc(OffsetDateTime startTimeUtc) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateRunProperties(); + } + this.innerProperties().withStartTimeUtc(startTimeUtc); + return this; + } + + /** + * Get the endTimeUtc property: When the step reached a terminal state. + * + * @return the endTimeUtc value. + */ + public OffsetDateTime endTimeUtc() { + return this.innerProperties() == null ? null : this.innerProperties().endTimeUtc(); + } + + /** + * Set the endTimeUtc property: When the step reached a terminal state. + * + * @param endTimeUtc the endTimeUtc value to set. + * @return the UpdateRunInner object itself. + */ + public UpdateRunInner withEndTimeUtc(OffsetDateTime endTimeUtc) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateRunProperties(); + } + this.innerProperties().withEndTimeUtc(endTimeUtc); + return this; + } + + /** + * Get the lastUpdatedTimeUtc property: Completion time of this step or the last completed sub-step. + * + * @return the lastUpdatedTimeUtc value. + */ + public OffsetDateTime lastUpdatedTimeUtc() { + return this.innerProperties() == null ? null : this.innerProperties().lastUpdatedTimeUtc(); + } + + /** + * Set the lastUpdatedTimeUtc property: Completion time of this step or the last completed sub-step. + * + * @param lastUpdatedTimeUtc the lastUpdatedTimeUtc value to set. + * @return the UpdateRunInner object itself. + */ + public UpdateRunInner withLastUpdatedTimeUtc(OffsetDateTime lastUpdatedTimeUtc) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateRunProperties(); + } + this.innerProperties().withLastUpdatedTimeUtc(lastUpdatedTimeUtc); + return this; + } + + /** + * Get the steps property: Recursive model for child steps of this step. + * + * @return the steps value. + */ + public List steps() { + return this.innerProperties() == null ? null : this.innerProperties().steps(); + } + + /** + * Set the steps property: Recursive model for child steps of this step. + * + * @param steps the steps value to set. + * @return the UpdateRunInner object itself. + */ + public UpdateRunInner withSteps(List steps) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateRunProperties(); + } + this.innerProperties().withSteps(steps); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateRunProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateRunProperties.java new file mode 100644 index 000000000000..a78c125e2e6e --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateRunProperties.java @@ -0,0 +1,351 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; +import com.azure.resourcemanager.azurestackhci.models.UpdateRunPropertiesState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Details of an Update run. */ +@Fluent +public final class UpdateRunProperties { + /* + * Provisioning state of the UpdateRuns proxy resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Timestamp of the update run was started. + */ + @JsonProperty(value = "timeStarted") + private OffsetDateTime timeStarted; + + /* + * Timestamp of the most recently completed step in the update run. + */ + @JsonProperty(value = "lastUpdatedTime") + private OffsetDateTime lastUpdatedTime; + + /* + * Duration of the update run. + */ + @JsonProperty(value = "duration") + private String duration; + + /* + * State of the update run. + */ + @JsonProperty(value = "state") + private UpdateRunPropertiesState state; + + /* + * Progress representation of the update run steps. + */ + @JsonProperty(value = "progress") + private Step innerProgress; + + /** Creates an instance of UpdateRunProperties class. */ + public UpdateRunProperties() { + } + + /** + * Get the provisioningState property: Provisioning state of the UpdateRuns proxy resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the timeStarted property: Timestamp of the update run was started. + * + * @return the timeStarted value. + */ + public OffsetDateTime timeStarted() { + return this.timeStarted; + } + + /** + * Set the timeStarted property: Timestamp of the update run was started. + * + * @param timeStarted the timeStarted value to set. + * @return the UpdateRunProperties object itself. + */ + public UpdateRunProperties withTimeStarted(OffsetDateTime timeStarted) { + this.timeStarted = timeStarted; + return this; + } + + /** + * Get the lastUpdatedTime property: Timestamp of the most recently completed step in the update run. + * + * @return the lastUpdatedTime value. + */ + public OffsetDateTime lastUpdatedTime() { + return this.lastUpdatedTime; + } + + /** + * Set the lastUpdatedTime property: Timestamp of the most recently completed step in the update run. + * + * @param lastUpdatedTime the lastUpdatedTime value to set. + * @return the UpdateRunProperties object itself. + */ + public UpdateRunProperties withLastUpdatedTime(OffsetDateTime lastUpdatedTime) { + this.lastUpdatedTime = lastUpdatedTime; + return this; + } + + /** + * Get the duration property: Duration of the update run. + * + * @return the duration value. + */ + public String duration() { + return this.duration; + } + + /** + * Set the duration property: Duration of the update run. + * + * @param duration the duration value to set. + * @return the UpdateRunProperties object itself. + */ + public UpdateRunProperties withDuration(String duration) { + this.duration = duration; + return this; + } + + /** + * Get the state property: State of the update run. + * + * @return the state value. + */ + public UpdateRunPropertiesState state() { + return this.state; + } + + /** + * Set the state property: State of the update run. + * + * @param state the state value to set. + * @return the UpdateRunProperties object itself. + */ + public UpdateRunProperties withState(UpdateRunPropertiesState state) { + this.state = state; + return this; + } + + /** + * Get the innerProgress property: Progress representation of the update run steps. + * + * @return the innerProgress value. + */ + private Step innerProgress() { + return this.innerProgress; + } + + /** + * Get the name property: Name of the step. + * + * @return the name value. + */ + public String name() { + return this.innerProgress() == null ? null : this.innerProgress().name(); + } + + /** + * Set the name property: Name of the step. + * + * @param name the name value to set. + * @return the UpdateRunProperties object itself. + */ + public UpdateRunProperties withName(String name) { + if (this.innerProgress() == null) { + this.innerProgress = new Step(); + } + this.innerProgress().withName(name); + return this; + } + + /** + * Get the description property: More detailed description of the step. + * + * @return the description value. + */ + public String description() { + return this.innerProgress() == null ? null : this.innerProgress().description(); + } + + /** + * Set the description property: More detailed description of the step. + * + * @param description the description value to set. + * @return the UpdateRunProperties object itself. + */ + public UpdateRunProperties withDescription(String description) { + if (this.innerProgress() == null) { + this.innerProgress = new Step(); + } + this.innerProgress().withDescription(description); + return this; + } + + /** + * Get the errorMessage property: Error message, specified if the step is in a failed state. + * + * @return the errorMessage value. + */ + public String errorMessage() { + return this.innerProgress() == null ? null : this.innerProgress().errorMessage(); + } + + /** + * Set the errorMessage property: Error message, specified if the step is in a failed state. + * + * @param errorMessage the errorMessage value to set. + * @return the UpdateRunProperties object itself. + */ + public UpdateRunProperties withErrorMessage(String errorMessage) { + if (this.innerProgress() == null) { + this.innerProgress = new Step(); + } + this.innerProgress().withErrorMessage(errorMessage); + return this; + } + + /** + * Get the status property: Status of the step, bubbled up from the ECE action plan for installation attempts. + * Values are: 'Success', 'Error', 'InProgress', and 'Unknown status'. + * + * @return the status value. + */ + public String status() { + return this.innerProgress() == null ? null : this.innerProgress().status(); + } + + /** + * Set the status property: Status of the step, bubbled up from the ECE action plan for installation attempts. + * Values are: 'Success', 'Error', 'InProgress', and 'Unknown status'. + * + * @param status the status value to set. + * @return the UpdateRunProperties object itself. + */ + public UpdateRunProperties withStatus(String status) { + if (this.innerProgress() == null) { + this.innerProgress = new Step(); + } + this.innerProgress().withStatus(status); + return this; + } + + /** + * Get the startTimeUtc property: When the step started, or empty if it has not started executing. + * + * @return the startTimeUtc value. + */ + public OffsetDateTime startTimeUtc() { + return this.innerProgress() == null ? null : this.innerProgress().startTimeUtc(); + } + + /** + * Set the startTimeUtc property: When the step started, or empty if it has not started executing. + * + * @param startTimeUtc the startTimeUtc value to set. + * @return the UpdateRunProperties object itself. + */ + public UpdateRunProperties withStartTimeUtc(OffsetDateTime startTimeUtc) { + if (this.innerProgress() == null) { + this.innerProgress = new Step(); + } + this.innerProgress().withStartTimeUtc(startTimeUtc); + return this; + } + + /** + * Get the endTimeUtc property: When the step reached a terminal state. + * + * @return the endTimeUtc value. + */ + public OffsetDateTime endTimeUtc() { + return this.innerProgress() == null ? null : this.innerProgress().endTimeUtc(); + } + + /** + * Set the endTimeUtc property: When the step reached a terminal state. + * + * @param endTimeUtc the endTimeUtc value to set. + * @return the UpdateRunProperties object itself. + */ + public UpdateRunProperties withEndTimeUtc(OffsetDateTime endTimeUtc) { + if (this.innerProgress() == null) { + this.innerProgress = new Step(); + } + this.innerProgress().withEndTimeUtc(endTimeUtc); + return this; + } + + /** + * Get the lastUpdatedTimeUtc property: Completion time of this step or the last completed sub-step. + * + * @return the lastUpdatedTimeUtc value. + */ + public OffsetDateTime lastUpdatedTimeUtc() { + return this.innerProgress() == null ? null : this.innerProgress().lastUpdatedTimeUtc(); + } + + /** + * Set the lastUpdatedTimeUtc property: Completion time of this step or the last completed sub-step. + * + * @param lastUpdatedTimeUtc the lastUpdatedTimeUtc value to set. + * @return the UpdateRunProperties object itself. + */ + public UpdateRunProperties withLastUpdatedTimeUtc(OffsetDateTime lastUpdatedTimeUtc) { + if (this.innerProgress() == null) { + this.innerProgress = new Step(); + } + this.innerProgress().withLastUpdatedTimeUtc(lastUpdatedTimeUtc); + return this; + } + + /** + * Get the steps property: Recursive model for child steps of this step. + * + * @return the steps value. + */ + public List steps() { + return this.innerProgress() == null ? null : this.innerProgress().steps(); + } + + /** + * Set the steps property: Recursive model for child steps of this step. + * + * @param steps the steps value to set. + * @return the UpdateRunProperties object itself. + */ + public UpdateRunProperties withSteps(List steps) { + if (this.innerProgress() == null) { + this.innerProgress = new Step(); + } + this.innerProgress().withSteps(steps); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProgress() != null) { + innerProgress().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateStateProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateStateProperties.java new file mode 100644 index 000000000000..f60984021df1 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateStateProperties.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Additional information regarding the state of the update. See definition of UpdateStateProperties type below for more + * details on this property. + */ +@Fluent +public final class UpdateStateProperties { + /* + * Progress percentage of ongoing operation. Currently this property is only valid when the update is in the + * Downloading state, where it maps to how much of the update content has been downloaded. + */ + @JsonProperty(value = "progressPercentage") + private Float progressPercentage; + + /* + * Brief message with instructions for updates of AvailabilityType Notify. + */ + @JsonProperty(value = "notifyMessage") + private String notifyMessage; + + /** Creates an instance of UpdateStateProperties class. */ + public UpdateStateProperties() { + } + + /** + * Get the progressPercentage property: Progress percentage of ongoing operation. Currently this property is only + * valid when the update is in the Downloading state, where it maps to how much of the update content has been + * downloaded. + * + * @return the progressPercentage value. + */ + public Float progressPercentage() { + return this.progressPercentage; + } + + /** + * Set the progressPercentage property: Progress percentage of ongoing operation. Currently this property is only + * valid when the update is in the Downloading state, where it maps to how much of the update content has been + * downloaded. + * + * @param progressPercentage the progressPercentage value to set. + * @return the UpdateStateProperties object itself. + */ + public UpdateStateProperties withProgressPercentage(Float progressPercentage) { + this.progressPercentage = progressPercentage; + return this; + } + + /** + * Get the notifyMessage property: Brief message with instructions for updates of AvailabilityType Notify. + * + * @return the notifyMessage value. + */ + public String notifyMessage() { + return this.notifyMessage; + } + + /** + * Set the notifyMessage property: Brief message with instructions for updates of AvailabilityType Notify. + * + * @param notifyMessage the notifyMessage value to set. + * @return the UpdateStateProperties object itself. + */ + public UpdateStateProperties withNotifyMessage(String notifyMessage) { + this.notifyMessage = notifyMessage; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateSummariesInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateSummariesInner.java new file mode 100644 index 000000000000..3f9f82cee4ec --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateSummariesInner.java @@ -0,0 +1,331 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.azurestackhci.models.HealthState; +import com.azure.resourcemanager.azurestackhci.models.PackageVersionInfo; +import com.azure.resourcemanager.azurestackhci.models.PrecheckResult; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; +import com.azure.resourcemanager.azurestackhci.models.UpdateSummariesPropertiesState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Get the update summaries for the cluster. */ +@Fluent +public final class UpdateSummariesInner extends ProxyResource { + /* + * The geo-location where the resource lives + */ + @JsonProperty(value = "location") + private String location; + + /* + * Update summaries properties + */ + @JsonProperty(value = "properties") + private UpdateSummariesProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of UpdateSummariesInner class. */ + public UpdateSummariesInner() { + } + + /** + * 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 UpdateSummariesInner object itself. + */ + public UpdateSummariesInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the innerProperties property: Update summaries properties. + * + * @return the innerProperties value. + */ + private UpdateSummariesProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the provisioningState property: Provisioning state of the UpdateSummaries proxy resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the oemFamily property: OEM family name. + * + * @return the oemFamily value. + */ + public String oemFamily() { + return this.innerProperties() == null ? null : this.innerProperties().oemFamily(); + } + + /** + * Set the oemFamily property: OEM family name. + * + * @param oemFamily the oemFamily value to set. + * @return the UpdateSummariesInner object itself. + */ + public UpdateSummariesInner withOemFamily(String oemFamily) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateSummariesProperties(); + } + this.innerProperties().withOemFamily(oemFamily); + return this; + } + + /** + * Get the hardwareModel property: Name of the hardware model. + * + * @return the hardwareModel value. + */ + public String hardwareModel() { + return this.innerProperties() == null ? null : this.innerProperties().hardwareModel(); + } + + /** + * Set the hardwareModel property: Name of the hardware model. + * + * @param hardwareModel the hardwareModel value to set. + * @return the UpdateSummariesInner object itself. + */ + public UpdateSummariesInner withHardwareModel(String hardwareModel) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateSummariesProperties(); + } + this.innerProperties().withHardwareModel(hardwareModel); + return this; + } + + /** + * Get the packageVersions property: Current version of each updatable component. + * + * @return the packageVersions value. + */ + public List packageVersions() { + return this.innerProperties() == null ? null : this.innerProperties().packageVersions(); + } + + /** + * Set the packageVersions property: Current version of each updatable component. + * + * @param packageVersions the packageVersions value to set. + * @return the UpdateSummariesInner object itself. + */ + public UpdateSummariesInner withPackageVersions(List packageVersions) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateSummariesProperties(); + } + this.innerProperties().withPackageVersions(packageVersions); + return this; + } + + /** + * Get the currentVersion property: Current Solution Bundle version of the stamp. + * + * @return the currentVersion value. + */ + public String currentVersion() { + return this.innerProperties() == null ? null : this.innerProperties().currentVersion(); + } + + /** + * Set the currentVersion property: Current Solution Bundle version of the stamp. + * + * @param currentVersion the currentVersion value to set. + * @return the UpdateSummariesInner object itself. + */ + public UpdateSummariesInner withCurrentVersion(String currentVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateSummariesProperties(); + } + this.innerProperties().withCurrentVersion(currentVersion); + return this; + } + + /** + * Get the lastUpdated property: Last time an update installation completed successfully. + * + * @return the lastUpdated value. + */ + public OffsetDateTime lastUpdated() { + return this.innerProperties() == null ? null : this.innerProperties().lastUpdated(); + } + + /** + * Set the lastUpdated property: Last time an update installation completed successfully. + * + * @param lastUpdated the lastUpdated value to set. + * @return the UpdateSummariesInner object itself. + */ + public UpdateSummariesInner withLastUpdated(OffsetDateTime lastUpdated) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateSummariesProperties(); + } + this.innerProperties().withLastUpdated(lastUpdated); + return this; + } + + /** + * Get the lastChecked property: Last time the update service successfully checked for updates. + * + * @return the lastChecked value. + */ + public OffsetDateTime lastChecked() { + return this.innerProperties() == null ? null : this.innerProperties().lastChecked(); + } + + /** + * Set the lastChecked property: Last time the update service successfully checked for updates. + * + * @param lastChecked the lastChecked value to set. + * @return the UpdateSummariesInner object itself. + */ + public UpdateSummariesInner withLastChecked(OffsetDateTime lastChecked) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateSummariesProperties(); + } + this.innerProperties().withLastChecked(lastChecked); + return this; + } + + /** + * Get the healthState property: Overall health state for update-specific health checks. + * + * @return the healthState value. + */ + public HealthState healthState() { + return this.innerProperties() == null ? null : this.innerProperties().healthState(); + } + + /** + * Set the healthState property: Overall health state for update-specific health checks. + * + * @param healthState the healthState value to set. + * @return the UpdateSummariesInner object itself. + */ + public UpdateSummariesInner withHealthState(HealthState healthState) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateSummariesProperties(); + } + this.innerProperties().withHealthState(healthState); + return this; + } + + /** + * Get the healthCheckResult property: An array of pre-check result objects. + * + * @return the healthCheckResult value. + */ + public List healthCheckResult() { + return this.innerProperties() == null ? null : this.innerProperties().healthCheckResult(); + } + + /** + * Set the healthCheckResult property: An array of pre-check result objects. + * + * @param healthCheckResult the healthCheckResult value to set. + * @return the UpdateSummariesInner object itself. + */ + public UpdateSummariesInner withHealthCheckResult(List healthCheckResult) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateSummariesProperties(); + } + this.innerProperties().withHealthCheckResult(healthCheckResult); + return this; + } + + /** + * Get the healthCheckDate property: Last time the package-specific checks were run. + * + * @return the healthCheckDate value. + */ + public OffsetDateTime healthCheckDate() { + return this.innerProperties() == null ? null : this.innerProperties().healthCheckDate(); + } + + /** + * Set the healthCheckDate property: Last time the package-specific checks were run. + * + * @param healthCheckDate the healthCheckDate value to set. + * @return the UpdateSummariesInner object itself. + */ + public UpdateSummariesInner withHealthCheckDate(OffsetDateTime healthCheckDate) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateSummariesProperties(); + } + this.innerProperties().withHealthCheckDate(healthCheckDate); + return this; + } + + /** + * Get the state property: Overall update state of the stamp. + * + * @return the state value. + */ + public UpdateSummariesPropertiesState state() { + return this.innerProperties() == null ? null : this.innerProperties().state(); + } + + /** + * Set the state property: Overall update state of the stamp. + * + * @param state the state value to set. + * @return the UpdateSummariesInner object itself. + */ + public UpdateSummariesInner withState(UpdateSummariesPropertiesState state) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateSummariesProperties(); + } + this.innerProperties().withState(state); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateSummariesProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateSummariesProperties.java new file mode 100644 index 000000000000..29b3196d2bec --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateSummariesProperties.java @@ -0,0 +1,312 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurestackhci.models.HealthState; +import com.azure.resourcemanager.azurestackhci.models.PackageVersionInfo; +import com.azure.resourcemanager.azurestackhci.models.PrecheckResult; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; +import com.azure.resourcemanager.azurestackhci.models.UpdateSummariesPropertiesState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Properties of Update summaries. */ +@Fluent +public final class UpdateSummariesProperties { + /* + * Provisioning state of the UpdateSummaries proxy resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * OEM family name. + */ + @JsonProperty(value = "oemFamily") + private String oemFamily; + + /* + * Name of the hardware model. + */ + @JsonProperty(value = "hardwareModel") + private String hardwareModel; + + /* + * Current version of each updatable component. + */ + @JsonProperty(value = "packageVersions") + private List packageVersions; + + /* + * Current Solution Bundle version of the stamp. + */ + @JsonProperty(value = "currentVersion") + private String currentVersion; + + /* + * Last time an update installation completed successfully. + */ + @JsonProperty(value = "lastUpdated") + private OffsetDateTime lastUpdated; + + /* + * Last time the update service successfully checked for updates + */ + @JsonProperty(value = "lastChecked") + private OffsetDateTime lastChecked; + + /* + * Overall health state for update-specific health checks. + */ + @JsonProperty(value = "healthState") + private HealthState healthState; + + /* + * An array of pre-check result objects. + */ + @JsonProperty(value = "healthCheckResult") + private List healthCheckResult; + + /* + * Last time the package-specific checks were run. + */ + @JsonProperty(value = "healthCheckDate") + private OffsetDateTime healthCheckDate; + + /* + * Overall update state of the stamp. + */ + @JsonProperty(value = "state") + private UpdateSummariesPropertiesState state; + + /** Creates an instance of UpdateSummariesProperties class. */ + public UpdateSummariesProperties() { + } + + /** + * Get the provisioningState property: Provisioning state of the UpdateSummaries proxy resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the oemFamily property: OEM family name. + * + * @return the oemFamily value. + */ + public String oemFamily() { + return this.oemFamily; + } + + /** + * Set the oemFamily property: OEM family name. + * + * @param oemFamily the oemFamily value to set. + * @return the UpdateSummariesProperties object itself. + */ + public UpdateSummariesProperties withOemFamily(String oemFamily) { + this.oemFamily = oemFamily; + return this; + } + + /** + * Get the hardwareModel property: Name of the hardware model. + * + * @return the hardwareModel value. + */ + public String hardwareModel() { + return this.hardwareModel; + } + + /** + * Set the hardwareModel property: Name of the hardware model. + * + * @param hardwareModel the hardwareModel value to set. + * @return the UpdateSummariesProperties object itself. + */ + public UpdateSummariesProperties withHardwareModel(String hardwareModel) { + this.hardwareModel = hardwareModel; + return this; + } + + /** + * Get the packageVersions property: Current version of each updatable component. + * + * @return the packageVersions value. + */ + public List packageVersions() { + return this.packageVersions; + } + + /** + * Set the packageVersions property: Current version of each updatable component. + * + * @param packageVersions the packageVersions value to set. + * @return the UpdateSummariesProperties object itself. + */ + public UpdateSummariesProperties withPackageVersions(List packageVersions) { + this.packageVersions = packageVersions; + return this; + } + + /** + * Get the currentVersion property: Current Solution Bundle version of the stamp. + * + * @return the currentVersion value. + */ + public String currentVersion() { + return this.currentVersion; + } + + /** + * Set the currentVersion property: Current Solution Bundle version of the stamp. + * + * @param currentVersion the currentVersion value to set. + * @return the UpdateSummariesProperties object itself. + */ + public UpdateSummariesProperties withCurrentVersion(String currentVersion) { + this.currentVersion = currentVersion; + return this; + } + + /** + * Get the lastUpdated property: Last time an update installation completed successfully. + * + * @return the lastUpdated value. + */ + public OffsetDateTime lastUpdated() { + return this.lastUpdated; + } + + /** + * Set the lastUpdated property: Last time an update installation completed successfully. + * + * @param lastUpdated the lastUpdated value to set. + * @return the UpdateSummariesProperties object itself. + */ + public UpdateSummariesProperties withLastUpdated(OffsetDateTime lastUpdated) { + this.lastUpdated = lastUpdated; + return this; + } + + /** + * Get the lastChecked property: Last time the update service successfully checked for updates. + * + * @return the lastChecked value. + */ + public OffsetDateTime lastChecked() { + return this.lastChecked; + } + + /** + * Set the lastChecked property: Last time the update service successfully checked for updates. + * + * @param lastChecked the lastChecked value to set. + * @return the UpdateSummariesProperties object itself. + */ + public UpdateSummariesProperties withLastChecked(OffsetDateTime lastChecked) { + this.lastChecked = lastChecked; + return this; + } + + /** + * Get the healthState property: Overall health state for update-specific health checks. + * + * @return the healthState value. + */ + public HealthState healthState() { + return this.healthState; + } + + /** + * Set the healthState property: Overall health state for update-specific health checks. + * + * @param healthState the healthState value to set. + * @return the UpdateSummariesProperties object itself. + */ + public UpdateSummariesProperties withHealthState(HealthState healthState) { + this.healthState = healthState; + return this; + } + + /** + * Get the healthCheckResult property: An array of pre-check result objects. + * + * @return the healthCheckResult value. + */ + public List healthCheckResult() { + return this.healthCheckResult; + } + + /** + * Set the healthCheckResult property: An array of pre-check result objects. + * + * @param healthCheckResult the healthCheckResult value to set. + * @return the UpdateSummariesProperties object itself. + */ + public UpdateSummariesProperties withHealthCheckResult(List healthCheckResult) { + this.healthCheckResult = healthCheckResult; + return this; + } + + /** + * Get the healthCheckDate property: Last time the package-specific checks were run. + * + * @return the healthCheckDate value. + */ + public OffsetDateTime healthCheckDate() { + return this.healthCheckDate; + } + + /** + * Set the healthCheckDate property: Last time the package-specific checks were run. + * + * @param healthCheckDate the healthCheckDate value to set. + * @return the UpdateSummariesProperties object itself. + */ + public UpdateSummariesProperties withHealthCheckDate(OffsetDateTime healthCheckDate) { + this.healthCheckDate = healthCheckDate; + return this; + } + + /** + * Get the state property: Overall update state of the stamp. + * + * @return the state value. + */ + public UpdateSummariesPropertiesState state() { + return this.state; + } + + /** + * Set the state property: Overall update state of the stamp. + * + * @param state the state value to set. + * @return the UpdateSummariesProperties object itself. + */ + public UpdateSummariesProperties withState(UpdateSummariesPropertiesState state) { + this.state = state; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (packageVersions() != null) { + packageVersions().forEach(e -> e.validate()); + } + if (healthCheckResult() != null) { + healthCheckResult().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingImpl.java index e7c22ee4ecd1..bfba4014688b 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingImpl.java @@ -187,16 +187,16 @@ public ArcSetting refresh(Context context) { return this; } - public PasswordCredential generatePassword() { - return serviceManager.arcSettings().generatePassword(resourceGroupName, clusterName, arcSettingName); - } - public Response generatePasswordWithResponse(Context context) { return serviceManager .arcSettings() .generatePasswordWithResponse(resourceGroupName, clusterName, arcSettingName, context); } + public PasswordCredential generatePassword() { + return serviceManager.arcSettings().generatePassword(resourceGroupName, clusterName, arcSettingName); + } + public ArcIdentityResponse createIdentity() { return serviceManager.arcSettings().createIdentity(resourceGroupName, clusterName, arcSettingName); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingsClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingsClientImpl.java index 0da1463d4857..0f59b3af5a2a 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingsClientImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingsClientImpl.java @@ -68,7 +68,7 @@ public final class ArcSettingsClientImpl implements ArcSettingsClient { */ @Host("{$host}") @ServiceInterface(name = "AzureStackHciClientA") - private interface ArcSettingsService { + public interface ArcSettingsService { @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" @@ -503,14 +503,16 @@ private Mono getAsync(String resourceGroupName, String clusterN * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return arcSetting resource details of HCI Cluster. + * @return arcSetting resource details of HCI Cluster along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ArcSettingInner get(String resourceGroupName, String clusterName, String arcSettingName) { - return getAsync(resourceGroupName, clusterName, arcSettingName).block(); + public Response getWithResponse( + String resourceGroupName, String clusterName, String arcSettingName, Context context) { + return getWithResponseAsync(resourceGroupName, clusterName, arcSettingName, context).block(); } /** @@ -519,16 +521,14 @@ public ArcSettingInner get(String resourceGroupName, String clusterName, String * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return arcSetting resource details of HCI Cluster along with {@link Response}. + * @return arcSetting resource details of HCI Cluster. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String clusterName, String arcSettingName, Context context) { - return getWithResponseAsync(resourceGroupName, clusterName, arcSettingName, context).block(); + public ArcSettingInner get(String resourceGroupName, String clusterName, String arcSettingName) { + return getWithResponse(resourceGroupName, clusterName, arcSettingName, Context.NONE).getValue(); } /** @@ -679,15 +679,20 @@ private Mono createAsync( * @param clusterName The name of the cluster. * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. * @param arcSetting Parameters supplied to the Create ArcSetting resource for this HCI cluster. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return arcSetting details. + * @return arcSetting details along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ArcSettingInner create( - String resourceGroupName, String clusterName, String arcSettingName, ArcSettingInner arcSetting) { - return createAsync(resourceGroupName, clusterName, arcSettingName, arcSetting).block(); + public Response createWithResponse( + String resourceGroupName, + String clusterName, + String arcSettingName, + ArcSettingInner arcSetting, + Context context) { + return createWithResponseAsync(resourceGroupName, clusterName, arcSettingName, arcSetting, context).block(); } /** @@ -697,20 +702,15 @@ public ArcSettingInner create( * @param clusterName The name of the cluster. * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. * @param arcSetting Parameters supplied to the Create ArcSetting resource for this HCI cluster. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return arcSetting details along with {@link Response}. + * @return arcSetting details. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse( - String resourceGroupName, - String clusterName, - String arcSettingName, - ArcSettingInner arcSetting, - Context context) { - return createWithResponseAsync(resourceGroupName, clusterName, arcSettingName, arcSetting, context).block(); + public ArcSettingInner create( + String resourceGroupName, String clusterName, String arcSettingName, ArcSettingInner arcSetting) { + return createWithResponse(resourceGroupName, clusterName, arcSettingName, arcSetting, Context.NONE).getValue(); } /** @@ -861,15 +861,20 @@ private Mono updateAsync( * @param clusterName The name of the cluster. * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. * @param arcSetting ArcSettings parameters that needs 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 arcSetting details. + * @return arcSetting details along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ArcSettingInner update( - String resourceGroupName, String clusterName, String arcSettingName, ArcSettingsPatch arcSetting) { - return updateAsync(resourceGroupName, clusterName, arcSettingName, arcSetting).block(); + public Response updateWithResponse( + String resourceGroupName, + String clusterName, + String arcSettingName, + ArcSettingsPatch arcSetting, + Context context) { + return updateWithResponseAsync(resourceGroupName, clusterName, arcSettingName, arcSetting, context).block(); } /** @@ -879,20 +884,15 @@ public ArcSettingInner update( * @param clusterName The name of the cluster. * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. * @param arcSetting ArcSettings parameters that needs 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 arcSetting details along with {@link Response}. + * @return arcSetting details. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, - String clusterName, - String arcSettingName, - ArcSettingsPatch arcSetting, - Context context) { - return updateWithResponseAsync(resourceGroupName, clusterName, arcSettingName, arcSetting, context).block(); + public ArcSettingInner update( + String resourceGroupName, String clusterName, String arcSettingName, ArcSettingsPatch arcSetting) { + return updateWithResponse(resourceGroupName, clusterName, arcSettingName, arcSetting, Context.NONE).getValue(); } /** @@ -1275,15 +1275,16 @@ private Mono generatePasswordAsync( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PasswordCredentialInner generatePassword( - String resourceGroupName, String clusterName, String arcSettingName) { - return generatePasswordAsync(resourceGroupName, clusterName, arcSettingName).block(); + public Response generatePasswordWithResponse( + String resourceGroupName, String clusterName, String arcSettingName, Context context) { + return generatePasswordWithResponseAsync(resourceGroupName, clusterName, arcSettingName, context).block(); } /** @@ -1292,16 +1293,15 @@ public PasswordCredentialInner generatePassword( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response generatePasswordWithResponse( - String resourceGroupName, String clusterName, String arcSettingName, Context context) { - return generatePasswordWithResponseAsync(resourceGroupName, clusterName, arcSettingName, context).block(); + public PasswordCredentialInner generatePassword( + String resourceGroupName, String clusterName, String arcSettingName) { + return generatePasswordWithResponse(resourceGroupName, clusterName, arcSettingName, Context.NONE).getValue(); } /** @@ -1574,7 +1574,8 @@ public ArcIdentityResponseInner createIdentity( /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1610,7 +1611,8 @@ private Mono> listByClusterNextSinglePageAsync(St /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingsImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingsImpl.java index e7fc8d055b32..82252170e9c4 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingsImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingsImpl.java @@ -42,15 +42,6 @@ public PagedIterable listByCluster(String resourceGroupName, String return Utils.mapPage(inner, inner1 -> new ArcSettingImpl(inner1, this.manager())); } - public ArcSetting get(String resourceGroupName, String clusterName, String arcSettingName) { - ArcSettingInner inner = this.serviceClient().get(resourceGroupName, clusterName, arcSettingName); - if (inner != null) { - return new ArcSettingImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getWithResponse( String resourceGroupName, String clusterName, String arcSettingName, Context context) { Response inner = @@ -66,6 +57,15 @@ public Response getWithResponse( } } + public ArcSetting get(String resourceGroupName, String clusterName, String arcSettingName) { + ArcSettingInner inner = this.serviceClient().get(resourceGroupName, clusterName, arcSettingName); + if (inner != null) { + return new ArcSettingImpl(inner, this.manager()); + } else { + return null; + } + } + public void delete(String resourceGroupName, String clusterName, String arcSettingName) { this.serviceClient().delete(resourceGroupName, clusterName, arcSettingName); } @@ -74,16 +74,6 @@ public void delete(String resourceGroupName, String clusterName, String arcSetti this.serviceClient().delete(resourceGroupName, clusterName, arcSettingName, context); } - public PasswordCredential generatePassword(String resourceGroupName, String clusterName, String arcSettingName) { - PasswordCredentialInner inner = - this.serviceClient().generatePassword(resourceGroupName, clusterName, arcSettingName); - if (inner != null) { - return new PasswordCredentialImpl(inner, this.manager()); - } else { - return null; - } - } - public Response generatePasswordWithResponse( String resourceGroupName, String clusterName, String arcSettingName, Context context) { Response inner = @@ -99,6 +89,16 @@ public Response generatePasswordWithResponse( } } + public PasswordCredential generatePassword(String resourceGroupName, String clusterName, String arcSettingName) { + PasswordCredentialInner inner = + this.serviceClient().generatePassword(resourceGroupName, clusterName, arcSettingName); + if (inner != null) { + return new PasswordCredentialImpl(inner, this.manager()); + } else { + return null; + } + } + public ArcIdentityResponse createIdentity(String resourceGroupName, String clusterName, String arcSettingName) { ArcIdentityResponseInner inner = this.serviceClient().createIdentity(resourceGroupName, clusterName, arcSettingName); diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/AzureStackHciClientBuilder.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/AzureStackHciClientBuilder.java index 31e4c5141f02..a68487f0b8c2 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/AzureStackHciClientBuilder.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/AzureStackHciClientBuilder.java @@ -119,24 +119,26 @@ public AzureStackHciClientBuilder serializerAdapter(SerializerAdapter serializer * @return an instance of AzureStackHciClientImpl. */ public AzureStackHciClientImpl buildClient() { - if (endpoint == null) { - this.endpoint = "https://management.azure.com"; - } - if (environment == null) { - this.environment = AzureEnvironment.AZURE; - } - if (pipeline == null) { - this.pipeline = new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); - } - if (defaultPollInterval == null) { - this.defaultPollInterval = Duration.ofSeconds(30); - } - if (serializerAdapter == null) { - this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); - } + 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(); AzureStackHciClientImpl client = new AzureStackHciClientImpl( - pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + localPipeline, + localSerializerAdapter, + localDefaultPollInterval, + localEnvironment, + subscriptionId, + localEndpoint); return client; } } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/AzureStackHciClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/AzureStackHciClientImpl.java index 773a2426d48d..55bead353fc6 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/AzureStackHciClientImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/AzureStackHciClientImpl.java @@ -26,7 +26,13 @@ import com.azure.resourcemanager.azurestackhci.fluent.AzureStackHciClient; import com.azure.resourcemanager.azurestackhci.fluent.ClustersClient; import com.azure.resourcemanager.azurestackhci.fluent.ExtensionsClient; +import com.azure.resourcemanager.azurestackhci.fluent.OffersClient; import com.azure.resourcemanager.azurestackhci.fluent.OperationsClient; +import com.azure.resourcemanager.azurestackhci.fluent.PublishersClient; +import com.azure.resourcemanager.azurestackhci.fluent.SkusClient; +import com.azure.resourcemanager.azurestackhci.fluent.UpdateRunsClient; +import com.azure.resourcemanager.azurestackhci.fluent.UpdateSummariesOperationsClient; +import com.azure.resourcemanager.azurestackhci.fluent.UpdatesClient; import java.io.IOException; import java.lang.reflect.Type; import java.nio.ByteBuffer; @@ -147,6 +153,18 @@ public ExtensionsClient getExtensions() { return this.extensions; } + /** The OffersClient object to access its operations. */ + private final OffersClient offers; + + /** + * Gets the OffersClient object to access its operations. + * + * @return the OffersClient object. + */ + public OffersClient getOffers() { + return this.offers; + } + /** The OperationsClient object to access its operations. */ private final OperationsClient operations; @@ -159,6 +177,66 @@ public OperationsClient getOperations() { return this.operations; } + /** The PublishersClient object to access its operations. */ + private final PublishersClient publishers; + + /** + * Gets the PublishersClient object to access its operations. + * + * @return the PublishersClient object. + */ + public PublishersClient getPublishers() { + return this.publishers; + } + + /** The SkusClient object to access its operations. */ + private final SkusClient skus; + + /** + * Gets the SkusClient object to access its operations. + * + * @return the SkusClient object. + */ + public SkusClient getSkus() { + return this.skus; + } + + /** The UpdateRunsClient object to access its operations. */ + private final UpdateRunsClient updateRuns; + + /** + * Gets the UpdateRunsClient object to access its operations. + * + * @return the UpdateRunsClient object. + */ + public UpdateRunsClient getUpdateRuns() { + return this.updateRuns; + } + + /** The UpdateSummariesOperationsClient object to access its operations. */ + private final UpdateSummariesOperationsClient updateSummariesOperations; + + /** + * Gets the UpdateSummariesOperationsClient object to access its operations. + * + * @return the UpdateSummariesOperationsClient object. + */ + public UpdateSummariesOperationsClient getUpdateSummariesOperations() { + return this.updateSummariesOperations; + } + + /** The UpdatesClient object to access its operations. */ + private final UpdatesClient updates; + + /** + * Gets the UpdatesClient object to access its operations. + * + * @return the UpdatesClient object. + */ + public UpdatesClient getUpdates() { + return this.updates; + } + /** * Initializes an instance of AzureStackHciClient client. * @@ -181,11 +259,17 @@ public OperationsClient getOperations() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2022-05-01"; + this.apiVersion = "2022-12-01"; this.arcSettings = new ArcSettingsClientImpl(this); this.clusters = new ClustersClientImpl(this); this.extensions = new ExtensionsClientImpl(this); + this.offers = new OffersClientImpl(this); this.operations = new OperationsClientImpl(this); + this.publishers = new PublishersClientImpl(this); + this.skus = new SkusClientImpl(this); + this.updateRuns = new UpdateRunsClientImpl(this); + this.updateSummariesOperations = new UpdateSummariesOperationsClientImpl(this); + this.updates = new UpdatesClientImpl(this); } /** diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClusterImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClusterImpl.java index 3bb9fccdd06c..2c9b9d3b9129 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClusterImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClusterImpl.java @@ -13,12 +13,17 @@ import com.azure.resourcemanager.azurestackhci.models.ClusterIdentityResponse; import com.azure.resourcemanager.azurestackhci.models.ClusterPatch; import com.azure.resourcemanager.azurestackhci.models.ClusterReportedProperties; +import com.azure.resourcemanager.azurestackhci.models.ManagedServiceIdentityType; import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; +import com.azure.resourcemanager.azurestackhci.models.SoftwareAssuranceChangeRequest; +import com.azure.resourcemanager.azurestackhci.models.SoftwareAssuranceProperties; import com.azure.resourcemanager.azurestackhci.models.Status; import com.azure.resourcemanager.azurestackhci.models.UploadCertificateRequest; +import com.azure.resourcemanager.azurestackhci.models.UserAssignedIdentity; import java.time.OffsetDateTime; import java.util.Collections; import java.util.Map; +import java.util.UUID; public final class ClusterImpl implements Cluster, Cluster.Definition, Cluster.Update { private ClusterInner innerObject; @@ -54,6 +59,27 @@ public SystemData systemData() { return this.innerModel().systemData(); } + public UUID principalId() { + return this.innerModel().principalId(); + } + + public UUID tenantId() { + return this.innerModel().tenantId(); + } + + public ManagedServiceIdentityType typeIdentityType() { + return this.innerModel().typeIdentityType(); + } + + public Map userAssignedIdentities() { + Map inner = this.innerModel().userAssignedIdentities(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + public ProvisioningState provisioningState() { return this.innerModel().provisioningState(); } @@ -86,6 +112,10 @@ public String aadServicePrincipalObjectId() { return this.innerModel().aadServicePrincipalObjectId(); } + public SoftwareAssuranceProperties softwareAssuranceProperties() { + return this.innerModel().softwareAssuranceProperties(); + } + public ClusterDesiredProperties desiredProperties() { return this.innerModel().desiredProperties(); } @@ -118,6 +148,10 @@ public String serviceEndpoint() { return this.innerModel().serviceEndpoint(); } + public String resourceProviderObjectId() { + return this.innerModel().resourceProviderObjectId(); + } + public Region region() { return Region.fromName(this.regionName()); } @@ -243,6 +277,19 @@ public ClusterIdentityResponse createIdentity(Context context) { return serviceManager.clusters().createIdentity(resourceGroupName, clusterName, context); } + public Cluster extendSoftwareAssuranceBenefit(SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest) { + return serviceManager + .clusters() + .extendSoftwareAssuranceBenefit(resourceGroupName, clusterName, softwareAssuranceChangeRequest); + } + + public Cluster extendSoftwareAssuranceBenefit( + SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest, Context context) { + return serviceManager + .clusters() + .extendSoftwareAssuranceBenefit(resourceGroupName, clusterName, softwareAssuranceChangeRequest, context); + } + public ClusterImpl withRegion(Region location) { this.innerModel().withLocation(location.toString()); return this; @@ -263,6 +310,21 @@ public ClusterImpl withTags(Map tags) { } } + public ClusterImpl withTypeIdentityType(ManagedServiceIdentityType typeIdentityType) { + this.innerModel().withTypeIdentityType(typeIdentityType); + return this; + } + + public ClusterImpl withUserAssignedIdentities(Map userAssignedIdentities) { + if (isInCreateMode()) { + this.innerModel().withUserAssignedIdentities(userAssignedIdentities); + return this; + } else { + this.updateCluster.withUserAssignedIdentities(userAssignedIdentities); + return this; + } + } + public ClusterImpl withCloudManagementEndpoint(String cloudManagementEndpoint) { if (isInCreateMode()) { this.innerModel().withCloudManagementEndpoint(cloudManagementEndpoint); @@ -303,6 +365,11 @@ public ClusterImpl withAadServicePrincipalObjectId(String aadServicePrincipalObj return this; } + public ClusterImpl withSoftwareAssuranceProperties(SoftwareAssuranceProperties softwareAssuranceProperties) { + this.innerModel().withSoftwareAssuranceProperties(softwareAssuranceProperties); + return this; + } + public ClusterImpl withDesiredProperties(ClusterDesiredProperties desiredProperties) { if (isInCreateMode()) { this.innerModel().withDesiredProperties(desiredProperties); @@ -313,6 +380,11 @@ public ClusterImpl withDesiredProperties(ClusterDesiredProperties desiredPropert } } + public ClusterImpl withType(ManagedServiceIdentityType type) { + this.updateCluster.withType(type); + return this; + } + private boolean isInCreateMode() { return this.innerModel().id() == null; } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClustersClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClustersClientImpl.java index d04da2f86403..d5dd3f16047a 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClustersClientImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClustersClientImpl.java @@ -38,6 +38,7 @@ import com.azure.resourcemanager.azurestackhci.fluent.models.ClusterInner; import com.azure.resourcemanager.azurestackhci.models.ClusterList; import com.azure.resourcemanager.azurestackhci.models.ClusterPatch; +import com.azure.resourcemanager.azurestackhci.models.SoftwareAssuranceChangeRequest; import com.azure.resourcemanager.azurestackhci.models.UploadCertificateRequest; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; @@ -67,7 +68,7 @@ public final class ClustersClientImpl implements ClustersClient { */ @Host("{$host}") @ServiceInterface(name = "AzureStackHciClientC") - private interface ClustersService { + public interface ClustersService { @Headers({"Content-Type: application/json"}) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/clusters") @ExpectedResponses({200}) @@ -186,6 +187,22 @@ Mono>> createIdentity( @HeaderParam("Accept") String accept, Context context); + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/clusters/{clusterName}/extendSoftwareAssuranceBenefit") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> extendSoftwareAssuranceBenefit( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest, + @HeaderParam("Accept") String accept, + Context context); + @Headers({"Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -626,14 +643,16 @@ private Mono getByResourceGroupAsync(String resourceGroupName, Str * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hCI cluster. + * @return hCI cluster along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ClusterInner getByResourceGroup(String resourceGroupName, String clusterName) { - return getByResourceGroupAsync(resourceGroupName, clusterName).block(); + public Response getByResourceGroupWithResponse( + String resourceGroupName, String clusterName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, clusterName, context).block(); } /** @@ -641,16 +660,14 @@ public ClusterInner getByResourceGroup(String resourceGroupName, String clusterN * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hCI cluster along with {@link Response}. + * @return hCI cluster. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String clusterName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, clusterName, context).block(); + public ClusterInner getByResourceGroup(String resourceGroupName, String clusterName) { + return getByResourceGroupWithResponse(resourceGroupName, clusterName, Context.NONE).getValue(); } /** @@ -784,14 +801,16 @@ private Mono createAsync(String resourceGroupName, String clusterN * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param cluster Details of the HCI cluster. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster details. + * @return cluster details along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ClusterInner create(String resourceGroupName, String clusterName, ClusterInner cluster) { - return createAsync(resourceGroupName, clusterName, cluster).block(); + public Response createWithResponse( + String resourceGroupName, String clusterName, ClusterInner cluster, Context context) { + return createWithResponseAsync(resourceGroupName, clusterName, cluster, context).block(); } /** @@ -800,16 +819,14 @@ public ClusterInner create(String resourceGroupName, String clusterName, Cluster * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param cluster Details of the HCI cluster. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster details along with {@link Response}. + * @return cluster details. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse( - String resourceGroupName, String clusterName, ClusterInner cluster, Context context) { - return createWithResponseAsync(resourceGroupName, clusterName, cluster, context).block(); + public ClusterInner create(String resourceGroupName, String clusterName, ClusterInner cluster) { + return createWithResponse(resourceGroupName, clusterName, cluster, Context.NONE).getValue(); } /** @@ -943,14 +960,16 @@ private Mono updateAsync(String resourceGroupName, String clusterN * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param cluster Details of the HCI cluster. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster details. + * @return cluster details along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ClusterInner update(String resourceGroupName, String clusterName, ClusterPatch cluster) { - return updateAsync(resourceGroupName, clusterName, cluster).block(); + public Response updateWithResponse( + String resourceGroupName, String clusterName, ClusterPatch cluster, Context context) { + return updateWithResponseAsync(resourceGroupName, clusterName, cluster, context).block(); } /** @@ -959,16 +978,14 @@ public ClusterInner update(String resourceGroupName, String clusterName, Cluster * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param cluster Details of the HCI cluster. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster details along with {@link Response}. + * @return cluster details. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, String clusterName, ClusterPatch cluster, Context context) { - return updateWithResponseAsync(resourceGroupName, clusterName, cluster, context).block(); + public ClusterInner update(String resourceGroupName, String clusterName, ClusterPatch cluster) { + return updateWithResponse(resourceGroupName, clusterName, cluster, Context.NONE).getValue(); } /** @@ -1723,10 +1740,304 @@ public ClusterIdentityResponseInner createIdentity(String resourceGroupName, Str return createIdentityAsync(resourceGroupName, clusterName, context).block(); } + /** + * Extends Software Assurance Benefit to a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param softwareAssuranceChangeRequest Software Assurance Change Request Payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> extendSoftwareAssuranceBenefitWithResponseAsync( + String resourceGroupName, String clusterName, SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (softwareAssuranceChangeRequest == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter softwareAssuranceChangeRequest is required and cannot be null.")); + } else { + softwareAssuranceChangeRequest.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .extendSoftwareAssuranceBenefit( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + softwareAssuranceChangeRequest, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Extends Software Assurance Benefit to a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param softwareAssuranceChangeRequest Software Assurance Change Request Payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> extendSoftwareAssuranceBenefitWithResponseAsync( + String resourceGroupName, + String clusterName, + SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest, + 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (softwareAssuranceChangeRequest == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter softwareAssuranceChangeRequest is required and cannot be null.")); + } else { + softwareAssuranceChangeRequest.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .extendSoftwareAssuranceBenefit( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + softwareAssuranceChangeRequest, + accept, + context); + } + + /** + * Extends Software Assurance Benefit to a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param softwareAssuranceChangeRequest Software Assurance Change Request Payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 cluster details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ClusterInner> beginExtendSoftwareAssuranceBenefitAsync( + String resourceGroupName, String clusterName, SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest) { + Mono>> mono = + extendSoftwareAssuranceBenefitWithResponseAsync( + resourceGroupName, clusterName, softwareAssuranceChangeRequest); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ClusterInner.class, ClusterInner.class, this.client.getContext()); + } + + /** + * Extends Software Assurance Benefit to a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param softwareAssuranceChangeRequest Software Assurance Change Request Payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 cluster details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ClusterInner> beginExtendSoftwareAssuranceBenefitAsync( + String resourceGroupName, + String clusterName, + SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + extendSoftwareAssuranceBenefitWithResponseAsync( + resourceGroupName, clusterName, softwareAssuranceChangeRequest, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ClusterInner.class, ClusterInner.class, context); + } + + /** + * Extends Software Assurance Benefit to a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param softwareAssuranceChangeRequest Software Assurance Change Request Payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 cluster details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ClusterInner> beginExtendSoftwareAssuranceBenefit( + String resourceGroupName, String clusterName, SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest) { + return beginExtendSoftwareAssuranceBenefitAsync(resourceGroupName, clusterName, softwareAssuranceChangeRequest) + .getSyncPoller(); + } + + /** + * Extends Software Assurance Benefit to a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param softwareAssuranceChangeRequest Software Assurance Change Request Payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 cluster details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ClusterInner> beginExtendSoftwareAssuranceBenefit( + String resourceGroupName, + String clusterName, + SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest, + Context context) { + return beginExtendSoftwareAssuranceBenefitAsync( + resourceGroupName, clusterName, softwareAssuranceChangeRequest, context) + .getSyncPoller(); + } + + /** + * Extends Software Assurance Benefit to a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param softwareAssuranceChangeRequest Software Assurance Change Request Payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono extendSoftwareAssuranceBenefitAsync( + String resourceGroupName, String clusterName, SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest) { + return beginExtendSoftwareAssuranceBenefitAsync(resourceGroupName, clusterName, softwareAssuranceChangeRequest) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Extends Software Assurance Benefit to a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param softwareAssuranceChangeRequest Software Assurance Change Request Payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono extendSoftwareAssuranceBenefitAsync( + String resourceGroupName, + String clusterName, + SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest, + Context context) { + return beginExtendSoftwareAssuranceBenefitAsync( + resourceGroupName, clusterName, softwareAssuranceChangeRequest, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Extends Software Assurance Benefit to a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param softwareAssuranceChangeRequest Software Assurance Change Request Payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterInner extendSoftwareAssuranceBenefit( + String resourceGroupName, String clusterName, SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest) { + return extendSoftwareAssuranceBenefitAsync(resourceGroupName, clusterName, softwareAssuranceChangeRequest) + .block(); + } + + /** + * Extends Software Assurance Benefit to a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param softwareAssuranceChangeRequest Software Assurance Change Request Payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterInner extendSoftwareAssuranceBenefit( + String resourceGroupName, + String clusterName, + SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest, + Context context) { + return extendSoftwareAssuranceBenefitAsync( + resourceGroupName, clusterName, softwareAssuranceChangeRequest, context) + .block(); + } + /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1762,7 +2073,8 @@ private Mono> listBySubscriptionNextSinglePageAsync( /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1798,7 +2110,8 @@ private Mono> listBySubscriptionNextSinglePageAsync( /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1834,7 +2147,8 @@ private Mono> listByResourceGroupNextSinglePageAsync /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClustersImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClustersImpl.java index 980c49de2240..e7b6926116dd 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClustersImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClustersImpl.java @@ -15,6 +15,7 @@ import com.azure.resourcemanager.azurestackhci.models.Cluster; import com.azure.resourcemanager.azurestackhci.models.ClusterIdentityResponse; import com.azure.resourcemanager.azurestackhci.models.Clusters; +import com.azure.resourcemanager.azurestackhci.models.SoftwareAssuranceChangeRequest; import com.azure.resourcemanager.azurestackhci.models.UploadCertificateRequest; public final class ClustersImpl implements Clusters { @@ -50,15 +51,6 @@ public PagedIterable listByResourceGroup(String resourceGroupName, Cont return Utils.mapPage(inner, inner1 -> new ClusterImpl(inner1, this.manager())); } - public Cluster getByResourceGroup(String resourceGroupName, String clusterName) { - ClusterInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, clusterName); - if (inner != null) { - return new ClusterImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getByResourceGroupWithResponse( String resourceGroupName, String clusterName, Context context) { Response inner = @@ -74,6 +66,15 @@ public Response getByResourceGroupWithResponse( } } + public Cluster getByResourceGroup(String resourceGroupName, String clusterName) { + ClusterInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, clusterName); + if (inner != null) { + return new ClusterImpl(inner, this.manager()); + } else { + return null; + } + } + public void deleteByResourceGroup(String resourceGroupName, String clusterName) { this.serviceClient().delete(resourceGroupName, clusterName); } @@ -114,6 +115,36 @@ public ClusterIdentityResponse createIdentity(String resourceGroupName, String c } } + public Cluster extendSoftwareAssuranceBenefit( + String resourceGroupName, String clusterName, SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest) { + ClusterInner inner = + this + .serviceClient() + .extendSoftwareAssuranceBenefit(resourceGroupName, clusterName, softwareAssuranceChangeRequest); + if (inner != null) { + return new ClusterImpl(inner, this.manager()); + } else { + return null; + } + } + + public Cluster extendSoftwareAssuranceBenefit( + String resourceGroupName, + String clusterName, + SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest, + Context context) { + ClusterInner inner = + this + .serviceClient() + .extendSoftwareAssuranceBenefit( + resourceGroupName, clusterName, softwareAssuranceChangeRequest, context); + if (inner != null) { + return new ClusterImpl(inner, this.manager()); + } else { + return null; + } + } + public Cluster getById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ExtensionImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ExtensionImpl.java index 4340ad680657..b7c3489e7c9f 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ExtensionImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ExtensionImpl.java @@ -80,6 +80,10 @@ public Object protectedSettings() { return this.innerModel().protectedSettings(); } + public Boolean enableAutomaticUpgrade() { + return this.innerModel().enableAutomaticUpgrade(); + } + public String resourceGroupName() { return resourceGroupName; } @@ -217,4 +221,9 @@ public ExtensionImpl withProtectedSettings(Object protectedSettings) { this.innerModel().withProtectedSettings(protectedSettings); return this; } + + public ExtensionImpl withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { + this.innerModel().withEnableAutomaticUpgrade(enableAutomaticUpgrade); + return this; + } } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ExtensionsClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ExtensionsClientImpl.java index ea047f5486e1..98c6f11a4aa8 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ExtensionsClientImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ExtensionsClientImpl.java @@ -64,7 +64,7 @@ public final class ExtensionsClientImpl implements ExtensionsClient { */ @Host("{$host}") @ServiceInterface(name = "AzureStackHciClientE") - private interface ExtensionsService { + public interface ExtensionsService { @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" @@ -502,15 +502,16 @@ private Mono getAsync( * @param clusterName The name of the cluster. * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. * @param extensionName The name of the machine extension. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return particular Arc Extension of HCI Cluster. + * @return particular Arc Extension of HCI Cluster along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ExtensionInner get( - String resourceGroupName, String clusterName, String arcSettingName, String extensionName) { - return getAsync(resourceGroupName, clusterName, arcSettingName, extensionName).block(); + public Response getWithResponse( + String resourceGroupName, String clusterName, String arcSettingName, String extensionName, Context context) { + return getWithResponseAsync(resourceGroupName, clusterName, arcSettingName, extensionName, context).block(); } /** @@ -520,16 +521,15 @@ public ExtensionInner get( * @param clusterName The name of the cluster. * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. * @param extensionName The name of the machine extension. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return particular Arc Extension of HCI Cluster along with {@link Response}. + * @return particular Arc Extension of HCI Cluster. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String clusterName, String arcSettingName, String extensionName, Context context) { - return getWithResponseAsync(resourceGroupName, clusterName, arcSettingName, extensionName, context).block(); + public ExtensionInner get( + String resourceGroupName, String clusterName, String arcSettingName, String extensionName) { + return getWithResponse(resourceGroupName, clusterName, arcSettingName, extensionName, Context.NONE).getValue(); } /** @@ -1512,7 +1512,8 @@ public void delete( /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1548,7 +1549,8 @@ private Mono> listByArcSettingNextSinglePageAsync( /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ExtensionsImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ExtensionsImpl.java index a2ed71822024..040aa8b494d3 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ExtensionsImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ExtensionsImpl.java @@ -41,15 +41,6 @@ public PagedIterable listByArcSetting( return Utils.mapPage(inner, inner1 -> new ExtensionImpl(inner1, this.manager())); } - public Extension get(String resourceGroupName, String clusterName, String arcSettingName, String extensionName) { - ExtensionInner inner = this.serviceClient().get(resourceGroupName, clusterName, arcSettingName, extensionName); - if (inner != null) { - return new ExtensionImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getWithResponse( String resourceGroupName, String clusterName, String arcSettingName, String extensionName, Context context) { Response inner = @@ -67,6 +58,15 @@ public Response getWithResponse( } } + public Extension get(String resourceGroupName, String clusterName, String arcSettingName, String extensionName) { + ExtensionInner inner = this.serviceClient().get(resourceGroupName, clusterName, arcSettingName, extensionName); + if (inner != null) { + return new ExtensionImpl(inner, this.manager()); + } else { + return null; + } + } + public void delete(String resourceGroupName, String clusterName, String arcSettingName, String extensionName) { this.serviceClient().delete(resourceGroupName, clusterName, arcSettingName, extensionName); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OfferImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OfferImpl.java new file mode 100644 index 000000000000..2b1ebff07b91 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OfferImpl.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.azurestackhci.fluent.models.OfferInner; +import com.azure.resourcemanager.azurestackhci.models.Offer; +import com.azure.resourcemanager.azurestackhci.models.SkuMappings; +import java.util.Collections; +import java.util.List; + +public final class OfferImpl implements Offer { + private OfferInner innerObject; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + OfferImpl(OfferInner innerObject, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public String publisherId() { + return this.innerModel().publisherId(); + } + + public String content() { + return this.innerModel().content(); + } + + public String contentVersion() { + return this.innerModel().contentVersion(); + } + + public List skuMappings() { + List inner = this.innerModel().skuMappings(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public OfferInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OffersClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OffersClientImpl.java new file mode 100644 index 000000000000..c8102888c849 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OffersClientImpl.java @@ -0,0 +1,916 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.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.azurestackhci.fluent.OffersClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.OfferInner; +import com.azure.resourcemanager.azurestackhci.models.OfferList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in OffersClient. */ +public final class OffersClientImpl implements OffersClient { + /** The proxy service used to perform REST calls. */ + private final OffersService service; + + /** The service client containing this operation class. */ + private final AzureStackHciClientImpl client; + + /** + * Initializes an instance of OffersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OffersClientImpl(AzureStackHciClientImpl client) { + this.service = RestProxy.create(OffersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureStackHciClientOffers to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureStackHciClientO") + public interface OffersService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/clusters/{clusterName}/publishers/{publisherName}/offers") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByPublisher( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("publisherName") String publisherName, + @QueryParam("api-version") String apiVersion, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/clusters/{clusterName}/offers") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByCluster( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/clusters/{clusterName}/publishers/{publisherName}/offers/{offerName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("publisherName") String publisherName, + @PathParam("offerName") String offerName, + @QueryParam("api-version") String apiVersion, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByPublisherNext( + @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> listByClusterNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List Offers available for a publisher within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Offer proxy resources for the HCI cluster along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPublisherSinglePageAsync( + String resourceGroupName, String clusterName, String publisherName, String expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByPublisher( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + publisherName, + this.client.getApiVersion(), + expand, + 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 Offers available for a publisher within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Offer proxy resources for the HCI cluster along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPublisherSinglePageAsync( + String resourceGroupName, String clusterName, String publisherName, String expand, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByPublisher( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + publisherName, + this.client.getApiVersion(), + expand, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List Offers available for a publisher within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Offer proxy resources for the HCI cluster as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByPublisherAsync( + String resourceGroupName, String clusterName, String publisherName, String expand) { + return new PagedFlux<>( + () -> listByPublisherSinglePageAsync(resourceGroupName, clusterName, publisherName, expand), + nextLink -> listByPublisherNextSinglePageAsync(nextLink)); + } + + /** + * List Offers available for a publisher within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Offer proxy resources for the HCI cluster as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByPublisherAsync( + String resourceGroupName, String clusterName, String publisherName) { + final String expand = null; + return new PagedFlux<>( + () -> listByPublisherSinglePageAsync(resourceGroupName, clusterName, publisherName, expand), + nextLink -> listByPublisherNextSinglePageAsync(nextLink)); + } + + /** + * List Offers available for a publisher within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Offer proxy resources for the HCI cluster as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByPublisherAsync( + String resourceGroupName, String clusterName, String publisherName, String expand, Context context) { + return new PagedFlux<>( + () -> listByPublisherSinglePageAsync(resourceGroupName, clusterName, publisherName, expand, context), + nextLink -> listByPublisherNextSinglePageAsync(nextLink, context)); + } + + /** + * List Offers available for a publisher within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Offer proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByPublisher( + String resourceGroupName, String clusterName, String publisherName) { + final String expand = null; + return new PagedIterable<>(listByPublisherAsync(resourceGroupName, clusterName, publisherName, expand)); + } + + /** + * List Offers available for a publisher within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Offer proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByPublisher( + String resourceGroupName, String clusterName, String publisherName, String expand, Context context) { + return new PagedIterable<>( + listByPublisherAsync(resourceGroupName, clusterName, publisherName, expand, context)); + } + + /** + * List Offers available across publishers for the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Offer proxy resources for the HCI cluster along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByClusterSinglePageAsync( + String resourceGroupName, String clusterName, String expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByCluster( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + expand, + 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 Offers available across publishers for the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Offer proxy resources for the HCI cluster along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByClusterSinglePageAsync( + String resourceGroupName, String clusterName, String expand, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByCluster( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + expand, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List Offers available across publishers for the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Offer proxy resources for the HCI cluster as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByClusterAsync(String resourceGroupName, String clusterName, String expand) { + return new PagedFlux<>( + () -> listByClusterSinglePageAsync(resourceGroupName, clusterName, expand), + nextLink -> listByClusterNextSinglePageAsync(nextLink)); + } + + /** + * List Offers available across publishers for the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Offer proxy resources for the HCI cluster as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByClusterAsync(String resourceGroupName, String clusterName) { + final String expand = null; + return new PagedFlux<>( + () -> listByClusterSinglePageAsync(resourceGroupName, clusterName, expand), + nextLink -> listByClusterNextSinglePageAsync(nextLink)); + } + + /** + * List Offers available across publishers for the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Offer proxy resources for the HCI cluster as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByClusterAsync( + String resourceGroupName, String clusterName, String expand, Context context) { + return new PagedFlux<>( + () -> listByClusterSinglePageAsync(resourceGroupName, clusterName, expand, context), + nextLink -> listByClusterNextSinglePageAsync(nextLink, context)); + } + + /** + * List Offers available across publishers for the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Offer proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByCluster(String resourceGroupName, String clusterName) { + final String expand = null; + return new PagedIterable<>(listByClusterAsync(resourceGroupName, clusterName, expand)); + } + + /** + * List Offers available across publishers for the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Offer proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByCluster( + String resourceGroupName, String clusterName, String expand, Context context) { + return new PagedIterable<>(listByClusterAsync(resourceGroupName, clusterName, expand, context)); + } + + /** + * Get Offer resource details within a publisher of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return offer resource details within a publisher of HCI Cluster along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String clusterName, String publisherName, String offerName, String expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (offerName == null) { + return Mono.error(new IllegalArgumentException("Parameter offerName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + publisherName, + offerName, + this.client.getApiVersion(), + expand, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get Offer resource details within a publisher of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return offer resource details within a publisher of HCI Cluster along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String clusterName, + String publisherName, + String offerName, + String expand, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (offerName == null) { + return Mono.error(new IllegalArgumentException("Parameter offerName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + publisherName, + offerName, + this.client.getApiVersion(), + expand, + accept, + context); + } + + /** + * Get Offer resource details within a publisher of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return offer resource details within a publisher of HCI Cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String clusterName, String publisherName, String offerName) { + final String expand = null; + return getWithResponseAsync(resourceGroupName, clusterName, publisherName, offerName, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get Offer resource details within a publisher of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return offer resource details within a publisher of HCI Cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String clusterName, + String publisherName, + String offerName, + String expand, + Context context) { + return getWithResponseAsync(resourceGroupName, clusterName, publisherName, offerName, expand, context).block(); + } + + /** + * Get Offer resource details within a publisher of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return offer resource details within a publisher of HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OfferInner get(String resourceGroupName, String clusterName, String publisherName, String offerName) { + final String expand = null; + return getWithResponse(resourceGroupName, clusterName, publisherName, offerName, expand, Context.NONE) + .getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Offer proxy resources for the HCI cluster along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPublisherNextSinglePageAsync(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.listByPublisherNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Offer proxy resources for the HCI cluster along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPublisherNextSinglePageAsync(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 + .listByPublisherNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Offer proxy resources for the HCI cluster along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByClusterNextSinglePageAsync(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.listByClusterNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Offer proxy resources for the HCI cluster along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByClusterNextSinglePageAsync(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 + .listByClusterNext(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/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OffersImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OffersImpl.java new file mode 100644 index 000000000000..fdb94afa2aad --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OffersImpl.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.azurestackhci.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.azurestackhci.fluent.OffersClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.OfferInner; +import com.azure.resourcemanager.azurestackhci.models.Offer; +import com.azure.resourcemanager.azurestackhci.models.Offers; + +public final class OffersImpl implements Offers { + private static final ClientLogger LOGGER = new ClientLogger(OffersImpl.class); + + private final OffersClient innerClient; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + public OffersImpl( + OffersClient innerClient, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByPublisher(String resourceGroupName, String clusterName, String publisherName) { + PagedIterable inner = + this.serviceClient().listByPublisher(resourceGroupName, clusterName, publisherName); + return Utils.mapPage(inner, inner1 -> new OfferImpl(inner1, this.manager())); + } + + public PagedIterable listByPublisher( + String resourceGroupName, String clusterName, String publisherName, String expand, Context context) { + PagedIterable inner = + this.serviceClient().listByPublisher(resourceGroupName, clusterName, publisherName, expand, context); + return Utils.mapPage(inner, inner1 -> new OfferImpl(inner1, this.manager())); + } + + public PagedIterable listByCluster(String resourceGroupName, String clusterName) { + PagedIterable inner = this.serviceClient().listByCluster(resourceGroupName, clusterName); + return Utils.mapPage(inner, inner1 -> new OfferImpl(inner1, this.manager())); + } + + public PagedIterable listByCluster( + String resourceGroupName, String clusterName, String expand, Context context) { + PagedIterable inner = + this.serviceClient().listByCluster(resourceGroupName, clusterName, expand, context); + return Utils.mapPage(inner, inner1 -> new OfferImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceGroupName, + String clusterName, + String publisherName, + String offerName, + String expand, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, clusterName, publisherName, offerName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new OfferImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Offer get(String resourceGroupName, String clusterName, String publisherName, String offerName) { + OfferInner inner = this.serviceClient().get(resourceGroupName, clusterName, publisherName, offerName); + if (inner != null) { + return new OfferImpl(inner, this.manager()); + } else { + return null; + } + } + + private OffersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OperationsClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OperationsClientImpl.java index 1e22db58c596..96802f4b47fd 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OperationsClientImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OperationsClientImpl.java @@ -49,7 +49,7 @@ public final class OperationsClientImpl implements OperationsClient { */ @Host("{$host}") @ServiceInterface(name = "AzureStackHciClientO") - private interface OperationsService { + public interface OperationsService { @Headers({"Content-Type: application/json"}) @Get("/providers/Microsoft.AzureStackHCI/operations") @ExpectedResponses({200}) @@ -123,26 +123,26 @@ private Mono listAsync() { /** * List all available Microsoft.AzureStackHCI provider operations. * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public OperationListResultInner list() { - return listAsync().block(); + public Response listWithResponse(Context context) { + return listWithResponseAsync(context).block(); } /** * List all available Microsoft.AzureStackHCI provider operations. * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider along with {@link Response}. + * @return a list of REST API operations supported by an Azure Resource Provider. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse(Context context) { - return listWithResponseAsync(context).block(); + public OperationListResultInner list() { + return listWithResponse(Context.NONE).getValue(); } } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OperationsImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OperationsImpl.java index 9a5400b784a4..6ffcd8432998 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OperationsImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OperationsImpl.java @@ -26,15 +26,6 @@ public OperationsImpl( this.serviceManager = serviceManager; } - public OperationListResult list() { - OperationListResultInner inner = this.serviceClient().list(); - if (inner != null) { - return new OperationListResultImpl(inner, this.manager()); - } else { - return null; - } - } - public Response listWithResponse(Context context) { Response inner = this.serviceClient().listWithResponse(context); if (inner != null) { @@ -48,6 +39,15 @@ public Response listWithResponse(Context context) { } } + public OperationListResult list() { + OperationListResultInner inner = this.serviceClient().list(); + if (inner != null) { + return new OperationListResultImpl(inner, this.manager()); + } else { + return null; + } + } + private OperationsClient serviceClient() { return this.innerClient; } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/PublisherImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/PublisherImpl.java new file mode 100644 index 000000000000..7267b2bfb735 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/PublisherImpl.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.azurestackhci.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.azurestackhci.fluent.models.PublisherInner; +import com.azure.resourcemanager.azurestackhci.models.Publisher; + +public final class PublisherImpl implements Publisher { + private PublisherInner innerObject; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + PublisherImpl( + PublisherInner innerObject, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public PublisherInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/PublishersClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/PublishersClientImpl.java new file mode 100644 index 000000000000..60343c8c6776 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/PublishersClientImpl.java @@ -0,0 +1,513 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.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.azurestackhci.fluent.PublishersClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.PublisherInner; +import com.azure.resourcemanager.azurestackhci.models.PublisherList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PublishersClient. */ +public final class PublishersClientImpl implements PublishersClient { + /** The proxy service used to perform REST calls. */ + private final PublishersService service; + + /** The service client containing this operation class. */ + private final AzureStackHciClientImpl client; + + /** + * Initializes an instance of PublishersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PublishersClientImpl(AzureStackHciClientImpl client) { + this.service = + RestProxy.create(PublishersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureStackHciClientPublishers to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureStackHciClientP") + public interface PublishersService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/clusters/{clusterName}/publishers") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByCluster( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/clusters/{clusterName}/publishers/{publisherName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("publisherName") String publisherName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByClusterNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List Publishers available for the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Publisher proxy resources for the HCI cluster along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByClusterSinglePageAsync( + String resourceGroupName, String clusterName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByCluster( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + 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 Publishers available for the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Publisher proxy resources for the HCI cluster along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByClusterSinglePageAsync( + String resourceGroupName, String clusterName, 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByCluster( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List Publishers available for the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Publisher proxy resources for the HCI cluster as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByClusterAsync(String resourceGroupName, String clusterName) { + return new PagedFlux<>( + () -> listByClusterSinglePageAsync(resourceGroupName, clusterName), + nextLink -> listByClusterNextSinglePageAsync(nextLink)); + } + + /** + * List Publishers available for the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Publisher proxy resources for the HCI cluster as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByClusterAsync( + String resourceGroupName, String clusterName, Context context) { + return new PagedFlux<>( + () -> listByClusterSinglePageAsync(resourceGroupName, clusterName, context), + nextLink -> listByClusterNextSinglePageAsync(nextLink, context)); + } + + /** + * List Publishers available for the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Publisher proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByCluster(String resourceGroupName, String clusterName) { + return new PagedIterable<>(listByClusterAsync(resourceGroupName, clusterName)); + } + + /** + * List Publishers available for the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Publisher proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByCluster(String resourceGroupName, String clusterName, Context context) { + return new PagedIterable<>(listByClusterAsync(resourceGroupName, clusterName, context)); + } + + /** + * Get Publisher resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher resource details of HCI Cluster along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String clusterName, String publisherName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + publisherName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get Publisher resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher resource details of HCI Cluster along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String clusterName, String publisherName, 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + publisherName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get Publisher resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher resource details of HCI Cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String clusterName, String publisherName) { + return getWithResponseAsync(resourceGroupName, clusterName, publisherName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get Publisher resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher resource details of HCI Cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String clusterName, String publisherName, Context context) { + return getWithResponseAsync(resourceGroupName, clusterName, publisherName, context).block(); + } + + /** + * Get Publisher resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher resource details of HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PublisherInner get(String resourceGroupName, String clusterName, String publisherName) { + return getWithResponse(resourceGroupName, clusterName, publisherName, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Publisher proxy resources for the HCI cluster along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByClusterNextSinglePageAsync(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.listByClusterNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Publisher proxy resources for the HCI cluster along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByClusterNextSinglePageAsync(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 + .listByClusterNext(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/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/PublishersImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/PublishersImpl.java new file mode 100644 index 000000000000..0c57da8ee804 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/PublishersImpl.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.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.azurestackhci.fluent.PublishersClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.PublisherInner; +import com.azure.resourcemanager.azurestackhci.models.Publisher; +import com.azure.resourcemanager.azurestackhci.models.Publishers; + +public final class PublishersImpl implements Publishers { + private static final ClientLogger LOGGER = new ClientLogger(PublishersImpl.class); + + private final PublishersClient innerClient; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + public PublishersImpl( + PublishersClient innerClient, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByCluster(String resourceGroupName, String clusterName) { + PagedIterable inner = this.serviceClient().listByCluster(resourceGroupName, clusterName); + return Utils.mapPage(inner, inner1 -> new PublisherImpl(inner1, this.manager())); + } + + public PagedIterable listByCluster(String resourceGroupName, String clusterName, Context context) { + PagedIterable inner = + this.serviceClient().listByCluster(resourceGroupName, clusterName, context); + return Utils.mapPage(inner, inner1 -> new PublisherImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceGroupName, String clusterName, String publisherName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, clusterName, publisherName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PublisherImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Publisher get(String resourceGroupName, String clusterName, String publisherName) { + PublisherInner inner = this.serviceClient().get(resourceGroupName, clusterName, publisherName); + if (inner != null) { + return new PublisherImpl(inner, this.manager()); + } else { + return null; + } + } + + private PublishersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/SkuImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/SkuImpl.java new file mode 100644 index 000000000000..8a2673751d6f --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/SkuImpl.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.azurestackhci.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.azurestackhci.fluent.models.SkuInner; +import com.azure.resourcemanager.azurestackhci.models.Sku; +import com.azure.resourcemanager.azurestackhci.models.SkuMappings; +import java.util.Collections; +import java.util.List; + +public final class SkuImpl implements Sku { + private SkuInner innerObject; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + SkuImpl(SkuInner innerObject, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public String publisherId() { + return this.innerModel().publisherId(); + } + + public String offerId() { + return this.innerModel().offerId(); + } + + public String content() { + return this.innerModel().content(); + } + + public String contentVersion() { + return this.innerModel().contentVersion(); + } + + public List skuMappings() { + List inner = this.innerModel().skuMappings(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SkuInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/SkusClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/SkusClientImpl.java new file mode 100644 index 000000000000..6586175bb36b --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/SkusClientImpl.java @@ -0,0 +1,656 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.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.azurestackhci.fluent.SkusClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.SkuInner; +import com.azure.resourcemanager.azurestackhci.models.SkuList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SkusClient. */ +public final class SkusClientImpl implements SkusClient { + /** The proxy service used to perform REST calls. */ + private final SkusService service; + + /** The service client containing this operation class. */ + private final AzureStackHciClientImpl client; + + /** + * Initializes an instance of SkusClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SkusClientImpl(AzureStackHciClientImpl client) { + this.service = RestProxy.create(SkusService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureStackHciClientSkus to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureStackHciClientS") + public interface SkusService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/clusters/{clusterName}/publishers/{publisherName}/offers/{offerName}/skus") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByOffer( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("publisherName") String publisherName, + @PathParam("offerName") String offerName, + @QueryParam("api-version") String apiVersion, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/clusters/{clusterName}/publishers/{publisherName}/offers/{offerName}/skus/{skuName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("publisherName") String publisherName, + @PathParam("offerName") String offerName, + @PathParam("skuName") String skuName, + @QueryParam("api-version") String apiVersion, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByOfferNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List Skus available for a offer within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SKU proxy resources for the HCI cluster along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByOfferSinglePageAsync( + String resourceGroupName, String clusterName, String publisherName, String offerName, String expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (offerName == null) { + return Mono.error(new IllegalArgumentException("Parameter offerName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByOffer( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + publisherName, + offerName, + this.client.getApiVersion(), + expand, + 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 Skus available for a offer within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SKU proxy resources for the HCI cluster along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByOfferSinglePageAsync( + String resourceGroupName, + String clusterName, + String publisherName, + String offerName, + String expand, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (offerName == null) { + return Mono.error(new IllegalArgumentException("Parameter offerName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByOffer( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + publisherName, + offerName, + this.client.getApiVersion(), + expand, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List Skus available for a offer within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SKU proxy resources for the HCI cluster as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByOfferAsync( + String resourceGroupName, String clusterName, String publisherName, String offerName, String expand) { + return new PagedFlux<>( + () -> listByOfferSinglePageAsync(resourceGroupName, clusterName, publisherName, offerName, expand), + nextLink -> listByOfferNextSinglePageAsync(nextLink)); + } + + /** + * List Skus available for a offer within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SKU proxy resources for the HCI cluster as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByOfferAsync( + String resourceGroupName, String clusterName, String publisherName, String offerName) { + final String expand = null; + return new PagedFlux<>( + () -> listByOfferSinglePageAsync(resourceGroupName, clusterName, publisherName, offerName, expand), + nextLink -> listByOfferNextSinglePageAsync(nextLink)); + } + + /** + * List Skus available for a offer within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SKU proxy resources for the HCI cluster as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByOfferAsync( + String resourceGroupName, + String clusterName, + String publisherName, + String offerName, + String expand, + Context context) { + return new PagedFlux<>( + () -> listByOfferSinglePageAsync(resourceGroupName, clusterName, publisherName, offerName, expand, context), + nextLink -> listByOfferNextSinglePageAsync(nextLink, context)); + } + + /** + * List Skus available for a offer within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SKU proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByOffer( + String resourceGroupName, String clusterName, String publisherName, String offerName) { + final String expand = null; + return new PagedIterable<>(listByOfferAsync(resourceGroupName, clusterName, publisherName, offerName, expand)); + } + + /** + * List Skus available for a offer within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SKU proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByOffer( + String resourceGroupName, + String clusterName, + String publisherName, + String offerName, + String expand, + Context context) { + return new PagedIterable<>( + listByOfferAsync(resourceGroupName, clusterName, publisherName, offerName, expand, context)); + } + + /** + * Get SKU resource details within a offer of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @param skuName The name of the SKU available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sKU resource details within a offer of HCI Cluster along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String clusterName, + String publisherName, + String offerName, + String skuName, + String expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (offerName == null) { + return Mono.error(new IllegalArgumentException("Parameter offerName is required and cannot be null.")); + } + if (skuName == null) { + return Mono.error(new IllegalArgumentException("Parameter skuName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + publisherName, + offerName, + skuName, + this.client.getApiVersion(), + expand, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get SKU resource details within a offer of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @param skuName The name of the SKU available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sKU resource details within a offer of HCI Cluster along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String clusterName, + String publisherName, + String offerName, + String skuName, + String expand, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (offerName == null) { + return Mono.error(new IllegalArgumentException("Parameter offerName is required and cannot be null.")); + } + if (skuName == null) { + return Mono.error(new IllegalArgumentException("Parameter skuName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + publisherName, + offerName, + skuName, + this.client.getApiVersion(), + expand, + accept, + context); + } + + /** + * Get SKU resource details within a offer of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @param skuName The name of the SKU available within HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sKU resource details within a offer of HCI Cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String clusterName, String publisherName, String offerName, String skuName) { + final String expand = null; + return getWithResponseAsync(resourceGroupName, clusterName, publisherName, offerName, skuName, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get SKU resource details within a offer of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @param skuName The name of the SKU available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sKU resource details within a offer of HCI Cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String clusterName, + String publisherName, + String offerName, + String skuName, + String expand, + Context context) { + return getWithResponseAsync(resourceGroupName, clusterName, publisherName, offerName, skuName, expand, context) + .block(); + } + + /** + * Get SKU resource details within a offer of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @param skuName The name of the SKU available within HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sKU resource details within a offer of HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SkuInner get( + String resourceGroupName, String clusterName, String publisherName, String offerName, String skuName) { + final String expand = null; + return getWithResponse(resourceGroupName, clusterName, publisherName, offerName, skuName, expand, Context.NONE) + .getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SKU proxy resources for the HCI cluster along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByOfferNextSinglePageAsync(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.listByOfferNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SKU proxy resources for the HCI cluster along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByOfferNextSinglePageAsync(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 + .listByOfferNext(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/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/SkusImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/SkusImpl.java new file mode 100644 index 000000000000..af1432e04303 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/SkusImpl.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.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.azurestackhci.fluent.SkusClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.SkuInner; +import com.azure.resourcemanager.azurestackhci.models.Sku; +import com.azure.resourcemanager.azurestackhci.models.Skus; + +public final class SkusImpl implements Skus { + private static final ClientLogger LOGGER = new ClientLogger(SkusImpl.class); + + private final SkusClient innerClient; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + public SkusImpl( + SkusClient innerClient, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByOffer( + String resourceGroupName, String clusterName, String publisherName, String offerName) { + PagedIterable inner = + this.serviceClient().listByOffer(resourceGroupName, clusterName, publisherName, offerName); + return Utils.mapPage(inner, inner1 -> new SkuImpl(inner1, this.manager())); + } + + public PagedIterable listByOffer( + String resourceGroupName, + String clusterName, + String publisherName, + String offerName, + String expand, + Context context) { + PagedIterable inner = + this.serviceClient().listByOffer(resourceGroupName, clusterName, publisherName, offerName, expand, context); + return Utils.mapPage(inner, inner1 -> new SkuImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceGroupName, + String clusterName, + String publisherName, + String offerName, + String skuName, + String expand, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, clusterName, publisherName, offerName, skuName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SkuImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Sku get( + String resourceGroupName, String clusterName, String publisherName, String offerName, String skuName) { + SkuInner inner = this.serviceClient().get(resourceGroupName, clusterName, publisherName, offerName, skuName); + if (inner != null) { + return new SkuImpl(inner, this.manager()); + } else { + return null; + } + } + + private SkusClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateImpl.java new file mode 100644 index 000000000000..bb8db5045a97 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateImpl.java @@ -0,0 +1,375 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.UpdateInner; +import com.azure.resourcemanager.azurestackhci.models.AvailabilityType; +import com.azure.resourcemanager.azurestackhci.models.HealthState; +import com.azure.resourcemanager.azurestackhci.models.PackageVersionInfo; +import com.azure.resourcemanager.azurestackhci.models.PrecheckResult; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; +import com.azure.resourcemanager.azurestackhci.models.RebootRequirement; +import com.azure.resourcemanager.azurestackhci.models.State; +import com.azure.resourcemanager.azurestackhci.models.Update; +import com.azure.resourcemanager.azurestackhci.models.UpdatePrerequisite; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class UpdateImpl implements Update, Update.Definition, Update.Update { + private UpdateInner innerObject; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager 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 SystemData systemData() { + return this.innerModel().systemData(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public OffsetDateTime installedDate() { + return this.innerModel().installedDate(); + } + + public String description() { + return this.innerModel().description(); + } + + public State state() { + return this.innerModel().state(); + } + + public List prerequisites() { + List inner = this.innerModel().prerequisites(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List componentVersions() { + List inner = this.innerModel().componentVersions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public RebootRequirement rebootRequired() { + return this.innerModel().rebootRequired(); + } + + public HealthState healthState() { + return this.innerModel().healthState(); + } + + public List healthCheckResult() { + List inner = this.innerModel().healthCheckResult(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public OffsetDateTime healthCheckDate() { + return this.innerModel().healthCheckDate(); + } + + public String packagePath() { + return this.innerModel().packagePath(); + } + + public Float packageSizeInMb() { + return this.innerModel().packageSizeInMb(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public String version() { + return this.innerModel().version(); + } + + public String publisher() { + return this.innerModel().publisher(); + } + + public String releaseLink() { + return this.innerModel().releaseLink(); + } + + public AvailabilityType availabilityType() { + return this.innerModel().availabilityType(); + } + + public String packageType() { + return this.innerModel().packageType(); + } + + public String additionalProperties() { + return this.innerModel().additionalProperties(); + } + + public Float progressPercentage() { + return this.innerModel().progressPercentage(); + } + + public String notifyMessage() { + return this.innerModel().notifyMessage(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public UpdateInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String clusterName; + + private String updateName; + + public UpdateImpl withExistingCluster(String resourceGroupName, String clusterName) { + this.resourceGroupName = resourceGroupName; + this.clusterName = clusterName; + return this; + } + + public Update create() { + this.innerObject = + serviceManager + .serviceClient() + .getUpdates() + .putWithResponse(resourceGroupName, clusterName, updateName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public Update create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getUpdates() + .putWithResponse(resourceGroupName, clusterName, updateName, this.innerModel(), context) + .getValue(); + return this; + } + + UpdateImpl(String name, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = new UpdateInner(); + this.serviceManager = serviceManager; + this.updateName = name; + } + + public UpdateImpl update() { + return this; + } + + public Update apply() { + this.innerObject = + serviceManager + .serviceClient() + .getUpdates() + .putWithResponse(resourceGroupName, clusterName, updateName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public Update apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getUpdates() + .putWithResponse(resourceGroupName, clusterName, updateName, this.innerModel(), context) + .getValue(); + return this; + } + + UpdateImpl(UpdateInner innerObject, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.clusterName = Utils.getValueFromIdByName(innerObject.id(), "clusters"); + this.updateName = Utils.getValueFromIdByName(innerObject.id(), "updates"); + } + + public Update refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getUpdates() + .getWithResponse(resourceGroupName, clusterName, updateName, Context.NONE) + .getValue(); + return this; + } + + public Update refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getUpdates() + .getWithResponse(resourceGroupName, clusterName, updateName, context) + .getValue(); + return this; + } + + public void post() { + serviceManager.updates().post(resourceGroupName, clusterName, updateName); + } + + public void post(Context context) { + serviceManager.updates().post(resourceGroupName, clusterName, updateName, context); + } + + public UpdateImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public UpdateImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public UpdateImpl withInstalledDate(OffsetDateTime installedDate) { + this.innerModel().withInstalledDate(installedDate); + return this; + } + + public UpdateImpl withDescription(String description) { + this.innerModel().withDescription(description); + return this; + } + + public UpdateImpl withState(State state) { + this.innerModel().withState(state); + return this; + } + + public UpdateImpl withPrerequisites(List prerequisites) { + this.innerModel().withPrerequisites(prerequisites); + return this; + } + + public UpdateImpl withComponentVersions(List componentVersions) { + this.innerModel().withComponentVersions(componentVersions); + return this; + } + + public UpdateImpl withRebootRequired(RebootRequirement rebootRequired) { + this.innerModel().withRebootRequired(rebootRequired); + return this; + } + + public UpdateImpl withHealthState(HealthState healthState) { + this.innerModel().withHealthState(healthState); + return this; + } + + public UpdateImpl withHealthCheckResult(List healthCheckResult) { + this.innerModel().withHealthCheckResult(healthCheckResult); + return this; + } + + public UpdateImpl withHealthCheckDate(OffsetDateTime healthCheckDate) { + this.innerModel().withHealthCheckDate(healthCheckDate); + return this; + } + + public UpdateImpl withPackagePath(String packagePath) { + this.innerModel().withPackagePath(packagePath); + return this; + } + + public UpdateImpl withPackageSizeInMb(Float packageSizeInMb) { + this.innerModel().withPackageSizeInMb(packageSizeInMb); + return this; + } + + public UpdateImpl withDisplayName(String displayName) { + this.innerModel().withDisplayName(displayName); + return this; + } + + public UpdateImpl withVersion(String version) { + this.innerModel().withVersion(version); + return this; + } + + public UpdateImpl withPublisher(String publisher) { + this.innerModel().withPublisher(publisher); + return this; + } + + public UpdateImpl withReleaseLink(String releaseLink) { + this.innerModel().withReleaseLink(releaseLink); + return this; + } + + public UpdateImpl withAvailabilityType(AvailabilityType availabilityType) { + this.innerModel().withAvailabilityType(availabilityType); + return this; + } + + public UpdateImpl withPackageType(String packageType) { + this.innerModel().withPackageType(packageType); + return this; + } + + public UpdateImpl withAdditionalProperties(String additionalProperties) { + this.innerModel().withAdditionalProperties(additionalProperties); + return this; + } + + public UpdateImpl withProgressPercentage(Float progressPercentage) { + this.innerModel().withProgressPercentage(progressPercentage); + return this; + } + + public UpdateImpl withNotifyMessage(String notifyMessage) { + this.innerModel().withNotifyMessage(notifyMessage); + return this; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateRunImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateRunImpl.java new file mode 100644 index 000000000000..bebe89c1bc11 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateRunImpl.java @@ -0,0 +1,287 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.Step; +import com.azure.resourcemanager.azurestackhci.fluent.models.UpdateRunInner; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; +import com.azure.resourcemanager.azurestackhci.models.UpdateRun; +import com.azure.resourcemanager.azurestackhci.models.UpdateRunPropertiesState; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class UpdateRunImpl implements UpdateRun, UpdateRun.Definition, UpdateRun.Update { + private UpdateRunInner innerObject; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager 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 SystemData systemData() { + return this.innerModel().systemData(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public OffsetDateTime timeStarted() { + return this.innerModel().timeStarted(); + } + + public OffsetDateTime lastUpdatedTime() { + return this.innerModel().lastUpdatedTime(); + } + + public String duration() { + return this.innerModel().duration(); + } + + public UpdateRunPropertiesState state() { + return this.innerModel().state(); + } + + public String namePropertiesName() { + return this.innerModel().namePropertiesName(); + } + + public String description() { + return this.innerModel().description(); + } + + public String errorMessage() { + return this.innerModel().errorMessage(); + } + + public String status() { + return this.innerModel().status(); + } + + public OffsetDateTime startTimeUtc() { + return this.innerModel().startTimeUtc(); + } + + public OffsetDateTime endTimeUtc() { + return this.innerModel().endTimeUtc(); + } + + public OffsetDateTime lastUpdatedTimeUtc() { + return this.innerModel().lastUpdatedTimeUtc(); + } + + public List steps() { + List inner = this.innerModel().steps(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public UpdateRunInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String clusterName; + + private String updateName; + + private String updateRunName; + + public UpdateRunImpl withExistingUpdate(String resourceGroupName, String clusterName, String updateName) { + this.resourceGroupName = resourceGroupName; + this.clusterName = clusterName; + this.updateName = updateName; + return this; + } + + public UpdateRun create() { + this.innerObject = + serviceManager + .serviceClient() + .getUpdateRuns() + .putWithResponse( + resourceGroupName, clusterName, updateName, updateRunName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public UpdateRun create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getUpdateRuns() + .putWithResponse(resourceGroupName, clusterName, updateName, updateRunName, this.innerModel(), context) + .getValue(); + return this; + } + + UpdateRunImpl(String name, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = new UpdateRunInner(); + this.serviceManager = serviceManager; + this.updateRunName = name; + } + + public UpdateRunImpl update() { + return this; + } + + public UpdateRun apply() { + this.innerObject = + serviceManager + .serviceClient() + .getUpdateRuns() + .putWithResponse( + resourceGroupName, clusterName, updateName, updateRunName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public UpdateRun apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getUpdateRuns() + .putWithResponse(resourceGroupName, clusterName, updateName, updateRunName, this.innerModel(), context) + .getValue(); + return this; + } + + UpdateRunImpl( + UpdateRunInner innerObject, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.clusterName = Utils.getValueFromIdByName(innerObject.id(), "clusters"); + this.updateName = Utils.getValueFromIdByName(innerObject.id(), "updates"); + this.updateRunName = Utils.getValueFromIdByName(innerObject.id(), "updateRuns"); + } + + public UpdateRun refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getUpdateRuns() + .getWithResponse(resourceGroupName, clusterName, updateName, updateRunName, Context.NONE) + .getValue(); + return this; + } + + public UpdateRun refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getUpdateRuns() + .getWithResponse(resourceGroupName, clusterName, updateName, updateRunName, context) + .getValue(); + return this; + } + + public UpdateRunImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public UpdateRunImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public UpdateRunImpl withTimeStarted(OffsetDateTime timeStarted) { + this.innerModel().withTimeStarted(timeStarted); + return this; + } + + public UpdateRunImpl withLastUpdatedTime(OffsetDateTime lastUpdatedTime) { + this.innerModel().withLastUpdatedTime(lastUpdatedTime); + return this; + } + + public UpdateRunImpl withDuration(String duration) { + this.innerModel().withDuration(duration); + return this; + } + + public UpdateRunImpl withState(UpdateRunPropertiesState state) { + this.innerModel().withState(state); + return this; + } + + public UpdateRunImpl withNamePropertiesName(String namePropertiesName) { + this.innerModel().withNamePropertiesName(namePropertiesName); + return this; + } + + public UpdateRunImpl withDescription(String description) { + this.innerModel().withDescription(description); + return this; + } + + public UpdateRunImpl withErrorMessage(String errorMessage) { + this.innerModel().withErrorMessage(errorMessage); + return this; + } + + public UpdateRunImpl withStatus(String status) { + this.innerModel().withStatus(status); + return this; + } + + public UpdateRunImpl withStartTimeUtc(OffsetDateTime startTimeUtc) { + this.innerModel().withStartTimeUtc(startTimeUtc); + return this; + } + + public UpdateRunImpl withEndTimeUtc(OffsetDateTime endTimeUtc) { + this.innerModel().withEndTimeUtc(endTimeUtc); + return this; + } + + public UpdateRunImpl withLastUpdatedTimeUtc(OffsetDateTime lastUpdatedTimeUtc) { + this.innerModel().withLastUpdatedTimeUtc(lastUpdatedTimeUtc); + return this; + } + + public UpdateRunImpl withSteps(List steps) { + this.innerModel().withSteps(steps); + return this; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateRunsClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateRunsClientImpl.java new file mode 100644 index 000000000000..c9ae69a45176 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateRunsClientImpl.java @@ -0,0 +1,1071 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.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.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.azurestackhci.fluent.UpdateRunsClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.UpdateRunInner; +import com.azure.resourcemanager.azurestackhci.models.UpdateRunList; +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 UpdateRunsClient. */ +public final class UpdateRunsClientImpl implements UpdateRunsClient { + /** The proxy service used to perform REST calls. */ + private final UpdateRunsService service; + + /** The service client containing this operation class. */ + private final AzureStackHciClientImpl client; + + /** + * Initializes an instance of UpdateRunsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + UpdateRunsClientImpl(AzureStackHciClientImpl client) { + this.service = + RestProxy.create(UpdateRunsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureStackHciClientUpdateRuns to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureStackHciClientU") + public interface UpdateRunsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/clusters/{clusterName}/updates/{updateName}/updateRuns") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("updateName") String updateName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/clusters/{clusterName}/updates/{updateName}/updateRuns/{updateRunName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("updateName") String updateName, + @PathParam("updateRunName") String updateRunName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/clusters/{clusterName}/updates/{updateName}/updateRuns/{updateRunName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> put( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("updateName") String updateName, + @PathParam("updateRunName") String updateRunName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") UpdateRunInner updateRunsProperties, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/clusters/{clusterName}/updates/{updateName}/updateRuns/{updateRunName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("updateName") String updateName, + @PathParam("updateRunName") String updateRunName, + @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 all Update runs for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Update runs along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String clusterName, String updateName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (updateName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + updateName, + 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 all Update runs for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Update runs along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String clusterName, String updateName, 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (updateName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + updateName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List all Update runs for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Update runs as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String clusterName, String updateName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, clusterName, updateName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List all Update runs for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Update runs as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String clusterName, String updateName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, clusterName, updateName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List all Update runs for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Update runs as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String clusterName, String updateName) { + return new PagedIterable<>(listAsync(resourceGroupName, clusterName, updateName)); + } + + /** + * List all Update runs for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Update runs as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String clusterName, String updateName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, clusterName, updateName, context)); + } + + /** + * Delete specified Update Run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 clusterName, String updateName, String updateRunName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (updateName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateName is required and cannot be null.")); + } + if (updateRunName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateRunName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + updateName, + updateRunName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete specified Update Run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 clusterName, String updateName, String updateRunName, 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (updateName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateName is required and cannot be null.")); + } + if (updateRunName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateRunName 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, + clusterName, + updateName, + updateRunName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete specified Update Run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 clusterName, String updateName, String updateRunName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, clusterName, updateName, updateRunName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete specified Update Run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 clusterName, String updateName, String updateRunName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, clusterName, updateName, updateRunName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete specified Update Run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 clusterName, String updateName, String updateRunName) { + return beginDeleteAsync(resourceGroupName, clusterName, updateName, updateRunName).getSyncPoller(); + } + + /** + * Delete specified Update Run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 clusterName, String updateName, String updateRunName, Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, updateName, updateRunName, context).getSyncPoller(); + } + + /** + * Delete specified Update Run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 clusterName, String updateName, String updateRunName) { + return beginDeleteAsync(resourceGroupName, clusterName, updateName, updateRunName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete specified Update Run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 clusterName, String updateName, String updateRunName, Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, updateName, updateRunName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete specified Update Run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 clusterName, String updateName, String updateRunName) { + deleteAsync(resourceGroupName, clusterName, updateName, updateRunName).block(); + } + + /** + * Delete specified Update Run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 clusterName, String updateName, String updateRunName, Context context) { + deleteAsync(resourceGroupName, clusterName, updateName, updateRunName, context).block(); + } + + /** + * Put Update runs for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @param updateRunsProperties Properties of the updateRuns 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 details of an Update run along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> putWithResponseAsync( + String resourceGroupName, + String clusterName, + String updateName, + String updateRunName, + UpdateRunInner updateRunsProperties) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (updateName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateName is required and cannot be null.")); + } + if (updateRunName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateRunName is required and cannot be null.")); + } + if (updateRunsProperties == null) { + return Mono + .error(new IllegalArgumentException("Parameter updateRunsProperties is required and cannot be null.")); + } else { + updateRunsProperties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .put( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + updateName, + updateRunName, + this.client.getApiVersion(), + updateRunsProperties, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Put Update runs for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @param updateRunsProperties Properties of the updateRuns 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 details of an Update run along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> putWithResponseAsync( + String resourceGroupName, + String clusterName, + String updateName, + String updateRunName, + UpdateRunInner updateRunsProperties, + 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (updateName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateName is required and cannot be null.")); + } + if (updateRunName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateRunName is required and cannot be null.")); + } + if (updateRunsProperties == null) { + return Mono + .error(new IllegalArgumentException("Parameter updateRunsProperties is required and cannot be null.")); + } else { + updateRunsProperties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .put( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + updateName, + updateRunName, + this.client.getApiVersion(), + updateRunsProperties, + accept, + context); + } + + /** + * Put Update runs for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @param updateRunsProperties Properties of the updateRuns 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 details of an Update run on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono putAsync( + String resourceGroupName, + String clusterName, + String updateName, + String updateRunName, + UpdateRunInner updateRunsProperties) { + return putWithResponseAsync(resourceGroupName, clusterName, updateName, updateRunName, updateRunsProperties) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Put Update runs for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @param updateRunsProperties Properties of the updateRuns 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 details of an Update run along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse( + String resourceGroupName, + String clusterName, + String updateName, + String updateRunName, + UpdateRunInner updateRunsProperties, + Context context) { + return putWithResponseAsync( + resourceGroupName, clusterName, updateName, updateRunName, updateRunsProperties, context) + .block(); + } + + /** + * Put Update runs for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @param updateRunsProperties Properties of the updateRuns 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 details of an Update run. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public UpdateRunInner put( + String resourceGroupName, + String clusterName, + String updateName, + String updateRunName, + UpdateRunInner updateRunsProperties) { + return putWithResponse( + resourceGroupName, clusterName, updateName, updateRunName, updateRunsProperties, Context.NONE) + .getValue(); + } + + /** + * Get the Update run for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Update run for a specified update along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String clusterName, String updateName, String updateRunName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (updateName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateName is required and cannot be null.")); + } + if (updateRunName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateRunName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + updateName, + updateRunName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the Update run for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Update run for a specified update along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String clusterName, String updateName, String updateRunName, 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (updateName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateName is required and cannot be null.")); + } + if (updateRunName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateRunName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + updateName, + updateRunName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get the Update run for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Update run for a specified update on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String clusterName, String updateName, String updateRunName) { + return getWithResponseAsync(resourceGroupName, clusterName, updateName, updateRunName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the Update run for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Update run for a specified update along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String clusterName, String updateName, String updateRunName, Context context) { + return getWithResponseAsync(resourceGroupName, clusterName, updateName, updateRunName, context).block(); + } + + /** + * Get the Update run for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Update run for a specified update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public UpdateRunInner get(String resourceGroupName, String clusterName, String updateName, String updateRunName) { + return getWithResponse(resourceGroupName, clusterName, updateName, updateRunName, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Update runs 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/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateRunsImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateRunsImpl.java new file mode 100644 index 000000000000..e7f000599f3c --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateRunsImpl.java @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.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.azurestackhci.fluent.UpdateRunsClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.UpdateRunInner; +import com.azure.resourcemanager.azurestackhci.models.UpdateRun; +import com.azure.resourcemanager.azurestackhci.models.UpdateRuns; + +public final class UpdateRunsImpl implements UpdateRuns { + private static final ClientLogger LOGGER = new ClientLogger(UpdateRunsImpl.class); + + private final UpdateRunsClient innerClient; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + public UpdateRunsImpl( + UpdateRunsClient innerClient, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String clusterName, String updateName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, clusterName, updateName); + return Utils.mapPage(inner, inner1 -> new UpdateRunImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String clusterName, String updateName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, clusterName, updateName, context); + return Utils.mapPage(inner, inner1 -> new UpdateRunImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String clusterName, String updateName, String updateRunName) { + this.serviceClient().delete(resourceGroupName, clusterName, updateName, updateRunName); + } + + public void delete( + String resourceGroupName, String clusterName, String updateName, String updateRunName, Context context) { + this.serviceClient().delete(resourceGroupName, clusterName, updateName, updateRunName, context); + } + + public Response getWithResponse( + String resourceGroupName, String clusterName, String updateName, String updateRunName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, clusterName, updateName, updateRunName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new UpdateRunImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public UpdateRun get(String resourceGroupName, String clusterName, String updateName, String updateRunName) { + UpdateRunInner inner = this.serviceClient().get(resourceGroupName, clusterName, updateName, updateRunName); + if (inner != null) { + return new UpdateRunImpl(inner, this.manager()); + } else { + return null; + } + } + + public UpdateRun getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String updateName = Utils.getValueFromIdByName(id, "updates"); + if (updateName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'updates'.", id))); + } + String updateRunName = Utils.getValueFromIdByName(id, "updateRuns"); + if (updateRunName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'updateRuns'.", id))); + } + return this.getWithResponse(resourceGroupName, clusterName, updateName, updateRunName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String updateName = Utils.getValueFromIdByName(id, "updates"); + if (updateName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'updates'.", id))); + } + String updateRunName = Utils.getValueFromIdByName(id, "updateRuns"); + if (updateRunName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'updateRuns'.", id))); + } + return this.getWithResponse(resourceGroupName, clusterName, updateName, updateRunName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String updateName = Utils.getValueFromIdByName(id, "updates"); + if (updateName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'updates'.", id))); + } + String updateRunName = Utils.getValueFromIdByName(id, "updateRuns"); + if (updateRunName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'updateRuns'.", id))); + } + this.delete(resourceGroupName, clusterName, updateName, updateRunName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String updateName = Utils.getValueFromIdByName(id, "updates"); + if (updateName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'updates'.", id))); + } + String updateRunName = Utils.getValueFromIdByName(id, "updateRuns"); + if (updateRunName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'updateRuns'.", id))); + } + this.delete(resourceGroupName, clusterName, updateName, updateRunName, context); + } + + private UpdateRunsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } + + public UpdateRunImpl define(String name) { + return new UpdateRunImpl(name, this.manager()); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateSummariesImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateSummariesImpl.java new file mode 100644 index 000000000000..89ac8fb00fe2 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateSummariesImpl.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.azurestackhci.fluent.models.UpdateSummariesInner; +import com.azure.resourcemanager.azurestackhci.models.HealthState; +import com.azure.resourcemanager.azurestackhci.models.PackageVersionInfo; +import com.azure.resourcemanager.azurestackhci.models.PrecheckResult; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; +import com.azure.resourcemanager.azurestackhci.models.UpdateSummaries; +import com.azure.resourcemanager.azurestackhci.models.UpdateSummariesPropertiesState; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class UpdateSummariesImpl implements UpdateSummaries { + private UpdateSummariesInner innerObject; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + UpdateSummariesImpl( + UpdateSummariesInner innerObject, com.azure.resourcemanager.azurestackhci.AzureStackHciManager 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 SystemData systemData() { + return this.innerModel().systemData(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String oemFamily() { + return this.innerModel().oemFamily(); + } + + public String hardwareModel() { + return this.innerModel().hardwareModel(); + } + + public List packageVersions() { + List inner = this.innerModel().packageVersions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String currentVersion() { + return this.innerModel().currentVersion(); + } + + public OffsetDateTime lastUpdated() { + return this.innerModel().lastUpdated(); + } + + public OffsetDateTime lastChecked() { + return this.innerModel().lastChecked(); + } + + public HealthState healthState() { + return this.innerModel().healthState(); + } + + public List healthCheckResult() { + List inner = this.innerModel().healthCheckResult(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public OffsetDateTime healthCheckDate() { + return this.innerModel().healthCheckDate(); + } + + public UpdateSummariesPropertiesState state() { + return this.innerModel().state(); + } + + public UpdateSummariesInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateSummariesOperationsClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateSummariesOperationsClientImpl.java new file mode 100644 index 000000000000..34a843c89b06 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateSummariesOperationsClientImpl.java @@ -0,0 +1,926 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.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.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.azurestackhci.fluent.UpdateSummariesOperationsClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.UpdateSummariesInner; +import com.azure.resourcemanager.azurestackhci.models.UpdateSummariesList; +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 UpdateSummariesOperationsClient. */ +public final class UpdateSummariesOperationsClientImpl implements UpdateSummariesOperationsClient { + /** The proxy service used to perform REST calls. */ + private final UpdateSummariesOperationsService service; + + /** The service client containing this operation class. */ + private final AzureStackHciClientImpl client; + + /** + * Initializes an instance of UpdateSummariesOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + UpdateSummariesOperationsClientImpl(AzureStackHciClientImpl client) { + this.service = + RestProxy + .create( + UpdateSummariesOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureStackHciClientUpdateSummariesOperations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureStackHciClientU") + public interface UpdateSummariesOperationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/clusters/{clusterName}/updateSummaries") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/clusters/{clusterName}/updateSummaries/default") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/clusters/{clusterName}/updateSummaries/default") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> put( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") UpdateSummariesInner updateLocationProperties, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/clusters/{clusterName}/updateSummaries/default") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @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 all Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Update Summaries along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String clusterName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + 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 all Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Update Summaries along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String clusterName, 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List all Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Update Summaries as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String clusterName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, clusterName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List all Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Update Summaries as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String clusterName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, clusterName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List all Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Update Summaries as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String clusterName) { + return new PagedIterable<>(listAsync(resourceGroupName, clusterName)); + } + + /** + * List all Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Update Summaries as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String clusterName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, clusterName, context)); + } + + /** + * Delete Update Summaries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 clusterName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete Update Summaries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 clusterName, 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName 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, + clusterName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete Update Summaries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 clusterName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete Update Summaries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 clusterName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete Update Summaries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 clusterName) { + return beginDeleteAsync(resourceGroupName, clusterName).getSyncPoller(); + } + + /** + * Delete Update Summaries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 clusterName, Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, context).getSyncPoller(); + } + + /** + * Delete Update Summaries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 clusterName) { + return beginDeleteAsync(resourceGroupName, clusterName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete Update Summaries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 clusterName, Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete Update Summaries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 clusterName) { + deleteAsync(resourceGroupName, clusterName).block(); + } + + /** + * Delete Update Summaries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 clusterName, Context context) { + deleteAsync(resourceGroupName, clusterName, context).block(); + } + + /** + * Put Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateLocationProperties Properties of the UpdateSummaries resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return get the update summaries for the cluster along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> putWithResponseAsync( + String resourceGroupName, String clusterName, UpdateSummariesInner updateLocationProperties) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (updateLocationProperties == null) { + return Mono + .error( + new IllegalArgumentException("Parameter updateLocationProperties is required and cannot be null.")); + } else { + updateLocationProperties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .put( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + updateLocationProperties, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Put Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateLocationProperties Properties of the UpdateSummaries resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return get the update summaries for the cluster along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> putWithResponseAsync( + String resourceGroupName, String clusterName, UpdateSummariesInner updateLocationProperties, 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (updateLocationProperties == null) { + return Mono + .error( + new IllegalArgumentException("Parameter updateLocationProperties is required and cannot be null.")); + } else { + updateLocationProperties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .put( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + updateLocationProperties, + accept, + context); + } + + /** + * Put Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateLocationProperties Properties of the UpdateSummaries resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return get the update summaries for the cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono putAsync( + String resourceGroupName, String clusterName, UpdateSummariesInner updateLocationProperties) { + return putWithResponseAsync(resourceGroupName, clusterName, updateLocationProperties) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Put Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateLocationProperties Properties of the UpdateSummaries resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return get the update summaries for the cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse( + String resourceGroupName, String clusterName, UpdateSummariesInner updateLocationProperties, Context context) { + return putWithResponseAsync(resourceGroupName, clusterName, updateLocationProperties, context).block(); + } + + /** + * Put Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateLocationProperties Properties of the UpdateSummaries resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return get the update summaries for the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public UpdateSummariesInner put( + String resourceGroupName, String clusterName, UpdateSummariesInner updateLocationProperties) { + return putWithResponse(resourceGroupName, clusterName, updateLocationProperties, Context.NONE).getValue(); + } + + /** + * Get all Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Update summaries under the HCI cluster along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String clusterName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get all Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Update summaries under the HCI cluster along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String clusterName, 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get all Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Update summaries under the HCI cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String clusterName) { + return getWithResponseAsync(resourceGroupName, clusterName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get all Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Update summaries under the HCI cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String clusterName, Context context) { + return getWithResponseAsync(resourceGroupName, clusterName, context).block(); + } + + /** + * Get all Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Update summaries under the HCI cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public UpdateSummariesInner get(String resourceGroupName, String clusterName) { + return getWithResponse(resourceGroupName, clusterName, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Update Summaries 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/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateSummariesOperationsImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateSummariesOperationsImpl.java new file mode 100644 index 000000000000..7ab8e7edc1de --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateSummariesOperationsImpl.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.azurestackhci.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.azurestackhci.fluent.UpdateSummariesOperationsClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.UpdateSummariesInner; +import com.azure.resourcemanager.azurestackhci.models.UpdateSummaries; +import com.azure.resourcemanager.azurestackhci.models.UpdateSummariesOperations; + +public final class UpdateSummariesOperationsImpl implements UpdateSummariesOperations { + private static final ClientLogger LOGGER = new ClientLogger(UpdateSummariesOperationsImpl.class); + + private final UpdateSummariesOperationsClient innerClient; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + public UpdateSummariesOperationsImpl( + UpdateSummariesOperationsClient innerClient, + com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String clusterName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, clusterName); + return Utils.mapPage(inner, inner1 -> new UpdateSummariesImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String clusterName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, clusterName, context); + return Utils.mapPage(inner, inner1 -> new UpdateSummariesImpl(inner1, this.manager())); + } + + public void deleteByResourceGroup(String resourceGroupName, String clusterName) { + this.serviceClient().delete(resourceGroupName, clusterName); + } + + public void delete(String resourceGroupName, String clusterName, Context context) { + this.serviceClient().delete(resourceGroupName, clusterName, context); + } + + public Response putWithResponse( + String resourceGroupName, String clusterName, UpdateSummariesInner updateLocationProperties, Context context) { + Response inner = + this.serviceClient().putWithResponse(resourceGroupName, clusterName, updateLocationProperties, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new UpdateSummariesImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public UpdateSummaries put( + String resourceGroupName, String clusterName, UpdateSummariesInner updateLocationProperties) { + UpdateSummariesInner inner = this.serviceClient().put(resourceGroupName, clusterName, updateLocationProperties); + if (inner != null) { + return new UpdateSummariesImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse(String resourceGroupName, String clusterName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, clusterName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new UpdateSummariesImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public UpdateSummaries get(String resourceGroupName, String clusterName) { + UpdateSummariesInner inner = this.serviceClient().get(resourceGroupName, clusterName); + if (inner != null) { + return new UpdateSummariesImpl(inner, this.manager()); + } else { + return null; + } + } + + private UpdateSummariesOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdatesClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdatesClientImpl.java new file mode 100644 index 000000000000..ac83cc5b3bf8 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdatesClientImpl.java @@ -0,0 +1,1247 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.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.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.azurestackhci.fluent.UpdatesClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.UpdateInner; +import com.azure.resourcemanager.azurestackhci.models.UpdateList; +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 UpdatesClient. */ +public final class UpdatesClientImpl implements UpdatesClient { + /** The proxy service used to perform REST calls. */ + private final UpdatesService service; + + /** The service client containing this operation class. */ + private final AzureStackHciClientImpl client; + + /** + * Initializes an instance of UpdatesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + UpdatesClientImpl(AzureStackHciClientImpl client) { + this.service = RestProxy.create(UpdatesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureStackHciClientUpdates to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureStackHciClientU") + public interface UpdatesService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/clusters/{clusterName}/updates/{updateName}/apply") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> post( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("updateName") String updateName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/clusters/{clusterName}/updates") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/clusters/{clusterName}/updates/{updateName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("updateName") String updateName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/clusters/{clusterName}/updates/{updateName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> put( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("updateName") String updateName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") UpdateInner updateProperties, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/clusters/{clusterName}/updates/{updateName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("updateName") String updateName, + @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); + } + + /** + * Apply Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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>> postWithResponseAsync( + String resourceGroupName, String clusterName, String updateName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (updateName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .post( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + updateName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Apply Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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>> postWithResponseAsync( + String resourceGroupName, String clusterName, String updateName, 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (updateName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .post( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + updateName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Apply Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> beginPostAsync( + String resourceGroupName, String clusterName, String updateName) { + Mono>> mono = postWithResponseAsync(resourceGroupName, clusterName, updateName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Apply Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> beginPostAsync( + String resourceGroupName, String clusterName, String updateName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + postWithResponseAsync(resourceGroupName, clusterName, updateName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Apply Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> beginPost( + String resourceGroupName, String clusterName, String updateName) { + return beginPostAsync(resourceGroupName, clusterName, updateName).getSyncPoller(); + } + + /** + * Apply Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> beginPost( + String resourceGroupName, String clusterName, String updateName, Context context) { + return beginPostAsync(resourceGroupName, clusterName, updateName, context).getSyncPoller(); + } + + /** + * Apply Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 postAsync(String resourceGroupName, String clusterName, String updateName) { + return beginPostAsync(resourceGroupName, clusterName, updateName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Apply Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 postAsync(String resourceGroupName, String clusterName, String updateName, Context context) { + return beginPostAsync(resourceGroupName, clusterName, updateName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Apply Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 post(String resourceGroupName, String clusterName, String updateName) { + postAsync(resourceGroupName, clusterName, updateName).block(); + } + + /** + * Apply Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 post(String resourceGroupName, String clusterName, String updateName, Context context) { + postAsync(resourceGroupName, clusterName, updateName, context).block(); + } + + /** + * List all Updates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Updates along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String clusterName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + 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 all Updates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Updates along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String clusterName, 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List all Updates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Updates as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String clusterName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, clusterName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List all Updates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Updates as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String clusterName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, clusterName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List all Updates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Updates as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String clusterName) { + return new PagedIterable<>(listAsync(resourceGroupName, clusterName)); + } + + /** + * List all Updates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Updates as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String clusterName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, clusterName, context)); + } + + /** + * Delete specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 clusterName, String updateName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (updateName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + updateName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 clusterName, String updateName, 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (updateName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateName 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, + clusterName, + updateName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 clusterName, String updateName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName, updateName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 clusterName, String updateName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, clusterName, updateName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 clusterName, String updateName) { + return beginDeleteAsync(resourceGroupName, clusterName, updateName).getSyncPoller(); + } + + /** + * Delete specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 clusterName, String updateName, Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, updateName, context).getSyncPoller(); + } + + /** + * Delete specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 clusterName, String updateName) { + return beginDeleteAsync(resourceGroupName, clusterName, updateName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 clusterName, String updateName, Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, updateName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 clusterName, String updateName) { + deleteAsync(resourceGroupName, clusterName, updateName).block(); + } + + /** + * Delete specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 clusterName, String updateName, Context context) { + deleteAsync(resourceGroupName, clusterName, updateName, context).block(); + } + + /** + * Put specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateProperties Properties of the Updates 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 update details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> putWithResponseAsync( + String resourceGroupName, String clusterName, String updateName, UpdateInner updateProperties) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (updateName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateName is required and cannot be null.")); + } + if (updateProperties == null) { + return Mono + .error(new IllegalArgumentException("Parameter updateProperties is required and cannot be null.")); + } else { + updateProperties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .put( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + updateName, + this.client.getApiVersion(), + updateProperties, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Put specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateProperties Properties of the Updates 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 update details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> putWithResponseAsync( + String resourceGroupName, + String clusterName, + String updateName, + UpdateInner updateProperties, + 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (updateName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateName is required and cannot be null.")); + } + if (updateProperties == null) { + return Mono + .error(new IllegalArgumentException("Parameter updateProperties is required and cannot be null.")); + } else { + updateProperties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .put( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + updateName, + this.client.getApiVersion(), + updateProperties, + accept, + context); + } + + /** + * Put specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateProperties Properties of the Updates 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 update details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono putAsync( + String resourceGroupName, String clusterName, String updateName, UpdateInner updateProperties) { + return putWithResponseAsync(resourceGroupName, clusterName, updateName, updateProperties) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Put specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateProperties Properties of the Updates 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 update details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse( + String resourceGroupName, + String clusterName, + String updateName, + UpdateInner updateProperties, + Context context) { + return putWithResponseAsync(resourceGroupName, clusterName, updateName, updateProperties, context).block(); + } + + /** + * Put specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateProperties Properties of the Updates 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 update details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public UpdateInner put( + String resourceGroupName, String clusterName, String updateName, UpdateInner updateProperties) { + return putWithResponse(resourceGroupName, clusterName, updateName, updateProperties, Context.NONE).getValue(); + } + + /** + * Get specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specified Update along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String clusterName, String updateName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (updateName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + updateName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specified Update along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String clusterName, String updateName, 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (updateName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + updateName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specified Update on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String clusterName, String updateName) { + return getWithResponseAsync(resourceGroupName, clusterName, updateName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specified Update along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String clusterName, String updateName, Context context) { + return getWithResponseAsync(resourceGroupName, clusterName, updateName, context).block(); + } + + /** + * Get specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specified Update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public UpdateInner get(String resourceGroupName, String clusterName, String updateName) { + return getWithResponse(resourceGroupName, clusterName, updateName, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Updates 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/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdatesImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdatesImpl.java new file mode 100644 index 000000000000..986f8386be1c --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdatesImpl.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.azurestackhci.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.azurestackhci.fluent.UpdatesClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.UpdateInner; +import com.azure.resourcemanager.azurestackhci.models.Update; +import com.azure.resourcemanager.azurestackhci.models.Updates; + +public final class UpdatesImpl implements Updates { + private static final ClientLogger LOGGER = new ClientLogger(UpdatesImpl.class); + + private final UpdatesClient innerClient; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + public UpdatesImpl( + UpdatesClient innerClient, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void post(String resourceGroupName, String clusterName, String updateName) { + this.serviceClient().post(resourceGroupName, clusterName, updateName); + } + + public void post(String resourceGroupName, String clusterName, String updateName, Context context) { + this.serviceClient().post(resourceGroupName, clusterName, updateName, context); + } + + public PagedIterable list(String resourceGroupName, String clusterName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, clusterName); + return Utils.mapPage(inner, inner1 -> new UpdateImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String clusterName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, clusterName, context); + return Utils.mapPage(inner, inner1 -> new UpdateImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String clusterName, String updateName) { + this.serviceClient().delete(resourceGroupName, clusterName, updateName); + } + + public void delete(String resourceGroupName, String clusterName, String updateName, Context context) { + this.serviceClient().delete(resourceGroupName, clusterName, updateName, context); + } + + public Response getWithResponse( + String resourceGroupName, String clusterName, String updateName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, clusterName, updateName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new UpdateImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Update get(String resourceGroupName, String clusterName, String updateName) { + UpdateInner inner = this.serviceClient().get(resourceGroupName, clusterName, updateName); + if (inner != null) { + return new UpdateImpl(inner, this.manager()); + } else { + return null; + } + } + + public Update getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String updateName = Utils.getValueFromIdByName(id, "updates"); + if (updateName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'updates'.", id))); + } + return this.getWithResponse(resourceGroupName, clusterName, updateName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String updateName = Utils.getValueFromIdByName(id, "updates"); + if (updateName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'updates'.", id))); + } + return this.getWithResponse(resourceGroupName, clusterName, updateName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String updateName = Utils.getValueFromIdByName(id, "updates"); + if (updateName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'updates'.", id))); + } + this.delete(resourceGroupName, clusterName, updateName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String updateName = Utils.getValueFromIdByName(id, "updates"); + if (updateName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'updates'.", id))); + } + this.delete(resourceGroupName, clusterName, updateName, context); + } + + private UpdatesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } + + public UpdateImpl define(String name) { + return new UpdateImpl(name, this.manager()); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ActionType.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ActionType.java index 2b1410993e7d..9a8ca4ae60a8 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ActionType.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ActionType.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for ActionType. */ +/** Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ public final class ActionType extends ExpandableStringEnum { /** Static value Internal for ActionType. */ public static final ActionType INTERNAL = fromString("Internal"); diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSetting.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSetting.java index db757dbf992a..337f513ded2d 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSetting.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSetting.java @@ -35,7 +35,7 @@ public interface ArcSetting { String type(); /** - * Gets the systemData property: System data of ArcSetting resource. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ @@ -295,22 +295,22 @@ interface WithConnectivityProperties { /** * Generate password for arc settings. * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the response body along with {@link Response}. */ - PasswordCredential generatePassword(); + Response generatePasswordWithResponse(Context context); /** * Generate password for arc settings. * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. + * @return the response. */ - Response generatePasswordWithResponse(Context context); + PasswordCredential generatePassword(); /** * Create Aad identity for arc settings. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSettingAggregateState.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSettingAggregateState.java index b784d7a58be9..0cfd368b8581 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSettingAggregateState.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSettingAggregateState.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for ArcSettingAggregateState. */ +/** Aggregate state of Arc agent across the nodes in this HCI cluster. */ public final class ArcSettingAggregateState extends ExpandableStringEnum { /** Static value NotSpecified for ArcSettingAggregateState. */ public static final ArcSettingAggregateState NOT_SPECIFIED = fromString("NotSpecified"); @@ -55,6 +55,15 @@ public final class ArcSettingAggregateState extends ExpandableStringEnum getWithResponse( + String resourceGroupName, String clusterName, String arcSettingName, Context context); /** * Get ArcSetting resource details of HCI Cluster. @@ -54,14 +56,12 @@ public interface ArcSettings { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return arcSetting resource details of HCI Cluster along with {@link Response}. + * @return arcSetting resource details of HCI Cluster. */ - Response getWithResponse( - String resourceGroupName, String clusterName, String arcSettingName, Context context); + ArcSetting get(String resourceGroupName, String clusterName, String arcSettingName); /** * Delete ArcSetting resource details of HCI Cluster. @@ -94,12 +94,14 @@ Response getWithResponse( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the response body along with {@link Response}. */ - PasswordCredential generatePassword(String resourceGroupName, String clusterName, String arcSettingName); + Response generatePasswordWithResponse( + String resourceGroupName, String clusterName, String arcSettingName, Context context); /** * Generate password for arc settings. @@ -107,14 +109,12 @@ Response getWithResponse( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. + * @return the response. */ - Response generatePasswordWithResponse( - String resourceGroupName, String clusterName, String arcSettingName, Context context); + PasswordCredential generatePassword(String resourceGroupName, String clusterName, String arcSettingName); /** * Create Aad identity for arc settings. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSettingsPatch.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSettingsPatch.java index b9187894e0c5..0d30b01baa88 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSettingsPatch.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSettingsPatch.java @@ -26,6 +26,10 @@ public final class ArcSettingsPatch { @JsonProperty(value = "properties") private ArcSettingsPatchProperties innerProperties; + /** Creates an instance of ArcSettingsPatch class. */ + public ArcSettingsPatch() { + } + /** * Get the tags property: Resource tags. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/AvailabilityType.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/AvailabilityType.java new file mode 100644 index 000000000000..efcc87c95719 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/AvailabilityType.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Indicates the way the update content can be downloaded. */ +public final class AvailabilityType extends ExpandableStringEnum { + /** Static value Local for AvailabilityType. */ + public static final AvailabilityType LOCAL = fromString("Local"); + + /** Static value Online for AvailabilityType. */ + public static final AvailabilityType ONLINE = fromString("Online"); + + /** Static value Notify for AvailabilityType. */ + public static final AvailabilityType NOTIFY = fromString("Notify"); + + /** + * Creates or finds a AvailabilityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AvailabilityType. + */ + @JsonCreator + public static AvailabilityType fromString(String name) { + return fromString(name, AvailabilityType.class); + } + + /** + * Gets known AvailabilityType values. + * + * @return known AvailabilityType values. + */ + public static Collection values() { + return values(AvailabilityType.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Cluster.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Cluster.java index 1bc5810040be..0841f268925b 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Cluster.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Cluster.java @@ -10,6 +10,7 @@ import com.azure.resourcemanager.azurestackhci.fluent.models.ClusterInner; import java.time.OffsetDateTime; import java.util.Map; +import java.util.UUID; /** An immutable client-side representation of Cluster. */ public interface Cluster { @@ -49,12 +50,46 @@ public interface Cluster { Map tags(); /** - * Gets the systemData property: System data of Cluster resource. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ SystemData systemData(); + /** + * Gets the principalId property: The service principal ID of the system assigned identity. This property will only + * be provided for a system assigned identity. + * + * @return the principalId value. + */ + UUID principalId(); + + /** + * Gets the tenantId property: The tenant ID of the system assigned identity. This property will only be provided + * for a system assigned identity. + * + * @return the tenantId value. + */ + UUID tenantId(); + + /** + * Gets the typeIdentityType property: Type of managed service identity (where both SystemAssigned and UserAssigned + * types are allowed). + * + * @return the typeIdentityType value. + */ + ManagedServiceIdentityType typeIdentityType(); + + /** + * Gets the userAssignedIdentities property: The set of user assigned identities associated with the resource. The + * userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + * + * @return the userAssignedIdentities value. + */ + Map userAssignedIdentities(); + /** * Gets the provisioningState property: Provisioning state. * @@ -111,6 +146,13 @@ public interface Cluster { */ String aadServicePrincipalObjectId(); + /** + * Gets the softwareAssuranceProperties property: Software Assurance properties of the cluster. + * + * @return the softwareAssuranceProperties value. + */ + SoftwareAssuranceProperties softwareAssuranceProperties(); + /** * Gets the desiredProperties property: Desired properties of the cluster. * @@ -167,6 +209,13 @@ public interface Cluster { */ String serviceEndpoint(); + /** + * Gets the resourceProviderObjectId property: Object id of RP Service Principal. + * + * @return the resourceProviderObjectId value. + */ + String resourceProviderObjectId(); + /** * Gets the region of the resource. * @@ -241,11 +290,14 @@ interface WithResourceGroup { */ interface WithCreate extends DefinitionStages.WithTags, + DefinitionStages.WithTypeIdentityType, + DefinitionStages.WithUserAssignedIdentities, DefinitionStages.WithCloudManagementEndpoint, DefinitionStages.WithAadClientId, DefinitionStages.WithAadTenantId, DefinitionStages.WithAadApplicationObjectId, DefinitionStages.WithAadServicePrincipalObjectId, + DefinitionStages.WithSoftwareAssuranceProperties, DefinitionStages.WithDesiredProperties { /** * Executes the create request. @@ -272,6 +324,34 @@ interface WithTags { */ WithCreate withTags(Map tags); } + /** The stage of the Cluster definition allowing to specify typeIdentityType. */ + interface WithTypeIdentityType { + /** + * Specifies the typeIdentityType property: Type of managed service identity (where both SystemAssigned and + * UserAssigned types are allowed).. + * + * @param typeIdentityType Type of managed service identity (where both SystemAssigned and UserAssigned + * types are allowed). + * @return the next definition stage. + */ + WithCreate withTypeIdentityType(ManagedServiceIdentityType typeIdentityType); + } + /** The stage of the Cluster definition allowing to specify userAssignedIdentities. */ + interface WithUserAssignedIdentities { + /** + * Specifies the userAssignedIdentities property: The set of user assigned identities associated with the + * resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests.. + * + * @param userAssignedIdentities The set of user assigned identities associated with the resource. The + * userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + * @return the next definition stage. + */ + WithCreate withUserAssignedIdentities(Map userAssignedIdentities); + } /** The stage of the Cluster definition allowing to specify cloudManagementEndpoint. */ interface WithCloudManagementEndpoint { /** @@ -323,6 +403,16 @@ interface WithAadServicePrincipalObjectId { */ WithCreate withAadServicePrincipalObjectId(String aadServicePrincipalObjectId); } + /** The stage of the Cluster definition allowing to specify softwareAssuranceProperties. */ + interface WithSoftwareAssuranceProperties { + /** + * Specifies the softwareAssuranceProperties property: Software Assurance properties of the cluster.. + * + * @param softwareAssuranceProperties Software Assurance properties of the cluster. + * @return the next definition stage. + */ + WithCreate withSoftwareAssuranceProperties(SoftwareAssuranceProperties softwareAssuranceProperties); + } /** The stage of the Cluster definition allowing to specify desiredProperties. */ interface WithDesiredProperties { /** @@ -344,6 +434,8 @@ interface WithDesiredProperties { /** The template for Cluster update. */ interface Update extends UpdateStages.WithTags, + UpdateStages.WithType, + UpdateStages.WithUserAssignedIdentities, UpdateStages.WithCloudManagementEndpoint, UpdateStages.WithAadClientId, UpdateStages.WithAadTenantId, @@ -375,6 +467,34 @@ interface WithTags { */ Update withTags(Map tags); } + /** The stage of the Cluster update allowing to specify type. */ + interface WithType { + /** + * Specifies the type property: Type of managed service identity (where both SystemAssigned and UserAssigned + * types are allowed).. + * + * @param type Type of managed service identity (where both SystemAssigned and UserAssigned types are + * allowed). + * @return the next definition stage. + */ + Update withType(ManagedServiceIdentityType type); + } + /** The stage of the Cluster update allowing to specify userAssignedIdentities. */ + interface WithUserAssignedIdentities { + /** + * Specifies the userAssignedIdentities property: The set of user assigned identities associated with the + * resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests.. + * + * @param userAssignedIdentities The set of user assigned identities associated with the resource. The + * userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + * @return the next definition stage. + */ + Update withUserAssignedIdentities(Map userAssignedIdentities); + } /** The stage of the Cluster update allowing to specify cloudManagementEndpoint. */ interface WithCloudManagementEndpoint { /** @@ -471,4 +591,28 @@ interface WithDesiredProperties { * @return cluster Identity details. */ ClusterIdentityResponse createIdentity(Context context); + + /** + * Extends Software Assurance Benefit to a cluster. + * + * @param softwareAssuranceChangeRequest Software Assurance Change Request Payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster details. + */ + Cluster extendSoftwareAssuranceBenefit(SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest); + + /** + * Extends Software Assurance Benefit to a cluster. + * + * @param softwareAssuranceChangeRequest Software Assurance Change Request Payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster details. + */ + Cluster extendSoftwareAssuranceBenefit( + SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest, Context context); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterDesiredProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterDesiredProperties.java index 6047cd6aac00..5a11f22a5853 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterDesiredProperties.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterDesiredProperties.java @@ -22,6 +22,10 @@ public final class ClusterDesiredProperties { @JsonProperty(value = "diagnosticLevel") private DiagnosticLevel diagnosticLevel; + /** Creates an instance of ClusterDesiredProperties class. */ + public ClusterDesiredProperties() { + } + /** * Get the windowsServerSubscription property: Desired state of Windows Server Subscription. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterList.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterList.java index 0a18e044fdbf..1763a1bb995c 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterList.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterList.java @@ -24,6 +24,10 @@ public final class ClusterList { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; + /** Creates an instance of ClusterList class. */ + public ClusterList() { + } + /** * Get the value property: List of clusters. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterNode.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterNode.java index 1d7a5a571ed4..ea0a5b079dde 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterNode.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterNode.java @@ -28,6 +28,18 @@ public final class ClusterNode { @JsonProperty(value = "windowsServerSubscription", access = JsonProperty.Access.WRITE_ONLY) private WindowsServerSubscription windowsServerSubscription; + /* + * Type of the cluster node hardware. + */ + @JsonProperty(value = "nodeType", access = JsonProperty.Access.WRITE_ONLY) + private ClusterNodeType nodeType; + + /* + * Edge Hardware Center Resource Id + */ + @JsonProperty(value = "EhcResourceId", access = JsonProperty.Access.WRITE_ONLY) + private String ehcResourceId; + /* * Manufacturer of the cluster node hardware. */ @@ -52,6 +64,12 @@ public final class ClusterNode { @JsonProperty(value = "osVersion", access = JsonProperty.Access.WRITE_ONLY) private String osVersion; + /* + * Display version of the operating system running on the cluster node. + */ + @JsonProperty(value = "osDisplayVersion", access = JsonProperty.Access.WRITE_ONLY) + private String osDisplayVersion; + /* * Immutable id of the cluster node. */ @@ -70,6 +88,10 @@ public final class ClusterNode { @JsonProperty(value = "memoryInGiB", access = JsonProperty.Access.WRITE_ONLY) private Float memoryInGiB; + /** Creates an instance of ClusterNode class. */ + public ClusterNode() { + } + /** * Get the name property: Name of the cluster node. * @@ -97,6 +119,24 @@ public WindowsServerSubscription windowsServerSubscription() { return this.windowsServerSubscription; } + /** + * Get the nodeType property: Type of the cluster node hardware. + * + * @return the nodeType value. + */ + public ClusterNodeType nodeType() { + return this.nodeType; + } + + /** + * Get the ehcResourceId property: Edge Hardware Center Resource Id. + * + * @return the ehcResourceId value. + */ + public String ehcResourceId() { + return this.ehcResourceId; + } + /** * Get the manufacturer property: Manufacturer of the cluster node hardware. * @@ -133,6 +173,15 @@ public String osVersion() { return this.osVersion; } + /** + * Get the osDisplayVersion property: Display version of the operating system running on the cluster node. + * + * @return the osDisplayVersion value. + */ + public String osDisplayVersion() { + return this.osDisplayVersion; + } + /** * Get the serialNumber property: Immutable id of the cluster node. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterNodeType.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterNodeType.java new file mode 100644 index 000000000000..07554047c4ee --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterNodeType.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Type of the cluster node hardware. */ +public final class ClusterNodeType extends ExpandableStringEnum { + /** Static value FirstParty for ClusterNodeType. */ + public static final ClusterNodeType FIRST_PARTY = fromString("FirstParty"); + + /** Static value ThirdParty for ClusterNodeType. */ + public static final ClusterNodeType THIRD_PARTY = fromString("ThirdParty"); + + /** + * Creates or finds a ClusterNodeType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ClusterNodeType. + */ + @JsonCreator + public static ClusterNodeType fromString(String name) { + return fromString(name, ClusterNodeType.class); + } + + /** + * Gets known ClusterNodeType values. + * + * @return known ClusterNodeType values. + */ + public static Collection values() { + return values(ClusterNodeType.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterPatch.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterPatch.java index 2004f6129e9f..88ca22d755e0 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterPatch.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterPatch.java @@ -6,9 +6,11 @@ import com.azure.core.annotation.Fluent; import com.azure.resourcemanager.azurestackhci.fluent.models.ClusterPatchProperties; +import com.azure.resourcemanager.azurestackhci.fluent.models.ManagedServiceIdentity; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; +import java.util.UUID; /** Cluster details to update. */ @Fluent @@ -20,12 +22,22 @@ public final class ClusterPatch { @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; + /* + * Identity of Cluster resource + */ + @JsonProperty(value = "identity") + private ManagedServiceIdentity innerIdentity; + /* * Cluster properties. */ @JsonProperty(value = "properties") private ClusterPatchProperties innerProperties; + /** Creates an instance of ClusterPatch class. */ + public ClusterPatch() { + } + /** * Get the tags property: Resource tags. * @@ -46,6 +58,15 @@ public ClusterPatch withTags(Map tags) { return this; } + /** + * Get the innerIdentity property: Identity of Cluster resource. + * + * @return the innerIdentity value. + */ + private ManagedServiceIdentity innerIdentity() { + return this.innerIdentity; + } + /** * Get the innerProperties property: Cluster properties. * @@ -55,6 +76,80 @@ private ClusterPatchProperties innerProperties() { return this.innerProperties; } + /** + * Get the principalId property: The service principal ID of the system assigned identity. This property will only + * be provided for a system assigned identity. + * + * @return the principalId value. + */ + public UUID principalId() { + return this.innerIdentity() == null ? null : this.innerIdentity().principalId(); + } + + /** + * Get the tenantId property: The tenant ID of the system assigned identity. This property will only be provided for + * a system assigned identity. + * + * @return the tenantId value. + */ + public UUID tenantId() { + return this.innerIdentity() == null ? null : this.innerIdentity().tenantId(); + } + + /** + * Get the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are + * allowed). + * + * @return the type value. + */ + public ManagedServiceIdentityType type() { + return this.innerIdentity() == null ? null : this.innerIdentity().type(); + } + + /** + * Set the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are + * allowed). + * + * @param type the type value to set. + * @return the ClusterPatch object itself. + */ + public ClusterPatch withType(ManagedServiceIdentityType type) { + if (this.innerIdentity() == null) { + this.innerIdentity = new ManagedServiceIdentity(); + } + this.innerIdentity().withType(type); + return this; + } + + /** + * Get the userAssignedIdentities property: The set of user assigned identities associated with the resource. The + * userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.innerIdentity() == null ? null : this.innerIdentity().userAssignedIdentities(); + } + + /** + * Set the userAssignedIdentities property: The set of user assigned identities associated with the resource. The + * userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the ClusterPatch object itself. + */ + public ClusterPatch withUserAssignedIdentities(Map userAssignedIdentities) { + if (this.innerIdentity() == null) { + this.innerIdentity = new ManagedServiceIdentity(); + } + this.innerIdentity().withUserAssignedIdentities(userAssignedIdentities); + return this; + } + /** * Get the cloudManagementEndpoint property: Endpoint configured for management from the Azure portal. * @@ -153,6 +248,9 @@ public ClusterPatch withDesiredProperties(ClusterDesiredProperties desiredProper * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (innerIdentity() != null) { + innerIdentity().validate(); + } if (innerProperties() != null) { innerProperties().validate(); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterReportedProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterReportedProperties.java index 4a2d2b7c7895..983c2071d122 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterReportedProperties.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterReportedProperties.java @@ -54,6 +54,16 @@ public final class ClusterReportedProperties { @JsonProperty(value = "diagnosticLevel") private DiagnosticLevel diagnosticLevel; + /* + * Capabilities supported by the cluster. + */ + @JsonProperty(value = "supportedCapabilities", access = JsonProperty.Access.WRITE_ONLY) + private List supportedCapabilities; + + /** Creates an instance of ClusterReportedProperties class. */ + public ClusterReportedProperties() { + } + /** * Get the clusterName property: Name of the on-prem cluster connected to this resource. * @@ -128,6 +138,15 @@ public ClusterReportedProperties withDiagnosticLevel(DiagnosticLevel diagnosticL return this; } + /** + * Get the supportedCapabilities property: Capabilities supported by the cluster. + * + * @return the supportedCapabilities value. + */ + public List supportedCapabilities() { + return this.supportedCapabilities; + } + /** * Validates the instance. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Clusters.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Clusters.java index 989e69c94dfc..2e7865951e97 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Clusters.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Clusters.java @@ -58,25 +58,25 @@ public interface Clusters { * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hCI cluster. + * @return hCI cluster along with {@link Response}. */ - Cluster getByResourceGroup(String resourceGroupName, String clusterName); + Response getByResourceGroupWithResponse(String resourceGroupName, String clusterName, Context context); /** * Get HCI cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hCI cluster along with {@link Response}. + * @return hCI cluster. */ - Response getByResourceGroupWithResponse(String resourceGroupName, String clusterName, Context context); + Cluster getByResourceGroup(String resourceGroupName, String clusterName); /** * Delete an HCI cluster. @@ -156,6 +156,38 @@ void uploadCertificate( */ ClusterIdentityResponse createIdentity(String resourceGroupName, String clusterName, Context context); + /** + * Extends Software Assurance Benefit to a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param softwareAssuranceChangeRequest Software Assurance Change Request Payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster details. + */ + Cluster extendSoftwareAssuranceBenefit( + String resourceGroupName, String clusterName, SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest); + + /** + * Extends Software Assurance Benefit to a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param softwareAssuranceChangeRequest Software Assurance Change Request Payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster details. + */ + Cluster extendSoftwareAssuranceBenefit( + String resourceGroupName, + String clusterName, + SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest, + Context context); + /** * Get HCI cluster. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DiagnosticLevel.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DiagnosticLevel.java index 055016a21b28..6744b640b7b4 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DiagnosticLevel.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DiagnosticLevel.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for DiagnosticLevel. */ +/** Desired level of diagnostic data emitted by the cluster. */ public final class DiagnosticLevel extends ExpandableStringEnum { /** Static value Off for DiagnosticLevel. */ public static final DiagnosticLevel OFF = fromString("Off"); diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Extension.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Extension.java index 6ca8c95e770f..e8b9194f5ea6 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Extension.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Extension.java @@ -33,7 +33,7 @@ public interface Extension { String type(); /** - * Gets the systemData property: System data of Extension resource. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ @@ -112,6 +112,14 @@ public interface Extension { */ Object protectedSettings(); + /** + * Gets the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version available. + * + * @return the enableAutomaticUpgrade value. + */ + Boolean enableAutomaticUpgrade(); + /** * Gets the name of the resource group. * @@ -158,7 +166,8 @@ interface WithCreate DefinitionStages.WithTypeHandlerVersion, DefinitionStages.WithAutoUpgradeMinorVersion, DefinitionStages.WithSettings, - DefinitionStages.WithProtectedSettings { + DefinitionStages.WithProtectedSettings, + DefinitionStages.WithEnableAutomaticUpgrade { /** * Executes the create request. * @@ -251,6 +260,18 @@ interface WithProtectedSettings { */ WithCreate withProtectedSettings(Object protectedSettings); } + /** The stage of the Extension definition allowing to specify enableAutomaticUpgrade. */ + interface WithEnableAutomaticUpgrade { + /** + * Specifies the enableAutomaticUpgrade property: Indicates whether the extension should be automatically + * upgraded by the platform if there is a newer version available.. + * + * @param enableAutomaticUpgrade Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version available. + * @return the next definition stage. + */ + WithCreate withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade); + } } /** * Begins update for the Extension resource. @@ -267,7 +288,8 @@ interface Update UpdateStages.WithTypeHandlerVersion, UpdateStages.WithAutoUpgradeMinorVersion, UpdateStages.WithSettings, - UpdateStages.WithProtectedSettings { + UpdateStages.WithProtectedSettings, + UpdateStages.WithEnableAutomaticUpgrade { /** * Executes the update request. * @@ -362,6 +384,18 @@ interface WithProtectedSettings { */ Update withProtectedSettings(Object protectedSettings); } + /** The stage of the Extension update allowing to specify enableAutomaticUpgrade. */ + interface WithEnableAutomaticUpgrade { + /** + * Specifies the enableAutomaticUpgrade property: Indicates whether the extension should be automatically + * upgraded by the platform if there is a newer version available.. + * + * @param enableAutomaticUpgrade Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version available. + * @return the next definition stage. + */ + Update withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade); + } } /** * Refreshes the resource to sync with Azure. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionAggregateState.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionAggregateState.java index 23c5dfbc409d..2b6aa43f83ac 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionAggregateState.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionAggregateState.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for ExtensionAggregateState. */ +/** Aggregate state of Arc Extensions across the nodes in this HCI cluster. */ public final class ExtensionAggregateState extends ExpandableStringEnum { /** Static value NotSpecified for ExtensionAggregateState. */ public static final ExtensionAggregateState NOT_SPECIFIED = fromString("NotSpecified"); @@ -55,6 +55,12 @@ public final class ExtensionAggregateState extends ExpandableStringEnum listByArcSetting( * @param clusterName The name of the cluster. * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. * @param extensionName The name of the machine extension. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return particular Arc Extension of HCI Cluster. + * @return particular Arc Extension of HCI Cluster along with {@link Response}. */ - Extension get(String resourceGroupName, String clusterName, String arcSettingName, String extensionName); + Response getWithResponse( + String resourceGroupName, String clusterName, String arcSettingName, String extensionName, Context context); /** * Get particular Arc Extension of HCI Cluster. @@ -59,14 +61,12 @@ PagedIterable listByArcSetting( * @param clusterName The name of the cluster. * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. * @param extensionName The name of the machine extension. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return particular Arc Extension of HCI Cluster along with {@link Response}. + * @return particular Arc Extension of HCI Cluster. */ - Response getWithResponse( - String resourceGroupName, String clusterName, String arcSettingName, String extensionName, Context context); + Extension get(String resourceGroupName, String clusterName, String arcSettingName, String extensionName); /** * Delete particular Arc Extension of HCI Cluster. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HealthState.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HealthState.java new file mode 100644 index 000000000000..d7493ba7d458 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HealthState.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for HealthState. */ +public final class HealthState extends ExpandableStringEnum { + /** Static value Unknown for HealthState. */ + public static final HealthState UNKNOWN = fromString("Unknown"); + + /** Static value Success for HealthState. */ + public static final HealthState SUCCESS = fromString("Success"); + + /** Static value Failure for HealthState. */ + public static final HealthState FAILURE = fromString("Failure"); + + /** Static value Warning for HealthState. */ + public static final HealthState WARNING = fromString("Warning"); + + /** Static value Error for HealthState. */ + public static final HealthState ERROR = fromString("Error"); + + /** Static value InProgress for HealthState. */ + public static final HealthState IN_PROGRESS = fromString("InProgress"); + + /** + * Creates or finds a HealthState from its string representation. + * + * @param name a name to look for. + * @return the corresponding HealthState. + */ + @JsonCreator + public static HealthState fromString(String name) { + return fromString(name, HealthState.class); + } + + /** + * Gets known HealthState values. + * + * @return known HealthState values. + */ + public static Collection values() { + return values(HealthState.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ImdsAttestation.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ImdsAttestation.java index c3ca4a6a0bcf..ed88c23b9381 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ImdsAttestation.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ImdsAttestation.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for ImdsAttestation. */ +/** IMDS attestation status of the cluster. */ public final class ImdsAttestation extends ExpandableStringEnum { /** Static value Disabled for ImdsAttestation. */ public static final ImdsAttestation DISABLED = fromString("Disabled"); diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ManagedServiceIdentityType.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ManagedServiceIdentityType.java new file mode 100644 index 000000000000..01424001798a --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ManagedServiceIdentityType.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.azurestackhci.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). */ +public final class ManagedServiceIdentityType extends ExpandableStringEnum { + /** Static value None for ManagedServiceIdentityType. */ + public static final ManagedServiceIdentityType NONE = fromString("None"); + + /** Static value SystemAssigned for ManagedServiceIdentityType. */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** Static value UserAssigned for ManagedServiceIdentityType. */ + public static final ManagedServiceIdentityType USER_ASSIGNED = fromString("UserAssigned"); + + /** Static value SystemAssigned, UserAssigned for ManagedServiceIdentityType. */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED_USER_ASSIGNED = + fromString("SystemAssigned, UserAssigned"); + + /** + * Creates or finds a ManagedServiceIdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedServiceIdentityType. + */ + @JsonCreator + public static ManagedServiceIdentityType fromString(String name) { + return fromString(name, ManagedServiceIdentityType.class); + } + + /** + * Gets known ManagedServiceIdentityType values. + * + * @return known ManagedServiceIdentityType values. + */ + public static Collection values() { + return values(ManagedServiceIdentityType.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NodeArcState.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NodeArcState.java index c4f967773edf..d8eb74f18d3d 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NodeArcState.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NodeArcState.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for NodeArcState. */ +/** State of Arc agent in this node. */ public final class NodeArcState extends ExpandableStringEnum { /** Static value NotSpecified for NodeArcState. */ public static final NodeArcState NOT_SPECIFIED = fromString("NotSpecified"); @@ -46,6 +46,24 @@ public final class NodeArcState extends ExpandableStringEnum { /** Static value Moving for NodeArcState. */ public static final NodeArcState MOVING = fromString("Moving"); + /** Static value PartiallySucceeded for NodeArcState. */ + public static final NodeArcState PARTIALLY_SUCCEEDED = fromString("PartiallySucceeded"); + + /** Static value PartiallyConnected for NodeArcState. */ + public static final NodeArcState PARTIALLY_CONNECTED = fromString("PartiallyConnected"); + + /** Static value InProgress for NodeArcState. */ + public static final NodeArcState IN_PROGRESS = fromString("InProgress"); + + /** Static value Accepted for NodeArcState. */ + public static final NodeArcState ACCEPTED = fromString("Accepted"); + + /** Static value Provisioning for NodeArcState. */ + public static final NodeArcState PROVISIONING = fromString("Provisioning"); + + /** Static value DisableInProgress for NodeArcState. */ + public static final NodeArcState DISABLE_IN_PROGRESS = fromString("DisableInProgress"); + /** * Creates or finds a NodeArcState from its string representation. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NodeExtensionState.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NodeExtensionState.java index c3394d36855f..979fa472a16b 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NodeExtensionState.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NodeExtensionState.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for NodeExtensionState. */ +/** State of Arc Extension in this node. */ public final class NodeExtensionState extends ExpandableStringEnum { /** Static value NotSpecified for NodeExtensionState. */ public static final NodeExtensionState NOT_SPECIFIED = fromString("NotSpecified"); @@ -46,6 +46,21 @@ public final class NodeExtensionState extends ExpandableStringEnum skuMappings(); + + /** + * Gets the inner com.azure.resourcemanager.azurestackhci.fluent.models.OfferInner object. + * + * @return the inner object. + */ + OfferInner innerModel(); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OfferList.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OfferList.java new file mode 100644 index 000000000000..df7f18b491a8 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OfferList.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.azurestackhci.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.azurestackhci.fluent.models.OfferInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of Offer proxy resources for the HCI cluster. */ +@Immutable +public final class OfferList { + /* + * List of Offer proxy resources. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Link to the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** Creates an instance of OfferList class. */ + public OfferList() { + } + + /** + * Get the value property: List of Offer proxy resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Link to the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Offers.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Offers.java new file mode 100644 index 000000000000..05a0069a5c84 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Offers.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.azurestackhci.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 Offers. */ +public interface Offers { + /** + * List Offers available for a publisher within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Offer proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + PagedIterable listByPublisher(String resourceGroupName, String clusterName, String publisherName); + + /** + * List Offers available for a publisher within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Offer proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + PagedIterable listByPublisher( + String resourceGroupName, String clusterName, String publisherName, String expand, Context context); + + /** + * List Offers available across publishers for the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Offer proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + PagedIterable listByCluster(String resourceGroupName, String clusterName); + + /** + * List Offers available across publishers for the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Offer proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + PagedIterable listByCluster(String resourceGroupName, String clusterName, String expand, Context context); + + /** + * Get Offer resource details within a publisher of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return offer resource details within a publisher of HCI Cluster along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, + String clusterName, + String publisherName, + String offerName, + String expand, + Context context); + + /** + * Get Offer resource details within a publisher of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return offer resource details within a publisher of HCI Cluster. + */ + Offer get(String resourceGroupName, String clusterName, String publisherName, String offerName); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Operation.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Operation.java index 8a8c66e2aafe..2edd1d043c05 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Operation.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Operation.java @@ -7,20 +7,23 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** REST API Operation Details of a REST API operation, returned from the Resource Provider Operations API. */ +/** + * REST API Operation + * + *

Details of a REST API operation, returned from the Resource Provider Operations API. + */ @Fluent public final class Operation { /* - * The name of the operation, as per Resource-Based Access Control (RBAC). - * Examples: "Microsoft.Compute/virtualMachines/write", - * "Microsoft.Compute/virtualMachines/capture/action" + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" */ @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) private String name; /* - * Whether the operation applies to data-plane. This is "true" for - * data-plane operations and "false" for ARM/control-plane operations. + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for + * ARM/control-plane operations. */ @JsonProperty(value = "isDataAction", access = JsonProperty.Access.WRITE_ONLY) private Boolean isDataAction; @@ -32,19 +35,22 @@ public final class Operation { private OperationDisplay display; /* - * The intended executor of the operation; as in Resource Based Access - * Control (RBAC) and audit logs UX. Default value is "user,system" + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default + * value is "user,system" */ @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) private Origin origin; /* - * Enum. Indicates the action type. "Internal" refers to actions that are - * for internal only APIs. + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ @JsonProperty(value = "actionType", access = JsonProperty.Access.WRITE_ONLY) private ActionType actionType; + /** Creates an instance of Operation class. */ + public Operation() { + } + /** * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OperationDisplay.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OperationDisplay.java index 75a95b413ce4..2d240728b7e4 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OperationDisplay.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OperationDisplay.java @@ -11,34 +11,36 @@ @Immutable public final class OperationDisplay { /* - * The localized friendly form of the resource provider name, e.g. - * "Microsoft Monitoring Insights" or "Microsoft Compute". + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft + * Compute". */ @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) private String provider; /* - * The localized friendly name of the resource type related to this - * operation. E.g. "Virtual Machines" or "Job Schedule Collections". + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job + * Schedule Collections". */ @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) private String resource; /* - * The concise, localized friendly name for the operation; suitable for - * dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual - * Machine". + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual + * Machine", "Restart Virtual Machine". */ @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) private String operation; /* - * The short, localized friendly description of the operation; suitable for - * tool tips and detailed views. + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. */ @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) private String description; + /** Creates an instance of OperationDisplay class. */ + public OperationDisplay() { + } + /** * Get the provider property: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring * Insights" or "Microsoft Compute". diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Operations.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Operations.java index 570a7f0abbd4..a2b004c68e7d 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Operations.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Operations.java @@ -12,20 +12,20 @@ public interface Operations { /** * List all available Microsoft.AzureStackHCI provider operations. * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link Response}. */ - OperationListResult list(); + Response listWithResponse(Context context); /** * List all available Microsoft.AzureStackHCI provider operations. * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider along with {@link Response}. + * @return a list of REST API operations supported by an Azure Resource Provider. */ - Response listWithResponse(Context context); + OperationListResult list(); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Origin.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Origin.java index 5eb928fb9ec9..5fba491c43c0 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Origin.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Origin.java @@ -8,7 +8,10 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for Origin. */ +/** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value + * is "user,system". + */ public final class Origin extends ExpandableStringEnum { /** Static value user for Origin. */ public static final Origin USER = fromString("user"); diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PackageVersionInfo.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PackageVersionInfo.java new file mode 100644 index 000000000000..e110cff3201a --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PackageVersionInfo.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.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Current version of each updatable component. */ +@Fluent +public final class PackageVersionInfo { + /* + * Package type + */ + @JsonProperty(value = "packageType") + private String packageType; + + /* + * Package version + */ + @JsonProperty(value = "version") + private String version; + + /* + * Last time this component was updated. + */ + @JsonProperty(value = "lastUpdated") + private OffsetDateTime lastUpdated; + + /** Creates an instance of PackageVersionInfo class. */ + public PackageVersionInfo() { + } + + /** + * Get the packageType property: Package type. + * + * @return the packageType value. + */ + public String packageType() { + return this.packageType; + } + + /** + * Set the packageType property: Package type. + * + * @param packageType the packageType value to set. + * @return the PackageVersionInfo object itself. + */ + public PackageVersionInfo withPackageType(String packageType) { + this.packageType = packageType; + return this; + } + + /** + * Get the version property: Package version. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: Package version. + * + * @param version the version value to set. + * @return the PackageVersionInfo object itself. + */ + public PackageVersionInfo withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get the lastUpdated property: Last time this component was updated. + * + * @return the lastUpdated value. + */ + public OffsetDateTime lastUpdated() { + return this.lastUpdated; + } + + /** + * Set the lastUpdated property: Last time this component was updated. + * + * @param lastUpdated the lastUpdated value to set. + * @return the PackageVersionInfo object itself. + */ + public PackageVersionInfo withLastUpdated(OffsetDateTime lastUpdated) { + this.lastUpdated = lastUpdated; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PerNodeExtensionState.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PerNodeExtensionState.java index 54a16e384b67..77d9ab7e7b13 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PerNodeExtensionState.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PerNodeExtensionState.java @@ -17,8 +17,7 @@ public final class PerNodeExtensionState { private String name; /* - * Fully qualified resource ID for the particular Arc Extension on this - * node. + * Fully qualified resource ID for the particular Arc Extension on this node. */ @JsonProperty(value = "extension", access = JsonProperty.Access.WRITE_ONLY) private String extension; @@ -29,6 +28,10 @@ public final class PerNodeExtensionState { @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) private NodeExtensionState state; + /** Creates an instance of PerNodeExtensionState class. */ + public PerNodeExtensionState() { + } + /** * Get the name property: Name of the node in HCI Cluster. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PerNodeState.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PerNodeState.java index 9dad6d8d94a0..e13cca3e814f 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PerNodeState.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PerNodeState.java @@ -28,6 +28,10 @@ public final class PerNodeState { @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) private NodeArcState state; + /** Creates an instance of PerNodeState class. */ + public PerNodeState() { + } + /** * Get the name property: Name of the Node in HCI Cluster. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PrecheckResult.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PrecheckResult.java new file mode 100644 index 000000000000..74768e436be0 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PrecheckResult.java @@ -0,0 +1,350 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The PrecheckResult model. */ +@Fluent +public final class PrecheckResult { + /* + * Name of the individual test/rule/alert that was executed. Unique, not exposed to the customer. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Key-value pairs that allow grouping/filtering individual tests. + */ + @JsonProperty(value = "tags") + private PrecheckResultTags tags; + + /* + * User-facing name; one or more sentences indicating the direct issue. + */ + @JsonProperty(value = "title") + private String title; + + /* + * The status of the check running (i.e. Failed, Succeeded, In Progress). This answers whether the check ran, and + * passed or failed. + */ + @JsonProperty(value = "status") + private Status status; + + /* + * Severity of the result (Critical, Warning, Informational, Hidden). This answers how important the result is. + * Critical is the only update-blocking severity. + */ + @JsonProperty(value = "severity") + private Severity severity; + + /* + * Detailed overview of the issue and what impact the issue has on the stamp. + */ + @JsonProperty(value = "description") + private String description; + + /* + * Set of steps that can be taken to resolve the issue found. + */ + @JsonProperty(value = "remediation") + private String remediation; + + /* + * The unique identifier for the affected resource (such as a node or drive). + */ + @JsonProperty(value = "targetResourceID") + private String targetResourceId; + + /* + * The name of the affected resource. + */ + @JsonProperty(value = "targetResourceName") + private String targetResourceName; + + /* + * The Time in which the HealthCheck was called. + */ + @JsonProperty(value = "timestamp") + private OffsetDateTime timestamp; + + /* + * Property bag of key value pairs for additional information. + */ + @JsonProperty(value = "additionalData") + private String additionalData; + + /* + * The name of the services called for the HealthCheck (I.E. Test-AzureStack, Test-Cluster). + */ + @JsonProperty(value = "healthCheckSource") + private String healthCheckSource; + + /** Creates an instance of PrecheckResult class. */ + public PrecheckResult() { + } + + /** + * Get the name property: Name of the individual test/rule/alert that was executed. Unique, not exposed to the + * customer. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the individual test/rule/alert that was executed. Unique, not exposed to the + * customer. + * + * @param name the name value to set. + * @return the PrecheckResult object itself. + */ + public PrecheckResult withName(String name) { + this.name = name; + return this; + } + + /** + * Get the tags property: Key-value pairs that allow grouping/filtering individual tests. + * + * @return the tags value. + */ + public PrecheckResultTags tags() { + return this.tags; + } + + /** + * Set the tags property: Key-value pairs that allow grouping/filtering individual tests. + * + * @param tags the tags value to set. + * @return the PrecheckResult object itself. + */ + public PrecheckResult withTags(PrecheckResultTags tags) { + this.tags = tags; + return this; + } + + /** + * Get the title property: User-facing name; one or more sentences indicating the direct issue. + * + * @return the title value. + */ + public String title() { + return this.title; + } + + /** + * Set the title property: User-facing name; one or more sentences indicating the direct issue. + * + * @param title the title value to set. + * @return the PrecheckResult object itself. + */ + public PrecheckResult withTitle(String title) { + this.title = title; + return this; + } + + /** + * Get the status property: The status of the check running (i.e. Failed, Succeeded, In Progress). This answers + * whether the check ran, and passed or failed. + * + * @return the status value. + */ + public Status status() { + return this.status; + } + + /** + * Set the status property: The status of the check running (i.e. Failed, Succeeded, In Progress). This answers + * whether the check ran, and passed or failed. + * + * @param status the status value to set. + * @return the PrecheckResult object itself. + */ + public PrecheckResult withStatus(Status status) { + this.status = status; + return this; + } + + /** + * Get the severity property: Severity of the result (Critical, Warning, Informational, Hidden). This answers how + * important the result is. Critical is the only update-blocking severity. + * + * @return the severity value. + */ + public Severity severity() { + return this.severity; + } + + /** + * Set the severity property: Severity of the result (Critical, Warning, Informational, Hidden). This answers how + * important the result is. Critical is the only update-blocking severity. + * + * @param severity the severity value to set. + * @return the PrecheckResult object itself. + */ + public PrecheckResult withSeverity(Severity severity) { + this.severity = severity; + return this; + } + + /** + * Get the description property: Detailed overview of the issue and what impact the issue has on the stamp. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Detailed overview of the issue and what impact the issue has on the stamp. + * + * @param description the description value to set. + * @return the PrecheckResult object itself. + */ + public PrecheckResult withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the remediation property: Set of steps that can be taken to resolve the issue found. + * + * @return the remediation value. + */ + public String remediation() { + return this.remediation; + } + + /** + * Set the remediation property: Set of steps that can be taken to resolve the issue found. + * + * @param remediation the remediation value to set. + * @return the PrecheckResult object itself. + */ + public PrecheckResult withRemediation(String remediation) { + this.remediation = remediation; + return this; + } + + /** + * Get the targetResourceId property: The unique identifier for the affected resource (such as a node or drive). + * + * @return the targetResourceId value. + */ + public String targetResourceId() { + return this.targetResourceId; + } + + /** + * Set the targetResourceId property: The unique identifier for the affected resource (such as a node or drive). + * + * @param targetResourceId the targetResourceId value to set. + * @return the PrecheckResult object itself. + */ + public PrecheckResult withTargetResourceId(String targetResourceId) { + this.targetResourceId = targetResourceId; + return this; + } + + /** + * Get the targetResourceName property: The name of the affected resource. + * + * @return the targetResourceName value. + */ + public String targetResourceName() { + return this.targetResourceName; + } + + /** + * Set the targetResourceName property: The name of the affected resource. + * + * @param targetResourceName the targetResourceName value to set. + * @return the PrecheckResult object itself. + */ + public PrecheckResult withTargetResourceName(String targetResourceName) { + this.targetResourceName = targetResourceName; + return this; + } + + /** + * Get the timestamp property: The Time in which the HealthCheck was called. + * + * @return the timestamp value. + */ + public OffsetDateTime timestamp() { + return this.timestamp; + } + + /** + * Set the timestamp property: The Time in which the HealthCheck was called. + * + * @param timestamp the timestamp value to set. + * @return the PrecheckResult object itself. + */ + public PrecheckResult withTimestamp(OffsetDateTime timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Get the additionalData property: Property bag of key value pairs for additional information. + * + * @return the additionalData value. + */ + public String additionalData() { + return this.additionalData; + } + + /** + * Set the additionalData property: Property bag of key value pairs for additional information. + * + * @param additionalData the additionalData value to set. + * @return the PrecheckResult object itself. + */ + public PrecheckResult withAdditionalData(String additionalData) { + this.additionalData = additionalData; + return this; + } + + /** + * Get the healthCheckSource property: The name of the services called for the HealthCheck (I.E. Test-AzureStack, + * Test-Cluster). + * + * @return the healthCheckSource value. + */ + public String healthCheckSource() { + return this.healthCheckSource; + } + + /** + * Set the healthCheckSource property: The name of the services called for the HealthCheck (I.E. Test-AzureStack, + * Test-Cluster). + * + * @param healthCheckSource the healthCheckSource value to set. + * @return the PrecheckResult object itself. + */ + public PrecheckResult withHealthCheckSource(String healthCheckSource) { + this.healthCheckSource = healthCheckSource; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tags() != null) { + tags().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PrecheckResultTags.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PrecheckResultTags.java new file mode 100644 index 000000000000..d4e1493a0b9c --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PrecheckResultTags.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.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Key-value pairs that allow grouping/filtering individual tests. */ +@Fluent +public final class PrecheckResultTags { + /* + * Key that allow grouping/filtering individual tests. + */ + @JsonProperty(value = "key") + private String key; + + /* + * Value of the key that allow grouping/filtering individual tests. + */ + @JsonProperty(value = "value") + private String value; + + /** Creates an instance of PrecheckResultTags class. */ + public PrecheckResultTags() { + } + + /** + * Get the key property: Key that allow grouping/filtering individual tests. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: Key that allow grouping/filtering individual tests. + * + * @param key the key value to set. + * @return the PrecheckResultTags object itself. + */ + public PrecheckResultTags withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: Value of the key that allow grouping/filtering individual tests. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Value of the key that allow grouping/filtering individual tests. + * + * @param value the value value to set. + * @return the PrecheckResultTags object itself. + */ + public PrecheckResultTags withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ProvisioningState.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ProvisioningState.java index 117f3584ed15..4cbcab5619ed 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ProvisioningState.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ProvisioningState.java @@ -8,8 +8,14 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for ProvisioningState. */ +/** Provisioning state of the ArcSetting proxy resource. */ public final class ProvisioningState extends ExpandableStringEnum { + /** Static value NotSpecified for ProvisioningState. */ + public static final ProvisioningState NOT_SPECIFIED = fromString("NotSpecified"); + + /** Static value Error for ProvisioningState. */ + public static final ProvisioningState ERROR = fromString("Error"); + /** Static value Succeeded for ProvisioningState. */ public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); @@ -19,12 +25,45 @@ public final class ProvisioningState extends ExpandableStringEnum value; + + /* + * Link to the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** Creates an instance of PublisherList class. */ + public PublisherList() { + } + + /** + * Get the value property: List of Publisher proxy resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Link to the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Publishers.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Publishers.java new file mode 100644 index 000000000000..65eddd19fb09 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Publishers.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.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 Publishers. */ +public interface Publishers { + /** + * List Publishers available for the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Publisher proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + PagedIterable listByCluster(String resourceGroupName, String clusterName); + + /** + * List Publishers available for the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Publisher proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + PagedIterable listByCluster(String resourceGroupName, String clusterName, Context context); + + /** + * Get Publisher resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher resource details of HCI Cluster along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String clusterName, String publisherName, Context context); + + /** + * Get Publisher resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher resource details of HCI Cluster. + */ + Publisher get(String resourceGroupName, String clusterName, String publisherName); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/RawCertificateData.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/RawCertificateData.java index 5cb214a9d881..53bf8ca189b0 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/RawCertificateData.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/RawCertificateData.java @@ -17,6 +17,10 @@ public final class RawCertificateData { @JsonProperty(value = "certificates") private List certificates; + /** Creates an instance of RawCertificateData class. */ + public RawCertificateData() { + } + /** * Get the certificates property: The certificates property. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/RebootRequirement.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/RebootRequirement.java new file mode 100644 index 000000000000..c05b7d04bcf0 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/RebootRequirement.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RebootRequirement. */ +public final class RebootRequirement extends ExpandableStringEnum { + /** Static value Unknown for RebootRequirement. */ + public static final RebootRequirement UNKNOWN = fromString("Unknown"); + + /** Static value True for RebootRequirement. */ + public static final RebootRequirement TRUE = fromString("True"); + + /** Static value False for RebootRequirement. */ + public static final RebootRequirement FALSE = fromString("False"); + + /** + * Creates or finds a RebootRequirement from its string representation. + * + * @param name a name to look for. + * @return the corresponding RebootRequirement. + */ + @JsonCreator + public static RebootRequirement fromString(String name) { + return fromString(name, RebootRequirement.class); + } + + /** + * Gets known RebootRequirement values. + * + * @return known RebootRequirement values. + */ + public static Collection values() { + return values(RebootRequirement.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Severity.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Severity.java new file mode 100644 index 000000000000..2b52bbe93d27 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Severity.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.azurestackhci.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Severity of the result (Critical, Warning, Informational, Hidden). This answers how important the result is. Critical + * is the only update-blocking severity. + */ +public final class Severity extends ExpandableStringEnum { + /** Static value Critical for Severity. */ + public static final Severity CRITICAL = fromString("Critical"); + + /** Static value Warning for Severity. */ + public static final Severity WARNING = fromString("Warning"); + + /** Static value Informational for Severity. */ + public static final Severity INFORMATIONAL = fromString("Informational"); + + /** Static value Hidden for Severity. */ + public static final Severity HIDDEN = fromString("Hidden"); + + /** + * Creates or finds a Severity from its string representation. + * + * @param name a name to look for. + * @return the corresponding Severity. + */ + @JsonCreator + public static Severity fromString(String name) { + return fromString(name, Severity.class); + } + + /** + * Gets known Severity values. + * + * @return known Severity values. + */ + public static Collection values() { + return values(Severity.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Sku.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Sku.java new file mode 100644 index 000000000000..7e2ee240de5f --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Sku.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.azurestackhci.fluent.models.SkuInner; +import java.util.List; + +/** An immutable client-side representation of Sku. */ +public interface Sku { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: Provisioning State. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the publisherId property: Identifier of the Publisher for the offer. + * + * @return the publisherId value. + */ + String publisherId(); + + /** + * Gets the offerId property: Identifier of the Offer for the sku. + * + * @return the offerId value. + */ + String offerId(); + + /** + * Gets the content property: JSON serialized catalog content of the sku offer. + * + * @return the content value. + */ + String content(); + + /** + * Gets the contentVersion property: The API version of the catalog service used to serve the catalog content. + * + * @return the contentVersion value. + */ + String contentVersion(); + + /** + * Gets the skuMappings property: Array of SKU mappings. + * + * @return the skuMappings value. + */ + List skuMappings(); + + /** + * Gets the inner com.azure.resourcemanager.azurestackhci.fluent.models.SkuInner object. + * + * @return the inner object. + */ + SkuInner innerModel(); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SkuList.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SkuList.java new file mode 100644 index 000000000000..f1bcc39b5467 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SkuList.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.azurestackhci.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.azurestackhci.fluent.models.SkuInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of SKU proxy resources for the HCI cluster. */ +@Immutable +public final class SkuList { + /* + * List of SKU proxy resources. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Link to the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** Creates an instance of SkuList class. */ + public SkuList() { + } + + /** + * Get the value property: List of SKU proxy resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Link to the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SkuMappings.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SkuMappings.java new file mode 100644 index 000000000000..cc5f7f6ab613 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SkuMappings.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.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** SKU Mapping details. */ +@Fluent +public final class SkuMappings { + /* + * Identifier of the CatalogPlan for the sku + */ + @JsonProperty(value = "catalogPlanId") + private String catalogPlanId; + + /* + * Identifier for the sku + */ + @JsonProperty(value = "marketplaceSkuId") + private String marketplaceSkuId; + + /* + * Array of SKU versions available + */ + @JsonProperty(value = "marketplaceSkuVersions") + private List marketplaceSkuVersions; + + /** Creates an instance of SkuMappings class. */ + public SkuMappings() { + } + + /** + * Get the catalogPlanId property: Identifier of the CatalogPlan for the sku. + * + * @return the catalogPlanId value. + */ + public String catalogPlanId() { + return this.catalogPlanId; + } + + /** + * Set the catalogPlanId property: Identifier of the CatalogPlan for the sku. + * + * @param catalogPlanId the catalogPlanId value to set. + * @return the SkuMappings object itself. + */ + public SkuMappings withCatalogPlanId(String catalogPlanId) { + this.catalogPlanId = catalogPlanId; + return this; + } + + /** + * Get the marketplaceSkuId property: Identifier for the sku. + * + * @return the marketplaceSkuId value. + */ + public String marketplaceSkuId() { + return this.marketplaceSkuId; + } + + /** + * Set the marketplaceSkuId property: Identifier for the sku. + * + * @param marketplaceSkuId the marketplaceSkuId value to set. + * @return the SkuMappings object itself. + */ + public SkuMappings withMarketplaceSkuId(String marketplaceSkuId) { + this.marketplaceSkuId = marketplaceSkuId; + return this; + } + + /** + * Get the marketplaceSkuVersions property: Array of SKU versions available. + * + * @return the marketplaceSkuVersions value. + */ + public List marketplaceSkuVersions() { + return this.marketplaceSkuVersions; + } + + /** + * Set the marketplaceSkuVersions property: Array of SKU versions available. + * + * @param marketplaceSkuVersions the marketplaceSkuVersions value to set. + * @return the SkuMappings object itself. + */ + public SkuMappings withMarketplaceSkuVersions(List marketplaceSkuVersions) { + this.marketplaceSkuVersions = marketplaceSkuVersions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Skus.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Skus.java new file mode 100644 index 000000000000..35f403e506b3 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Skus.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.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 Skus. */ +public interface Skus { + /** + * List Skus available for a offer within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SKU proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + PagedIterable listByOffer( + String resourceGroupName, String clusterName, String publisherName, String offerName); + + /** + * List Skus available for a offer within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SKU proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + PagedIterable listByOffer( + String resourceGroupName, + String clusterName, + String publisherName, + String offerName, + String expand, + Context context); + + /** + * Get SKU resource details within a offer of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @param skuName The name of the SKU available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sKU resource details within a offer of HCI Cluster along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, + String clusterName, + String publisherName, + String offerName, + String skuName, + String expand, + Context context); + + /** + * Get SKU resource details within a offer of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @param skuName The name of the SKU available within HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sKU resource details within a offer of HCI Cluster. + */ + Sku get(String resourceGroupName, String clusterName, String publisherName, String offerName, String skuName); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SoftwareAssuranceChangeRequest.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SoftwareAssuranceChangeRequest.java new file mode 100644 index 000000000000..023ac5e109bd --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SoftwareAssuranceChangeRequest.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.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SoftwareAssuranceChangeRequest model. */ +@Fluent +public final class SoftwareAssuranceChangeRequest { + /* + * The properties property. + */ + @JsonProperty(value = "properties") + private SoftwareAssuranceChangeRequestProperties properties; + + /** Creates an instance of SoftwareAssuranceChangeRequest class. */ + public SoftwareAssuranceChangeRequest() { + } + + /** + * Get the properties property: The properties property. + * + * @return the properties value. + */ + public SoftwareAssuranceChangeRequestProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The properties property. + * + * @param properties the properties value to set. + * @return the SoftwareAssuranceChangeRequest object itself. + */ + public SoftwareAssuranceChangeRequest withProperties(SoftwareAssuranceChangeRequestProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SoftwareAssuranceChangeRequestProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SoftwareAssuranceChangeRequestProperties.java new file mode 100644 index 000000000000..b3a97aa0b74b --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SoftwareAssuranceChangeRequestProperties.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.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SoftwareAssuranceChangeRequestProperties model. */ +@Fluent +public final class SoftwareAssuranceChangeRequestProperties { + /* + * Customer Intent for Software Assurance Benefit. + */ + @JsonProperty(value = "softwareAssuranceIntent") + private SoftwareAssuranceIntent softwareAssuranceIntent; + + /** Creates an instance of SoftwareAssuranceChangeRequestProperties class. */ + public SoftwareAssuranceChangeRequestProperties() { + } + + /** + * Get the softwareAssuranceIntent property: Customer Intent for Software Assurance Benefit. + * + * @return the softwareAssuranceIntent value. + */ + public SoftwareAssuranceIntent softwareAssuranceIntent() { + return this.softwareAssuranceIntent; + } + + /** + * Set the softwareAssuranceIntent property: Customer Intent for Software Assurance Benefit. + * + * @param softwareAssuranceIntent the softwareAssuranceIntent value to set. + * @return the SoftwareAssuranceChangeRequestProperties object itself. + */ + public SoftwareAssuranceChangeRequestProperties withSoftwareAssuranceIntent( + SoftwareAssuranceIntent softwareAssuranceIntent) { + this.softwareAssuranceIntent = softwareAssuranceIntent; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SoftwareAssuranceIntent.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SoftwareAssuranceIntent.java new file mode 100644 index 000000000000..1a0a08e94146 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SoftwareAssuranceIntent.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Customer Intent for Software Assurance Benefit. */ +public final class SoftwareAssuranceIntent extends ExpandableStringEnum { + /** Static value Enable for SoftwareAssuranceIntent. */ + public static final SoftwareAssuranceIntent ENABLE = fromString("Enable"); + + /** Static value Disable for SoftwareAssuranceIntent. */ + public static final SoftwareAssuranceIntent DISABLE = fromString("Disable"); + + /** + * Creates or finds a SoftwareAssuranceIntent from its string representation. + * + * @param name a name to look for. + * @return the corresponding SoftwareAssuranceIntent. + */ + @JsonCreator + public static SoftwareAssuranceIntent fromString(String name) { + return fromString(name, SoftwareAssuranceIntent.class); + } + + /** + * Gets known SoftwareAssuranceIntent values. + * + * @return known SoftwareAssuranceIntent values. + */ + public static Collection values() { + return values(SoftwareAssuranceIntent.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SoftwareAssuranceProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SoftwareAssuranceProperties.java new file mode 100644 index 000000000000..f54dcebae145 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SoftwareAssuranceProperties.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.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Software Assurance properties of the cluster. */ +@Fluent +public final class SoftwareAssuranceProperties { + /* + * Status of the Software Assurance for the cluster. + */ + @JsonProperty(value = "softwareAssuranceStatus") + private SoftwareAssuranceStatus softwareAssuranceStatus; + + /* + * Customer Intent for Software Assurance Benefit. + */ + @JsonProperty(value = "softwareAssuranceIntent") + private SoftwareAssuranceIntent softwareAssuranceIntent; + + /* + * TimeStamp denoting the latest SA benefit applicability is validated. + */ + @JsonProperty(value = "lastUpdated", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastUpdated; + + /** Creates an instance of SoftwareAssuranceProperties class. */ + public SoftwareAssuranceProperties() { + } + + /** + * Get the softwareAssuranceStatus property: Status of the Software Assurance for the cluster. + * + * @return the softwareAssuranceStatus value. + */ + public SoftwareAssuranceStatus softwareAssuranceStatus() { + return this.softwareAssuranceStatus; + } + + /** + * Set the softwareAssuranceStatus property: Status of the Software Assurance for the cluster. + * + * @param softwareAssuranceStatus the softwareAssuranceStatus value to set. + * @return the SoftwareAssuranceProperties object itself. + */ + public SoftwareAssuranceProperties withSoftwareAssuranceStatus(SoftwareAssuranceStatus softwareAssuranceStatus) { + this.softwareAssuranceStatus = softwareAssuranceStatus; + return this; + } + + /** + * Get the softwareAssuranceIntent property: Customer Intent for Software Assurance Benefit. + * + * @return the softwareAssuranceIntent value. + */ + public SoftwareAssuranceIntent softwareAssuranceIntent() { + return this.softwareAssuranceIntent; + } + + /** + * Set the softwareAssuranceIntent property: Customer Intent for Software Assurance Benefit. + * + * @param softwareAssuranceIntent the softwareAssuranceIntent value to set. + * @return the SoftwareAssuranceProperties object itself. + */ + public SoftwareAssuranceProperties withSoftwareAssuranceIntent(SoftwareAssuranceIntent softwareAssuranceIntent) { + this.softwareAssuranceIntent = softwareAssuranceIntent; + return this; + } + + /** + * Get the lastUpdated property: TimeStamp denoting the latest SA benefit applicability is validated. + * + * @return the lastUpdated value. + */ + public OffsetDateTime lastUpdated() { + return this.lastUpdated; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SoftwareAssuranceStatus.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SoftwareAssuranceStatus.java new file mode 100644 index 000000000000..b7e0e8bc7fb0 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SoftwareAssuranceStatus.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Status of the Software Assurance for the cluster. */ +public final class SoftwareAssuranceStatus extends ExpandableStringEnum { + /** Static value Enabled for SoftwareAssuranceStatus. */ + public static final SoftwareAssuranceStatus ENABLED = fromString("Enabled"); + + /** Static value Disabled for SoftwareAssuranceStatus. */ + public static final SoftwareAssuranceStatus DISABLED = fromString("Disabled"); + + /** + * Creates or finds a SoftwareAssuranceStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding SoftwareAssuranceStatus. + */ + @JsonCreator + public static SoftwareAssuranceStatus fromString(String name) { + return fromString(name, SoftwareAssuranceStatus.class); + } + + /** + * Gets known SoftwareAssuranceStatus values. + * + * @return known SoftwareAssuranceStatus values. + */ + public static Collection values() { + return values(SoftwareAssuranceStatus.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/State.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/State.java new file mode 100644 index 000000000000..61835855e277 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/State.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.azurestackhci.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** State of the update as it relates to this stamp. */ +public final class State extends ExpandableStringEnum { + /** Static value HasPrerequisite for State. */ + public static final State HAS_PREREQUISITE = fromString("HasPrerequisite"); + + /** Static value Obsolete for State. */ + public static final State OBSOLETE = fromString("Obsolete"); + + /** Static value Ready for State. */ + public static final State READY = fromString("Ready"); + + /** Static value NotApplicableBecauseAnotherUpdateIsInProgress for State. */ + public static final State NOT_APPLICABLE_BECAUSE_ANOTHER_UPDATE_IS_IN_PROGRESS = + fromString("NotApplicableBecauseAnotherUpdateIsInProgress"); + + /** Static value Preparing for State. */ + public static final State PREPARING = fromString("Preparing"); + + /** Static value Installing for State. */ + public static final State INSTALLING = fromString("Installing"); + + /** Static value Installed for State. */ + public static final State INSTALLED = fromString("Installed"); + + /** Static value PreparationFailed for State. */ + public static final State PREPARATION_FAILED = fromString("PreparationFailed"); + + /** Static value InstallationFailed for State. */ + public static final State INSTALLATION_FAILED = fromString("InstallationFailed"); + + /** Static value Invalid for State. */ + public static final State INVALID = fromString("Invalid"); + + /** Static value Recalled for State. */ + public static final State RECALLED = fromString("Recalled"); + + /** Static value Downloading for State. */ + public static final State DOWNLOADING = fromString("Downloading"); + + /** Static value DownloadFailed for State. */ + public static final State DOWNLOAD_FAILED = fromString("DownloadFailed"); + + /** Static value HealthChecking for State. */ + public static final State HEALTH_CHECKING = fromString("HealthChecking"); + + /** Static value HealthCheckFailed for State. */ + public static final State HEALTH_CHECK_FAILED = fromString("HealthCheckFailed"); + + /** Static value ReadyToInstall for State. */ + public static final State READY_TO_INSTALL = fromString("ReadyToInstall"); + + /** Static value ScanInProgress for State. */ + public static final State SCAN_IN_PROGRESS = fromString("ScanInProgress"); + + /** Static value ScanFailed for State. */ + public static final State SCAN_FAILED = fromString("ScanFailed"); + + /** + * Creates or finds a State from its string representation. + * + * @param name a name to look for. + * @return the corresponding State. + */ + @JsonCreator + public static State fromString(String name) { + return fromString(name, State.class); + } + + /** + * Gets known State values. + * + * @return known State values. + */ + public static Collection values() { + return values(State.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Status.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Status.java index 91733d95bf45..a3d52a632bb3 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Status.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Status.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for Status. */ +/** Status of the cluster agent. */ public final class Status extends ExpandableStringEnum { /** Static value NotYetRegistered for Status. */ public static final Status NOT_YET_REGISTERED = fromString("NotYetRegistered"); @@ -25,6 +25,18 @@ public final class Status extends ExpandableStringEnum { /** Static value Error for Status. */ public static final Status ERROR = fromString("Error"); + /** Static value NotSpecified for Status. */ + public static final Status NOT_SPECIFIED = fromString("NotSpecified"); + + /** Static value Succeeded for Status. */ + public static final Status SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for Status. */ + public static final Status FAILED = fromString("Failed"); + + /** Static value InProgress for Status. */ + public static final Status IN_PROGRESS = fromString("InProgress"); + /** * Creates or finds a Status from its string representation. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Update.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Update.java new file mode 100644 index 000000000000..680be8ce21c8 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Update.java @@ -0,0 +1,822 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.UpdateInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** An immutable client-side representation of Update. */ +public interface Update { + /** + * 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 systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: Provisioning state of the Updates proxy resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the installedDate property: Date that the update was installed. + * + * @return the installedDate value. + */ + OffsetDateTime installedDate(); + + /** + * Gets the description property: Description of the update. + * + * @return the description value. + */ + String description(); + + /** + * Gets the state property: State of the update as it relates to this stamp. + * + * @return the state value. + */ + State state(); + + /** + * Gets the prerequisites property: If update State is HasPrerequisite, this property contains an array of objects + * describing prerequisite updates before installing this update. Otherwise, it is empty. + * + * @return the prerequisites value. + */ + List prerequisites(); + + /** + * Gets the componentVersions property: An array of component versions for a Solution Bundle update, and an empty + * array otherwise. + * + * @return the componentVersions value. + */ + List componentVersions(); + + /** + * Gets the rebootRequired property: The rebootRequired property. + * + * @return the rebootRequired value. + */ + RebootRequirement rebootRequired(); + + /** + * Gets the healthState property: Overall health state for update-specific health checks. + * + * @return the healthState value. + */ + HealthState healthState(); + + /** + * Gets the healthCheckResult property: An array of PrecheckResult objects. + * + * @return the healthCheckResult value. + */ + List healthCheckResult(); + + /** + * Gets the healthCheckDate property: Last time the package-specific checks were run. + * + * @return the healthCheckDate value. + */ + OffsetDateTime healthCheckDate(); + + /** + * Gets the packagePath property: Path where the update package is available. + * + * @return the packagePath value. + */ + String packagePath(); + + /** + * Gets the packageSizeInMb property: Size of the package. This value is a combination of the size from update + * metadata and size of the payload that results from the live scan operation for OS update content. + * + * @return the packageSizeInMb value. + */ + Float packageSizeInMb(); + + /** + * Gets the displayName property: Display name of the Update. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the version property: Version of the update. + * + * @return the version value. + */ + String version(); + + /** + * Gets the publisher property: Publisher of the update package. + * + * @return the publisher value. + */ + String publisher(); + + /** + * Gets the releaseLink property: Link to release notes for the update. + * + * @return the releaseLink value. + */ + String releaseLink(); + + /** + * Gets the availabilityType property: Indicates the way the update content can be downloaded. + * + * @return the availabilityType value. + */ + AvailabilityType availabilityType(); + + /** + * Gets the packageType property: Customer-visible type of the update. + * + * @return the packageType value. + */ + String packageType(); + + /** + * Gets the additionalProperties property: Extensible KV pairs serialized as a string. This is currently used to + * report the stamp OEM family and hardware model information when an update is flagged as Invalid for the stamp + * based on OEM type. + * + * @return the additionalProperties value. + */ + String additionalProperties(); + + /** + * Gets the progressPercentage property: Progress percentage of ongoing operation. Currently this property is only + * valid when the update is in the Downloading state, where it maps to how much of the update content has been + * downloaded. + * + * @return the progressPercentage value. + */ + Float progressPercentage(); + + /** + * Gets the notifyMessage property: Brief message with instructions for updates of AvailabilityType Notify. + * + * @return the notifyMessage value. + */ + String notifyMessage(); + + /** + * 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.azurestackhci.fluent.models.UpdateInner object. + * + * @return the inner object. + */ + UpdateInner innerModel(); + + /** The entirety of the Update definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The Update definition stages. */ + interface DefinitionStages { + /** The first stage of the Update definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the Update definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, clusterName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @return the next definition stage. + */ + WithCreate withExistingCluster(String resourceGroupName, String clusterName); + } + /** + * The stage of the Update 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.WithInstalledDate, + DefinitionStages.WithDescription, + DefinitionStages.WithState, + DefinitionStages.WithPrerequisites, + DefinitionStages.WithComponentVersions, + DefinitionStages.WithRebootRequired, + DefinitionStages.WithHealthState, + DefinitionStages.WithHealthCheckResult, + DefinitionStages.WithHealthCheckDate, + DefinitionStages.WithPackagePath, + DefinitionStages.WithPackageSizeInMb, + DefinitionStages.WithDisplayName, + DefinitionStages.WithVersion, + DefinitionStages.WithPublisher, + DefinitionStages.WithReleaseLink, + DefinitionStages.WithAvailabilityType, + DefinitionStages.WithPackageType, + DefinitionStages.WithAdditionalProperties, + DefinitionStages.WithProgressPercentage, + DefinitionStages.WithNotifyMessage { + /** + * Executes the create request. + * + * @return the created resource. + */ + Update create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Update create(Context context); + } + /** The stage of the Update 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 Update definition allowing to specify installedDate. */ + interface WithInstalledDate { + /** + * Specifies the installedDate property: Date that the update was installed.. + * + * @param installedDate Date that the update was installed. + * @return the next definition stage. + */ + WithCreate withInstalledDate(OffsetDateTime installedDate); + } + /** The stage of the Update definition allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: Description of the update.. + * + * @param description Description of the update. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + /** The stage of the Update definition allowing to specify state. */ + interface WithState { + /** + * Specifies the state property: State of the update as it relates to this stamp.. + * + * @param state State of the update as it relates to this stamp. + * @return the next definition stage. + */ + WithCreate withState(State state); + } + /** The stage of the Update definition allowing to specify prerequisites. */ + interface WithPrerequisites { + /** + * Specifies the prerequisites property: If update State is HasPrerequisite, this property contains an array + * of objects describing prerequisite updates before installing this update. Otherwise, it is empty.. + * + * @param prerequisites If update State is HasPrerequisite, this property contains an array of objects + * describing prerequisite updates before installing this update. Otherwise, it is empty. + * @return the next definition stage. + */ + WithCreate withPrerequisites(List prerequisites); + } + /** The stage of the Update definition allowing to specify componentVersions. */ + interface WithComponentVersions { + /** + * Specifies the componentVersions property: An array of component versions for a Solution Bundle update, + * and an empty array otherwise. . + * + * @param componentVersions An array of component versions for a Solution Bundle update, and an empty array + * otherwise. + * @return the next definition stage. + */ + WithCreate withComponentVersions(List componentVersions); + } + /** The stage of the Update definition allowing to specify rebootRequired. */ + interface WithRebootRequired { + /** + * Specifies the rebootRequired property: The rebootRequired property.. + * + * @param rebootRequired The rebootRequired property. + * @return the next definition stage. + */ + WithCreate withRebootRequired(RebootRequirement rebootRequired); + } + /** The stage of the Update definition allowing to specify healthState. */ + interface WithHealthState { + /** + * Specifies the healthState property: Overall health state for update-specific health checks.. + * + * @param healthState Overall health state for update-specific health checks. + * @return the next definition stage. + */ + WithCreate withHealthState(HealthState healthState); + } + /** The stage of the Update definition allowing to specify healthCheckResult. */ + interface WithHealthCheckResult { + /** + * Specifies the healthCheckResult property: An array of PrecheckResult objects.. + * + * @param healthCheckResult An array of PrecheckResult objects. + * @return the next definition stage. + */ + WithCreate withHealthCheckResult(List healthCheckResult); + } + /** The stage of the Update definition allowing to specify healthCheckDate. */ + interface WithHealthCheckDate { + /** + * Specifies the healthCheckDate property: Last time the package-specific checks were run.. + * + * @param healthCheckDate Last time the package-specific checks were run. + * @return the next definition stage. + */ + WithCreate withHealthCheckDate(OffsetDateTime healthCheckDate); + } + /** The stage of the Update definition allowing to specify packagePath. */ + interface WithPackagePath { + /** + * Specifies the packagePath property: Path where the update package is available.. + * + * @param packagePath Path where the update package is available. + * @return the next definition stage. + */ + WithCreate withPackagePath(String packagePath); + } + /** The stage of the Update definition allowing to specify packageSizeInMb. */ + interface WithPackageSizeInMb { + /** + * Specifies the packageSizeInMb property: Size of the package. This value is a combination of the size from + * update metadata and size of the payload that results from the live scan operation for OS update content.. + * + * @param packageSizeInMb Size of the package. This value is a combination of the size from update metadata + * and size of the payload that results from the live scan operation for OS update content. + * @return the next definition stage. + */ + WithCreate withPackageSizeInMb(Float packageSizeInMb); + } + /** The stage of the Update definition allowing to specify displayName. */ + interface WithDisplayName { + /** + * Specifies the displayName property: Display name of the Update. + * + * @param displayName Display name of the Update. + * @return the next definition stage. + */ + WithCreate withDisplayName(String displayName); + } + /** The stage of the Update definition allowing to specify version. */ + interface WithVersion { + /** + * Specifies the version property: Version of the update.. + * + * @param version Version of the update. + * @return the next definition stage. + */ + WithCreate withVersion(String version); + } + /** The stage of the Update definition allowing to specify publisher. */ + interface WithPublisher { + /** + * Specifies the publisher property: Publisher of the update package.. + * + * @param publisher Publisher of the update package. + * @return the next definition stage. + */ + WithCreate withPublisher(String publisher); + } + /** The stage of the Update definition allowing to specify releaseLink. */ + interface WithReleaseLink { + /** + * Specifies the releaseLink property: Link to release notes for the update.. + * + * @param releaseLink Link to release notes for the update. + * @return the next definition stage. + */ + WithCreate withReleaseLink(String releaseLink); + } + /** The stage of the Update definition allowing to specify availabilityType. */ + interface WithAvailabilityType { + /** + * Specifies the availabilityType property: Indicates the way the update content can be downloaded.. + * + * @param availabilityType Indicates the way the update content can be downloaded. + * @return the next definition stage. + */ + WithCreate withAvailabilityType(AvailabilityType availabilityType); + } + /** The stage of the Update definition allowing to specify packageType. */ + interface WithPackageType { + /** + * Specifies the packageType property: Customer-visible type of the update.. + * + * @param packageType Customer-visible type of the update. + * @return the next definition stage. + */ + WithCreate withPackageType(String packageType); + } + /** The stage of the Update definition allowing to specify additionalProperties. */ + interface WithAdditionalProperties { + /** + * Specifies the additionalProperties property: Extensible KV pairs serialized as a string. This is + * currently used to report the stamp OEM family and hardware model information when an update is flagged as + * Invalid for the stamp based on OEM type.. + * + * @param additionalProperties Extensible KV pairs serialized as a string. This is currently used to report + * the stamp OEM family and hardware model information when an update is flagged as Invalid for the + * stamp based on OEM type. + * @return the next definition stage. + */ + WithCreate withAdditionalProperties(String additionalProperties); + } + /** The stage of the Update definition allowing to specify progressPercentage. */ + interface WithProgressPercentage { + /** + * Specifies the progressPercentage property: Progress percentage of ongoing operation. Currently this + * property is only valid when the update is in the Downloading state, where it maps to how much of the + * update content has been downloaded.. + * + * @param progressPercentage Progress percentage of ongoing operation. Currently this property is only valid + * when the update is in the Downloading state, where it maps to how much of the update content has been + * downloaded. + * @return the next definition stage. + */ + WithCreate withProgressPercentage(Float progressPercentage); + } + /** The stage of the Update definition allowing to specify notifyMessage. */ + interface WithNotifyMessage { + /** + * Specifies the notifyMessage property: Brief message with instructions for updates of AvailabilityType + * Notify.. + * + * @param notifyMessage Brief message with instructions for updates of AvailabilityType Notify. + * @return the next definition stage. + */ + WithCreate withNotifyMessage(String notifyMessage); + } + } + /** + * Begins update for the Update resource. + * + * @return the stage of resource update. + */ + Update.Update update(); + + /** The template for Update update. */ + interface Update + extends UpdateStages.WithInstalledDate, + UpdateStages.WithDescription, + UpdateStages.WithState, + UpdateStages.WithPrerequisites, + UpdateStages.WithComponentVersions, + UpdateStages.WithRebootRequired, + UpdateStages.WithHealthState, + UpdateStages.WithHealthCheckResult, + UpdateStages.WithHealthCheckDate, + UpdateStages.WithPackagePath, + UpdateStages.WithPackageSizeInMb, + UpdateStages.WithDisplayName, + UpdateStages.WithVersion, + UpdateStages.WithPublisher, + UpdateStages.WithReleaseLink, + UpdateStages.WithAvailabilityType, + UpdateStages.WithPackageType, + UpdateStages.WithAdditionalProperties, + UpdateStages.WithProgressPercentage, + UpdateStages.WithNotifyMessage { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Update apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Update apply(Context context); + } + /** The Update update stages. */ + interface UpdateStages { + /** The stage of the Update update allowing to specify installedDate. */ + interface WithInstalledDate { + /** + * Specifies the installedDate property: Date that the update was installed.. + * + * @param installedDate Date that the update was installed. + * @return the next definition stage. + */ + Update withInstalledDate(OffsetDateTime installedDate); + } + /** The stage of the Update update allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: Description of the update.. + * + * @param description Description of the update. + * @return the next definition stage. + */ + Update withDescription(String description); + } + /** The stage of the Update update allowing to specify state. */ + interface WithState { + /** + * Specifies the state property: State of the update as it relates to this stamp.. + * + * @param state State of the update as it relates to this stamp. + * @return the next definition stage. + */ + Update withState(State state); + } + /** The stage of the Update update allowing to specify prerequisites. */ + interface WithPrerequisites { + /** + * Specifies the prerequisites property: If update State is HasPrerequisite, this property contains an array + * of objects describing prerequisite updates before installing this update. Otherwise, it is empty.. + * + * @param prerequisites If update State is HasPrerequisite, this property contains an array of objects + * describing prerequisite updates before installing this update. Otherwise, it is empty. + * @return the next definition stage. + */ + Update withPrerequisites(List prerequisites); + } + /** The stage of the Update update allowing to specify componentVersions. */ + interface WithComponentVersions { + /** + * Specifies the componentVersions property: An array of component versions for a Solution Bundle update, + * and an empty array otherwise. . + * + * @param componentVersions An array of component versions for a Solution Bundle update, and an empty array + * otherwise. + * @return the next definition stage. + */ + Update withComponentVersions(List componentVersions); + } + /** The stage of the Update update allowing to specify rebootRequired. */ + interface WithRebootRequired { + /** + * Specifies the rebootRequired property: The rebootRequired property.. + * + * @param rebootRequired The rebootRequired property. + * @return the next definition stage. + */ + Update withRebootRequired(RebootRequirement rebootRequired); + } + /** The stage of the Update update allowing to specify healthState. */ + interface WithHealthState { + /** + * Specifies the healthState property: Overall health state for update-specific health checks.. + * + * @param healthState Overall health state for update-specific health checks. + * @return the next definition stage. + */ + Update withHealthState(HealthState healthState); + } + /** The stage of the Update update allowing to specify healthCheckResult. */ + interface WithHealthCheckResult { + /** + * Specifies the healthCheckResult property: An array of PrecheckResult objects.. + * + * @param healthCheckResult An array of PrecheckResult objects. + * @return the next definition stage. + */ + Update withHealthCheckResult(List healthCheckResult); + } + /** The stage of the Update update allowing to specify healthCheckDate. */ + interface WithHealthCheckDate { + /** + * Specifies the healthCheckDate property: Last time the package-specific checks were run.. + * + * @param healthCheckDate Last time the package-specific checks were run. + * @return the next definition stage. + */ + Update withHealthCheckDate(OffsetDateTime healthCheckDate); + } + /** The stage of the Update update allowing to specify packagePath. */ + interface WithPackagePath { + /** + * Specifies the packagePath property: Path where the update package is available.. + * + * @param packagePath Path where the update package is available. + * @return the next definition stage. + */ + Update withPackagePath(String packagePath); + } + /** The stage of the Update update allowing to specify packageSizeInMb. */ + interface WithPackageSizeInMb { + /** + * Specifies the packageSizeInMb property: Size of the package. This value is a combination of the size from + * update metadata and size of the payload that results from the live scan operation for OS update content.. + * + * @param packageSizeInMb Size of the package. This value is a combination of the size from update metadata + * and size of the payload that results from the live scan operation for OS update content. + * @return the next definition stage. + */ + Update withPackageSizeInMb(Float packageSizeInMb); + } + /** The stage of the Update update allowing to specify displayName. */ + interface WithDisplayName { + /** + * Specifies the displayName property: Display name of the Update. + * + * @param displayName Display name of the Update. + * @return the next definition stage. + */ + Update withDisplayName(String displayName); + } + /** The stage of the Update update allowing to specify version. */ + interface WithVersion { + /** + * Specifies the version property: Version of the update.. + * + * @param version Version of the update. + * @return the next definition stage. + */ + Update withVersion(String version); + } + /** The stage of the Update update allowing to specify publisher. */ + interface WithPublisher { + /** + * Specifies the publisher property: Publisher of the update package.. + * + * @param publisher Publisher of the update package. + * @return the next definition stage. + */ + Update withPublisher(String publisher); + } + /** The stage of the Update update allowing to specify releaseLink. */ + interface WithReleaseLink { + /** + * Specifies the releaseLink property: Link to release notes for the update.. + * + * @param releaseLink Link to release notes for the update. + * @return the next definition stage. + */ + Update withReleaseLink(String releaseLink); + } + /** The stage of the Update update allowing to specify availabilityType. */ + interface WithAvailabilityType { + /** + * Specifies the availabilityType property: Indicates the way the update content can be downloaded.. + * + * @param availabilityType Indicates the way the update content can be downloaded. + * @return the next definition stage. + */ + Update withAvailabilityType(AvailabilityType availabilityType); + } + /** The stage of the Update update allowing to specify packageType. */ + interface WithPackageType { + /** + * Specifies the packageType property: Customer-visible type of the update.. + * + * @param packageType Customer-visible type of the update. + * @return the next definition stage. + */ + Update withPackageType(String packageType); + } + /** The stage of the Update update allowing to specify additionalProperties. */ + interface WithAdditionalProperties { + /** + * Specifies the additionalProperties property: Extensible KV pairs serialized as a string. This is + * currently used to report the stamp OEM family and hardware model information when an update is flagged as + * Invalid for the stamp based on OEM type.. + * + * @param additionalProperties Extensible KV pairs serialized as a string. This is currently used to report + * the stamp OEM family and hardware model information when an update is flagged as Invalid for the + * stamp based on OEM type. + * @return the next definition stage. + */ + Update withAdditionalProperties(String additionalProperties); + } + /** The stage of the Update update allowing to specify progressPercentage. */ + interface WithProgressPercentage { + /** + * Specifies the progressPercentage property: Progress percentage of ongoing operation. Currently this + * property is only valid when the update is in the Downloading state, where it maps to how much of the + * update content has been downloaded.. + * + * @param progressPercentage Progress percentage of ongoing operation. Currently this property is only valid + * when the update is in the Downloading state, where it maps to how much of the update content has been + * downloaded. + * @return the next definition stage. + */ + Update withProgressPercentage(Float progressPercentage); + } + /** The stage of the Update update allowing to specify notifyMessage. */ + interface WithNotifyMessage { + /** + * Specifies the notifyMessage property: Brief message with instructions for updates of AvailabilityType + * Notify.. + * + * @param notifyMessage Brief message with instructions for updates of AvailabilityType Notify. + * @return the next definition stage. + */ + Update withNotifyMessage(String notifyMessage); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Update refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Update refresh(Context context); + + /** + * Apply Update. + * + * @throws com.azure.core.management.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 post(); + + /** + * Apply Update. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 post(Context context); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateList.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateList.java new file mode 100644 index 000000000000..331c4aec3501 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateList.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurestackhci.fluent.models.UpdateInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of Updates. */ +@Fluent +public final class UpdateList { + /* + * List of Updates + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link to the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** Creates an instance of UpdateList class. */ + public UpdateList() { + } + + /** + * Get the value property: List of Updates. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of Updates. + * + * @param value the value value to set. + * @return the UpdateList object itself. + */ + public UpdateList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdatePrerequisite.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdatePrerequisite.java new file mode 100644 index 000000000000..23bfc58f35ad --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdatePrerequisite.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * If update State is HasPrerequisite, this property contains an array of objects describing prerequisite updates before + * installing this update. Otherwise, it is empty. + */ +@Fluent +public final class UpdatePrerequisite { + /* + * Updatable component type. + */ + @JsonProperty(value = "updateType") + private String updateType; + + /* + * Version of the prerequisite. + */ + @JsonProperty(value = "version") + private String version; + + /* + * Friendly name of the prerequisite. + */ + @JsonProperty(value = "packageName") + private String packageName; + + /** Creates an instance of UpdatePrerequisite class. */ + public UpdatePrerequisite() { + } + + /** + * Get the updateType property: Updatable component type. + * + * @return the updateType value. + */ + public String updateType() { + return this.updateType; + } + + /** + * Set the updateType property: Updatable component type. + * + * @param updateType the updateType value to set. + * @return the UpdatePrerequisite object itself. + */ + public UpdatePrerequisite withUpdateType(String updateType) { + this.updateType = updateType; + return this; + } + + /** + * Get the version property: Version of the prerequisite. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: Version of the prerequisite. + * + * @param version the version value to set. + * @return the UpdatePrerequisite object itself. + */ + public UpdatePrerequisite withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get the packageName property: Friendly name of the prerequisite. + * + * @return the packageName value. + */ + public String packageName() { + return this.packageName; + } + + /** + * Set the packageName property: Friendly name of the prerequisite. + * + * @param packageName the packageName value to set. + * @return the UpdatePrerequisite object itself. + */ + public UpdatePrerequisite withPackageName(String packageName) { + this.packageName = packageName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateRun.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateRun.java new file mode 100644 index 000000000000..6b87e231ae17 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateRun.java @@ -0,0 +1,542 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.Step; +import com.azure.resourcemanager.azurestackhci.fluent.models.UpdateRunInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** An immutable client-side representation of UpdateRun. */ +public interface UpdateRun { + /** + * 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 systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: Provisioning state of the UpdateRuns proxy resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the timeStarted property: Timestamp of the update run was started. + * + * @return the timeStarted value. + */ + OffsetDateTime timeStarted(); + + /** + * Gets the lastUpdatedTime property: Timestamp of the most recently completed step in the update run. + * + * @return the lastUpdatedTime value. + */ + OffsetDateTime lastUpdatedTime(); + + /** + * Gets the duration property: Duration of the update run. + * + * @return the duration value. + */ + String duration(); + + /** + * Gets the state property: State of the update run. + * + * @return the state value. + */ + UpdateRunPropertiesState state(); + + /** + * Gets the namePropertiesName property: Name of the step. + * + * @return the namePropertiesName value. + */ + String namePropertiesName(); + + /** + * Gets the description property: More detailed description of the step. + * + * @return the description value. + */ + String description(); + + /** + * Gets the errorMessage property: Error message, specified if the step is in a failed state. + * + * @return the errorMessage value. + */ + String errorMessage(); + + /** + * Gets the status property: Status of the step, bubbled up from the ECE action plan for installation attempts. + * Values are: 'Success', 'Error', 'InProgress', and 'Unknown status'. + * + * @return the status value. + */ + String status(); + + /** + * Gets the startTimeUtc property: When the step started, or empty if it has not started executing. + * + * @return the startTimeUtc value. + */ + OffsetDateTime startTimeUtc(); + + /** + * Gets the endTimeUtc property: When the step reached a terminal state. + * + * @return the endTimeUtc value. + */ + OffsetDateTime endTimeUtc(); + + /** + * Gets the lastUpdatedTimeUtc property: Completion time of this step or the last completed sub-step. + * + * @return the lastUpdatedTimeUtc value. + */ + OffsetDateTime lastUpdatedTimeUtc(); + + /** + * Gets the steps property: Recursive model for child steps of this step. + * + * @return the steps value. + */ + List steps(); + + /** + * 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.azurestackhci.fluent.models.UpdateRunInner object. + * + * @return the inner object. + */ + UpdateRunInner innerModel(); + + /** The entirety of the UpdateRun definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The UpdateRun definition stages. */ + interface DefinitionStages { + /** The first stage of the UpdateRun definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the UpdateRun definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, clusterName, updateName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @return the next definition stage. + */ + WithCreate withExistingUpdate(String resourceGroupName, String clusterName, String updateName); + } + /** + * The stage of the UpdateRun 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.WithTimeStarted, + DefinitionStages.WithLastUpdatedTime, + DefinitionStages.WithDuration, + DefinitionStages.WithState, + DefinitionStages.WithNamePropertiesName, + DefinitionStages.WithDescription, + DefinitionStages.WithErrorMessage, + DefinitionStages.WithStatus, + DefinitionStages.WithStartTimeUtc, + DefinitionStages.WithEndTimeUtc, + DefinitionStages.WithLastUpdatedTimeUtc, + DefinitionStages.WithSteps { + /** + * Executes the create request. + * + * @return the created resource. + */ + UpdateRun create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + UpdateRun create(Context context); + } + /** The stage of the UpdateRun 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 UpdateRun definition allowing to specify timeStarted. */ + interface WithTimeStarted { + /** + * Specifies the timeStarted property: Timestamp of the update run was started.. + * + * @param timeStarted Timestamp of the update run was started. + * @return the next definition stage. + */ + WithCreate withTimeStarted(OffsetDateTime timeStarted); + } + /** The stage of the UpdateRun definition allowing to specify lastUpdatedTime. */ + interface WithLastUpdatedTime { + /** + * Specifies the lastUpdatedTime property: Timestamp of the most recently completed step in the update run.. + * + * @param lastUpdatedTime Timestamp of the most recently completed step in the update run. + * @return the next definition stage. + */ + WithCreate withLastUpdatedTime(OffsetDateTime lastUpdatedTime); + } + /** The stage of the UpdateRun definition allowing to specify duration. */ + interface WithDuration { + /** + * Specifies the duration property: Duration of the update run.. + * + * @param duration Duration of the update run. + * @return the next definition stage. + */ + WithCreate withDuration(String duration); + } + /** The stage of the UpdateRun definition allowing to specify state. */ + interface WithState { + /** + * Specifies the state property: State of the update run.. + * + * @param state State of the update run. + * @return the next definition stage. + */ + WithCreate withState(UpdateRunPropertiesState state); + } + /** The stage of the UpdateRun definition allowing to specify namePropertiesName. */ + interface WithNamePropertiesName { + /** + * Specifies the namePropertiesName property: Name of the step.. + * + * @param namePropertiesName Name of the step. + * @return the next definition stage. + */ + WithCreate withNamePropertiesName(String namePropertiesName); + } + /** The stage of the UpdateRun definition allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: More detailed description of the step.. + * + * @param description More detailed description of the step. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + /** The stage of the UpdateRun definition allowing to specify errorMessage. */ + interface WithErrorMessage { + /** + * Specifies the errorMessage property: Error message, specified if the step is in a failed state.. + * + * @param errorMessage Error message, specified if the step is in a failed state. + * @return the next definition stage. + */ + WithCreate withErrorMessage(String errorMessage); + } + /** The stage of the UpdateRun definition allowing to specify status. */ + interface WithStatus { + /** + * Specifies the status property: Status of the step, bubbled up from the ECE action plan for installation + * attempts. Values are: 'Success', 'Error', 'InProgress', and 'Unknown status'.. + * + * @param status Status of the step, bubbled up from the ECE action plan for installation attempts. Values + * are: 'Success', 'Error', 'InProgress', and 'Unknown status'. + * @return the next definition stage. + */ + WithCreate withStatus(String status); + } + /** The stage of the UpdateRun definition allowing to specify startTimeUtc. */ + interface WithStartTimeUtc { + /** + * Specifies the startTimeUtc property: When the step started, or empty if it has not started executing.. + * + * @param startTimeUtc When the step started, or empty if it has not started executing. + * @return the next definition stage. + */ + WithCreate withStartTimeUtc(OffsetDateTime startTimeUtc); + } + /** The stage of the UpdateRun definition allowing to specify endTimeUtc. */ + interface WithEndTimeUtc { + /** + * Specifies the endTimeUtc property: When the step reached a terminal state.. + * + * @param endTimeUtc When the step reached a terminal state. + * @return the next definition stage. + */ + WithCreate withEndTimeUtc(OffsetDateTime endTimeUtc); + } + /** The stage of the UpdateRun definition allowing to specify lastUpdatedTimeUtc. */ + interface WithLastUpdatedTimeUtc { + /** + * Specifies the lastUpdatedTimeUtc property: Completion time of this step or the last completed sub-step.. + * + * @param lastUpdatedTimeUtc Completion time of this step or the last completed sub-step. + * @return the next definition stage. + */ + WithCreate withLastUpdatedTimeUtc(OffsetDateTime lastUpdatedTimeUtc); + } + /** The stage of the UpdateRun definition allowing to specify steps. */ + interface WithSteps { + /** + * Specifies the steps property: Recursive model for child steps of this step.. + * + * @param steps Recursive model for child steps of this step. + * @return the next definition stage. + */ + WithCreate withSteps(List steps); + } + } + /** + * Begins update for the UpdateRun resource. + * + * @return the stage of resource update. + */ + UpdateRun.Update update(); + + /** The template for UpdateRun update. */ + interface Update + extends UpdateStages.WithTimeStarted, + UpdateStages.WithLastUpdatedTime, + UpdateStages.WithDuration, + UpdateStages.WithState, + UpdateStages.WithNamePropertiesName, + UpdateStages.WithDescription, + UpdateStages.WithErrorMessage, + UpdateStages.WithStatus, + UpdateStages.WithStartTimeUtc, + UpdateStages.WithEndTimeUtc, + UpdateStages.WithLastUpdatedTimeUtc, + UpdateStages.WithSteps { + /** + * Executes the update request. + * + * @return the updated resource. + */ + UpdateRun apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + UpdateRun apply(Context context); + } + /** The UpdateRun update stages. */ + interface UpdateStages { + /** The stage of the UpdateRun update allowing to specify timeStarted. */ + interface WithTimeStarted { + /** + * Specifies the timeStarted property: Timestamp of the update run was started.. + * + * @param timeStarted Timestamp of the update run was started. + * @return the next definition stage. + */ + Update withTimeStarted(OffsetDateTime timeStarted); + } + /** The stage of the UpdateRun update allowing to specify lastUpdatedTime. */ + interface WithLastUpdatedTime { + /** + * Specifies the lastUpdatedTime property: Timestamp of the most recently completed step in the update run.. + * + * @param lastUpdatedTime Timestamp of the most recently completed step in the update run. + * @return the next definition stage. + */ + Update withLastUpdatedTime(OffsetDateTime lastUpdatedTime); + } + /** The stage of the UpdateRun update allowing to specify duration. */ + interface WithDuration { + /** + * Specifies the duration property: Duration of the update run.. + * + * @param duration Duration of the update run. + * @return the next definition stage. + */ + Update withDuration(String duration); + } + /** The stage of the UpdateRun update allowing to specify state. */ + interface WithState { + /** + * Specifies the state property: State of the update run.. + * + * @param state State of the update run. + * @return the next definition stage. + */ + Update withState(UpdateRunPropertiesState state); + } + /** The stage of the UpdateRun update allowing to specify namePropertiesName. */ + interface WithNamePropertiesName { + /** + * Specifies the namePropertiesName property: Name of the step.. + * + * @param namePropertiesName Name of the step. + * @return the next definition stage. + */ + Update withNamePropertiesName(String namePropertiesName); + } + /** The stage of the UpdateRun update allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: More detailed description of the step.. + * + * @param description More detailed description of the step. + * @return the next definition stage. + */ + Update withDescription(String description); + } + /** The stage of the UpdateRun update allowing to specify errorMessage. */ + interface WithErrorMessage { + /** + * Specifies the errorMessage property: Error message, specified if the step is in a failed state.. + * + * @param errorMessage Error message, specified if the step is in a failed state. + * @return the next definition stage. + */ + Update withErrorMessage(String errorMessage); + } + /** The stage of the UpdateRun update allowing to specify status. */ + interface WithStatus { + /** + * Specifies the status property: Status of the step, bubbled up from the ECE action plan for installation + * attempts. Values are: 'Success', 'Error', 'InProgress', and 'Unknown status'.. + * + * @param status Status of the step, bubbled up from the ECE action plan for installation attempts. Values + * are: 'Success', 'Error', 'InProgress', and 'Unknown status'. + * @return the next definition stage. + */ + Update withStatus(String status); + } + /** The stage of the UpdateRun update allowing to specify startTimeUtc. */ + interface WithStartTimeUtc { + /** + * Specifies the startTimeUtc property: When the step started, or empty if it has not started executing.. + * + * @param startTimeUtc When the step started, or empty if it has not started executing. + * @return the next definition stage. + */ + Update withStartTimeUtc(OffsetDateTime startTimeUtc); + } + /** The stage of the UpdateRun update allowing to specify endTimeUtc. */ + interface WithEndTimeUtc { + /** + * Specifies the endTimeUtc property: When the step reached a terminal state.. + * + * @param endTimeUtc When the step reached a terminal state. + * @return the next definition stage. + */ + Update withEndTimeUtc(OffsetDateTime endTimeUtc); + } + /** The stage of the UpdateRun update allowing to specify lastUpdatedTimeUtc. */ + interface WithLastUpdatedTimeUtc { + /** + * Specifies the lastUpdatedTimeUtc property: Completion time of this step or the last completed sub-step.. + * + * @param lastUpdatedTimeUtc Completion time of this step or the last completed sub-step. + * @return the next definition stage. + */ + Update withLastUpdatedTimeUtc(OffsetDateTime lastUpdatedTimeUtc); + } + /** The stage of the UpdateRun update allowing to specify steps. */ + interface WithSteps { + /** + * Specifies the steps property: Recursive model for child steps of this step.. + * + * @param steps Recursive model for child steps of this step. + * @return the next definition stage. + */ + Update withSteps(List steps); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + UpdateRun refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + UpdateRun refresh(Context context); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateRunList.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateRunList.java new file mode 100644 index 000000000000..381cfba50999 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateRunList.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurestackhci.fluent.models.UpdateRunInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of Update runs. */ +@Fluent +public final class UpdateRunList { + /* + * List of Update runs + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link to the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** Creates an instance of UpdateRunList class. */ + public UpdateRunList() { + } + + /** + * Get the value property: List of Update runs. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of Update runs. + * + * @param value the value value to set. + * @return the UpdateRunList object itself. + */ + public UpdateRunList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateRunPropertiesState.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateRunPropertiesState.java new file mode 100644 index 000000000000..51604cdacad8 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateRunPropertiesState.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.azurestackhci.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** State of the update run. */ +public final class UpdateRunPropertiesState extends ExpandableStringEnum { + /** Static value Unknown for UpdateRunPropertiesState. */ + public static final UpdateRunPropertiesState UNKNOWN = fromString("Unknown"); + + /** Static value Succeeded for UpdateRunPropertiesState. */ + public static final UpdateRunPropertiesState SUCCEEDED = fromString("Succeeded"); + + /** Static value InProgress for UpdateRunPropertiesState. */ + public static final UpdateRunPropertiesState IN_PROGRESS = fromString("InProgress"); + + /** Static value Failed for UpdateRunPropertiesState. */ + public static final UpdateRunPropertiesState FAILED = fromString("Failed"); + + /** + * Creates or finds a UpdateRunPropertiesState from its string representation. + * + * @param name a name to look for. + * @return the corresponding UpdateRunPropertiesState. + */ + @JsonCreator + public static UpdateRunPropertiesState fromString(String name) { + return fromString(name, UpdateRunPropertiesState.class); + } + + /** + * Gets known UpdateRunPropertiesState values. + * + * @return known UpdateRunPropertiesState values. + */ + public static Collection values() { + return values(UpdateRunPropertiesState.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateRuns.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateRuns.java new file mode 100644 index 000000000000..ceb153877e08 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateRuns.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.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 UpdateRuns. */ +public interface UpdateRuns { + /** + * List all Update runs for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Update runs as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String clusterName, String updateName); + + /** + * List all Update runs for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Update runs as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String clusterName, String updateName, Context context); + + /** + * Delete specified Update Run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 clusterName, String updateName, String updateRunName); + + /** + * Delete specified Update Run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 clusterName, String updateName, String updateRunName, Context context); + + /** + * Get the Update run for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Update run for a specified update along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String clusterName, String updateName, String updateRunName, Context context); + + /** + * Get the Update run for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Update run for a specified update. + */ + UpdateRun get(String resourceGroupName, String clusterName, String updateName, String updateRunName); + + /** + * Get the Update run for a specified update. + * + * @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 Update run for a specified update along with {@link Response}. + */ + UpdateRun getById(String id); + + /** + * Get the Update run for a specified update. + * + * @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 Update run for a specified update along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete specified Update Run. + * + * @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); + + /** + * Delete specified Update Run. + * + * @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 UpdateRun resource. + * + * @param name resource name. + * @return the first stage of the new UpdateRun definition. + */ + UpdateRun.DefinitionStages.Blank define(String name); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateSummaries.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateSummaries.java new file mode 100644 index 000000000000..eabb6231bc94 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateSummaries.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.azurestackhci.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.azurestackhci.fluent.models.UpdateSummariesInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** An immutable client-side representation of UpdateSummaries. */ +public interface UpdateSummaries { + /** + * 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 systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: Provisioning state of the UpdateSummaries proxy resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the oemFamily property: OEM family name. + * + * @return the oemFamily value. + */ + String oemFamily(); + + /** + * Gets the hardwareModel property: Name of the hardware model. + * + * @return the hardwareModel value. + */ + String hardwareModel(); + + /** + * Gets the packageVersions property: Current version of each updatable component. + * + * @return the packageVersions value. + */ + List packageVersions(); + + /** + * Gets the currentVersion property: Current Solution Bundle version of the stamp. + * + * @return the currentVersion value. + */ + String currentVersion(); + + /** + * Gets the lastUpdated property: Last time an update installation completed successfully. + * + * @return the lastUpdated value. + */ + OffsetDateTime lastUpdated(); + + /** + * Gets the lastChecked property: Last time the update service successfully checked for updates. + * + * @return the lastChecked value. + */ + OffsetDateTime lastChecked(); + + /** + * Gets the healthState property: Overall health state for update-specific health checks. + * + * @return the healthState value. + */ + HealthState healthState(); + + /** + * Gets the healthCheckResult property: An array of pre-check result objects. + * + * @return the healthCheckResult value. + */ + List healthCheckResult(); + + /** + * Gets the healthCheckDate property: Last time the package-specific checks were run. + * + * @return the healthCheckDate value. + */ + OffsetDateTime healthCheckDate(); + + /** + * Gets the state property: Overall update state of the stamp. + * + * @return the state value. + */ + UpdateSummariesPropertiesState state(); + + /** + * Gets the inner com.azure.resourcemanager.azurestackhci.fluent.models.UpdateSummariesInner object. + * + * @return the inner object. + */ + UpdateSummariesInner innerModel(); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateSummariesList.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateSummariesList.java new file mode 100644 index 000000000000..e3daf3ded1ce --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateSummariesList.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurestackhci.fluent.models.UpdateSummariesInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of Update Summaries. */ +@Fluent +public final class UpdateSummariesList { + /* + * List of Update Summaries + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link to the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** Creates an instance of UpdateSummariesList class. */ + public UpdateSummariesList() { + } + + /** + * Get the value property: List of Update Summaries. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of Update Summaries. + * + * @param value the value value to set. + * @return the UpdateSummariesList object itself. + */ + public UpdateSummariesList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateSummariesOperations.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateSummariesOperations.java new file mode 100644 index 000000000000..a4e2d89c5b67 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateSummariesOperations.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.UpdateSummariesInner; + +/** Resource collection API of UpdateSummariesOperations. */ +public interface UpdateSummariesOperations { + /** + * List all Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Update Summaries as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String clusterName); + + /** + * List all Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Update Summaries as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String clusterName, Context context); + + /** + * Delete Update Summaries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 clusterName); + + /** + * Delete Update Summaries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 clusterName, Context context); + + /** + * Put Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateLocationProperties Properties of the UpdateSummaries resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return get the update summaries for the cluster along with {@link Response}. + */ + Response putWithResponse( + String resourceGroupName, String clusterName, UpdateSummariesInner updateLocationProperties, Context context); + + /** + * Put Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateLocationProperties Properties of the UpdateSummaries resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return get the update summaries for the cluster. + */ + UpdateSummaries put(String resourceGroupName, String clusterName, UpdateSummariesInner updateLocationProperties); + + /** + * Get all Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Update summaries under the HCI cluster along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String clusterName, Context context); + + /** + * Get all Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Update summaries under the HCI cluster. + */ + UpdateSummaries get(String resourceGroupName, String clusterName); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateSummariesPropertiesState.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateSummariesPropertiesState.java new file mode 100644 index 000000000000..28cf1d8e8470 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateSummariesPropertiesState.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.azurestackhci.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Overall update state of the stamp. */ +public final class UpdateSummariesPropertiesState extends ExpandableStringEnum { + /** Static value Unknown for UpdateSummariesPropertiesState. */ + public static final UpdateSummariesPropertiesState UNKNOWN = fromString("Unknown"); + + /** Static value AppliedSuccessfully for UpdateSummariesPropertiesState. */ + public static final UpdateSummariesPropertiesState APPLIED_SUCCESSFULLY = fromString("AppliedSuccessfully"); + + /** Static value UpdateAvailable for UpdateSummariesPropertiesState. */ + public static final UpdateSummariesPropertiesState UPDATE_AVAILABLE = fromString("UpdateAvailable"); + + /** Static value UpdateInProgress for UpdateSummariesPropertiesState. */ + public static final UpdateSummariesPropertiesState UPDATE_IN_PROGRESS = fromString("UpdateInProgress"); + + /** Static value UpdateFailed for UpdateSummariesPropertiesState. */ + public static final UpdateSummariesPropertiesState UPDATE_FAILED = fromString("UpdateFailed"); + + /** Static value NeedsAttention for UpdateSummariesPropertiesState. */ + public static final UpdateSummariesPropertiesState NEEDS_ATTENTION = fromString("NeedsAttention"); + + /** Static value PreparationInProgress for UpdateSummariesPropertiesState. */ + public static final UpdateSummariesPropertiesState PREPARATION_IN_PROGRESS = fromString("PreparationInProgress"); + + /** Static value PreparationFailed for UpdateSummariesPropertiesState. */ + public static final UpdateSummariesPropertiesState PREPARATION_FAILED = fromString("PreparationFailed"); + + /** + * Creates or finds a UpdateSummariesPropertiesState from its string representation. + * + * @param name a name to look for. + * @return the corresponding UpdateSummariesPropertiesState. + */ + @JsonCreator + public static UpdateSummariesPropertiesState fromString(String name) { + return fromString(name, UpdateSummariesPropertiesState.class); + } + + /** + * Gets known UpdateSummariesPropertiesState values. + * + * @return known UpdateSummariesPropertiesState values. + */ + public static Collection values() { + return values(UpdateSummariesPropertiesState.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Updates.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Updates.java new file mode 100644 index 000000000000..112683b28596 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Updates.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.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 Updates. */ +public interface Updates { + /** + * Apply Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 post(String resourceGroupName, String clusterName, String updateName); + + /** + * Apply Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 post(String resourceGroupName, String clusterName, String updateName, Context context); + + /** + * List all Updates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Updates as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String clusterName); + + /** + * List all Updates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Updates as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String clusterName, Context context); + + /** + * Delete specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 clusterName, String updateName); + + /** + * Delete specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 clusterName, String updateName, Context context); + + /** + * Get specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specified Update along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String clusterName, String updateName, Context context); + + /** + * Get specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specified Update. + */ + Update get(String resourceGroupName, String clusterName, String updateName); + + /** + * Get specified Update. + * + * @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 specified Update along with {@link Response}. + */ + Update getById(String id); + + /** + * Get specified Update. + * + * @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 specified Update along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete specified Update. + * + * @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); + + /** + * Delete specified Update. + * + * @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 Update resource. + * + * @param name resource name. + * @return the first stage of the new Update definition. + */ + Update.DefinitionStages.Blank define(String name); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UploadCertificateRequest.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UploadCertificateRequest.java index 8fabb105a662..341a6910ed1c 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UploadCertificateRequest.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UploadCertificateRequest.java @@ -16,6 +16,10 @@ public final class UploadCertificateRequest { @JsonProperty(value = "properties") private RawCertificateData properties; + /** Creates an instance of UploadCertificateRequest class. */ + public UploadCertificateRequest() { + } + /** * Get the properties property: The properties property. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UserAssignedIdentity.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UserAssignedIdentity.java new file mode 100644 index 000000000000..ded203d93243 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UserAssignedIdentity.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.azurestackhci.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.UUID; + +/** User assigned identity properties. */ +@Immutable +public class UserAssignedIdentity { + /* + * The principal ID of the assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private UUID principalId; + + /* + * The client ID of the assigned identity. + */ + @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) + private UUID clientId; + + /** Creates an instance of UserAssignedIdentity class. */ + public UserAssignedIdentity() { + } + + /** + * Get the principalId property: The principal ID of the assigned identity. + * + * @return the principalId value. + */ + public UUID principalId() { + return this.principalId; + } + + /** + * Get the clientId property: The client ID of the assigned identity. + * + * @return the clientId value. + */ + public UUID clientId() { + return this.clientId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/WindowsServerSubscription.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/WindowsServerSubscription.java index 6d9da4e53ba7..176ee7fc1b2b 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/WindowsServerSubscription.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/WindowsServerSubscription.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for WindowsServerSubscription. */ +/** Desired state of Windows Server Subscription. */ public final class WindowsServerSubscription extends ExpandableStringEnum { /** Static value Disabled for WindowsServerSubscription. */ public static final WindowsServerSubscription DISABLED = fromString("Disabled"); diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsCreateIdentitySamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsCreateIdentitySamples.java index 47e9f75aa33b..1efa72e480ed 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsCreateIdentitySamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsCreateIdentitySamples.java @@ -9,7 +9,7 @@ /** Samples for ArcSettings CreateIdentity. */ public final class ArcSettingsCreateIdentitySamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/CreateArcIdentity.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/CreateArcIdentity.json */ /** * Sample code: Create Arc Identity. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsCreateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsCreateSamples.java index b0da37f7e07e..588af504c3f5 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsCreateSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsCreateSamples.java @@ -7,7 +7,7 @@ /** Samples for ArcSettings Create. */ public final class ArcSettingsCreateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/PutArcSetting.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/PutArcSetting.json */ /** * Sample code: Create ArcSetting. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsDeleteSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsDeleteSamples.java index dd70b8317555..fd2d60ddddbe 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsDeleteSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsDeleteSamples.java @@ -9,7 +9,7 @@ /** Samples for ArcSettings Delete. */ public final class ArcSettingsDeleteSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/DeleteArcSetting.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/DeleteArcSetting.json */ /** * Sample code: Delete ArcSetting. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsGeneratePasswordSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsGeneratePasswordSamples.java index 066deffefc05..cca5eb43f6d8 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsGeneratePasswordSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsGeneratePasswordSamples.java @@ -9,7 +9,7 @@ /** Samples for ArcSettings GeneratePassword. */ public final class ArcSettingsGeneratePasswordSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/GeneratePassword.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/GeneratePassword.json */ /** * Sample code: Generate Password. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsGetSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsGetSamples.java index 9b49a686cf00..e5e09eeff418 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsGetSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsGetSamples.java @@ -9,7 +9,7 @@ /** Samples for ArcSettings Get. */ public final class ArcSettingsGetSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/GetArcSetting.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/GetArcSetting.json */ /** * Sample code: Get ArcSetting. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsListByClusterSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsListByClusterSamples.java index 840759606cea..76312cf1a918 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsListByClusterSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsListByClusterSamples.java @@ -9,7 +9,7 @@ /** Samples for ArcSettings ListByCluster. */ public final class ArcSettingsListByClusterSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/ListArcSettingsByCluster.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/ListArcSettingsByCluster.json */ /** * Sample code: List ArcSetting resources by HCI Cluster. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsUpdateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsUpdateSamples.java index bfc08f7891a4..f8e6d1e20b3f 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsUpdateSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsUpdateSamples.java @@ -13,7 +13,7 @@ /** Samples for ArcSettings Update. */ public final class ArcSettingsUpdateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/PatchArcSetting.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/PatchArcSetting.json */ /** * Sample code: Patch ArcSetting. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersCreateIdentitySamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersCreateIdentitySamples.java index 076cc9c75fbc..20f85a85e9e5 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersCreateIdentitySamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersCreateIdentitySamples.java @@ -9,7 +9,7 @@ /** Samples for Clusters CreateIdentity. */ public final class ClustersCreateIdentitySamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/CreateClusterIdentity.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/CreateClusterIdentity.json */ /** * Sample code: Create cluster Identity. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersCreateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersCreateSamples.java index 2e5a4bc4c68c..94fb35688982 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersCreateSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersCreateSamples.java @@ -4,10 +4,12 @@ package com.azure.resourcemanager.azurestackhci.generated; +import com.azure.resourcemanager.azurestackhci.models.ManagedServiceIdentityType; + /** Samples for Clusters Create. */ public final class ClustersCreateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/CreateCluster.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/CreateCluster.json */ /** * Sample code: Create cluster. @@ -20,6 +22,7 @@ public static void createCluster(com.azure.resourcemanager.azurestackhci.AzureSt .define("myCluster") .withRegion("East US") .withExistingResourceGroup("test-rg") + .withTypeIdentityType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) .withCloudManagementEndpoint("https://98294836-31be-4668-aeae-698667faf99b.waconazure.com") .withAadClientId("24a6e53d-04e5-44d2-b7cc-1b732a847dfc") .withAadTenantId("7e589cc1-a8b6-4dff-91bd-5ec0fa18db94") diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersDeleteSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersDeleteSamples.java index 087f8a22c28b..d4d237007dd0 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersDeleteSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersDeleteSamples.java @@ -9,7 +9,7 @@ /** Samples for Clusters Delete. */ public final class ClustersDeleteSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/DeleteCluster.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/DeleteCluster.json */ /** * Sample code: Delete cluster. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersExtendSoftwareAssuranceBenefitSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersExtendSoftwareAssuranceBenefitSamples.java new file mode 100644 index 000000000000..e4bbfa2975b2 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersExtendSoftwareAssuranceBenefitSamples.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.azurestackhci.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.models.SoftwareAssuranceChangeRequest; +import com.azure.resourcemanager.azurestackhci.models.SoftwareAssuranceChangeRequestProperties; +import com.azure.resourcemanager.azurestackhci.models.SoftwareAssuranceIntent; + +/** Samples for Clusters ExtendSoftwareAssuranceBenefit. */ +public final class ClustersExtendSoftwareAssuranceBenefitSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/ExtendSoftwareAssuranceBenefit.json + */ + /** + * Sample code: Create cluster Identity. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void createClusterIdentity(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .clusters() + .extendSoftwareAssuranceBenefit( + "test-rg", + "myCluster", + new SoftwareAssuranceChangeRequest() + .withProperties( + new SoftwareAssuranceChangeRequestProperties() + .withSoftwareAssuranceIntent(SoftwareAssuranceIntent.ENABLE)), + Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersGetByResourceGroupSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersGetByResourceGroupSamples.java index fb08e4f84c92..f40252c8836d 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersGetByResourceGroupSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersGetByResourceGroupSamples.java @@ -9,7 +9,7 @@ /** Samples for Clusters GetByResourceGroup. */ public final class ClustersGetByResourceGroupSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/GetCluster.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/GetCluster.json */ /** * Sample code: Get cluster. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersListByResourceGroupSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersListByResourceGroupSamples.java index 3bdd3e760971..b50c0630d431 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersListByResourceGroupSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersListByResourceGroupSamples.java @@ -9,7 +9,7 @@ /** Samples for Clusters ListByResourceGroup. */ public final class ClustersListByResourceGroupSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/ListClustersByResourceGroup.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/ListClustersByResourceGroup.json */ /** * Sample code: List clusters in a given resource group. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersListSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersListSamples.java index 2d619de3c166..ad21d5f7d605 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersListSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersListSamples.java @@ -9,7 +9,7 @@ /** Samples for Clusters List. */ public final class ClustersListSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/ListClustersBySubscription.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/ListClustersBySubscription.json */ /** * Sample code: List clusters in a given subscription. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersUpdateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersUpdateSamples.java index 0604ed772ffc..942a7cb77d9d 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersUpdateSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersUpdateSamples.java @@ -8,6 +8,7 @@ import com.azure.resourcemanager.azurestackhci.models.Cluster; import com.azure.resourcemanager.azurestackhci.models.ClusterDesiredProperties; import com.azure.resourcemanager.azurestackhci.models.DiagnosticLevel; +import com.azure.resourcemanager.azurestackhci.models.ManagedServiceIdentityType; import com.azure.resourcemanager.azurestackhci.models.WindowsServerSubscription; import java.util.HashMap; import java.util.Map; @@ -15,7 +16,7 @@ /** Samples for Clusters Update. */ public final class ClustersUpdateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/UpdateCluster.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/UpdateCluster.json */ /** * Sample code: Update cluster. @@ -28,6 +29,7 @@ public static void updateCluster(com.azure.resourcemanager.azurestackhci.AzureSt resource .update() .withTags(mapOf("tag1", "value1", "tag2", "value2")) + .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) .withCloudManagementEndpoint("https://98294836-31be-4668-aeae-698667faf99b.waconazure.com") .withDesiredProperties( new ClusterDesiredProperties() diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersUploadCertificateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersUploadCertificateSamples.java index e0b951ddce12..f588d02d0cda 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersUploadCertificateSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersUploadCertificateSamples.java @@ -12,7 +12,7 @@ /** Samples for Clusters UploadCertificate. */ public final class ClustersUploadCertificateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/UploadCertificate.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/UploadCertificate.json */ /** * Sample code: Upload certificate. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsCreateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsCreateSamples.java index b25518c9e877..62a68243c5db 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsCreateSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsCreateSamples.java @@ -11,7 +11,7 @@ /** Samples for Extensions Create. */ public final class ExtensionsCreateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/PutExtension.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/PutExtension.json */ /** * Sample code: Create Arc Extension. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsDeleteSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsDeleteSamples.java index e89be94c7633..dfcb5b605975 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsDeleteSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsDeleteSamples.java @@ -9,7 +9,7 @@ /** Samples for Extensions Delete. */ public final class ExtensionsDeleteSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/DeleteExtension.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/DeleteExtension.json */ /** * Sample code: Delete Arc Extension. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsGetSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsGetSamples.java index 6cf05532d264..9285264df294 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsGetSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsGetSamples.java @@ -9,7 +9,7 @@ /** Samples for Extensions Get. */ public final class ExtensionsGetSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/GetExtension.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/GetExtension.json */ /** * Sample code: Get ArcSettings Extension. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsListByArcSettingSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsListByArcSettingSamples.java index 8206a6b61cd7..83c92cfa28de 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsListByArcSettingSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsListByArcSettingSamples.java @@ -9,7 +9,7 @@ /** Samples for Extensions ListByArcSetting. */ public final class ExtensionsListByArcSettingSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/ListExtensionsByArcSetting.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/ListExtensionsByArcSetting.json */ /** * Sample code: List Extensions under ArcSetting resource. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsUpdateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsUpdateSamples.java index 382bea80ca75..e281c3d28b98 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsUpdateSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsUpdateSamples.java @@ -13,7 +13,7 @@ /** Samples for Extensions Update. */ public final class ExtensionsUpdateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/PatchExtension.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/PatchExtension.json */ /** * Sample code: Update Arc Extension. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/OffersGetSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/OffersGetSamples.java new file mode 100644 index 000000000000..1e8d0b216877 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/OffersGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +import com.azure.core.util.Context; + +/** Samples for Offers Get. */ +public final class OffersGetSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/GetOffer.json + */ + /** + * Sample code: Get Offer. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getOffer(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.offers().getWithResponse("test-rg", "myCluster", "publisher1", "offer1", null, Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/OffersListByClusterSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/OffersListByClusterSamples.java new file mode 100644 index 000000000000..d3f81b7edc6d --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/OffersListByClusterSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +import com.azure.core.util.Context; + +/** Samples for Offers ListByCluster. */ +public final class OffersListByClusterSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/ListOffersByCluster.json + */ + /** + * Sample code: List Offer resources by HCI Cluster. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listOfferResourcesByHCICluster( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.offers().listByCluster("test-rg", "myCluster", null, Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/OffersListByPublisherSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/OffersListByPublisherSamples.java new file mode 100644 index 000000000000..c85a5076e8ff --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/OffersListByPublisherSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +import com.azure.core.util.Context; + +/** Samples for Offers ListByPublisher. */ +public final class OffersListByPublisherSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/ListOffersByPublisher.json + */ + /** + * Sample code: List Offer resources by publisher for the HCI Cluster. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listOfferResourcesByPublisherForTheHCICluster( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.offers().listByPublisher("test-rg", "myCluster", "publisher1", null, Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/OperationsListSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/OperationsListSamples.java index 7dc158cda4c3..9ed9faa1f1e4 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/OperationsListSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/OperationsListSamples.java @@ -9,7 +9,7 @@ /** Samples for Operations List. */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/ListOperations.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/ListOperations.json */ /** * Sample code: Create cluster. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/PublishersGetSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/PublishersGetSamples.java new file mode 100644 index 000000000000..3fcdfb5c6d7c --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/PublishersGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +import com.azure.core.util.Context; + +/** Samples for Publishers Get. */ +public final class PublishersGetSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/GetPublisher.json + */ + /** + * Sample code: Get Publisher. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getPublisher(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.publishers().getWithResponse("test-rg", "myCluster", "publisher1", Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/PublishersListByClusterSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/PublishersListByClusterSamples.java new file mode 100644 index 000000000000..f8d83822dca3 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/PublishersListByClusterSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +import com.azure.core.util.Context; + +/** Samples for Publishers ListByCluster. */ +public final class PublishersListByClusterSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/ListPublishersByCluster.json + */ + /** + * Sample code: List Publisher resources by HCI Cluster. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listPublisherResourcesByHCICluster( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.publishers().listByCluster("test-rg", "myCluster", Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/SkusGetSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/SkusGetSamples.java new file mode 100644 index 000000000000..87fcfb55624a --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/SkusGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +import com.azure.core.util.Context; + +/** Samples for Skus Get. */ +public final class SkusGetSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/GetSku.json + */ + /** + * Sample code: Get Sku. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getSku(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.skus().getWithResponse("test-rg", "myCluster", "publisher1", "offer1", "sku1", null, Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/SkusListByOfferSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/SkusListByOfferSamples.java new file mode 100644 index 000000000000..ece68671bb55 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/SkusListByOfferSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +import com.azure.core.util.Context; + +/** Samples for Skus ListByOffer. */ +public final class SkusListByOfferSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/ListSkusByOffer.json + */ + /** + * Sample code: List SKU resources by offer for the HCI Cluster. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listSKUResourcesByOfferForTheHCICluster( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.skus().listByOffer("test-rg", "myCluster", "publisher1", "offer1", null, Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsDeleteSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsDeleteSamples.java new file mode 100644 index 000000000000..7c522bb6bb64 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsDeleteSamples.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.azurestackhci.generated; + +import com.azure.core.util.Context; + +/** Samples for UpdateRuns Delete. */ +public final class UpdateRunsDeleteSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/DeleteUpdateRuns.json + */ + /** + * Sample code: Delete an Update. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void deleteAnUpdate(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .updateRuns() + .delete( + "testrg", "testcluster", "Microsoft4.2203.2.32", "23b779ba-0d52-4a80-8571-45ca74664ec3", Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsGetSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsGetSamples.java new file mode 100644 index 000000000000..b87b2e54605d --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsGetSamples.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.azurestackhci.generated; + +import com.azure.core.util.Context; + +/** Samples for UpdateRuns Get. */ +public final class UpdateRunsGetSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/GetUpdateRuns.json + */ + /** + * Sample code: Get Update runs under cluster resource. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getUpdateRunsUnderClusterResource( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .updateRuns() + .getWithResponse( + "testrg", "testcluster", "Microsoft4.2203.2.32", "23b779ba-0d52-4a80-8571-45ca74664ec3", Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsListSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsListSamples.java new file mode 100644 index 000000000000..66880733b0fc --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +import com.azure.core.util.Context; + +/** Samples for UpdateRuns List. */ +public final class UpdateRunsListSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/ListUpdateRuns.json + */ + /** + * Sample code: List Update runs under cluster resource. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listUpdateRunsUnderClusterResource( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.updateRuns().list("testrg", "testcluster", "Microsoft4.2203.2.32", Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsPutSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsPutSamples.java new file mode 100644 index 000000000000..a03531aa40f8 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsPutSamples.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.Step; +import com.azure.resourcemanager.azurestackhci.models.UpdateRun; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** Samples for UpdateRuns Put. */ +public final class UpdateRunsPutSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/PutUpdateRuns.json + */ + /** + * Sample code: Get Update runs under cluster resource. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getUpdateRunsUnderClusterResource( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + UpdateRun resource = + manager + .updateRuns() + .getWithResponse( + "testrg", + "testcluster", + "Microsoft4.2203.2.32", + "23b779ba-0d52-4a80-8571-45ca74664ec3", + Context.NONE) + .getValue(); + resource + .update() + .withNamePropertiesName("Unnamed step") + .withDescription("Update Azure Stack.") + .withErrorMessage("") + .withStatus("Success") + .withStartTimeUtc(OffsetDateTime.parse("2022-04-06T01:36:33.3876751+00:00")) + .withEndTimeUtc(OffsetDateTime.parse("2022-04-06T13:58:42.969006+00:00")) + .withLastUpdatedTimeUtc(OffsetDateTime.parse("2022-04-06T13:58:42.969006+00:00")) + .withSteps( + Arrays + .asList( + new Step() + .withName("PreUpdate Cloud") + .withDescription("Prepare for SSU update") + .withErrorMessage("") + .withStatus("Success") + .withStartTimeUtc(OffsetDateTime.parse("2022-04-06T01:36:33.3876751+00:00")) + .withEndTimeUtc(OffsetDateTime.parse("2022-04-06T01:37:16.8728314+00:00")) + .withLastUpdatedTimeUtc(OffsetDateTime.parse("2022-04-06T01:37:16.8728314+00:00")) + .withSteps(Arrays.asList()))) + .apply(); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateSummariesOperationDeleteSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateSummariesOperationDeleteSamples.java new file mode 100644 index 000000000000..63176cac7187 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateSummariesOperationDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +import com.azure.core.util.Context; + +/** Samples for UpdateSummariesOperation Delete. */ +public final class UpdateSummariesOperationDeleteSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/DeleteUpdateSummaries.json + */ + /** + * Sample code: Delete an Update. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void deleteAnUpdate(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.updateSummariesOperations().delete("testrg", "testcluster", Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateSummariesOperationGetSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateSummariesOperationGetSamples.java new file mode 100644 index 000000000000..3dd84feec9e0 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateSummariesOperationGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +import com.azure.core.util.Context; + +/** Samples for UpdateSummariesOperation Get. */ +public final class UpdateSummariesOperationGetSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/GetUpdateSummaries.json + */ + /** + * Sample code: Get Update summaries under cluster resource. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getUpdateSummariesUnderClusterResource( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.updateSummariesOperations().getWithResponse("testrg", "testcluster", Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateSummariesOperationListSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateSummariesOperationListSamples.java new file mode 100644 index 000000000000..41d337b1dfc6 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateSummariesOperationListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +import com.azure.core.util.Context; + +/** Samples for UpdateSummariesOperation List. */ +public final class UpdateSummariesOperationListSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/ListUpdateSummaries.json + */ + /** + * Sample code: Get Update summaries under cluster resource. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getUpdateSummariesUnderClusterResource( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.updateSummariesOperations().list("testrg", "testcluster", Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateSummariesOperationPutSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateSummariesOperationPutSamples.java new file mode 100644 index 000000000000..dc322d3ddb96 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateSummariesOperationPutSamples.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.UpdateSummariesInner; +import com.azure.resourcemanager.azurestackhci.models.UpdateSummariesPropertiesState; +import java.time.OffsetDateTime; + +/** Samples for UpdateSummariesOperation Put. */ +public final class UpdateSummariesOperationPutSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/PutUpdateSummaries.json + */ + /** + * Sample code: Put Update summaries under cluster resource. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void putUpdateSummariesUnderClusterResource( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .updateSummariesOperations() + .putWithResponse( + "testrg", + "testcluster", + new UpdateSummariesInner() + .withOemFamily("DellEMC") + .withHardwareModel("PowerEdge R730xd") + .withCurrentVersion("4.2203.2.32") + .withLastUpdated(OffsetDateTime.parse("2022-04-06T14:08:18.254Z")) + .withLastChecked(OffsetDateTime.parse("2022-04-07T18:04:07Z")) + .withState(UpdateSummariesPropertiesState.APPLIED_SUCCESSFULLY), + Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesDeleteSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesDeleteSamples.java new file mode 100644 index 000000000000..068b06d93f7c --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +import com.azure.core.util.Context; + +/** Samples for Updates Delete. */ +public final class UpdatesDeleteSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/DeleteUpdates.json + */ + /** + * Sample code: Delete an Update. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void deleteAnUpdate(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.updates().delete("testrg", "testcluster", "Microsoft4.2203.2.32", Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesGetSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesGetSamples.java new file mode 100644 index 000000000000..e6686482f6f5 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +import com.azure.core.util.Context; + +/** Samples for Updates Get. */ +public final class UpdatesGetSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/GetUpdates.json + */ + /** + * Sample code: Get a specific update. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getASpecificUpdate(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.updates().getWithResponse("testrg", "testcluster", "Microsoft4.2203.2.32", Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesListSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesListSamples.java new file mode 100644 index 000000000000..7a0d67413042 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +import com.azure.core.util.Context; + +/** Samples for Updates List. */ +public final class UpdatesListSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/ListUpdates.json + */ + /** + * Sample code: List available updates. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listAvailableUpdates(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.updates().list("testrg", "testcluster", Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesPostSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesPostSamples.java new file mode 100644 index 000000000000..c7e901b569cf --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesPostSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +import com.azure.core.util.Context; + +/** Samples for Updates Post. */ +public final class UpdatesPostSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/PostUpdates.json + */ + /** + * Sample code: List available updates. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listAvailableUpdates(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.updates().post("testrg", "testcluster", "Microsoft4.2203.2.32", Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesPutSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesPutSamples.java new file mode 100644 index 000000000000..bc98fa568906 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesPutSamples.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.azurestackhci.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.models.AvailabilityType; +import com.azure.resourcemanager.azurestackhci.models.State; +import com.azure.resourcemanager.azurestackhci.models.Update; +import com.azure.resourcemanager.azurestackhci.models.UpdatePrerequisite; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** Samples for Updates Put. */ +public final class UpdatesPutSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/PutUpdates.json + */ + /** + * Sample code: Put a specific update. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void putASpecificUpdate(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + Update resource = + manager.updates().getWithResponse("testrg", "testcluster", "Microsoft4.2203.2.32", Context.NONE).getValue(); + resource + .update() + .withInstalledDate(OffsetDateTime.parse("2022-04-06T14:08:18.254Z")) + .withDescription("AzS Update 4.2203.2.32") + .withState(State.INSTALLED) + .withPrerequisites( + Arrays + .asList( + new UpdatePrerequisite() + .withUpdateType("update type") + .withVersion("prerequisite version") + .withPackageName("update package name"))) + .withPackagePath("\\\\SU1FileServer\\SU1_Infrastructure_2\\Updates\\Packages\\Microsoft4.2203.2.32") + .withPackageSizeInMb(18858.0F) + .withDisplayName("AzS Update - 4.2203.2.32") + .withVersion("4.2203.2.32") + .withPublisher("Microsoft") + .withReleaseLink("https://docs.microsoft.com/azure-stack/operator/release-notes?view=azs-2203") + .withAvailabilityType(AvailabilityType.LOCAL) + .withPackageType("Infrastructure") + .withAdditionalProperties("additional properties") + .withProgressPercentage(0.0F) + .withNotifyMessage("Brief message with instructions for updates of AvailabilityType Notify") + .apply(); + } +}