diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index e78acf6e1c3a7..ab3c62bcdfe65 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -294,6 +294,7 @@ com.azure.resourcemanager:azure-resourcemanager-imagebuilder;1.0.0-beta.1;1.0.0- com.azure.resourcemanager:azure-resourcemanager-maps;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-botservice;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-recoveryservicesbackup;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-providerhub;1.0.0-beta.1;1.0.0-beta.1 # Unreleased dependencies: Copy the entry from above, prepend "unreleased_" and remove the current # version. Unreleased dependencies are only valid for dependency versions. diff --git a/pom.xml b/pom.xml index 593ffcb081892..bdb97f2ae60ac 100644 --- a/pom.xml +++ b/pom.xml @@ -776,6 +776,7 @@ sdk/policyinsights sdk/postgresql sdk/powerbidedicated + sdk/providerhub sdk/purview sdk/quantum sdk/recoveryservices diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/CHANGELOG.md b/sdk/providerhub/azure-resourcemanager-providerhub/CHANGELOG.md new file mode 100644 index 0000000000000..444dbf1349ecd --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2021-05-26) + +- Azure Resource Manager ProviderHub client library for Java. This package contains Microsoft Azure SDK for ProviderHub Management SDK. Microsoft ProviderHub. Package tag package-2020-11-20. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/README.md b/sdk/providerhub/azure-resourcemanager-providerhub/README.md new file mode 100644 index 0000000000000..29c8da37c0f7f --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/README.md @@ -0,0 +1,101 @@ +# Azure Resource Manager ProviderHub client library for Java + +Azure Resource Manager ProviderHub client library for Java. + +This package contains Microsoft Azure SDK for ProviderHub Management SDK. Microsoft ProviderHub. Package tag package-2020-11-20. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +## We'd love to hear your feedback + +We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. + +If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. + +Thank you in advance for your collaboration. We really appreciate your time! + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-providerhub;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-providerhub + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Include the recommended packages + +Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. + +[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. + +### Authentication + +By default, Azure Active Directory token authentication depends on correct configure of 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`. + +With above configuration, `azure` client can be authenticated by following code: + +```java +AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +ProviderHubManager manager = ProviderHubManager + .authenticate(credential, profile); +``` + +The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. + +See [Authentication][authenticate] for more options. + +## Key concepts + +See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. + +## Examples + + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/master/CONTRIBUTING.md). + +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 + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/resourcemanager/docs/DESIGN.md diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/pom.xml b/sdk/providerhub/azure-resourcemanager-providerhub/pom.xml new file mode 100644 index 0000000000000..c0406c56cfdda --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/pom.xml @@ -0,0 +1,86 @@ + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-providerhub + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for ProviderHub Management + This package contains Microsoft Azure SDK for ProviderHub Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Microsoft ProviderHub. Package tag package-2020-11-20. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + + + + + com.azure + azure-core + 1.16.0 + + + com.azure + azure-core-management + 1.2.2 + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + true + + + + org.revapi + revapi-maven-plugin + 0.11.2 + + + + + java.method.addedToInterface + + + true + .* + com\.azure\.resourcemanager(\.[^.]+)+\.fluent(\.[^.]+)* + + + + + + + + diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/ProviderHubManager.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/ProviderHubManager.java new file mode 100644 index 0000000000000..3bcff99ecd44d --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/ProviderHubManager.java @@ -0,0 +1,301 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub; + +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.providerhub.fluent.ProviderHub; +import com.azure.resourcemanager.providerhub.implementation.CustomRolloutsImpl; +import com.azure.resourcemanager.providerhub.implementation.DefaultRolloutsImpl; +import com.azure.resourcemanager.providerhub.implementation.NotificationRegistrationsImpl; +import com.azure.resourcemanager.providerhub.implementation.OperationsImpl; +import com.azure.resourcemanager.providerhub.implementation.ProviderHubBuilder; +import com.azure.resourcemanager.providerhub.implementation.ProviderRegistrationsImpl; +import com.azure.resourcemanager.providerhub.implementation.ResourceProvidersImpl; +import com.azure.resourcemanager.providerhub.implementation.ResourceTypeRegistrationsImpl; +import com.azure.resourcemanager.providerhub.implementation.SkusImpl; +import com.azure.resourcemanager.providerhub.models.CustomRollouts; +import com.azure.resourcemanager.providerhub.models.DefaultRollouts; +import com.azure.resourcemanager.providerhub.models.NotificationRegistrations; +import com.azure.resourcemanager.providerhub.models.Operations; +import com.azure.resourcemanager.providerhub.models.ProviderRegistrations; +import com.azure.resourcemanager.providerhub.models.ResourceProviders; +import com.azure.resourcemanager.providerhub.models.ResourceTypeRegistrations; +import com.azure.resourcemanager.providerhub.models.Skus; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** Entry point to ProviderHubManager. Microsoft ProviderHub. */ +public final class ProviderHubManager { + private CustomRollouts customRollouts; + + private DefaultRollouts defaultRollouts; + + private ResourceProviders resourceProviders; + + private NotificationRegistrations notificationRegistrations; + + private Operations operations; + + private ProviderRegistrations providerRegistrations; + + private ResourceTypeRegistrations resourceTypeRegistrations; + + private Skus skus; + + private final ProviderHub clientObject; + + private ProviderHubManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new ProviderHubBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of ProviderHub service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the ProviderHub service API instance. + */ + public static ProviderHubManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Gets a Configurable instance that can be used to create ProviderHubManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new ProviderHubManager.Configurable(); + } + + /** The Configurable allowing configurations to be set. */ + public static final class Configurable { + private final ClientLogger logger = new ClientLogger(Configurable.class); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private RetryPolicy retryPolicy; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of ProviderHub service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the ProviderHub service API instance. + */ + public ProviderHubManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + StringBuilder userAgentBuilder = new StringBuilder(); + userAgentBuilder + .append("azsdk-java") + .append("-") + .append("com.azure.resourcemanager.providerhub") + .append("/") + .append("1.0.0-beta.1"); + if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { + userAgentBuilder + .append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (retryPolicy == null) { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new RequestIdPolicy()); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies + .add( + new BearerTokenAuthenticationPolicy( + credential, profile.getEnvironment().getManagementEndpoint() + "/.default")); + policies.addAll(this.policies); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new ProviderHubManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** @return Resource collection API of CustomRollouts. */ + public CustomRollouts customRollouts() { + if (this.customRollouts == null) { + this.customRollouts = new CustomRolloutsImpl(clientObject.getCustomRollouts(), this); + } + return customRollouts; + } + + /** @return Resource collection API of DefaultRollouts. */ + public DefaultRollouts defaultRollouts() { + if (this.defaultRollouts == null) { + this.defaultRollouts = new DefaultRolloutsImpl(clientObject.getDefaultRollouts(), this); + } + return defaultRollouts; + } + + /** @return Resource collection API of ResourceProviders. */ + public ResourceProviders resourceProviders() { + if (this.resourceProviders == null) { + this.resourceProviders = new ResourceProvidersImpl(clientObject.getResourceProviders(), this); + } + return resourceProviders; + } + + /** @return Resource collection API of NotificationRegistrations. */ + public NotificationRegistrations notificationRegistrations() { + if (this.notificationRegistrations == null) { + this.notificationRegistrations = + new NotificationRegistrationsImpl(clientObject.getNotificationRegistrations(), this); + } + return notificationRegistrations; + } + + /** @return Resource collection API of Operations. */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** @return Resource collection API of ProviderRegistrations. */ + public ProviderRegistrations providerRegistrations() { + if (this.providerRegistrations == null) { + this.providerRegistrations = new ProviderRegistrationsImpl(clientObject.getProviderRegistrations(), this); + } + return providerRegistrations; + } + + /** @return Resource collection API of ResourceTypeRegistrations. */ + public ResourceTypeRegistrations resourceTypeRegistrations() { + if (this.resourceTypeRegistrations == null) { + this.resourceTypeRegistrations = + new ResourceTypeRegistrationsImpl(clientObject.getResourceTypeRegistrations(), this); + } + return resourceTypeRegistrations; + } + + /** @return Resource collection API of Skus. */ + public Skus skus() { + if (this.skus == null) { + this.skus = new SkusImpl(clientObject.getSkus(), this); + } + return skus; + } + + /** + * @return Wrapped service client ProviderHub providing direct access to the underlying auto-generated API + * implementation, based on Azure REST API. + */ + public ProviderHub serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/fluent/CustomRolloutsClient.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/fluent/CustomRolloutsClient.java new file mode 100644 index 0000000000000..fb2fe07df559f --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/fluent/CustomRolloutsClient.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.providerhub.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.providerhub.fluent.models.CustomRolloutInner; + +/** An instance of this class provides access to all the operations defined in CustomRolloutsClient. */ +public interface CustomRolloutsClient { + /** + * Gets the custom rollout details. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param rolloutName The rollout name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom rollout details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CustomRolloutInner get(String providerNamespace, String rolloutName); + + /** + * Gets the custom rollout details. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param rolloutName The rollout name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom rollout details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String providerNamespace, String rolloutName, Context context); + + /** + * Creates or updates the rollout details. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param rolloutName The rollout name. + * @param properties The custom rollout properties supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return rollout details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CustomRolloutInner createOrUpdate(String providerNamespace, String rolloutName, CustomRolloutInner properties); + + /** + * Creates or updates the rollout details. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param rolloutName The rollout name. + * @param properties The custom rollout properties supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return rollout details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String providerNamespace, String rolloutName, CustomRolloutInner properties, Context context); + + /** + * Gets the list of the custom rollouts for the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the custom rollouts for the given provider. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByProviderRegistration(String providerNamespace); + + /** + * Gets the list of the custom rollouts for the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the custom rollouts for the given provider. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByProviderRegistration(String providerNamespace, Context context); +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/fluent/DefaultRolloutsClient.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/fluent/DefaultRolloutsClient.java new file mode 100644 index 0000000000000..d94649f80b21e --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/fluent/DefaultRolloutsClient.java @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.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.providerhub.fluent.models.DefaultRolloutInner; + +/** An instance of this class provides access to all the operations defined in DefaultRolloutsClient. */ +public interface DefaultRolloutsClient { + /** + * Gets the default rollout details. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param rolloutName The rollout name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the default rollout details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DefaultRolloutInner get(String providerNamespace, String rolloutName); + + /** + * Gets the default rollout details. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param rolloutName The rollout name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the default rollout details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String providerNamespace, String rolloutName, Context context); + + /** + * Deletes the rollout resource. Rollout must be in terminal state. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param rolloutName The rollout name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String providerNamespace, String rolloutName); + + /** + * Deletes the rollout resource. Rollout must be in terminal state. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param rolloutName The rollout name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String providerNamespace, String rolloutName, Context context); + + /** + * Creates or updates the rollout details. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param rolloutName The rollout name. + * @param properties The Default rollout properties supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return default rollout definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DefaultRolloutInner> beginCreateOrUpdate( + String providerNamespace, String rolloutName, DefaultRolloutInner properties); + + /** + * Creates or updates the rollout details. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param rolloutName The rollout name. + * @param properties The Default rollout properties supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return default rollout definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DefaultRolloutInner> beginCreateOrUpdate( + String providerNamespace, String rolloutName, DefaultRolloutInner properties, Context context); + + /** + * Creates or updates the rollout details. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param rolloutName The rollout name. + * @param properties The Default rollout properties supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return default rollout definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DefaultRolloutInner createOrUpdate(String providerNamespace, String rolloutName, DefaultRolloutInner properties); + + /** + * Creates or updates the rollout details. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param rolloutName The rollout name. + * @param properties The Default rollout properties supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return default rollout definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DefaultRolloutInner createOrUpdate( + String providerNamespace, String rolloutName, DefaultRolloutInner properties, Context context); + + /** + * Gets the list of the rollouts for the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the rollouts for the given provider. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByProviderRegistration(String providerNamespace); + + /** + * Gets the list of the rollouts for the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the rollouts for the given provider. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByProviderRegistration(String providerNamespace, Context context); + + /** + * Stops or cancels the rollout, if in progress. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param rolloutName The rollout name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void stop(String providerNamespace, String rolloutName); + + /** + * Stops or cancels the rollout, if in progress. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param rolloutName The rollout name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response stopWithResponse(String providerNamespace, String rolloutName, Context context); +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/fluent/NotificationRegistrationsClient.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/fluent/NotificationRegistrationsClient.java new file mode 100644 index 0000000000000..3b3d888585e2e --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/fluent/NotificationRegistrationsClient.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.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.providerhub.fluent.models.NotificationRegistrationInner; + +/** An instance of this class provides access to all the operations defined in NotificationRegistrationsClient. */ +public interface NotificationRegistrationsClient { + /** + * Gets the notification registration details. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param notificationRegistrationName The notification registration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the notification registration details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NotificationRegistrationInner get(String providerNamespace, String notificationRegistrationName); + + /** + * Gets the notification registration details. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param notificationRegistrationName The notification registration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the notification registration details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String providerNamespace, String notificationRegistrationName, Context context); + + /** + * Creates or updates a notification registration. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param notificationRegistrationName The notification registration. + * @param properties The required body parameters supplied to the notification registration operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the notification registration definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NotificationRegistrationInner createOrUpdate( + String providerNamespace, String notificationRegistrationName, NotificationRegistrationInner properties); + + /** + * Creates or updates a notification registration. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param notificationRegistrationName The notification registration. + * @param properties The required body parameters supplied to the notification registration operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the notification registration definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String providerNamespace, + String notificationRegistrationName, + NotificationRegistrationInner properties, + Context context); + + /** + * Deletes a notification registration. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param notificationRegistrationName The notification registration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 providerNamespace, String notificationRegistrationName); + + /** + * Deletes a notification registration. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param notificationRegistrationName The notification registration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String providerNamespace, String notificationRegistrationName, Context context); + + /** + * Gets the list of the notification registrations for the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the notification registrations for the given provider. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByProviderRegistration(String providerNamespace); + + /** + * Gets the list of the notification registrations for the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the notification registrations for the given provider. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByProviderRegistration(String providerNamespace, Context context); +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/fluent/OperationsClient.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/fluent/OperationsClient.java new file mode 100644 index 0000000000000..b76fcdb859aa2 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/fluent/OperationsClient.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.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.providerhub.fluent.models.OperationsContentInner; +import com.azure.resourcemanager.providerhub.fluent.models.OperationsDefinitionInner; +import com.azure.resourcemanager.providerhub.models.OperationsPutContent; +import java.util.List; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public interface OperationsClient { + /** + * Lists all the operations supported by Microsoft.ProviderHub. + * + * @throws com.azure.core.management.exception.ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all the operations supported by Microsoft.ProviderHub. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Gets the operations supported by the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operations supported by the given provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + List listByProviderRegistration(String providerNamespace); + + /** + * Gets the operations supported by the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operations supported by the given provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response> listByProviderRegistrationWithResponse( + String providerNamespace, Context context); + + /** + * Creates or updates the operation supported by the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param operationsPutContent The operations content properties supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationsContentInner createOrUpdate(String providerNamespace, OperationsPutContent operationsPutContent); + + /** + * Creates or updates the operation supported by the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param operationsPutContent The operations content properties supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String providerNamespace, OperationsPutContent operationsPutContent, Context context); + + /** + * Deletes an operation. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 providerNamespace); + + /** + * Deletes an operation. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String providerNamespace, Context context); +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/fluent/ProviderHub.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/fluent/ProviderHub.java new file mode 100644 index 0000000000000..c86fb68a54ce9 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/fluent/ProviderHub.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for ProviderHub class. */ +public interface ProviderHub { + /** + * Gets The ID of the target subscription. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the CustomRolloutsClient object to access its operations. + * + * @return the CustomRolloutsClient object. + */ + CustomRolloutsClient getCustomRollouts(); + + /** + * Gets the DefaultRolloutsClient object to access its operations. + * + * @return the DefaultRolloutsClient object. + */ + DefaultRolloutsClient getDefaultRollouts(); + + /** + * Gets the ResourceProvidersClient object to access its operations. + * + * @return the ResourceProvidersClient object. + */ + ResourceProvidersClient getResourceProviders(); + + /** + * Gets the NotificationRegistrationsClient object to access its operations. + * + * @return the NotificationRegistrationsClient object. + */ + NotificationRegistrationsClient getNotificationRegistrations(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the ProviderRegistrationsClient object to access its operations. + * + * @return the ProviderRegistrationsClient object. + */ + ProviderRegistrationsClient getProviderRegistrations(); + + /** + * Gets the ResourceTypeRegistrationsClient object to access its operations. + * + * @return the ResourceTypeRegistrationsClient object. + */ + ResourceTypeRegistrationsClient getResourceTypeRegistrations(); + + /** + * Gets the SkusClient object to access its operations. + * + * @return the SkusClient object. + */ + SkusClient getSkus(); +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/fluent/ProviderRegistrationsClient.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/fluent/ProviderRegistrationsClient.java new file mode 100644 index 0000000000000..3157ac3023d37 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/fluent/ProviderRegistrationsClient.java @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.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.providerhub.fluent.models.OperationsDefinitionInner; +import com.azure.resourcemanager.providerhub.fluent.models.ProviderRegistrationInner; +import java.util.List; + +/** An instance of this class provides access to all the operations defined in ProviderRegistrationsClient. */ +public interface ProviderRegistrationsClient { + /** + * Gets the provider registration details. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the provider registration details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProviderRegistrationInner get(String providerNamespace); + + /** + * Gets the provider registration details. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the provider registration details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String providerNamespace, Context context); + + /** + * Creates or updates the provider registration. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param properties The provider registration properties supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ProviderRegistrationInner> beginCreateOrUpdate( + String providerNamespace, ProviderRegistrationInner properties); + + /** + * Creates or updates the provider registration. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param properties The provider registration properties supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ProviderRegistrationInner> beginCreateOrUpdate( + String providerNamespace, ProviderRegistrationInner properties, Context context); + + /** + * Creates or updates the provider registration. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param properties The provider registration properties supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProviderRegistrationInner createOrUpdate(String providerNamespace, ProviderRegistrationInner properties); + + /** + * Creates or updates the provider registration. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param properties The provider registration properties supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProviderRegistrationInner createOrUpdate( + String providerNamespace, ProviderRegistrationInner properties, Context context); + + /** + * Deletes a provider registration. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 providerNamespace); + + /** + * Deletes a provider registration. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String providerNamespace, Context context); + + /** + * Gets the list of the provider registrations in the subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the provider registrations in the subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets the list of the provider registrations in the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the provider registrations in the subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Generates the operations api for the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return array of OperationsDefinition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + List generateOperations(String providerNamespace); + + /** + * Generates the operations api for the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return array of OperationsDefinition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response> generateOperationsWithResponse(String providerNamespace, Context context); +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/fluent/ResourceProvidersClient.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/fluent/ResourceProvidersClient.java new file mode 100644 index 0000000000000..a0bcf3bd3c24d --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/fluent/ResourceProvidersClient.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.providerhub.fluent.models.CheckinManifestInfoInner; +import com.azure.resourcemanager.providerhub.fluent.models.ResourceProviderManifestInner; +import com.azure.resourcemanager.providerhub.models.CheckinManifestParams; + +/** An instance of this class provides access to all the operations defined in ResourceProvidersClient. */ +public interface ResourceProvidersClient { + /** + * Generates the manifest for the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ResourceProviderManifestInner generateManifest(String providerNamespace); + + /** + * Generates the manifest for the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response generateManifestWithResponse(String providerNamespace, Context context); + + /** + * Checkin the manifest. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param checkinManifestParams The required body parameters supplied to the checkin manifest operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CheckinManifestInfoInner checkinManifest(String providerNamespace, CheckinManifestParams checkinManifestParams); + + /** + * Checkin the manifest. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param checkinManifestParams The required body parameters supplied to the checkin manifest operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkinManifestWithResponse( + String providerNamespace, CheckinManifestParams checkinManifestParams, Context context); +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/fluent/ResourceTypeRegistrationsClient.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/fluent/ResourceTypeRegistrationsClient.java new file mode 100644 index 0000000000000..3a3f49e20131b --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/fluent/ResourceTypeRegistrationsClient.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.providerhub.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.providerhub.fluent.models.ResourceTypeRegistrationInner; + +/** An instance of this class provides access to all the operations defined in ResourceTypeRegistrationsClient. */ +public interface ResourceTypeRegistrationsClient { + /** + * Gets a resource type details in the given subscription and provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a resource type details in the given subscription and provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ResourceTypeRegistrationInner get(String providerNamespace, String resourceType); + + /** + * Gets a resource type details in the given subscription and provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a resource type details in the given subscription and provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String providerNamespace, String resourceType, Context context); + + /** + * Creates or updates a resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param properties The required request body parameters supplied to the resource type registration CreateOrUpdate + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ResourceTypeRegistrationInner> beginCreateOrUpdate( + String providerNamespace, String resourceType, ResourceTypeRegistrationInner properties); + + /** + * Creates or updates a resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param properties The required request body parameters supplied to the resource type registration CreateOrUpdate + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ResourceTypeRegistrationInner> beginCreateOrUpdate( + String providerNamespace, String resourceType, ResourceTypeRegistrationInner properties, Context context); + + /** + * Creates or updates a resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param properties The required request body parameters supplied to the resource type registration CreateOrUpdate + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ResourceTypeRegistrationInner createOrUpdate( + String providerNamespace, String resourceType, ResourceTypeRegistrationInner properties); + + /** + * Creates or updates a resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param properties The required request body parameters supplied to the resource type registration CreateOrUpdate + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ResourceTypeRegistrationInner createOrUpdate( + String providerNamespace, String resourceType, ResourceTypeRegistrationInner properties, Context context); + + /** + * Deletes a resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String providerNamespace, String resourceType); + + /** + * Deletes a resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String providerNamespace, String resourceType, Context context); + + /** + * Gets the list of the resource types for the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the resource types for the given provider. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByProviderRegistration(String providerNamespace); + + /** + * Gets the list of the resource types for the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the resource types for the given provider. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByProviderRegistration(String providerNamespace, Context context); +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/fluent/SkusClient.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/fluent/SkusClient.java new file mode 100644 index 0000000000000..6185d8618345f --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/fluent/SkusClient.java @@ -0,0 +1,638 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.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.providerhub.fluent.models.SkuResourceInner; +import com.azure.resourcemanager.providerhub.models.ResourceTypeSku; + +/** An instance of this class provides access to all the operations defined in SkusClient. */ +public interface SkusClient { + /** + * Gets the sku details for the given resource type and sku name. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param sku The SKU. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sku details for the given resource type and sku name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SkuResourceInner get(String providerNamespace, String resourceType, String sku); + + /** + * Gets the sku details for the given resource type and sku name. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param sku The SKU. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sku details for the given resource type and sku name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String providerNamespace, String resourceType, String sku, Context context); + + /** + * Creates or updates the resource type skus in the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param sku The SKU. + * @param properties The required body parameters supplied to the resource sku operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SkuResourceInner createOrUpdate( + String providerNamespace, String resourceType, String sku, ResourceTypeSku properties); + + /** + * Creates or updates the resource type skus in the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param sku The SKU. + * @param properties The required body parameters supplied to the resource sku operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String providerNamespace, String resourceType, String sku, ResourceTypeSku properties, Context context); + + /** + * Deletes a resource type sku. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param sku The SKU. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 providerNamespace, String resourceType, String sku); + + /** + * Deletes a resource type sku. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param sku The SKU. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String providerNamespace, String resourceType, String sku, Context context); + + /** + * Gets the sku details for the given resource type and sku name. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param sku The SKU. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sku details for the given resource type and sku name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SkuResourceInner getNestedResourceTypeFirst( + String providerNamespace, String resourceType, String nestedResourceTypeFirst, String sku); + + /** + * Gets the sku details for the given resource type and sku name. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param sku The SKU. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sku details for the given resource type and sku name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getNestedResourceTypeFirstWithResponse( + String providerNamespace, String resourceType, String nestedResourceTypeFirst, String sku, Context context); + + /** + * Creates or updates the resource type skus in the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param sku The SKU. + * @param properties The required body parameters supplied to the resource sku operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SkuResourceInner createOrUpdateNestedResourceTypeFirst( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String sku, + ResourceTypeSku properties); + + /** + * Creates or updates the resource type skus in the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param sku The SKU. + * @param properties The required body parameters supplied to the resource sku operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateNestedResourceTypeFirstWithResponse( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String sku, + ResourceTypeSku properties, + Context context); + + /** + * Deletes a resource type sku. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param sku The SKU. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deleteNestedResourceTypeFirst( + String providerNamespace, String resourceType, String nestedResourceTypeFirst, String sku); + + /** + * Deletes a resource type sku. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param sku The SKU. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteNestedResourceTypeFirstWithResponse( + String providerNamespace, String resourceType, String nestedResourceTypeFirst, String sku, Context context); + + /** + * Gets the sku details for the given resource type and sku name. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param sku The SKU. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sku details for the given resource type and sku name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SkuResourceInner getNestedResourceTypeSecond( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String sku); + + /** + * Gets the sku details for the given resource type and sku name. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param sku The SKU. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sku details for the given resource type and sku name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getNestedResourceTypeSecondWithResponse( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String sku, + Context context); + + /** + * Creates or updates the resource type skus in the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param sku The SKU. + * @param properties The required body parameters supplied to the resource sku operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SkuResourceInner createOrUpdateNestedResourceTypeSecond( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String sku, + ResourceTypeSku properties); + + /** + * Creates or updates the resource type skus in the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param sku The SKU. + * @param properties The required body parameters supplied to the resource sku operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateNestedResourceTypeSecondWithResponse( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String sku, + ResourceTypeSku properties, + Context context); + + /** + * Deletes a resource type sku. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param sku The SKU. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deleteNestedResourceTypeSecond( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String sku); + + /** + * Deletes a resource type sku. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param sku The SKU. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteNestedResourceTypeSecondWithResponse( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String sku, + Context context); + + /** + * Gets the sku details for the given resource type and sku name. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param nestedResourceTypeThird The third child resource type. + * @param sku The SKU. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sku details for the given resource type and sku name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SkuResourceInner getNestedResourceTypeThird( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String nestedResourceTypeThird, + String sku); + + /** + * Gets the sku details for the given resource type and sku name. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param nestedResourceTypeThird The third child resource type. + * @param sku The SKU. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sku details for the given resource type and sku name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getNestedResourceTypeThirdWithResponse( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String nestedResourceTypeThird, + String sku, + Context context); + + /** + * Creates or updates the resource type skus in the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param nestedResourceTypeThird The third child resource type. + * @param sku The SKU. + * @param properties The required body parameters supplied to the resource sku operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SkuResourceInner createOrUpdateNestedResourceTypeThird( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String nestedResourceTypeThird, + String sku, + ResourceTypeSku properties); + + /** + * Creates or updates the resource type skus in the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param nestedResourceTypeThird The third child resource type. + * @param sku The SKU. + * @param properties The required body parameters supplied to the resource sku operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateNestedResourceTypeThirdWithResponse( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String nestedResourceTypeThird, + String sku, + ResourceTypeSku properties, + Context context); + + /** + * Deletes a resource type sku. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param nestedResourceTypeThird The third child resource type. + * @param sku The SKU. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deleteNestedResourceTypeThird( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String nestedResourceTypeThird, + String sku); + + /** + * Deletes a resource type sku. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param nestedResourceTypeThird The third child resource type. + * @param sku The SKU. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteNestedResourceTypeThirdWithResponse( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String nestedResourceTypeThird, + String sku, + Context context); + + /** + * Gets the list of skus for the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of skus for the given resource type. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceTypeRegistrations(String providerNamespace, String resourceType); + + /** + * Gets the list of skus for the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of skus for the given resource type. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceTypeRegistrations( + String providerNamespace, String resourceType, Context context); + + /** + * Gets the list of skus for the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of skus for the given resource type. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceTypeRegistrationsNestedResourceTypeFirst( + String providerNamespace, String resourceType, String nestedResourceTypeFirst); + + /** + * Gets the list of skus for the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of skus for the given resource type. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceTypeRegistrationsNestedResourceTypeFirst( + String providerNamespace, String resourceType, String nestedResourceTypeFirst, Context context); + + /** + * Gets the list of skus for the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of skus for the given resource type. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceTypeRegistrationsNestedResourceTypeSecond( + String providerNamespace, String resourceType, String nestedResourceTypeFirst, String nestedResourceTypeSecond); + + /** + * Gets the list of skus for the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of skus for the given resource type. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceTypeRegistrationsNestedResourceTypeSecond( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + Context context); + + /** + * Gets the list of skus for the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param nestedResourceTypeThird The third child resource type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of skus for the given resource type. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceTypeRegistrationsNestedResourceTypeThird( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String nestedResourceTypeThird); + + /** + * Gets the list of skus for the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param nestedResourceTypeThird The third child resource type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of skus for the given resource type. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceTypeRegistrationsNestedResourceTypeThird( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String nestedResourceTypeThird, + Context context); +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/fluent/models/CheckinManifestInfoInner.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/fluent/models/CheckinManifestInfoInner.java new file mode 100644 index 0000000000000..7f63af2cfd29b --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/fluent/models/CheckinManifestInfoInner.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The CheckinManifestInfo model. */ +@Fluent +public final class CheckinManifestInfoInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CheckinManifestInfoInner.class); + + /* + * The isCheckedIn property. + */ + @JsonProperty(value = "isCheckedIn", required = true) + private boolean isCheckedIn; + + /* + * The statusMessage property. + */ + @JsonProperty(value = "statusMessage", required = true) + private String statusMessage; + + /* + * The pullRequest property. + */ + @JsonProperty(value = "pullRequest") + private String pullRequest; + + /* + * The commitId property. + */ + @JsonProperty(value = "commitId") + private String commitId; + + /** + * Get the isCheckedIn property: The isCheckedIn property. + * + * @return the isCheckedIn value. + */ + public boolean isCheckedIn() { + return this.isCheckedIn; + } + + /** + * Set the isCheckedIn property: The isCheckedIn property. + * + * @param isCheckedIn the isCheckedIn value to set. + * @return the CheckinManifestInfoInner object itself. + */ + public CheckinManifestInfoInner withIsCheckedIn(boolean isCheckedIn) { + this.isCheckedIn = isCheckedIn; + return this; + } + + /** + * Get the statusMessage property: The statusMessage property. + * + * @return the statusMessage value. + */ + public String statusMessage() { + return this.statusMessage; + } + + /** + * Set the statusMessage property: The statusMessage property. + * + * @param statusMessage the statusMessage value to set. + * @return the CheckinManifestInfoInner object itself. + */ + public CheckinManifestInfoInner withStatusMessage(String statusMessage) { + this.statusMessage = statusMessage; + return this; + } + + /** + * Get the pullRequest property: The pullRequest property. + * + * @return the pullRequest value. + */ + public String pullRequest() { + return this.pullRequest; + } + + /** + * Set the pullRequest property: The pullRequest property. + * + * @param pullRequest the pullRequest value to set. + * @return the CheckinManifestInfoInner object itself. + */ + public CheckinManifestInfoInner withPullRequest(String pullRequest) { + this.pullRequest = pullRequest; + return this; + } + + /** + * Get the commitId property: The commitId property. + * + * @return the commitId value. + */ + public String commitId() { + return this.commitId; + } + + /** + * Set the commitId property: The commitId property. + * + * @param commitId the commitId value to set. + * @return the CheckinManifestInfoInner object itself. + */ + public CheckinManifestInfoInner withCommitId(String commitId) { + this.commitId = commitId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (statusMessage() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property statusMessage in model CheckinManifestInfoInner")); + } + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/fluent/models/CustomRolloutInner.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/fluent/models/CustomRolloutInner.java new file mode 100644 index 0000000000000..7c56b9cd8499d --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/fluent/models/CustomRolloutInner.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.providerhub.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.providerhub.models.CustomRolloutProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Rollout details. */ +@Fluent +public final class CustomRolloutInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomRolloutInner.class); + + /* + * Properties of the rollout. + */ + @JsonProperty(value = "properties", required = true) + private CustomRolloutProperties properties; + + /** + * Get the properties property: Properties of the rollout. + * + * @return the properties value. + */ + public CustomRolloutProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the rollout. + * + * @param properties the properties value to set. + * @return the CustomRolloutInner object itself. + */ + public CustomRolloutInner withProperties(CustomRolloutProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property properties in model CustomRolloutInner")); + } else { + properties().validate(); + } + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/fluent/models/DefaultRolloutInner.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/fluent/models/DefaultRolloutInner.java new file mode 100644 index 0000000000000..e364bba80aafa --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/fluent/models/DefaultRolloutInner.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.providerhub.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.providerhub.models.DefaultRolloutProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Default rollout definition. */ +@Fluent +public final class DefaultRolloutInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DefaultRolloutInner.class); + + /* + * Properties of the rollout. + */ + @JsonProperty(value = "properties") + private DefaultRolloutProperties properties; + + /** + * Get the properties property: Properties of the rollout. + * + * @return the properties value. + */ + public DefaultRolloutProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the rollout. + * + * @param properties the properties value to set. + * @return the DefaultRolloutInner object itself. + */ + public DefaultRolloutInner withProperties(DefaultRolloutProperties 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/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/fluent/models/NotificationRegistrationInner.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/fluent/models/NotificationRegistrationInner.java new file mode 100644 index 0000000000000..d2d2e32e3df50 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/fluent/models/NotificationRegistrationInner.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.providerhub.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.providerhub.models.NotificationRegistrationProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The notification registration definition. */ +@Fluent +public final class NotificationRegistrationInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NotificationRegistrationInner.class); + + /* + * The properties property. + */ + @JsonProperty(value = "properties") + private NotificationRegistrationProperties properties; + + /** + * Get the properties property: The properties property. + * + * @return the properties value. + */ + public NotificationRegistrationProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The properties property. + * + * @param properties the properties value to set. + * @return the NotificationRegistrationInner object itself. + */ + public NotificationRegistrationInner withProperties(NotificationRegistrationProperties 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/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/fluent/models/OperationsContentInner.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/fluent/models/OperationsContentInner.java new file mode 100644 index 0000000000000..7c6e2323dcfae --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/fluent/models/OperationsContentInner.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.providerhub.models.OperationsDefinitionActionType; +import com.azure.resourcemanager.providerhub.models.OperationsDefinitionDisplay; +import com.azure.resourcemanager.providerhub.models.OperationsDefinitionOrigin; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The OperationsContent model. */ +@JsonFlatten +@Fluent +public class OperationsContentInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsContentInner.class); + + /* + * Name of the operation. + */ + @JsonProperty(value = "properties.name") + private String namePropertiesName; + + /* + * Indicates whether the operation applies to data-plane. + */ + @JsonProperty(value = "properties.isDataAction") + private Boolean isDataAction; + + /* + * The origin property. + */ + @JsonProperty(value = "properties.origin") + private OperationsDefinitionOrigin origin; + + /* + * Display information of the operation. + */ + @JsonProperty(value = "properties.display") + private OperationsDefinitionDisplay display; + + /* + * The actionType property. + */ + @JsonProperty(value = "properties.actionType") + private OperationsDefinitionActionType actionType; + + /* + * Any object + */ + @JsonProperty(value = "properties.properties") + private Object properties; + + /** + * Get the namePropertiesName property: Name of the operation. + * + * @return the namePropertiesName value. + */ + public String namePropertiesName() { + return this.namePropertiesName; + } + + /** + * Set the namePropertiesName property: Name of the operation. + * + * @param namePropertiesName the namePropertiesName value to set. + * @return the OperationsContentInner object itself. + */ + public OperationsContentInner withNamePropertiesName(String namePropertiesName) { + this.namePropertiesName = namePropertiesName; + return this; + } + + /** + * Get the isDataAction property: Indicates whether the operation applies to data-plane. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Set the isDataAction property: Indicates whether the operation applies to data-plane. + * + * @param isDataAction the isDataAction value to set. + * @return the OperationsContentInner object itself. + */ + public OperationsContentInner withIsDataAction(Boolean isDataAction) { + this.isDataAction = isDataAction; + return this; + } + + /** + * Get the origin property: The origin property. + * + * @return the origin value. + */ + public OperationsDefinitionOrigin origin() { + return this.origin; + } + + /** + * Set the origin property: The origin property. + * + * @param origin the origin value to set. + * @return the OperationsContentInner object itself. + */ + public OperationsContentInner withOrigin(OperationsDefinitionOrigin origin) { + this.origin = origin; + return this; + } + + /** + * Get the display property: Display information of the operation. + * + * @return the display value. + */ + public OperationsDefinitionDisplay display() { + return this.display; + } + + /** + * Set the display property: Display information of the operation. + * + * @param display the display value to set. + * @return the OperationsContentInner object itself. + */ + public OperationsContentInner withDisplay(OperationsDefinitionDisplay display) { + this.display = display; + return this; + } + + /** + * Get the actionType property: The actionType property. + * + * @return the actionType value. + */ + public OperationsDefinitionActionType actionType() { + return this.actionType; + } + + /** + * Set the actionType property: The actionType property. + * + * @param actionType the actionType value to set. + * @return the OperationsContentInner object itself. + */ + public OperationsContentInner withActionType(OperationsDefinitionActionType actionType) { + this.actionType = actionType; + return this; + } + + /** + * Get the properties property: Any object. + * + * @return the properties value. + */ + public Object properties() { + return this.properties; + } + + /** + * Set the properties property: Any object. + * + * @param properties the properties value to set. + * @return the OperationsContentInner object itself. + */ + public OperationsContentInner withProperties(Object properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/fluent/models/OperationsDefinitionInner.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/fluent/models/OperationsDefinitionInner.java new file mode 100644 index 0000000000000..920e38dbf4b82 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/fluent/models/OperationsDefinitionInner.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.providerhub.models.OperationsDefinitionActionType; +import com.azure.resourcemanager.providerhub.models.OperationsDefinitionDisplay; +import com.azure.resourcemanager.providerhub.models.OperationsDefinitionOrigin; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of an Operation. */ +@Fluent +public final class OperationsDefinitionInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsDefinitionInner.class); + + /* + * Name of the operation. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Indicates whether the operation applies to data-plane. + */ + @JsonProperty(value = "isDataAction") + private Boolean isDataAction; + + /* + * The origin property. + */ + @JsonProperty(value = "origin") + private OperationsDefinitionOrigin origin; + + /* + * Display information of the operation. + */ + @JsonProperty(value = "display", required = true) + private OperationsDefinitionDisplay display; + + /* + * The actionType property. + */ + @JsonProperty(value = "actionType") + private OperationsDefinitionActionType actionType; + + /* + * Any object + */ + @JsonProperty(value = "properties") + private Object properties; + + /** + * Get the name property: Name of the operation. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the operation. + * + * @param name the name value to set. + * @return the OperationsDefinitionInner object itself. + */ + public OperationsDefinitionInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the isDataAction property: Indicates whether the operation applies to data-plane. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Set the isDataAction property: Indicates whether the operation applies to data-plane. + * + * @param isDataAction the isDataAction value to set. + * @return the OperationsDefinitionInner object itself. + */ + public OperationsDefinitionInner withIsDataAction(Boolean isDataAction) { + this.isDataAction = isDataAction; + return this; + } + + /** + * Get the origin property: The origin property. + * + * @return the origin value. + */ + public OperationsDefinitionOrigin origin() { + return this.origin; + } + + /** + * Set the origin property: The origin property. + * + * @param origin the origin value to set. + * @return the OperationsDefinitionInner object itself. + */ + public OperationsDefinitionInner withOrigin(OperationsDefinitionOrigin origin) { + this.origin = origin; + return this; + } + + /** + * Get the display property: Display information of the operation. + * + * @return the display value. + */ + public OperationsDefinitionDisplay display() { + return this.display; + } + + /** + * Set the display property: Display information of the operation. + * + * @param display the display value to set. + * @return the OperationsDefinitionInner object itself. + */ + public OperationsDefinitionInner withDisplay(OperationsDefinitionDisplay display) { + this.display = display; + return this; + } + + /** + * Get the actionType property: The actionType property. + * + * @return the actionType value. + */ + public OperationsDefinitionActionType actionType() { + return this.actionType; + } + + /** + * Set the actionType property: The actionType property. + * + * @param actionType the actionType value to set. + * @return the OperationsDefinitionInner object itself. + */ + public OperationsDefinitionInner withActionType(OperationsDefinitionActionType actionType) { + this.actionType = actionType; + return this; + } + + /** + * Get the properties property: Any object. + * + * @return the properties value. + */ + public Object properties() { + return this.properties; + } + + /** + * Set the properties property: Any object. + * + * @param properties the properties value to set. + * @return the OperationsDefinitionInner object itself. + */ + public OperationsDefinitionInner withProperties(Object properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model OperationsDefinitionInner")); + } + if (display() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property display in model OperationsDefinitionInner")); + } else { + display().validate(); + } + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/fluent/models/ProviderRegistrationInner.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/fluent/models/ProviderRegistrationInner.java new file mode 100644 index 0000000000000..5ad1e30f2c376 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/fluent/models/ProviderRegistrationInner.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.providerhub.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.providerhub.models.ProviderRegistrationProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ProviderRegistration model. */ +@Fluent +public class ProviderRegistrationInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProviderRegistrationInner.class); + + /* + * The properties property. + */ + @JsonProperty(value = "properties") + private ProviderRegistrationProperties properties; + + /** + * Get the properties property: The properties property. + * + * @return the properties value. + */ + public ProviderRegistrationProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The properties property. + * + * @param properties the properties value to set. + * @return the ProviderRegistrationInner object itself. + */ + public ProviderRegistrationInner withProperties(ProviderRegistrationProperties 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/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/fluent/models/ResourceProviderManifestInner.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/fluent/models/ResourceProviderManifestInner.java new file mode 100644 index 0000000000000..817ba5c815030 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/fluent/models/ResourceProviderManifestInner.java @@ -0,0 +1,431 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.providerhub.models.ResourceProviderAuthorization; +import com.azure.resourcemanager.providerhub.models.ResourceProviderCapabilities; +import com.azure.resourcemanager.providerhub.models.ResourceProviderEndpoint; +import com.azure.resourcemanager.providerhub.models.ResourceProviderManifestFeaturesRule; +import com.azure.resourcemanager.providerhub.models.ResourceProviderManifestManagement; +import com.azure.resourcemanager.providerhub.models.ResourceProviderManifestProviderAuthentication; +import com.azure.resourcemanager.providerhub.models.ResourceProviderManifestReRegisterSubscriptionMetadata; +import com.azure.resourcemanager.providerhub.models.ResourceProviderManifestRequestHeaderOptions; +import com.azure.resourcemanager.providerhub.models.ResourceProviderType; +import com.azure.resourcemanager.providerhub.models.ResourceType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The ResourceProviderManifest model. */ +@Fluent +public final class ResourceProviderManifestInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceProviderManifestInner.class); + + /* + * The providerAuthentication property. + */ + @JsonProperty(value = "providerAuthentication") + private ResourceProviderManifestProviderAuthentication providerAuthentication; + + /* + * The providerAuthorizations property. + */ + @JsonProperty(value = "providerAuthorizations") + private List providerAuthorizations; + + /* + * The namespace property. + */ + @JsonProperty(value = "namespace") + private String namespace; + + /* + * The providerVersion property. + */ + @JsonProperty(value = "providerVersion") + private String providerVersion; + + /* + * The providerType property. + */ + @JsonProperty(value = "providerType") + private ResourceProviderType providerType; + + /* + * The requiredFeatures property. + */ + @JsonProperty(value = "requiredFeatures") + private List requiredFeatures; + + /* + * The featuresRule property. + */ + @JsonProperty(value = "featuresRule") + private ResourceProviderManifestFeaturesRule featuresRule; + + /* + * The requestHeaderOptions property. + */ + @JsonProperty(value = "requestHeaderOptions") + private ResourceProviderManifestRequestHeaderOptions requestHeaderOptions; + + /* + * The resourceTypes property. + */ + @JsonProperty(value = "resourceTypes") + private List resourceTypes; + + /* + * The management property. + */ + @JsonProperty(value = "management") + private ResourceProviderManifestManagement management; + + /* + * The capabilities property. + */ + @JsonProperty(value = "capabilities") + private List capabilities; + + /* + * Any object + */ + @JsonProperty(value = "metadata") + private Object metadata; + + /* + * The globalNotificationEndpoints property. + */ + @JsonProperty(value = "globalNotificationEndpoints") + private List globalNotificationEndpoints; + + /* + * The reRegisterSubscriptionMetadata property. + */ + @JsonProperty(value = "reRegisterSubscriptionMetadata") + private ResourceProviderManifestReRegisterSubscriptionMetadata reRegisterSubscriptionMetadata; + + /** + * Get the providerAuthentication property: The providerAuthentication property. + * + * @return the providerAuthentication value. + */ + public ResourceProviderManifestProviderAuthentication providerAuthentication() { + return this.providerAuthentication; + } + + /** + * Set the providerAuthentication property: The providerAuthentication property. + * + * @param providerAuthentication the providerAuthentication value to set. + * @return the ResourceProviderManifestInner object itself. + */ + public ResourceProviderManifestInner withProviderAuthentication( + ResourceProviderManifestProviderAuthentication providerAuthentication) { + this.providerAuthentication = providerAuthentication; + return this; + } + + /** + * Get the providerAuthorizations property: The providerAuthorizations property. + * + * @return the providerAuthorizations value. + */ + public List providerAuthorizations() { + return this.providerAuthorizations; + } + + /** + * Set the providerAuthorizations property: The providerAuthorizations property. + * + * @param providerAuthorizations the providerAuthorizations value to set. + * @return the ResourceProviderManifestInner object itself. + */ + public ResourceProviderManifestInner withProviderAuthorizations( + List providerAuthorizations) { + this.providerAuthorizations = providerAuthorizations; + return this; + } + + /** + * Get the namespace property: The namespace property. + * + * @return the namespace value. + */ + public String namespace() { + return this.namespace; + } + + /** + * Set the namespace property: The namespace property. + * + * @param namespace the namespace value to set. + * @return the ResourceProviderManifestInner object itself. + */ + public ResourceProviderManifestInner withNamespace(String namespace) { + this.namespace = namespace; + return this; + } + + /** + * Get the providerVersion property: The providerVersion property. + * + * @return the providerVersion value. + */ + public String providerVersion() { + return this.providerVersion; + } + + /** + * Set the providerVersion property: The providerVersion property. + * + * @param providerVersion the providerVersion value to set. + * @return the ResourceProviderManifestInner object itself. + */ + public ResourceProviderManifestInner withProviderVersion(String providerVersion) { + this.providerVersion = providerVersion; + return this; + } + + /** + * Get the providerType property: The providerType property. + * + * @return the providerType value. + */ + public ResourceProviderType providerType() { + return this.providerType; + } + + /** + * Set the providerType property: The providerType property. + * + * @param providerType the providerType value to set. + * @return the ResourceProviderManifestInner object itself. + */ + public ResourceProviderManifestInner withProviderType(ResourceProviderType providerType) { + this.providerType = providerType; + return this; + } + + /** + * Get the requiredFeatures property: The requiredFeatures property. + * + * @return the requiredFeatures value. + */ + public List requiredFeatures() { + return this.requiredFeatures; + } + + /** + * Set the requiredFeatures property: The requiredFeatures property. + * + * @param requiredFeatures the requiredFeatures value to set. + * @return the ResourceProviderManifestInner object itself. + */ + public ResourceProviderManifestInner withRequiredFeatures(List requiredFeatures) { + this.requiredFeatures = requiredFeatures; + return this; + } + + /** + * Get the featuresRule property: The featuresRule property. + * + * @return the featuresRule value. + */ + public ResourceProviderManifestFeaturesRule featuresRule() { + return this.featuresRule; + } + + /** + * Set the featuresRule property: The featuresRule property. + * + * @param featuresRule the featuresRule value to set. + * @return the ResourceProviderManifestInner object itself. + */ + public ResourceProviderManifestInner withFeaturesRule(ResourceProviderManifestFeaturesRule featuresRule) { + this.featuresRule = featuresRule; + return this; + } + + /** + * Get the requestHeaderOptions property: The requestHeaderOptions property. + * + * @return the requestHeaderOptions value. + */ + public ResourceProviderManifestRequestHeaderOptions requestHeaderOptions() { + return this.requestHeaderOptions; + } + + /** + * Set the requestHeaderOptions property: The requestHeaderOptions property. + * + * @param requestHeaderOptions the requestHeaderOptions value to set. + * @return the ResourceProviderManifestInner object itself. + */ + public ResourceProviderManifestInner withRequestHeaderOptions( + ResourceProviderManifestRequestHeaderOptions requestHeaderOptions) { + this.requestHeaderOptions = requestHeaderOptions; + return this; + } + + /** + * Get the resourceTypes property: The resourceTypes property. + * + * @return the resourceTypes value. + */ + public List resourceTypes() { + return this.resourceTypes; + } + + /** + * Set the resourceTypes property: The resourceTypes property. + * + * @param resourceTypes the resourceTypes value to set. + * @return the ResourceProviderManifestInner object itself. + */ + public ResourceProviderManifestInner withResourceTypes(List resourceTypes) { + this.resourceTypes = resourceTypes; + return this; + } + + /** + * Get the management property: The management property. + * + * @return the management value. + */ + public ResourceProviderManifestManagement management() { + return this.management; + } + + /** + * Set the management property: The management property. + * + * @param management the management value to set. + * @return the ResourceProviderManifestInner object itself. + */ + public ResourceProviderManifestInner withManagement(ResourceProviderManifestManagement management) { + this.management = management; + return this; + } + + /** + * Get the capabilities property: The capabilities property. + * + * @return the capabilities value. + */ + public List capabilities() { + return this.capabilities; + } + + /** + * Set the capabilities property: The capabilities property. + * + * @param capabilities the capabilities value to set. + * @return the ResourceProviderManifestInner object itself. + */ + public ResourceProviderManifestInner withCapabilities(List capabilities) { + this.capabilities = capabilities; + return this; + } + + /** + * Get the metadata property: Any object. + * + * @return the metadata value. + */ + public Object metadata() { + return this.metadata; + } + + /** + * Set the metadata property: Any object. + * + * @param metadata the metadata value to set. + * @return the ResourceProviderManifestInner object itself. + */ + public ResourceProviderManifestInner withMetadata(Object metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get the globalNotificationEndpoints property: The globalNotificationEndpoints property. + * + * @return the globalNotificationEndpoints value. + */ + public List globalNotificationEndpoints() { + return this.globalNotificationEndpoints; + } + + /** + * Set the globalNotificationEndpoints property: The globalNotificationEndpoints property. + * + * @param globalNotificationEndpoints the globalNotificationEndpoints value to set. + * @return the ResourceProviderManifestInner object itself. + */ + public ResourceProviderManifestInner withGlobalNotificationEndpoints( + List globalNotificationEndpoints) { + this.globalNotificationEndpoints = globalNotificationEndpoints; + return this; + } + + /** + * Get the reRegisterSubscriptionMetadata property: The reRegisterSubscriptionMetadata property. + * + * @return the reRegisterSubscriptionMetadata value. + */ + public ResourceProviderManifestReRegisterSubscriptionMetadata reRegisterSubscriptionMetadata() { + return this.reRegisterSubscriptionMetadata; + } + + /** + * Set the reRegisterSubscriptionMetadata property: The reRegisterSubscriptionMetadata property. + * + * @param reRegisterSubscriptionMetadata the reRegisterSubscriptionMetadata value to set. + * @return the ResourceProviderManifestInner object itself. + */ + public ResourceProviderManifestInner withReRegisterSubscriptionMetadata( + ResourceProviderManifestReRegisterSubscriptionMetadata reRegisterSubscriptionMetadata) { + this.reRegisterSubscriptionMetadata = reRegisterSubscriptionMetadata; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (providerAuthentication() != null) { + providerAuthentication().validate(); + } + if (providerAuthorizations() != null) { + providerAuthorizations().forEach(e -> e.validate()); + } + if (featuresRule() != null) { + featuresRule().validate(); + } + if (requestHeaderOptions() != null) { + requestHeaderOptions().validate(); + } + if (resourceTypes() != null) { + resourceTypes().forEach(e -> e.validate()); + } + if (management() != null) { + management().validate(); + } + if (capabilities() != null) { + capabilities().forEach(e -> e.validate()); + } + if (globalNotificationEndpoints() != null) { + globalNotificationEndpoints().forEach(e -> e.validate()); + } + if (reRegisterSubscriptionMetadata() != null) { + reRegisterSubscriptionMetadata().validate(); + } + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/fluent/models/ResourceTypeRegistrationInner.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/fluent/models/ResourceTypeRegistrationInner.java new file mode 100644 index 0000000000000..31855c19a5d51 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/fluent/models/ResourceTypeRegistrationInner.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.providerhub.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.providerhub.models.ResourceTypeRegistrationProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ResourceTypeRegistration model. */ +@Fluent +public final class ResourceTypeRegistrationInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceTypeRegistrationInner.class); + + /* + * The properties property. + */ + @JsonProperty(value = "properties") + private ResourceTypeRegistrationProperties properties; + + /** + * Get the properties property: The properties property. + * + * @return the properties value. + */ + public ResourceTypeRegistrationProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The properties property. + * + * @param properties the properties value to set. + * @return the ResourceTypeRegistrationInner object itself. + */ + public ResourceTypeRegistrationInner withProperties(ResourceTypeRegistrationProperties 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/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/fluent/models/SkuResourceInner.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/fluent/models/SkuResourceInner.java new file mode 100644 index 0000000000000..a1735d2b6a339 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/fluent/models/SkuResourceInner.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.providerhub.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.providerhub.models.SkuResourceProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SkuResource model. */ +@Fluent +public final class SkuResourceInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SkuResourceInner.class); + + /* + * The properties property. + */ + @JsonProperty(value = "properties") + private SkuResourceProperties properties; + + /** + * Get the properties property: The properties property. + * + * @return the properties value. + */ + public SkuResourceProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The properties property. + * + * @param properties the properties value to set. + * @return the SkuResourceInner object itself. + */ + public SkuResourceInner withProperties(SkuResourceProperties 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/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/fluent/models/package-info.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/fluent/models/package-info.java new file mode 100644 index 0000000000000..7ddc9f258e55e --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/fluent/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the inner data models for ProviderHub. Microsoft ProviderHub. */ +package com.azure.resourcemanager.providerhub.fluent.models; diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/fluent/package-info.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/fluent/package-info.java new file mode 100644 index 0000000000000..99ec7bc66353f --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/fluent/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the service clients for ProviderHub. Microsoft ProviderHub. */ +package com.azure.resourcemanager.providerhub.fluent; diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/CheckinManifestInfoImpl.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/CheckinManifestInfoImpl.java new file mode 100644 index 0000000000000..c5c70917f8194 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/CheckinManifestInfoImpl.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.providerhub.implementation; + +import com.azure.resourcemanager.providerhub.fluent.models.CheckinManifestInfoInner; +import com.azure.resourcemanager.providerhub.models.CheckinManifestInfo; + +public final class CheckinManifestInfoImpl implements CheckinManifestInfo { + private CheckinManifestInfoInner innerObject; + + private final com.azure.resourcemanager.providerhub.ProviderHubManager serviceManager; + + CheckinManifestInfoImpl( + CheckinManifestInfoInner innerObject, com.azure.resourcemanager.providerhub.ProviderHubManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public boolean isCheckedIn() { + return this.innerModel().isCheckedIn(); + } + + public String statusMessage() { + return this.innerModel().statusMessage(); + } + + public String pullRequest() { + return this.innerModel().pullRequest(); + } + + public String commitId() { + return this.innerModel().commitId(); + } + + public CheckinManifestInfoInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.providerhub.ProviderHubManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/CustomRolloutImpl.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/CustomRolloutImpl.java new file mode 100644 index 0000000000000..18784be772271 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/CustomRolloutImpl.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.providerhub.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.providerhub.fluent.models.CustomRolloutInner; +import com.azure.resourcemanager.providerhub.models.CustomRollout; +import com.azure.resourcemanager.providerhub.models.CustomRolloutProperties; + +public final class CustomRolloutImpl implements CustomRollout, CustomRollout.Definition, CustomRollout.Update { + private CustomRolloutInner innerObject; + + private final com.azure.resourcemanager.providerhub.ProviderHubManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public CustomRolloutProperties properties() { + return this.innerModel().properties(); + } + + public CustomRolloutInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.providerhub.ProviderHubManager manager() { + return this.serviceManager; + } + + private String providerNamespace; + + private String rolloutName; + + public CustomRolloutImpl withExistingProviderRegistration(String providerNamespace) { + this.providerNamespace = providerNamespace; + return this; + } + + public CustomRollout create() { + this.innerObject = + serviceManager + .serviceClient() + .getCustomRollouts() + .createOrUpdateWithResponse(providerNamespace, rolloutName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public CustomRollout create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCustomRollouts() + .createOrUpdateWithResponse(providerNamespace, rolloutName, this.innerModel(), context) + .getValue(); + return this; + } + + CustomRolloutImpl(String name, com.azure.resourcemanager.providerhub.ProviderHubManager serviceManager) { + this.innerObject = new CustomRolloutInner(); + this.serviceManager = serviceManager; + this.rolloutName = name; + } + + public CustomRolloutImpl update() { + return this; + } + + public CustomRollout apply() { + this.innerObject = + serviceManager + .serviceClient() + .getCustomRollouts() + .createOrUpdateWithResponse(providerNamespace, rolloutName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public CustomRollout apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCustomRollouts() + .createOrUpdateWithResponse(providerNamespace, rolloutName, this.innerModel(), context) + .getValue(); + return this; + } + + CustomRolloutImpl( + CustomRolloutInner innerObject, com.azure.resourcemanager.providerhub.ProviderHubManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.providerNamespace = Utils.getValueFromIdByName(innerObject.id(), "providerRegistrations"); + this.rolloutName = Utils.getValueFromIdByName(innerObject.id(), "customRollouts"); + } + + public CustomRollout refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getCustomRollouts() + .getWithResponse(providerNamespace, rolloutName, Context.NONE) + .getValue(); + return this; + } + + public CustomRollout refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCustomRollouts() + .getWithResponse(providerNamespace, rolloutName, context) + .getValue(); + return this; + } + + public CustomRolloutImpl withProperties(CustomRolloutProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/CustomRolloutsClientImpl.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/CustomRolloutsClientImpl.java new file mode 100644 index 0000000000000..fb5d334d62207 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/CustomRolloutsClientImpl.java @@ -0,0 +1,671 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.providerhub.fluent.CustomRolloutsClient; +import com.azure.resourcemanager.providerhub.fluent.models.CustomRolloutInner; +import com.azure.resourcemanager.providerhub.models.CustomRolloutArrayResponseWithContinuation; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in CustomRolloutsClient. */ +public final class CustomRolloutsClientImpl implements CustomRolloutsClient { + private final ClientLogger logger = new ClientLogger(CustomRolloutsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final CustomRolloutsService service; + + /** The service client containing this operation class. */ + private final ProviderHubImpl client; + + /** + * Initializes an instance of CustomRolloutsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CustomRolloutsClientImpl(ProviderHubImpl client) { + this.service = + RestProxy.create(CustomRolloutsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ProviderHubCustomRollouts to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ProviderHubCustomRol") + private interface CustomRolloutsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}" + + "/customRollouts/{rolloutName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("providerNamespace") String providerNamespace, + @PathParam("rolloutName") String rolloutName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}" + + "/customRollouts/{rolloutName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("providerNamespace") String providerNamespace, + @PathParam("rolloutName") String rolloutName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") CustomRolloutInner properties, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}" + + "/customRollouts") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByProviderRegistration( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("providerNamespace") String providerNamespace, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByProviderRegistrationNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the custom rollout details. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param rolloutName The rollout name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom rollout details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String providerNamespace, String rolloutName) { + 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 (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + if (rolloutName == null) { + return Mono.error(new IllegalArgumentException("Parameter rolloutName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + rolloutName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the custom rollout details. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param rolloutName The rollout name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom rollout details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String providerNamespace, String rolloutName, 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 (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + if (rolloutName == null) { + return Mono.error(new IllegalArgumentException("Parameter rolloutName 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(), + providerNamespace, + rolloutName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the custom rollout details. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param rolloutName The rollout name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom rollout details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String providerNamespace, String rolloutName) { + return getWithResponseAsync(providerNamespace, rolloutName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the custom rollout details. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param rolloutName The rollout name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom rollout details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomRolloutInner get(String providerNamespace, String rolloutName) { + return getAsync(providerNamespace, rolloutName).block(); + } + + /** + * Gets the custom rollout details. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param rolloutName The rollout name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom rollout details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String providerNamespace, String rolloutName, Context context) { + return getWithResponseAsync(providerNamespace, rolloutName, context).block(); + } + + /** + * Creates or updates the rollout details. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param rolloutName The rollout name. + * @param properties The custom rollout properties supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return rollout details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String providerNamespace, String rolloutName, CustomRolloutInner properties) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + if (rolloutName == null) { + return Mono.error(new IllegalArgumentException("Parameter rolloutName is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + rolloutName, + this.client.getApiVersion(), + properties, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates the rollout details. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param rolloutName The rollout name. + * @param properties The custom rollout properties supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return rollout details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String providerNamespace, String rolloutName, CustomRolloutInner properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + if (rolloutName == null) { + return Mono.error(new IllegalArgumentException("Parameter rolloutName is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + rolloutName, + this.client.getApiVersion(), + properties, + accept, + context); + } + + /** + * Creates or updates the rollout details. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param rolloutName The rollout name. + * @param properties The custom rollout properties supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return rollout details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String providerNamespace, String rolloutName, CustomRolloutInner properties) { + return createOrUpdateWithResponseAsync(providerNamespace, rolloutName, properties) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates the rollout details. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param rolloutName The rollout name. + * @param properties The custom rollout properties supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return rollout details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomRolloutInner createOrUpdate( + String providerNamespace, String rolloutName, CustomRolloutInner properties) { + return createOrUpdateAsync(providerNamespace, rolloutName, properties).block(); + } + + /** + * Creates or updates the rollout details. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param rolloutName The rollout name. + * @param properties The custom rollout properties supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return rollout details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String providerNamespace, String rolloutName, CustomRolloutInner properties, Context context) { + return createOrUpdateWithResponseAsync(providerNamespace, rolloutName, properties, context).block(); + } + + /** + * Gets the list of the custom rollouts for the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the custom rollouts for the given provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProviderRegistrationSinglePageAsync( + String providerNamespace) { + 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 (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByProviderRegistration( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + 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())); + } + + /** + * Gets the list of the custom rollouts for the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the custom rollouts for the given provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProviderRegistrationSinglePageAsync( + String providerNamespace, 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 (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByProviderRegistration( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the list of the custom rollouts for the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the custom rollouts for the given provider. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByProviderRegistrationAsync(String providerNamespace) { + return new PagedFlux<>( + () -> listByProviderRegistrationSinglePageAsync(providerNamespace), + nextLink -> listByProviderRegistrationNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of the custom rollouts for the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the custom rollouts for the given provider. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByProviderRegistrationAsync(String providerNamespace, Context context) { + return new PagedFlux<>( + () -> listByProviderRegistrationSinglePageAsync(providerNamespace, context), + nextLink -> listByProviderRegistrationNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the list of the custom rollouts for the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the custom rollouts for the given provider. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByProviderRegistration(String providerNamespace) { + return new PagedIterable<>(listByProviderRegistrationAsync(providerNamespace)); + } + + /** + * Gets the list of the custom rollouts for the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the custom rollouts for the given provider. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByProviderRegistration(String providerNamespace, Context context) { + return new PagedIterable<>(listByProviderRegistrationAsync(providerNamespace, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProviderRegistrationNextSinglePageAsync(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.listByProviderRegistrationNext(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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProviderRegistrationNextSinglePageAsync( + 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 + .listByProviderRegistrationNext(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/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/CustomRolloutsImpl.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/CustomRolloutsImpl.java new file mode 100644 index 0000000000000..c3fa9dbc1483b --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/CustomRolloutsImpl.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.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.providerhub.fluent.CustomRolloutsClient; +import com.azure.resourcemanager.providerhub.fluent.models.CustomRolloutInner; +import com.azure.resourcemanager.providerhub.models.CustomRollout; +import com.azure.resourcemanager.providerhub.models.CustomRollouts; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class CustomRolloutsImpl implements CustomRollouts { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomRolloutsImpl.class); + + private final CustomRolloutsClient innerClient; + + private final com.azure.resourcemanager.providerhub.ProviderHubManager serviceManager; + + public CustomRolloutsImpl( + CustomRolloutsClient innerClient, com.azure.resourcemanager.providerhub.ProviderHubManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public CustomRollout get(String providerNamespace, String rolloutName) { + CustomRolloutInner inner = this.serviceClient().get(providerNamespace, rolloutName); + if (inner != null) { + return new CustomRolloutImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse(String providerNamespace, String rolloutName, Context context) { + Response inner = + this.serviceClient().getWithResponse(providerNamespace, rolloutName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CustomRolloutImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listByProviderRegistration(String providerNamespace) { + PagedIterable inner = this.serviceClient().listByProviderRegistration(providerNamespace); + return Utils.mapPage(inner, inner1 -> new CustomRolloutImpl(inner1, this.manager())); + } + + public PagedIterable listByProviderRegistration(String providerNamespace, Context context) { + PagedIterable inner = + this.serviceClient().listByProviderRegistration(providerNamespace, context); + return Utils.mapPage(inner, inner1 -> new CustomRolloutImpl(inner1, this.manager())); + } + + public CustomRollout getById(String id) { + String providerNamespace = Utils.getValueFromIdByName(id, "providerRegistrations"); + if (providerNamespace == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'providerRegistrations'.", + id))); + } + String rolloutName = Utils.getValueFromIdByName(id, "customRollouts"); + if (rolloutName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'customRollouts'.", id))); + } + return this.getWithResponse(providerNamespace, rolloutName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String providerNamespace = Utils.getValueFromIdByName(id, "providerRegistrations"); + if (providerNamespace == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'providerRegistrations'.", + id))); + } + String rolloutName = Utils.getValueFromIdByName(id, "customRollouts"); + if (rolloutName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'customRollouts'.", id))); + } + return this.getWithResponse(providerNamespace, rolloutName, context); + } + + private CustomRolloutsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.providerhub.ProviderHubManager manager() { + return this.serviceManager; + } + + public CustomRolloutImpl define(String name) { + return new CustomRolloutImpl(name, this.manager()); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/DefaultRolloutImpl.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/DefaultRolloutImpl.java new file mode 100644 index 0000000000000..4a909745426ad --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/DefaultRolloutImpl.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.providerhub.fluent.models.DefaultRolloutInner; +import com.azure.resourcemanager.providerhub.models.DefaultRollout; +import com.azure.resourcemanager.providerhub.models.DefaultRolloutProperties; + +public final class DefaultRolloutImpl implements DefaultRollout, DefaultRollout.Definition, DefaultRollout.Update { + private DefaultRolloutInner innerObject; + + private final com.azure.resourcemanager.providerhub.ProviderHubManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public DefaultRolloutProperties properties() { + return this.innerModel().properties(); + } + + public DefaultRolloutInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.providerhub.ProviderHubManager manager() { + return this.serviceManager; + } + + private String providerNamespace; + + private String rolloutName; + + public DefaultRolloutImpl withExistingProviderRegistration(String providerNamespace) { + this.providerNamespace = providerNamespace; + return this; + } + + public DefaultRollout create() { + this.innerObject = + serviceManager + .serviceClient() + .getDefaultRollouts() + .createOrUpdate(providerNamespace, rolloutName, this.innerModel(), Context.NONE); + return this; + } + + public DefaultRollout create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDefaultRollouts() + .createOrUpdate(providerNamespace, rolloutName, this.innerModel(), context); + return this; + } + + DefaultRolloutImpl(String name, com.azure.resourcemanager.providerhub.ProviderHubManager serviceManager) { + this.innerObject = new DefaultRolloutInner(); + this.serviceManager = serviceManager; + this.rolloutName = name; + } + + public DefaultRolloutImpl update() { + return this; + } + + public DefaultRollout apply() { + this.innerObject = + serviceManager + .serviceClient() + .getDefaultRollouts() + .createOrUpdate(providerNamespace, rolloutName, this.innerModel(), Context.NONE); + return this; + } + + public DefaultRollout apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDefaultRollouts() + .createOrUpdate(providerNamespace, rolloutName, this.innerModel(), context); + return this; + } + + DefaultRolloutImpl( + DefaultRolloutInner innerObject, com.azure.resourcemanager.providerhub.ProviderHubManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.providerNamespace = Utils.getValueFromIdByName(innerObject.id(), "providerRegistrations"); + this.rolloutName = Utils.getValueFromIdByName(innerObject.id(), "defaultRollouts"); + } + + public DefaultRollout refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getDefaultRollouts() + .getWithResponse(providerNamespace, rolloutName, Context.NONE) + .getValue(); + return this; + } + + public DefaultRollout refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDefaultRollouts() + .getWithResponse(providerNamespace, rolloutName, context) + .getValue(); + return this; + } + + public void stop() { + serviceManager.defaultRollouts().stop(providerNamespace, rolloutName); + } + + public Response stopWithResponse(Context context) { + return serviceManager.defaultRollouts().stopWithResponse(providerNamespace, rolloutName, context); + } + + public DefaultRolloutImpl withProperties(DefaultRolloutProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/DefaultRolloutsClientImpl.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/DefaultRolloutsClientImpl.java new file mode 100644 index 0000000000000..bcd9d6c48a35b --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/DefaultRolloutsClientImpl.java @@ -0,0 +1,1083 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.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.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.providerhub.fluent.DefaultRolloutsClient; +import com.azure.resourcemanager.providerhub.fluent.models.DefaultRolloutInner; +import com.azure.resourcemanager.providerhub.models.DefaultRolloutArrayResponseWithContinuation; +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 DefaultRolloutsClient. */ +public final class DefaultRolloutsClientImpl implements DefaultRolloutsClient { + private final ClientLogger logger = new ClientLogger(DefaultRolloutsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final DefaultRolloutsService service; + + /** The service client containing this operation class. */ + private final ProviderHubImpl client; + + /** + * Initializes an instance of DefaultRolloutsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DefaultRolloutsClientImpl(ProviderHubImpl client) { + this.service = + RestProxy.create(DefaultRolloutsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ProviderHubDefaultRollouts to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ProviderHubDefaultRo") + private interface DefaultRolloutsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}" + + "/defaultRollouts/{rolloutName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("providerNamespace") String providerNamespace, + @PathParam("rolloutName") String rolloutName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}" + + "/defaultRollouts/{rolloutName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("providerNamespace") String providerNamespace, + @PathParam("rolloutName") String rolloutName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}" + + "/defaultRollouts/{rolloutName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("providerNamespace") String providerNamespace, + @PathParam("rolloutName") String rolloutName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DefaultRolloutInner properties, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}" + + "/defaultRollouts") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByProviderRegistration( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("providerNamespace") String providerNamespace, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}" + + "/defaultRollouts/{rolloutName}/stop") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> stop( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("providerNamespace") String providerNamespace, + @PathParam("rolloutName") String rolloutName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByProviderRegistrationNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the default rollout details. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param rolloutName The rollout name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the default rollout details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String providerNamespace, String rolloutName) { + 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 (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + if (rolloutName == null) { + return Mono.error(new IllegalArgumentException("Parameter rolloutName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + rolloutName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the default rollout details. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param rolloutName The rollout name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the default rollout details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String providerNamespace, String rolloutName, 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 (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + if (rolloutName == null) { + return Mono.error(new IllegalArgumentException("Parameter rolloutName 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(), + providerNamespace, + rolloutName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the default rollout details. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param rolloutName The rollout name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the default rollout details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String providerNamespace, String rolloutName) { + return getWithResponseAsync(providerNamespace, rolloutName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the default rollout details. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param rolloutName The rollout name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the default rollout details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DefaultRolloutInner get(String providerNamespace, String rolloutName) { + return getAsync(providerNamespace, rolloutName).block(); + } + + /** + * Gets the default rollout details. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param rolloutName The rollout name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the default rollout details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String providerNamespace, String rolloutName, Context context) { + return getWithResponseAsync(providerNamespace, rolloutName, context).block(); + } + + /** + * Deletes the rollout resource. Rollout must be in terminal state. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param rolloutName The rollout name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String providerNamespace, String rolloutName) { + 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 (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + if (rolloutName == null) { + return Mono.error(new IllegalArgumentException("Parameter rolloutName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + rolloutName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the rollout resource. Rollout must be in terminal state. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param rolloutName The rollout name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String providerNamespace, String rolloutName, 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 (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + if (rolloutName == null) { + return Mono.error(new IllegalArgumentException("Parameter rolloutName 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(), + providerNamespace, + rolloutName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes the rollout resource. Rollout must be in terminal state. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param rolloutName The rollout name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String providerNamespace, String rolloutName) { + return deleteWithResponseAsync(providerNamespace, rolloutName).flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes the rollout resource. Rollout must be in terminal state. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param rolloutName The rollout name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String providerNamespace, String rolloutName) { + deleteAsync(providerNamespace, rolloutName).block(); + } + + /** + * Deletes the rollout resource. Rollout must be in terminal state. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param rolloutName The rollout name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String providerNamespace, String rolloutName, Context context) { + return deleteWithResponseAsync(providerNamespace, rolloutName, context).block(); + } + + /** + * Creates or updates the rollout details. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param rolloutName The rollout name. + * @param properties The Default rollout properties supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return default rollout definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String providerNamespace, String rolloutName, DefaultRolloutInner properties) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + if (rolloutName == null) { + return Mono.error(new IllegalArgumentException("Parameter rolloutName is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + rolloutName, + this.client.getApiVersion(), + properties, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates the rollout details. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param rolloutName The rollout name. + * @param properties The Default rollout properties supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return default rollout definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String providerNamespace, String rolloutName, DefaultRolloutInner properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + if (rolloutName == null) { + return Mono.error(new IllegalArgumentException("Parameter rolloutName is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + rolloutName, + this.client.getApiVersion(), + properties, + accept, + context); + } + + /** + * Creates or updates the rollout details. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param rolloutName The rollout name. + * @param properties The Default rollout properties supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return default rollout definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DefaultRolloutInner> beginCreateOrUpdateAsync( + String providerNamespace, String rolloutName, DefaultRolloutInner properties) { + Mono>> mono = + createOrUpdateWithResponseAsync(providerNamespace, rolloutName, properties); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DefaultRolloutInner.class, + DefaultRolloutInner.class, + Context.NONE); + } + + /** + * Creates or updates the rollout details. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param rolloutName The rollout name. + * @param properties The Default rollout properties supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return default rollout definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DefaultRolloutInner> beginCreateOrUpdateAsync( + String providerNamespace, String rolloutName, DefaultRolloutInner properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(providerNamespace, rolloutName, properties, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), DefaultRolloutInner.class, DefaultRolloutInner.class, context); + } + + /** + * Creates or updates the rollout details. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param rolloutName The rollout name. + * @param properties The Default rollout properties supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return default rollout definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DefaultRolloutInner> beginCreateOrUpdate( + String providerNamespace, String rolloutName, DefaultRolloutInner properties) { + return beginCreateOrUpdateAsync(providerNamespace, rolloutName, properties).getSyncPoller(); + } + + /** + * Creates or updates the rollout details. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param rolloutName The rollout name. + * @param properties The Default rollout properties supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return default rollout definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DefaultRolloutInner> beginCreateOrUpdate( + String providerNamespace, String rolloutName, DefaultRolloutInner properties, Context context) { + return beginCreateOrUpdateAsync(providerNamespace, rolloutName, properties, context).getSyncPoller(); + } + + /** + * Creates or updates the rollout details. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param rolloutName The rollout name. + * @param properties The Default rollout properties supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return default rollout definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String providerNamespace, String rolloutName, DefaultRolloutInner properties) { + return beginCreateOrUpdateAsync(providerNamespace, rolloutName, properties) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates the rollout details. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param rolloutName The rollout name. + * @param properties The Default rollout properties supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return default rollout definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String providerNamespace, String rolloutName, DefaultRolloutInner properties, Context context) { + return beginCreateOrUpdateAsync(providerNamespace, rolloutName, properties, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates the rollout details. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param rolloutName The rollout name. + * @param properties The Default rollout properties supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return default rollout definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DefaultRolloutInner createOrUpdate( + String providerNamespace, String rolloutName, DefaultRolloutInner properties) { + return createOrUpdateAsync(providerNamespace, rolloutName, properties).block(); + } + + /** + * Creates or updates the rollout details. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param rolloutName The rollout name. + * @param properties The Default rollout properties supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return default rollout definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DefaultRolloutInner createOrUpdate( + String providerNamespace, String rolloutName, DefaultRolloutInner properties, Context context) { + return createOrUpdateAsync(providerNamespace, rolloutName, properties, context).block(); + } + + /** + * Gets the list of the rollouts for the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the rollouts for the given provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProviderRegistrationSinglePageAsync( + String providerNamespace) { + 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 (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByProviderRegistration( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + 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())); + } + + /** + * Gets the list of the rollouts for the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the rollouts for the given provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProviderRegistrationSinglePageAsync( + String providerNamespace, 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 (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByProviderRegistration( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the list of the rollouts for the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the rollouts for the given provider. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByProviderRegistrationAsync(String providerNamespace) { + return new PagedFlux<>( + () -> listByProviderRegistrationSinglePageAsync(providerNamespace), + nextLink -> listByProviderRegistrationNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of the rollouts for the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the rollouts for the given provider. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByProviderRegistrationAsync(String providerNamespace, Context context) { + return new PagedFlux<>( + () -> listByProviderRegistrationSinglePageAsync(providerNamespace, context), + nextLink -> listByProviderRegistrationNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the list of the rollouts for the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the rollouts for the given provider. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByProviderRegistration(String providerNamespace) { + return new PagedIterable<>(listByProviderRegistrationAsync(providerNamespace)); + } + + /** + * Gets the list of the rollouts for the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the rollouts for the given provider. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByProviderRegistration(String providerNamespace, Context context) { + return new PagedIterable<>(listByProviderRegistrationAsync(providerNamespace, context)); + } + + /** + * Stops or cancels the rollout, if in progress. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param rolloutName The rollout name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> stopWithResponseAsync(String providerNamespace, String rolloutName) { + 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 (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + if (rolloutName == null) { + return Mono.error(new IllegalArgumentException("Parameter rolloutName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .stop( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + rolloutName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Stops or cancels the rollout, if in progress. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param rolloutName The rollout name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> stopWithResponseAsync(String providerNamespace, String rolloutName, 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 (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + if (rolloutName == null) { + return Mono.error(new IllegalArgumentException("Parameter rolloutName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .stop( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + rolloutName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Stops or cancels the rollout, if in progress. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param rolloutName The rollout name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono stopAsync(String providerNamespace, String rolloutName) { + return stopWithResponseAsync(providerNamespace, rolloutName).flatMap((Response res) -> Mono.empty()); + } + + /** + * Stops or cancels the rollout, if in progress. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param rolloutName The rollout name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void stop(String providerNamespace, String rolloutName) { + stopAsync(providerNamespace, rolloutName).block(); + } + + /** + * Stops or cancels the rollout, if in progress. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param rolloutName The rollout name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response stopWithResponse(String providerNamespace, String rolloutName, Context context) { + return stopWithResponseAsync(providerNamespace, rolloutName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProviderRegistrationNextSinglePageAsync(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.listByProviderRegistrationNext(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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProviderRegistrationNextSinglePageAsync( + 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 + .listByProviderRegistrationNext(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/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/DefaultRolloutsImpl.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/DefaultRolloutsImpl.java new file mode 100644 index 0000000000000..5c5aa0f308efe --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/DefaultRolloutsImpl.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.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.providerhub.fluent.DefaultRolloutsClient; +import com.azure.resourcemanager.providerhub.fluent.models.DefaultRolloutInner; +import com.azure.resourcemanager.providerhub.models.DefaultRollout; +import com.azure.resourcemanager.providerhub.models.DefaultRollouts; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class DefaultRolloutsImpl implements DefaultRollouts { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DefaultRolloutsImpl.class); + + private final DefaultRolloutsClient innerClient; + + private final com.azure.resourcemanager.providerhub.ProviderHubManager serviceManager; + + public DefaultRolloutsImpl( + DefaultRolloutsClient innerClient, com.azure.resourcemanager.providerhub.ProviderHubManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public DefaultRollout get(String providerNamespace, String rolloutName) { + DefaultRolloutInner inner = this.serviceClient().get(providerNamespace, rolloutName); + if (inner != null) { + return new DefaultRolloutImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse(String providerNamespace, String rolloutName, Context context) { + Response inner = + this.serviceClient().getWithResponse(providerNamespace, rolloutName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DefaultRolloutImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String providerNamespace, String rolloutName) { + this.serviceClient().delete(providerNamespace, rolloutName); + } + + public Response deleteWithResponse(String providerNamespace, String rolloutName, Context context) { + return this.serviceClient().deleteWithResponse(providerNamespace, rolloutName, context); + } + + public PagedIterable listByProviderRegistration(String providerNamespace) { + PagedIterable inner = this.serviceClient().listByProviderRegistration(providerNamespace); + return Utils.mapPage(inner, inner1 -> new DefaultRolloutImpl(inner1, this.manager())); + } + + public PagedIterable listByProviderRegistration(String providerNamespace, Context context) { + PagedIterable inner = + this.serviceClient().listByProviderRegistration(providerNamespace, context); + return Utils.mapPage(inner, inner1 -> new DefaultRolloutImpl(inner1, this.manager())); + } + + public void stop(String providerNamespace, String rolloutName) { + this.serviceClient().stop(providerNamespace, rolloutName); + } + + public Response stopWithResponse(String providerNamespace, String rolloutName, Context context) { + return this.serviceClient().stopWithResponse(providerNamespace, rolloutName, context); + } + + public DefaultRollout getById(String id) { + String providerNamespace = Utils.getValueFromIdByName(id, "providerRegistrations"); + if (providerNamespace == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'providerRegistrations'.", + id))); + } + String rolloutName = Utils.getValueFromIdByName(id, "defaultRollouts"); + if (rolloutName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'defaultRollouts'.", id))); + } + return this.getWithResponse(providerNamespace, rolloutName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String providerNamespace = Utils.getValueFromIdByName(id, "providerRegistrations"); + if (providerNamespace == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'providerRegistrations'.", + id))); + } + String rolloutName = Utils.getValueFromIdByName(id, "defaultRollouts"); + if (rolloutName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'defaultRollouts'.", id))); + } + return this.getWithResponse(providerNamespace, rolloutName, context); + } + + public void deleteById(String id) { + String providerNamespace = Utils.getValueFromIdByName(id, "providerRegistrations"); + if (providerNamespace == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'providerRegistrations'.", + id))); + } + String rolloutName = Utils.getValueFromIdByName(id, "defaultRollouts"); + if (rolloutName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'defaultRollouts'.", id))); + } + this.deleteWithResponse(providerNamespace, rolloutName, Context.NONE).getValue(); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String providerNamespace = Utils.getValueFromIdByName(id, "providerRegistrations"); + if (providerNamespace == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'providerRegistrations'.", + id))); + } + String rolloutName = Utils.getValueFromIdByName(id, "defaultRollouts"); + if (rolloutName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'defaultRollouts'.", id))); + } + return this.deleteWithResponse(providerNamespace, rolloutName, context); + } + + private DefaultRolloutsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.providerhub.ProviderHubManager manager() { + return this.serviceManager; + } + + public DefaultRolloutImpl define(String name) { + return new DefaultRolloutImpl(name, this.manager()); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/NotificationRegistrationImpl.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/NotificationRegistrationImpl.java new file mode 100644 index 0000000000000..76e10f96d5a43 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/NotificationRegistrationImpl.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.providerhub.fluent.models.NotificationRegistrationInner; +import com.azure.resourcemanager.providerhub.models.NotificationRegistration; +import com.azure.resourcemanager.providerhub.models.NotificationRegistrationProperties; + +public final class NotificationRegistrationImpl + implements NotificationRegistration, NotificationRegistration.Definition, NotificationRegistration.Update { + private NotificationRegistrationInner innerObject; + + private final com.azure.resourcemanager.providerhub.ProviderHubManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public NotificationRegistrationProperties properties() { + return this.innerModel().properties(); + } + + public NotificationRegistrationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.providerhub.ProviderHubManager manager() { + return this.serviceManager; + } + + private String providerNamespace; + + private String notificationRegistrationName; + + public NotificationRegistrationImpl withExistingProviderRegistration(String providerNamespace) { + this.providerNamespace = providerNamespace; + return this; + } + + public NotificationRegistration create() { + this.innerObject = + serviceManager + .serviceClient() + .getNotificationRegistrations() + .createOrUpdateWithResponse( + providerNamespace, notificationRegistrationName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public NotificationRegistration create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNotificationRegistrations() + .createOrUpdateWithResponse(providerNamespace, notificationRegistrationName, this.innerModel(), context) + .getValue(); + return this; + } + + NotificationRegistrationImpl(String name, com.azure.resourcemanager.providerhub.ProviderHubManager serviceManager) { + this.innerObject = new NotificationRegistrationInner(); + this.serviceManager = serviceManager; + this.notificationRegistrationName = name; + } + + public NotificationRegistrationImpl update() { + return this; + } + + public NotificationRegistration apply() { + this.innerObject = + serviceManager + .serviceClient() + .getNotificationRegistrations() + .createOrUpdateWithResponse( + providerNamespace, notificationRegistrationName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public NotificationRegistration apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNotificationRegistrations() + .createOrUpdateWithResponse(providerNamespace, notificationRegistrationName, this.innerModel(), context) + .getValue(); + return this; + } + + NotificationRegistrationImpl( + NotificationRegistrationInner innerObject, + com.azure.resourcemanager.providerhub.ProviderHubManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.providerNamespace = Utils.getValueFromIdByName(innerObject.id(), "providerRegistrations"); + this.notificationRegistrationName = Utils.getValueFromIdByName(innerObject.id(), "notificationRegistrations"); + } + + public NotificationRegistration refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getNotificationRegistrations() + .getWithResponse(providerNamespace, notificationRegistrationName, Context.NONE) + .getValue(); + return this; + } + + public NotificationRegistration refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNotificationRegistrations() + .getWithResponse(providerNamespace, notificationRegistrationName, context) + .getValue(); + return this; + } + + public NotificationRegistrationImpl withProperties(NotificationRegistrationProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/NotificationRegistrationsClientImpl.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/NotificationRegistrationsClientImpl.java new file mode 100644 index 0000000000000..72a24377d7169 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/NotificationRegistrationsClientImpl.java @@ -0,0 +1,861 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.providerhub.fluent.NotificationRegistrationsClient; +import com.azure.resourcemanager.providerhub.fluent.models.NotificationRegistrationInner; +import com.azure.resourcemanager.providerhub.models.NotificationRegistrationArrayResponseWithContinuation; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in NotificationRegistrationsClient. */ +public final class NotificationRegistrationsClientImpl implements NotificationRegistrationsClient { + private final ClientLogger logger = new ClientLogger(NotificationRegistrationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final NotificationRegistrationsService service; + + /** The service client containing this operation class. */ + private final ProviderHubImpl client; + + /** + * Initializes an instance of NotificationRegistrationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NotificationRegistrationsClientImpl(ProviderHubImpl client) { + this.service = + RestProxy + .create( + NotificationRegistrationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ProviderHubNotificationRegistrations to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ProviderHubNotificat") + private interface NotificationRegistrationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}" + + "/notificationRegistrations/{notificationRegistrationName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("providerNamespace") String providerNamespace, + @PathParam("notificationRegistrationName") String notificationRegistrationName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}" + + "/notificationRegistrations/{notificationRegistrationName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("providerNamespace") String providerNamespace, + @PathParam("notificationRegistrationName") String notificationRegistrationName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") NotificationRegistrationInner properties, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}" + + "/notificationRegistrations/{notificationRegistrationName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("providerNamespace") String providerNamespace, + @PathParam("notificationRegistrationName") String notificationRegistrationName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}" + + "/notificationRegistrations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByProviderRegistration( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("providerNamespace") String providerNamespace, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByProviderRegistrationNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the notification registration details. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param notificationRegistrationName The notification registration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the notification registration details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String providerNamespace, String notificationRegistrationName) { + 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 (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + if (notificationRegistrationName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter notificationRegistrationName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + notificationRegistrationName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the notification registration details. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param notificationRegistrationName The notification registration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the notification registration details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String providerNamespace, String notificationRegistrationName, 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 (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + if (notificationRegistrationName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter notificationRegistrationName 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(), + providerNamespace, + notificationRegistrationName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the notification registration details. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param notificationRegistrationName The notification registration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the notification registration details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String providerNamespace, String notificationRegistrationName) { + return getWithResponseAsync(providerNamespace, notificationRegistrationName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the notification registration details. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param notificationRegistrationName The notification registration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the notification registration details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NotificationRegistrationInner get(String providerNamespace, String notificationRegistrationName) { + return getAsync(providerNamespace, notificationRegistrationName).block(); + } + + /** + * Gets the notification registration details. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param notificationRegistrationName The notification registration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the notification registration details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String providerNamespace, String notificationRegistrationName, Context context) { + return getWithResponseAsync(providerNamespace, notificationRegistrationName, context).block(); + } + + /** + * Creates or updates a notification registration. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param notificationRegistrationName The notification registration. + * @param properties The required body parameters supplied to the notification registration operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the notification registration definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String providerNamespace, String notificationRegistrationName, NotificationRegistrationInner properties) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + if (notificationRegistrationName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter notificationRegistrationName is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + notificationRegistrationName, + this.client.getApiVersion(), + properties, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a notification registration. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param notificationRegistrationName The notification registration. + * @param properties The required body parameters supplied to the notification registration operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the notification registration definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String providerNamespace, + String notificationRegistrationName, + NotificationRegistrationInner properties, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + if (notificationRegistrationName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter notificationRegistrationName is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + notificationRegistrationName, + this.client.getApiVersion(), + properties, + accept, + context); + } + + /** + * Creates or updates a notification registration. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param notificationRegistrationName The notification registration. + * @param properties The required body parameters supplied to the notification registration operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the notification registration definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String providerNamespace, String notificationRegistrationName, NotificationRegistrationInner properties) { + return createOrUpdateWithResponseAsync(providerNamespace, notificationRegistrationName, properties) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates a notification registration. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param notificationRegistrationName The notification registration. + * @param properties The required body parameters supplied to the notification registration operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the notification registration definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NotificationRegistrationInner createOrUpdate( + String providerNamespace, String notificationRegistrationName, NotificationRegistrationInner properties) { + return createOrUpdateAsync(providerNamespace, notificationRegistrationName, properties).block(); + } + + /** + * Creates or updates a notification registration. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param notificationRegistrationName The notification registration. + * @param properties The required body parameters supplied to the notification registration operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the notification registration definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String providerNamespace, + String notificationRegistrationName, + NotificationRegistrationInner properties, + Context context) { + return createOrUpdateWithResponseAsync(providerNamespace, notificationRegistrationName, properties, context) + .block(); + } + + /** + * Deletes a notification registration. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param notificationRegistrationName The notification registration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String providerNamespace, String notificationRegistrationName) { + 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 (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + if (notificationRegistrationName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter notificationRegistrationName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + notificationRegistrationName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a notification registration. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param notificationRegistrationName The notification registration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String providerNamespace, String notificationRegistrationName, 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 (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + if (notificationRegistrationName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter notificationRegistrationName 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(), + providerNamespace, + notificationRegistrationName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes a notification registration. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param notificationRegistrationName The notification registration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String providerNamespace, String notificationRegistrationName) { + return deleteWithResponseAsync(providerNamespace, notificationRegistrationName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes a notification registration. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param notificationRegistrationName The notification registration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 providerNamespace, String notificationRegistrationName) { + deleteAsync(providerNamespace, notificationRegistrationName).block(); + } + + /** + * Deletes a notification registration. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param notificationRegistrationName The notification registration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String providerNamespace, String notificationRegistrationName, Context context) { + return deleteWithResponseAsync(providerNamespace, notificationRegistrationName, context).block(); + } + + /** + * Gets the list of the notification registrations for the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the notification registrations for the given provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProviderRegistrationSinglePageAsync( + String providerNamespace) { + 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 (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByProviderRegistration( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + 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())); + } + + /** + * Gets the list of the notification registrations for the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the notification registrations for the given provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProviderRegistrationSinglePageAsync( + String providerNamespace, 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 (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByProviderRegistration( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the list of the notification registrations for the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the notification registrations for the given provider. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByProviderRegistrationAsync(String providerNamespace) { + return new PagedFlux<>( + () -> listByProviderRegistrationSinglePageAsync(providerNamespace), + nextLink -> listByProviderRegistrationNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of the notification registrations for the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the notification registrations for the given provider. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByProviderRegistrationAsync( + String providerNamespace, Context context) { + return new PagedFlux<>( + () -> listByProviderRegistrationSinglePageAsync(providerNamespace, context), + nextLink -> listByProviderRegistrationNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the list of the notification registrations for the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the notification registrations for the given provider. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByProviderRegistration(String providerNamespace) { + return new PagedIterable<>(listByProviderRegistrationAsync(providerNamespace)); + } + + /** + * Gets the list of the notification registrations for the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the notification registrations for the given provider. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByProviderRegistration( + String providerNamespace, Context context) { + return new PagedIterable<>(listByProviderRegistrationAsync(providerNamespace, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProviderRegistrationNextSinglePageAsync( + 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.listByProviderRegistrationNext(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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProviderRegistrationNextSinglePageAsync( + 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 + .listByProviderRegistrationNext(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/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/NotificationRegistrationsImpl.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/NotificationRegistrationsImpl.java new file mode 100644 index 0000000000000..5f31cd5d02b0a --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/NotificationRegistrationsImpl.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.providerhub.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.providerhub.fluent.NotificationRegistrationsClient; +import com.azure.resourcemanager.providerhub.fluent.models.NotificationRegistrationInner; +import com.azure.resourcemanager.providerhub.models.NotificationRegistration; +import com.azure.resourcemanager.providerhub.models.NotificationRegistrations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class NotificationRegistrationsImpl implements NotificationRegistrations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NotificationRegistrationsImpl.class); + + private final NotificationRegistrationsClient innerClient; + + private final com.azure.resourcemanager.providerhub.ProviderHubManager serviceManager; + + public NotificationRegistrationsImpl( + NotificationRegistrationsClient innerClient, + com.azure.resourcemanager.providerhub.ProviderHubManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public NotificationRegistration get(String providerNamespace, String notificationRegistrationName) { + NotificationRegistrationInner inner = this.serviceClient().get(providerNamespace, notificationRegistrationName); + if (inner != null) { + return new NotificationRegistrationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String providerNamespace, String notificationRegistrationName, Context context) { + Response inner = + this.serviceClient().getWithResponse(providerNamespace, notificationRegistrationName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NotificationRegistrationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String providerNamespace, String notificationRegistrationName) { + this.serviceClient().delete(providerNamespace, notificationRegistrationName); + } + + public Response deleteWithResponse( + String providerNamespace, String notificationRegistrationName, Context context) { + return this.serviceClient().deleteWithResponse(providerNamespace, notificationRegistrationName, context); + } + + public PagedIterable listByProviderRegistration(String providerNamespace) { + PagedIterable inner = + this.serviceClient().listByProviderRegistration(providerNamespace); + return Utils.mapPage(inner, inner1 -> new NotificationRegistrationImpl(inner1, this.manager())); + } + + public PagedIterable listByProviderRegistration( + String providerNamespace, Context context) { + PagedIterable inner = + this.serviceClient().listByProviderRegistration(providerNamespace, context); + return Utils.mapPage(inner, inner1 -> new NotificationRegistrationImpl(inner1, this.manager())); + } + + public NotificationRegistration getById(String id) { + String providerNamespace = Utils.getValueFromIdByName(id, "providerRegistrations"); + if (providerNamespace == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'providerRegistrations'.", + id))); + } + String notificationRegistrationName = Utils.getValueFromIdByName(id, "notificationRegistrations"); + if (notificationRegistrationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'notificationRegistrations'.", + id))); + } + return this.getWithResponse(providerNamespace, notificationRegistrationName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String providerNamespace = Utils.getValueFromIdByName(id, "providerRegistrations"); + if (providerNamespace == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'providerRegistrations'.", + id))); + } + String notificationRegistrationName = Utils.getValueFromIdByName(id, "notificationRegistrations"); + if (notificationRegistrationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'notificationRegistrations'.", + id))); + } + return this.getWithResponse(providerNamespace, notificationRegistrationName, context); + } + + public void deleteById(String id) { + String providerNamespace = Utils.getValueFromIdByName(id, "providerRegistrations"); + if (providerNamespace == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'providerRegistrations'.", + id))); + } + String notificationRegistrationName = Utils.getValueFromIdByName(id, "notificationRegistrations"); + if (notificationRegistrationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'notificationRegistrations'.", + id))); + } + this.deleteWithResponse(providerNamespace, notificationRegistrationName, Context.NONE).getValue(); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String providerNamespace = Utils.getValueFromIdByName(id, "providerRegistrations"); + if (providerNamespace == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'providerRegistrations'.", + id))); + } + String notificationRegistrationName = Utils.getValueFromIdByName(id, "notificationRegistrations"); + if (notificationRegistrationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'notificationRegistrations'.", + id))); + } + return this.deleteWithResponse(providerNamespace, notificationRegistrationName, context); + } + + private NotificationRegistrationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.providerhub.ProviderHubManager manager() { + return this.serviceManager; + } + + public NotificationRegistrationImpl define(String name) { + return new NotificationRegistrationImpl(name, this.manager()); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/OperationsClientImpl.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/OperationsClientImpl.java new file mode 100644 index 0000000000000..7f3970fda3d78 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/OperationsClientImpl.java @@ -0,0 +1,730 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.providerhub.fluent.OperationsClient; +import com.azure.resourcemanager.providerhub.fluent.models.OperationsContentInner; +import com.azure.resourcemanager.providerhub.fluent.models.OperationsDefinitionInner; +import com.azure.resourcemanager.providerhub.models.OperationsDefinitionArrayResponseWithContinuation; +import com.azure.resourcemanager.providerhub.models.OperationsPutContent; +import java.util.List; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public final class OperationsClientImpl implements OperationsClient { + private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final OperationsService service; + + /** The service client containing this operation class. */ + private final ProviderHubImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(ProviderHubImpl client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ProviderHubOperations to be used by the proxy service to perform REST + * calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ProviderHubOperation") + private interface OperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.ProviderHub/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}" + + "/operations/default") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> listByProviderRegistration( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("providerNamespace") String providerNamespace, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}" + + "/operations/default") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("providerNamespace") String providerNamespace, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") OperationsPutContent operationsPutContent, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}" + + "/operations/default") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("providerNamespace") String providerNamespace, + @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); + } + + /** + * Lists all the operations supported by Microsoft.ProviderHub. + * + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), 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())); + } + + /** + * Lists all the operations supported by Microsoft.ProviderHub. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the operations supported by Microsoft.ProviderHub. + * + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the operations supported by Microsoft.ProviderHub. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the operations supported by Microsoft.ProviderHub. + * + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all the operations supported by Microsoft.ProviderHub. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Gets the operations supported by the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operations supported by the given provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listByProviderRegistrationWithResponseAsync( + String providerNamespace) { + 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 (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByProviderRegistration( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the operations supported by the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operations supported by the given provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listByProviderRegistrationWithResponseAsync( + String providerNamespace, 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 (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByProviderRegistration( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the operations supported by the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operations supported by the given provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProviderRegistrationAsync(String providerNamespace) { + return listByProviderRegistrationWithResponseAsync(providerNamespace) + .flatMap( + (Response> res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the operations supported by the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operations supported by the given provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public List listByProviderRegistration(String providerNamespace) { + return listByProviderRegistrationAsync(providerNamespace).block(); + } + + /** + * Gets the operations supported by the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operations supported by the given provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response> listByProviderRegistrationWithResponse( + String providerNamespace, Context context) { + return listByProviderRegistrationWithResponseAsync(providerNamespace, context).block(); + } + + /** + * Creates or updates the operation supported by the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param operationsPutContent The operations content properties supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String providerNamespace, OperationsPutContent operationsPutContent) { + 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 (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + if (operationsPutContent == null) { + return Mono + .error(new IllegalArgumentException("Parameter operationsPutContent is required and cannot be null.")); + } else { + operationsPutContent.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + this.client.getApiVersion(), + operationsPutContent, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates the operation supported by the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param operationsPutContent The operations content properties supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String providerNamespace, OperationsPutContent operationsPutContent, 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 (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + if (operationsPutContent == null) { + return Mono + .error(new IllegalArgumentException("Parameter operationsPutContent is required and cannot be null.")); + } else { + operationsPutContent.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + this.client.getApiVersion(), + operationsPutContent, + accept, + context); + } + + /** + * Creates or updates the operation supported by the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param operationsPutContent The operations content properties supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String providerNamespace, OperationsPutContent operationsPutContent) { + return createOrUpdateWithResponseAsync(providerNamespace, operationsPutContent) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates the operation supported by the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param operationsPutContent The operations content properties supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationsContentInner createOrUpdate(String providerNamespace, OperationsPutContent operationsPutContent) { + return createOrUpdateAsync(providerNamespace, operationsPutContent).block(); + } + + /** + * Creates or updates the operation supported by the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param operationsPutContent The operations content properties supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String providerNamespace, OperationsPutContent operationsPutContent, Context context) { + return createOrUpdateWithResponseAsync(providerNamespace, operationsPutContent, context).block(); + } + + /** + * Deletes an operation. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String providerNamespace) { + 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 (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an operation. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String providerNamespace, 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 (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace 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(), + providerNamespace, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes an operation. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String providerNamespace) { + return deleteWithResponseAsync(providerNamespace).flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes an operation. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 providerNamespace) { + deleteAsync(providerNamespace).block(); + } + + /** + * Deletes an operation. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String providerNamespace, Context context) { + return deleteWithResponseAsync(providerNamespace, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @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/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/OperationsContentImpl.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/OperationsContentImpl.java new file mode 100644 index 0000000000000..4592492ce7ded --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/OperationsContentImpl.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.implementation; + +import com.azure.resourcemanager.providerhub.fluent.models.OperationsContentInner; +import com.azure.resourcemanager.providerhub.models.OperationsContent; +import com.azure.resourcemanager.providerhub.models.OperationsDefinitionActionType; +import com.azure.resourcemanager.providerhub.models.OperationsDefinitionDisplay; +import com.azure.resourcemanager.providerhub.models.OperationsDefinitionOrigin; + +public final class OperationsContentImpl implements OperationsContent { + private OperationsContentInner innerObject; + + private final com.azure.resourcemanager.providerhub.ProviderHubManager serviceManager; + + OperationsContentImpl( + OperationsContentInner innerObject, com.azure.resourcemanager.providerhub.ProviderHubManager 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 namePropertiesName() { + return this.innerModel().namePropertiesName(); + } + + public Boolean isDataAction() { + return this.innerModel().isDataAction(); + } + + public OperationsDefinitionOrigin origin() { + return this.innerModel().origin(); + } + + public OperationsDefinitionDisplay display() { + return this.innerModel().display(); + } + + public OperationsDefinitionActionType actionType() { + return this.innerModel().actionType(); + } + + public Object properties() { + return this.innerModel().properties(); + } + + public OperationsContentInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.providerhub.ProviderHubManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/OperationsDefinitionImpl.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/OperationsDefinitionImpl.java new file mode 100644 index 0000000000000..25e98263d7b64 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/OperationsDefinitionImpl.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.providerhub.implementation; + +import com.azure.resourcemanager.providerhub.fluent.models.OperationsDefinitionInner; +import com.azure.resourcemanager.providerhub.models.OperationsDefinition; +import com.azure.resourcemanager.providerhub.models.OperationsDefinitionActionType; +import com.azure.resourcemanager.providerhub.models.OperationsDefinitionDisplay; +import com.azure.resourcemanager.providerhub.models.OperationsDefinitionOrigin; + +public final class OperationsDefinitionImpl implements OperationsDefinition { + private OperationsDefinitionInner innerObject; + + private final com.azure.resourcemanager.providerhub.ProviderHubManager serviceManager; + + OperationsDefinitionImpl( + OperationsDefinitionInner innerObject, + com.azure.resourcemanager.providerhub.ProviderHubManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public Boolean isDataAction() { + return this.innerModel().isDataAction(); + } + + public OperationsDefinitionOrigin origin() { + return this.innerModel().origin(); + } + + public OperationsDefinitionDisplay display() { + return this.innerModel().display(); + } + + public OperationsDefinitionActionType actionType() { + return this.innerModel().actionType(); + } + + public Object properties() { + return this.innerModel().properties(); + } + + public OperationsDefinitionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.providerhub.ProviderHubManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/OperationsImpl.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..f90c570f0aed5 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/OperationsImpl.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.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.providerhub.fluent.OperationsClient; +import com.azure.resourcemanager.providerhub.fluent.models.OperationsContentInner; +import com.azure.resourcemanager.providerhub.fluent.models.OperationsDefinitionInner; +import com.azure.resourcemanager.providerhub.models.Operations; +import com.azure.resourcemanager.providerhub.models.OperationsContent; +import com.azure.resourcemanager.providerhub.models.OperationsDefinition; +import com.azure.resourcemanager.providerhub.models.OperationsPutContent; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class OperationsImpl implements Operations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final com.azure.resourcemanager.providerhub.ProviderHubManager serviceManager; + + public OperationsImpl( + OperationsClient innerClient, com.azure.resourcemanager.providerhub.ProviderHubManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new OperationsDefinitionImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new OperationsDefinitionImpl(inner1, this.manager())); + } + + public List listByProviderRegistration(String providerNamespace) { + List inner = this.serviceClient().listByProviderRegistration(providerNamespace); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new OperationsDefinitionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public Response> listByProviderRegistrationWithResponse( + String providerNamespace, Context context) { + Response> inner = + this.serviceClient().listByProviderRegistrationWithResponse(providerNamespace, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + inner + .getValue() + .stream() + .map(inner1 -> new OperationsDefinitionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return null; + } + } + + public OperationsContent createOrUpdate(String providerNamespace, OperationsPutContent operationsPutContent) { + OperationsContentInner inner = this.serviceClient().createOrUpdate(providerNamespace, operationsPutContent); + if (inner != null) { + return new OperationsContentImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createOrUpdateWithResponse( + String providerNamespace, OperationsPutContent operationsPutContent, Context context) { + Response inner = + this.serviceClient().createOrUpdateWithResponse(providerNamespace, operationsPutContent, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new OperationsContentImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String providerNamespace) { + this.serviceClient().delete(providerNamespace); + } + + public Response deleteWithResponse(String providerNamespace, Context context) { + return this.serviceClient().deleteWithResponse(providerNamespace, context); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.providerhub.ProviderHubManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/ProviderHubBuilder.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/ProviderHubBuilder.java new file mode 100644 index 0000000000000..a425ae40abf68 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/ProviderHubBuilder.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.CookiePolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** A builder for creating a new instance of the ProviderHubImpl type. */ +@ServiceClientBuilder(serviceClients = {ProviderHubImpl.class}) +public final class ProviderHubBuilder { + /* + * The ID of the target subscription. + */ + private String subscriptionId; + + /** + * Sets The ID of the target subscription. + * + * @param subscriptionId the subscriptionId value. + * @return the ProviderHubBuilder. + */ + public ProviderHubBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the ProviderHubBuilder. + */ + public ProviderHubBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The environment to connect to + */ + private AzureEnvironment environment; + + /** + * Sets The environment to connect to. + * + * @param environment the environment value. + * @return the ProviderHubBuilder. + */ + public ProviderHubBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the ProviderHubBuilder. + */ + public ProviderHubBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the ProviderHubBuilder. + */ + public ProviderHubBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the ProviderHubBuilder. + */ + public ProviderHubBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of ProviderHubImpl with the provided parameters. + * + * @return an instance of ProviderHubImpl. + */ + public ProviderHubImpl buildClient() { + if (endpoint == null) { + this.endpoint = "https://management.azure.com"; + } + if (environment == null) { + this.environment = AzureEnvironment.AZURE; + } + if (defaultPollInterval == null) { + this.defaultPollInterval = Duration.ofSeconds(30); + } + if (pipeline == null) { + this.pipeline = + new HttpPipelineBuilder() + .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) + .build(); + } + if (serializerAdapter == null) { + this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); + } + ProviderHubImpl client = + new ProviderHubImpl( + pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + return client; + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/ProviderHubImpl.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/ProviderHubImpl.java new file mode 100644 index 0000000000000..eca0864f8d49d --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/ProviderHubImpl.java @@ -0,0 +1,391 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.providerhub.fluent.CustomRolloutsClient; +import com.azure.resourcemanager.providerhub.fluent.DefaultRolloutsClient; +import com.azure.resourcemanager.providerhub.fluent.NotificationRegistrationsClient; +import com.azure.resourcemanager.providerhub.fluent.OperationsClient; +import com.azure.resourcemanager.providerhub.fluent.ProviderHub; +import com.azure.resourcemanager.providerhub.fluent.ProviderRegistrationsClient; +import com.azure.resourcemanager.providerhub.fluent.ResourceProvidersClient; +import com.azure.resourcemanager.providerhub.fluent.ResourceTypeRegistrationsClient; +import com.azure.resourcemanager.providerhub.fluent.SkusClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import java.util.Map; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the ProviderHubImpl type. */ +@ServiceClient(builder = ProviderHubBuilder.class) +public final class ProviderHubImpl implements ProviderHub { + private final ClientLogger logger = new ClientLogger(ProviderHubImpl.class); + + /** The ID of the target subscription. */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** server parameter. */ + private final String endpoint; + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** Api Version. */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** The HTTP pipeline to send requests through. */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** The serializer to serialize an object into a string. */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** The default poll interval for long-running operation. */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** The CustomRolloutsClient object to access its operations. */ + private final CustomRolloutsClient customRollouts; + + /** + * Gets the CustomRolloutsClient object to access its operations. + * + * @return the CustomRolloutsClient object. + */ + public CustomRolloutsClient getCustomRollouts() { + return this.customRollouts; + } + + /** The DefaultRolloutsClient object to access its operations. */ + private final DefaultRolloutsClient defaultRollouts; + + /** + * Gets the DefaultRolloutsClient object to access its operations. + * + * @return the DefaultRolloutsClient object. + */ + public DefaultRolloutsClient getDefaultRollouts() { + return this.defaultRollouts; + } + + /** The ResourceProvidersClient object to access its operations. */ + private final ResourceProvidersClient resourceProviders; + + /** + * Gets the ResourceProvidersClient object to access its operations. + * + * @return the ResourceProvidersClient object. + */ + public ResourceProvidersClient getResourceProviders() { + return this.resourceProviders; + } + + /** The NotificationRegistrationsClient object to access its operations. */ + private final NotificationRegistrationsClient notificationRegistrations; + + /** + * Gets the NotificationRegistrationsClient object to access its operations. + * + * @return the NotificationRegistrationsClient object. + */ + public NotificationRegistrationsClient getNotificationRegistrations() { + return this.notificationRegistrations; + } + + /** The OperationsClient object to access its operations. */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** The ProviderRegistrationsClient object to access its operations. */ + private final ProviderRegistrationsClient providerRegistrations; + + /** + * Gets the ProviderRegistrationsClient object to access its operations. + * + * @return the ProviderRegistrationsClient object. + */ + public ProviderRegistrationsClient getProviderRegistrations() { + return this.providerRegistrations; + } + + /** The ResourceTypeRegistrationsClient object to access its operations. */ + private final ResourceTypeRegistrationsClient resourceTypeRegistrations; + + /** + * Gets the ResourceTypeRegistrationsClient object to access its operations. + * + * @return the ResourceTypeRegistrationsClient object. + */ + public ResourceTypeRegistrationsClient getResourceTypeRegistrations() { + return this.resourceTypeRegistrations; + } + + /** 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; + } + + /** + * Initializes an instance of ProviderHub client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param defaultPollInterval The default poll interval for long-running operation. + * @param environment The Azure environment. + * @param subscriptionId The ID of the target subscription. + * @param endpoint server parameter. + */ + ProviderHubImpl( + HttpPipeline httpPipeline, + SerializerAdapter serializerAdapter, + Duration defaultPollInterval, + AzureEnvironment environment, + String subscriptionId, + String endpoint) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = "2020-11-20"; + this.customRollouts = new CustomRolloutsClientImpl(this); + this.defaultRollouts = new DefaultRolloutsClientImpl(this); + this.resourceProviders = new ResourceProvidersClientImpl(this); + this.notificationRegistrations = new NotificationRegistrationsClientImpl(this); + this.operations = new OperationsClientImpl(this); + this.providerRegistrations = new ProviderRegistrationsClientImpl(this); + this.resourceTypeRegistrations = new ResourceTypeRegistrationsClientImpl(this); + this.skus = new SkusClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + for (Map.Entry entry : this.getContext().getValues().entrySet()) { + context = context.addData(entry.getKey(), entry.getValue()); + } + return context; + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult( + Mono>> activationResponse, + HttpPipeline httpPipeline, + Type pollResultType, + Type finalResultType, + Context context) { + return PollerFactory + .create( + serializerAdapter, + httpPipeline, + pollResultType, + finalResultType, + defaultPollInterval, + activationResponse, + context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = + new HttpResponseImpl( + lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = + this + .getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + logger.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(s); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/ProviderRegistrationImpl.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/ProviderRegistrationImpl.java new file mode 100644 index 0000000000000..a197cd67e8db0 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/ProviderRegistrationImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.implementation; + +import com.azure.resourcemanager.providerhub.fluent.models.ProviderRegistrationInner; +import com.azure.resourcemanager.providerhub.models.ProviderRegistration; +import com.azure.resourcemanager.providerhub.models.ProviderRegistrationProperties; + +public final class ProviderRegistrationImpl implements ProviderRegistration { + private ProviderRegistrationInner innerObject; + + private final com.azure.resourcemanager.providerhub.ProviderHubManager serviceManager; + + ProviderRegistrationImpl( + ProviderRegistrationInner innerObject, + com.azure.resourcemanager.providerhub.ProviderHubManager 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 ProviderRegistrationProperties properties() { + return this.innerModel().properties(); + } + + public ProviderRegistrationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.providerhub.ProviderHubManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/ProviderRegistrationsClientImpl.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/ProviderRegistrationsClientImpl.java new file mode 100644 index 0000000000000..c8e87e690cd80 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/ProviderRegistrationsClientImpl.java @@ -0,0 +1,1003 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.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.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.providerhub.fluent.ProviderRegistrationsClient; +import com.azure.resourcemanager.providerhub.fluent.models.OperationsDefinitionInner; +import com.azure.resourcemanager.providerhub.fluent.models.ProviderRegistrationInner; +import com.azure.resourcemanager.providerhub.models.ProviderRegistrationArrayResponseWithContinuation; +import java.nio.ByteBuffer; +import java.util.List; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ProviderRegistrationsClient. */ +public final class ProviderRegistrationsClientImpl implements ProviderRegistrationsClient { + private final ClientLogger logger = new ClientLogger(ProviderRegistrationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ProviderRegistrationsService service; + + /** The service client containing this operation class. */ + private final ProviderHubImpl client; + + /** + * Initializes an instance of ProviderRegistrationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ProviderRegistrationsClientImpl(ProviderHubImpl client) { + this.service = + RestProxy + .create(ProviderRegistrationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ProviderHubProviderRegistrations to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ProviderHubProviderR") + private interface ProviderRegistrationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("providerNamespace") String providerNamespace, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("providerNamespace") String providerNamespace, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ProviderRegistrationInner properties, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("providerNamespace") String providerNamespace, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}" + + "/generateOperations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> generateOperations( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("providerNamespace") String providerNamespace, + @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); + } + + /** + * Gets the provider registration details. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the provider registration details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String providerNamespace) { + 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 (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the provider registration details. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the provider registration details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String providerNamespace, 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 (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace 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(), + providerNamespace, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the provider registration details. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the provider registration details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String providerNamespace) { + return getWithResponseAsync(providerNamespace) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the provider registration details. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the provider registration details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProviderRegistrationInner get(String providerNamespace) { + return getAsync(providerNamespace).block(); + } + + /** + * Gets the provider registration details. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the provider registration details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String providerNamespace, Context context) { + return getWithResponseAsync(providerNamespace, context).block(); + } + + /** + * Creates or updates the provider registration. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param properties The provider registration properties supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String providerNamespace, ProviderRegistrationInner properties) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + this.client.getApiVersion(), + properties, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates the provider registration. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param properties The provider registration properties supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String providerNamespace, ProviderRegistrationInner properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + this.client.getApiVersion(), + properties, + accept, + context); + } + + /** + * Creates or updates the provider registration. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param properties The provider registration properties supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ProviderRegistrationInner> beginCreateOrUpdateAsync( + String providerNamespace, ProviderRegistrationInner properties) { + Mono>> mono = createOrUpdateWithResponseAsync(providerNamespace, properties); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ProviderRegistrationInner.class, + ProviderRegistrationInner.class, + Context.NONE); + } + + /** + * Creates or updates the provider registration. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param properties The provider registration properties supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ProviderRegistrationInner> beginCreateOrUpdateAsync( + String providerNamespace, ProviderRegistrationInner properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = createOrUpdateWithResponseAsync(providerNamespace, properties, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ProviderRegistrationInner.class, + ProviderRegistrationInner.class, + context); + } + + /** + * Creates or updates the provider registration. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param properties The provider registration properties supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ProviderRegistrationInner> beginCreateOrUpdate( + String providerNamespace, ProviderRegistrationInner properties) { + return beginCreateOrUpdateAsync(providerNamespace, properties).getSyncPoller(); + } + + /** + * Creates or updates the provider registration. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param properties The provider registration properties supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ProviderRegistrationInner> beginCreateOrUpdate( + String providerNamespace, ProviderRegistrationInner properties, Context context) { + return beginCreateOrUpdateAsync(providerNamespace, properties, context).getSyncPoller(); + } + + /** + * Creates or updates the provider registration. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param properties The provider registration properties supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String providerNamespace, ProviderRegistrationInner properties) { + return beginCreateOrUpdateAsync(providerNamespace, properties) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates the provider registration. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param properties The provider registration properties supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String providerNamespace, ProviderRegistrationInner properties, Context context) { + return beginCreateOrUpdateAsync(providerNamespace, properties, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates the provider registration. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param properties The provider registration properties supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProviderRegistrationInner createOrUpdate(String providerNamespace, ProviderRegistrationInner properties) { + return createOrUpdateAsync(providerNamespace, properties).block(); + } + + /** + * Creates or updates the provider registration. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param properties The provider registration properties supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProviderRegistrationInner createOrUpdate( + String providerNamespace, ProviderRegistrationInner properties, Context context) { + return createOrUpdateAsync(providerNamespace, properties, context).block(); + } + + /** + * Deletes a provider registration. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String providerNamespace) { + 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 (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a provider registration. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String providerNamespace, 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 (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace 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(), + providerNamespace, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes a provider registration. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String providerNamespace) { + return deleteWithResponseAsync(providerNamespace).flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes a provider registration. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 providerNamespace) { + deleteAsync(providerNamespace).block(); + } + + /** + * Deletes a provider registration. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String providerNamespace, Context context) { + return deleteWithResponseAsync(providerNamespace, context).block(); + } + + /** + * Gets the list of the provider registrations in the subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the provider registrations in the subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the list of the provider registrations in the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the provider registrations in the subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the list of the provider registrations in the subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the provider registrations in the subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of the provider registrations in the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the provider registrations in the subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the list of the provider registrations in the subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the provider registrations in the subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets the list of the provider registrations in the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the provider registrations in the subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Generates the operations api for the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return array of OperationsDefinition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> generateOperationsWithResponseAsync( + String providerNamespace) { + 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 (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .generateOperations( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Generates the operations api for the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return array of OperationsDefinition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> generateOperationsWithResponseAsync( + String providerNamespace, 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 (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .generateOperations( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Generates the operations api for the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return array of OperationsDefinition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> generateOperationsAsync(String providerNamespace) { + return generateOperationsWithResponseAsync(providerNamespace) + .flatMap( + (Response> res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Generates the operations api for the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return array of OperationsDefinition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public List generateOperations(String providerNamespace) { + return generateOperationsAsync(providerNamespace).block(); + } + + /** + * Generates the operations api for the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return array of OperationsDefinition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response> generateOperationsWithResponse( + String providerNamespace, Context context) { + return generateOperationsWithResponseAsync(providerNamespace, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @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/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/ProviderRegistrationsImpl.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/ProviderRegistrationsImpl.java new file mode 100644 index 0000000000000..b21e8b3ce7d69 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/ProviderRegistrationsImpl.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.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.providerhub.fluent.ProviderRegistrationsClient; +import com.azure.resourcemanager.providerhub.fluent.models.OperationsDefinitionInner; +import com.azure.resourcemanager.providerhub.fluent.models.ProviderRegistrationInner; +import com.azure.resourcemanager.providerhub.models.OperationsDefinition; +import com.azure.resourcemanager.providerhub.models.ProviderRegistration; +import com.azure.resourcemanager.providerhub.models.ProviderRegistrations; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class ProviderRegistrationsImpl implements ProviderRegistrations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProviderRegistrationsImpl.class); + + private final ProviderRegistrationsClient innerClient; + + private final com.azure.resourcemanager.providerhub.ProviderHubManager serviceManager; + + public ProviderRegistrationsImpl( + ProviderRegistrationsClient innerClient, + com.azure.resourcemanager.providerhub.ProviderHubManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ProviderRegistration get(String providerNamespace) { + ProviderRegistrationInner inner = this.serviceClient().get(providerNamespace); + if (inner != null) { + return new ProviderRegistrationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse(String providerNamespace, Context context) { + Response inner = this.serviceClient().getWithResponse(providerNamespace, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ProviderRegistrationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ProviderRegistration createOrUpdate(String providerNamespace, ProviderRegistrationInner properties) { + ProviderRegistrationInner inner = this.serviceClient().createOrUpdate(providerNamespace, properties); + if (inner != null) { + return new ProviderRegistrationImpl(inner, this.manager()); + } else { + return null; + } + } + + public ProviderRegistration createOrUpdate( + String providerNamespace, ProviderRegistrationInner properties, Context context) { + ProviderRegistrationInner inner = this.serviceClient().createOrUpdate(providerNamespace, properties, context); + if (inner != null) { + return new ProviderRegistrationImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String providerNamespace) { + this.serviceClient().delete(providerNamespace); + } + + public Response deleteWithResponse(String providerNamespace, Context context) { + return this.serviceClient().deleteWithResponse(providerNamespace, context); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ProviderRegistrationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ProviderRegistrationImpl(inner1, this.manager())); + } + + public List generateOperations(String providerNamespace) { + List inner = this.serviceClient().generateOperations(providerNamespace); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new OperationsDefinitionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public Response> generateOperationsWithResponse( + String providerNamespace, Context context) { + Response> inner = + this.serviceClient().generateOperationsWithResponse(providerNamespace, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + inner + .getValue() + .stream() + .map(inner1 -> new OperationsDefinitionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return null; + } + } + + private ProviderRegistrationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.providerhub.ProviderHubManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/ResourceProviderManifestImpl.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/ResourceProviderManifestImpl.java new file mode 100644 index 0000000000000..9c407ab53fb49 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/ResourceProviderManifestImpl.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.implementation; + +import com.azure.resourcemanager.providerhub.fluent.models.ResourceProviderManifestInner; +import com.azure.resourcemanager.providerhub.models.ResourceProviderAuthorization; +import com.azure.resourcemanager.providerhub.models.ResourceProviderCapabilities; +import com.azure.resourcemanager.providerhub.models.ResourceProviderEndpoint; +import com.azure.resourcemanager.providerhub.models.ResourceProviderManifest; +import com.azure.resourcemanager.providerhub.models.ResourceProviderManifestFeaturesRule; +import com.azure.resourcemanager.providerhub.models.ResourceProviderManifestManagement; +import com.azure.resourcemanager.providerhub.models.ResourceProviderManifestProviderAuthentication; +import com.azure.resourcemanager.providerhub.models.ResourceProviderManifestReRegisterSubscriptionMetadata; +import com.azure.resourcemanager.providerhub.models.ResourceProviderManifestRequestHeaderOptions; +import com.azure.resourcemanager.providerhub.models.ResourceProviderType; +import com.azure.resourcemanager.providerhub.models.ResourceType; +import java.util.Collections; +import java.util.List; + +public final class ResourceProviderManifestImpl implements ResourceProviderManifest { + private ResourceProviderManifestInner innerObject; + + private final com.azure.resourcemanager.providerhub.ProviderHubManager serviceManager; + + ResourceProviderManifestImpl( + ResourceProviderManifestInner innerObject, + com.azure.resourcemanager.providerhub.ProviderHubManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public ResourceProviderManifestProviderAuthentication providerAuthentication() { + return this.innerModel().providerAuthentication(); + } + + public List providerAuthorizations() { + List inner = this.innerModel().providerAuthorizations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String namespace() { + return this.innerModel().namespace(); + } + + public String providerVersion() { + return this.innerModel().providerVersion(); + } + + public ResourceProviderType providerType() { + return this.innerModel().providerType(); + } + + public List requiredFeatures() { + List inner = this.innerModel().requiredFeatures(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ResourceProviderManifestFeaturesRule featuresRule() { + return this.innerModel().featuresRule(); + } + + public ResourceProviderManifestRequestHeaderOptions requestHeaderOptions() { + return this.innerModel().requestHeaderOptions(); + } + + public List resourceTypes() { + List inner = this.innerModel().resourceTypes(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ResourceProviderManifestManagement management() { + return this.innerModel().management(); + } + + public List capabilities() { + List inner = this.innerModel().capabilities(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Object metadata() { + return this.innerModel().metadata(); + } + + public List globalNotificationEndpoints() { + List inner = this.innerModel().globalNotificationEndpoints(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ResourceProviderManifestReRegisterSubscriptionMetadata reRegisterSubscriptionMetadata() { + return this.innerModel().reRegisterSubscriptionMetadata(); + } + + public ResourceProviderManifestInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.providerhub.ProviderHubManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/ResourceProvidersClientImpl.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/ResourceProvidersClientImpl.java new file mode 100644 index 0000000000000..5857bee800d2b --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/ResourceProvidersClientImpl.java @@ -0,0 +1,381 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.providerhub.fluent.ResourceProvidersClient; +import com.azure.resourcemanager.providerhub.fluent.models.CheckinManifestInfoInner; +import com.azure.resourcemanager.providerhub.fluent.models.ResourceProviderManifestInner; +import com.azure.resourcemanager.providerhub.models.CheckinManifestParams; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ResourceProvidersClient. */ +public final class ResourceProvidersClientImpl implements ResourceProvidersClient { + private final ClientLogger logger = new ClientLogger(ResourceProvidersClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ResourceProvidersService service; + + /** The service client containing this operation class. */ + private final ProviderHubImpl client; + + /** + * Initializes an instance of ResourceProvidersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ResourceProvidersClientImpl(ProviderHubImpl client) { + this.service = + RestProxy.create(ResourceProvidersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ProviderHubResourceProviders to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ProviderHubResourceP") + private interface ResourceProvidersService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}" + + "/generateManifest") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> generateManifest( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("providerNamespace") String providerNamespace, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}" + + "/checkinManifest") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkinManifest( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("providerNamespace") String providerNamespace, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") CheckinManifestParams checkinManifestParams, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Generates the manifest for the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> generateManifestWithResponseAsync(String providerNamespace) { + 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 (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .generateManifest( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Generates the manifest for the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> generateManifestWithResponseAsync( + String providerNamespace, 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 (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .generateManifest( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Generates the manifest for the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono generateManifestAsync(String providerNamespace) { + return generateManifestWithResponseAsync(providerNamespace) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Generates the manifest for the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ResourceProviderManifestInner generateManifest(String providerNamespace) { + return generateManifestAsync(providerNamespace).block(); + } + + /** + * Generates the manifest for the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response generateManifestWithResponse( + String providerNamespace, Context context) { + return generateManifestWithResponseAsync(providerNamespace, context).block(); + } + + /** + * Checkin the manifest. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param checkinManifestParams The required body parameters supplied to the checkin manifest operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkinManifestWithResponseAsync( + String providerNamespace, CheckinManifestParams checkinManifestParams) { + 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 (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + if (checkinManifestParams == null) { + return Mono + .error(new IllegalArgumentException("Parameter checkinManifestParams is required and cannot be null.")); + } else { + checkinManifestParams.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .checkinManifest( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + this.client.getApiVersion(), + checkinManifestParams, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Checkin the manifest. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param checkinManifestParams The required body parameters supplied to the checkin manifest operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkinManifestWithResponseAsync( + String providerNamespace, CheckinManifestParams checkinManifestParams, 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 (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + if (checkinManifestParams == null) { + return Mono + .error(new IllegalArgumentException("Parameter checkinManifestParams is required and cannot be null.")); + } else { + checkinManifestParams.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkinManifest( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + this.client.getApiVersion(), + checkinManifestParams, + accept, + context); + } + + /** + * Checkin the manifest. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param checkinManifestParams The required body parameters supplied to the checkin manifest operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkinManifestAsync( + String providerNamespace, CheckinManifestParams checkinManifestParams) { + return checkinManifestWithResponseAsync(providerNamespace, checkinManifestParams) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Checkin the manifest. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param checkinManifestParams The required body parameters supplied to the checkin manifest operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CheckinManifestInfoInner checkinManifest( + String providerNamespace, CheckinManifestParams checkinManifestParams) { + return checkinManifestAsync(providerNamespace, checkinManifestParams).block(); + } + + /** + * Checkin the manifest. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param checkinManifestParams The required body parameters supplied to the checkin manifest operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkinManifestWithResponse( + String providerNamespace, CheckinManifestParams checkinManifestParams, Context context) { + return checkinManifestWithResponseAsync(providerNamespace, checkinManifestParams, context).block(); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/ResourceProvidersImpl.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/ResourceProvidersImpl.java new file mode 100644 index 0000000000000..2fc4a15be5d4a --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/ResourceProvidersImpl.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.providerhub.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.providerhub.fluent.ResourceProvidersClient; +import com.azure.resourcemanager.providerhub.fluent.models.CheckinManifestInfoInner; +import com.azure.resourcemanager.providerhub.fluent.models.ResourceProviderManifestInner; +import com.azure.resourcemanager.providerhub.models.CheckinManifestInfo; +import com.azure.resourcemanager.providerhub.models.CheckinManifestParams; +import com.azure.resourcemanager.providerhub.models.ResourceProviderManifest; +import com.azure.resourcemanager.providerhub.models.ResourceProviders; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ResourceProvidersImpl implements ResourceProviders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceProvidersImpl.class); + + private final ResourceProvidersClient innerClient; + + private final com.azure.resourcemanager.providerhub.ProviderHubManager serviceManager; + + public ResourceProvidersImpl( + ResourceProvidersClient innerClient, com.azure.resourcemanager.providerhub.ProviderHubManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ResourceProviderManifest generateManifest(String providerNamespace) { + ResourceProviderManifestInner inner = this.serviceClient().generateManifest(providerNamespace); + if (inner != null) { + return new ResourceProviderManifestImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response generateManifestWithResponse(String providerNamespace, Context context) { + Response inner = + this.serviceClient().generateManifestWithResponse(providerNamespace, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ResourceProviderManifestImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CheckinManifestInfo checkinManifest(String providerNamespace, CheckinManifestParams checkinManifestParams) { + CheckinManifestInfoInner inner = this.serviceClient().checkinManifest(providerNamespace, checkinManifestParams); + if (inner != null) { + return new CheckinManifestInfoImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response checkinManifestWithResponse( + String providerNamespace, CheckinManifestParams checkinManifestParams, Context context) { + Response inner = + this.serviceClient().checkinManifestWithResponse(providerNamespace, checkinManifestParams, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CheckinManifestInfoImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private ResourceProvidersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.providerhub.ProviderHubManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/ResourceTypeRegistrationImpl.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/ResourceTypeRegistrationImpl.java new file mode 100644 index 0000000000000..ba623bdb0ef58 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/ResourceTypeRegistrationImpl.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.providerhub.fluent.models.ResourceTypeRegistrationInner; +import com.azure.resourcemanager.providerhub.models.ResourceTypeRegistration; +import com.azure.resourcemanager.providerhub.models.ResourceTypeRegistrationProperties; + +public final class ResourceTypeRegistrationImpl + implements ResourceTypeRegistration, ResourceTypeRegistration.Definition, ResourceTypeRegistration.Update { + private ResourceTypeRegistrationInner innerObject; + + private final com.azure.resourcemanager.providerhub.ProviderHubManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public ResourceTypeRegistrationProperties properties() { + return this.innerModel().properties(); + } + + public ResourceTypeRegistrationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.providerhub.ProviderHubManager manager() { + return this.serviceManager; + } + + private String providerNamespace; + + private String resourceType; + + public ResourceTypeRegistrationImpl withExistingProviderRegistration(String providerNamespace) { + this.providerNamespace = providerNamespace; + return this; + } + + public ResourceTypeRegistration create() { + this.innerObject = + serviceManager + .serviceClient() + .getResourceTypeRegistrations() + .createOrUpdate(providerNamespace, resourceType, this.innerModel(), Context.NONE); + return this; + } + + public ResourceTypeRegistration create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getResourceTypeRegistrations() + .createOrUpdate(providerNamespace, resourceType, this.innerModel(), context); + return this; + } + + ResourceTypeRegistrationImpl(String name, com.azure.resourcemanager.providerhub.ProviderHubManager serviceManager) { + this.innerObject = new ResourceTypeRegistrationInner(); + this.serviceManager = serviceManager; + this.resourceType = name; + } + + public ResourceTypeRegistrationImpl update() { + return this; + } + + public ResourceTypeRegistration apply() { + this.innerObject = + serviceManager + .serviceClient() + .getResourceTypeRegistrations() + .createOrUpdate(providerNamespace, resourceType, this.innerModel(), Context.NONE); + return this; + } + + public ResourceTypeRegistration apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getResourceTypeRegistrations() + .createOrUpdate(providerNamespace, resourceType, this.innerModel(), context); + return this; + } + + ResourceTypeRegistrationImpl( + ResourceTypeRegistrationInner innerObject, + com.azure.resourcemanager.providerhub.ProviderHubManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.providerNamespace = Utils.getValueFromIdByName(innerObject.id(), "providerRegistrations"); + this.resourceType = Utils.getValueFromIdByName(innerObject.id(), "resourcetypeRegistrations"); + } + + public ResourceTypeRegistration refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getResourceTypeRegistrations() + .getWithResponse(providerNamespace, resourceType, Context.NONE) + .getValue(); + return this; + } + + public ResourceTypeRegistration refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getResourceTypeRegistrations() + .getWithResponse(providerNamespace, resourceType, context) + .getValue(); + return this; + } + + public ResourceTypeRegistrationImpl withProperties(ResourceTypeRegistrationProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/ResourceTypeRegistrationsClientImpl.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/ResourceTypeRegistrationsClientImpl.java new file mode 100644 index 0000000000000..904b005f75035 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/ResourceTypeRegistrationsClientImpl.java @@ -0,0 +1,952 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.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.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.providerhub.fluent.ResourceTypeRegistrationsClient; +import com.azure.resourcemanager.providerhub.fluent.models.ResourceTypeRegistrationInner; +import com.azure.resourcemanager.providerhub.models.ResourceTypeRegistrationArrayResponseWithContinuation; +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 ResourceTypeRegistrationsClient. */ +public final class ResourceTypeRegistrationsClientImpl implements ResourceTypeRegistrationsClient { + private final ClientLogger logger = new ClientLogger(ResourceTypeRegistrationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ResourceTypeRegistrationsService service; + + /** The service client containing this operation class. */ + private final ProviderHubImpl client; + + /** + * Initializes an instance of ResourceTypeRegistrationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ResourceTypeRegistrationsClientImpl(ProviderHubImpl client) { + this.service = + RestProxy + .create( + ResourceTypeRegistrationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ProviderHubResourceTypeRegistrations to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ProviderHubResourceT") + private interface ResourceTypeRegistrationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}" + + "/resourcetypeRegistrations/{resourceType}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("providerNamespace") String providerNamespace, + @PathParam("resourceType") String resourceType, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}" + + "/resourcetypeRegistrations/{resourceType}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("providerNamespace") String providerNamespace, + @PathParam("resourceType") String resourceType, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ResourceTypeRegistrationInner properties, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}" + + "/resourcetypeRegistrations/{resourceType}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("providerNamespace") String providerNamespace, + @PathParam("resourceType") String resourceType, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}" + + "/resourcetypeRegistrations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByProviderRegistration( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("providerNamespace") String providerNamespace, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByProviderRegistrationNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets a resource type details in the given subscription and provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a resource type details in the given subscription and provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String providerNamespace, String resourceType) { + 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 (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + resourceType, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a resource type details in the given subscription and provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a resource type details in the given subscription and provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String providerNamespace, String resourceType, 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 (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType 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(), + providerNamespace, + resourceType, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets a resource type details in the given subscription and provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a resource type details in the given subscription and provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String providerNamespace, String resourceType) { + return getWithResponseAsync(providerNamespace, resourceType) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a resource type details in the given subscription and provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a resource type details in the given subscription and provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ResourceTypeRegistrationInner get(String providerNamespace, String resourceType) { + return getAsync(providerNamespace, resourceType).block(); + } + + /** + * Gets a resource type details in the given subscription and provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a resource type details in the given subscription and provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String providerNamespace, String resourceType, Context context) { + return getWithResponseAsync(providerNamespace, resourceType, context).block(); + } + + /** + * Creates or updates a resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param properties The required request body parameters supplied to the resource type registration CreateOrUpdate + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String providerNamespace, String resourceType, ResourceTypeRegistrationInner properties) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + resourceType, + this.client.getApiVersion(), + properties, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param properties The required request body parameters supplied to the resource type registration CreateOrUpdate + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String providerNamespace, String resourceType, ResourceTypeRegistrationInner properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + resourceType, + this.client.getApiVersion(), + properties, + accept, + context); + } + + /** + * Creates or updates a resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param properties The required request body parameters supplied to the resource type registration CreateOrUpdate + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ResourceTypeRegistrationInner> + beginCreateOrUpdateAsync( + String providerNamespace, String resourceType, ResourceTypeRegistrationInner properties) { + Mono>> mono = + createOrUpdateWithResponseAsync(providerNamespace, resourceType, properties); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ResourceTypeRegistrationInner.class, + ResourceTypeRegistrationInner.class, + Context.NONE); + } + + /** + * Creates or updates a resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param properties The required request body parameters supplied to the resource type registration CreateOrUpdate + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ResourceTypeRegistrationInner> + beginCreateOrUpdateAsync( + String providerNamespace, String resourceType, ResourceTypeRegistrationInner properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(providerNamespace, resourceType, properties, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ResourceTypeRegistrationInner.class, + ResourceTypeRegistrationInner.class, + context); + } + + /** + * Creates or updates a resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param properties The required request body parameters supplied to the resource type registration CreateOrUpdate + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ResourceTypeRegistrationInner> beginCreateOrUpdate( + String providerNamespace, String resourceType, ResourceTypeRegistrationInner properties) { + return beginCreateOrUpdateAsync(providerNamespace, resourceType, properties).getSyncPoller(); + } + + /** + * Creates or updates a resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param properties The required request body parameters supplied to the resource type registration CreateOrUpdate + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ResourceTypeRegistrationInner> beginCreateOrUpdate( + String providerNamespace, String resourceType, ResourceTypeRegistrationInner properties, Context context) { + return beginCreateOrUpdateAsync(providerNamespace, resourceType, properties, context).getSyncPoller(); + } + + /** + * Creates or updates a resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param properties The required request body parameters supplied to the resource type registration CreateOrUpdate + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String providerNamespace, String resourceType, ResourceTypeRegistrationInner properties) { + return beginCreateOrUpdateAsync(providerNamespace, resourceType, properties) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param properties The required request body parameters supplied to the resource type registration CreateOrUpdate + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String providerNamespace, String resourceType, ResourceTypeRegistrationInner properties, Context context) { + return beginCreateOrUpdateAsync(providerNamespace, resourceType, properties, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param properties The required request body parameters supplied to the resource type registration CreateOrUpdate + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ResourceTypeRegistrationInner createOrUpdate( + String providerNamespace, String resourceType, ResourceTypeRegistrationInner properties) { + return createOrUpdateAsync(providerNamespace, resourceType, properties).block(); + } + + /** + * Creates or updates a resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param properties The required request body parameters supplied to the resource type registration CreateOrUpdate + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ResourceTypeRegistrationInner createOrUpdate( + String providerNamespace, String resourceType, ResourceTypeRegistrationInner properties, Context context) { + return createOrUpdateAsync(providerNamespace, resourceType, properties, context).block(); + } + + /** + * Deletes a resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String providerNamespace, String resourceType) { + 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 (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + resourceType, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String providerNamespace, String resourceType, 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 (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType 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(), + providerNamespace, + resourceType, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes a resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String providerNamespace, String resourceType) { + return deleteWithResponseAsync(providerNamespace, resourceType).flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes a resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String providerNamespace, String resourceType) { + deleteAsync(providerNamespace, resourceType).block(); + } + + /** + * Deletes a resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String providerNamespace, String resourceType, Context context) { + return deleteWithResponseAsync(providerNamespace, resourceType, context).block(); + } + + /** + * Gets the list of the resource types for the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the resource types for the given provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProviderRegistrationSinglePageAsync( + String providerNamespace) { + 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 (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByProviderRegistration( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + 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())); + } + + /** + * Gets the list of the resource types for the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the resource types for the given provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProviderRegistrationSinglePageAsync( + String providerNamespace, 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 (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByProviderRegistration( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the list of the resource types for the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the resource types for the given provider. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByProviderRegistrationAsync(String providerNamespace) { + return new PagedFlux<>( + () -> listByProviderRegistrationSinglePageAsync(providerNamespace), + nextLink -> listByProviderRegistrationNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of the resource types for the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the resource types for the given provider. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByProviderRegistrationAsync( + String providerNamespace, Context context) { + return new PagedFlux<>( + () -> listByProviderRegistrationSinglePageAsync(providerNamespace, context), + nextLink -> listByProviderRegistrationNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the list of the resource types for the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the resource types for the given provider. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByProviderRegistration(String providerNamespace) { + return new PagedIterable<>(listByProviderRegistrationAsync(providerNamespace)); + } + + /** + * Gets the list of the resource types for the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the resource types for the given provider. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByProviderRegistration( + String providerNamespace, Context context) { + return new PagedIterable<>(listByProviderRegistrationAsync(providerNamespace, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProviderRegistrationNextSinglePageAsync( + 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.listByProviderRegistrationNext(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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProviderRegistrationNextSinglePageAsync( + 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 + .listByProviderRegistrationNext(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/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/ResourceTypeRegistrationsImpl.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/ResourceTypeRegistrationsImpl.java new file mode 100644 index 0000000000000..fdc92c59e9fd3 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/ResourceTypeRegistrationsImpl.java @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.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.providerhub.fluent.ResourceTypeRegistrationsClient; +import com.azure.resourcemanager.providerhub.fluent.models.ResourceTypeRegistrationInner; +import com.azure.resourcemanager.providerhub.models.ResourceTypeRegistration; +import com.azure.resourcemanager.providerhub.models.ResourceTypeRegistrations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ResourceTypeRegistrationsImpl implements ResourceTypeRegistrations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceTypeRegistrationsImpl.class); + + private final ResourceTypeRegistrationsClient innerClient; + + private final com.azure.resourcemanager.providerhub.ProviderHubManager serviceManager; + + public ResourceTypeRegistrationsImpl( + ResourceTypeRegistrationsClient innerClient, + com.azure.resourcemanager.providerhub.ProviderHubManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ResourceTypeRegistration get(String providerNamespace, String resourceType) { + ResourceTypeRegistrationInner inner = this.serviceClient().get(providerNamespace, resourceType); + if (inner != null) { + return new ResourceTypeRegistrationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String providerNamespace, String resourceType, Context context) { + Response inner = + this.serviceClient().getWithResponse(providerNamespace, resourceType, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ResourceTypeRegistrationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String providerNamespace, String resourceType) { + this.serviceClient().delete(providerNamespace, resourceType); + } + + public Response deleteWithResponse(String providerNamespace, String resourceType, Context context) { + return this.serviceClient().deleteWithResponse(providerNamespace, resourceType, context); + } + + public PagedIterable listByProviderRegistration(String providerNamespace) { + PagedIterable inner = + this.serviceClient().listByProviderRegistration(providerNamespace); + return Utils.mapPage(inner, inner1 -> new ResourceTypeRegistrationImpl(inner1, this.manager())); + } + + public PagedIterable listByProviderRegistration( + String providerNamespace, Context context) { + PagedIterable inner = + this.serviceClient().listByProviderRegistration(providerNamespace, context); + return Utils.mapPage(inner, inner1 -> new ResourceTypeRegistrationImpl(inner1, this.manager())); + } + + public ResourceTypeRegistration getById(String id) { + String providerNamespace = Utils.getValueFromIdByName(id, "providerRegistrations"); + if (providerNamespace == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'providerRegistrations'.", + id))); + } + String resourceType = Utils.getValueFromIdByName(id, "resourcetypeRegistrations"); + if (resourceType == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'resourcetypeRegistrations'.", + id))); + } + return this.getWithResponse(providerNamespace, resourceType, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String providerNamespace = Utils.getValueFromIdByName(id, "providerRegistrations"); + if (providerNamespace == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'providerRegistrations'.", + id))); + } + String resourceType = Utils.getValueFromIdByName(id, "resourcetypeRegistrations"); + if (resourceType == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'resourcetypeRegistrations'.", + id))); + } + return this.getWithResponse(providerNamespace, resourceType, context); + } + + public void deleteById(String id) { + String providerNamespace = Utils.getValueFromIdByName(id, "providerRegistrations"); + if (providerNamespace == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'providerRegistrations'.", + id))); + } + String resourceType = Utils.getValueFromIdByName(id, "resourcetypeRegistrations"); + if (resourceType == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'resourcetypeRegistrations'.", + id))); + } + this.deleteWithResponse(providerNamespace, resourceType, Context.NONE).getValue(); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String providerNamespace = Utils.getValueFromIdByName(id, "providerRegistrations"); + if (providerNamespace == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'providerRegistrations'.", + id))); + } + String resourceType = Utils.getValueFromIdByName(id, "resourcetypeRegistrations"); + if (resourceType == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'resourcetypeRegistrations'.", + id))); + } + return this.deleteWithResponse(providerNamespace, resourceType, context); + } + + private ResourceTypeRegistrationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.providerhub.ProviderHubManager manager() { + return this.serviceManager; + } + + public ResourceTypeRegistrationImpl define(String name) { + return new ResourceTypeRegistrationImpl(name, this.manager()); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/SkuResourceImpl.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/SkuResourceImpl.java new file mode 100644 index 0000000000000..34b505e68d151 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/SkuResourceImpl.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.providerhub.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.providerhub.fluent.models.SkuResourceInner; +import com.azure.resourcemanager.providerhub.models.ResourceTypeSku; +import com.azure.resourcemanager.providerhub.models.SkuResource; +import com.azure.resourcemanager.providerhub.models.SkuResourceProperties; +import com.azure.resourcemanager.providerhub.models.SkuSetting; +import java.util.List; + +public final class SkuResourceImpl implements SkuResource, SkuResource.Definition, SkuResource.Update { + private SkuResourceInner innerObject; + + private final com.azure.resourcemanager.providerhub.ProviderHubManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SkuResourceProperties properties() { + return this.innerModel().properties(); + } + + public SkuResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.providerhub.ProviderHubManager manager() { + return this.serviceManager; + } + + private String providerNamespace; + + private String resourceType; + + private String sku; + + private ResourceTypeSku createProperties; + + private ResourceTypeSku updateProperties; + + public SkuResourceImpl withExistingResourcetypeRegistration(String providerNamespace, String resourceType) { + this.providerNamespace = providerNamespace; + this.resourceType = resourceType; + return this; + } + + public SkuResource create() { + this.innerObject = + serviceManager + .serviceClient() + .getSkus() + .createOrUpdateWithResponse(providerNamespace, resourceType, sku, createProperties, Context.NONE) + .getValue(); + return this; + } + + public SkuResource create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSkus() + .createOrUpdateWithResponse(providerNamespace, resourceType, sku, createProperties, context) + .getValue(); + return this; + } + + SkuResourceImpl(String name, com.azure.resourcemanager.providerhub.ProviderHubManager serviceManager) { + this.innerObject = new SkuResourceInner(); + this.serviceManager = serviceManager; + this.sku = name; + this.createProperties = new ResourceTypeSku(); + } + + public SkuResourceImpl update() { + this.updateProperties = new ResourceTypeSku(); + return this; + } + + public SkuResource apply() { + this.innerObject = + serviceManager + .serviceClient() + .getSkus() + .createOrUpdateWithResponse(providerNamespace, resourceType, sku, updateProperties, Context.NONE) + .getValue(); + return this; + } + + public SkuResource apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSkus() + .createOrUpdateWithResponse(providerNamespace, resourceType, sku, updateProperties, context) + .getValue(); + return this; + } + + SkuResourceImpl( + SkuResourceInner innerObject, com.azure.resourcemanager.providerhub.ProviderHubManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.providerNamespace = Utils.getValueFromIdByName(innerObject.id(), "providerRegistrations"); + this.resourceType = Utils.getValueFromIdByName(innerObject.id(), "resourcetypeRegistrations"); + this.sku = Utils.getValueFromIdByName(innerObject.id(), "skus"); + } + + public SkuResource refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getSkus() + .getWithResponse(providerNamespace, resourceType, sku, Context.NONE) + .getValue(); + return this; + } + + public SkuResource refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSkus() + .getWithResponse(providerNamespace, resourceType, sku, context) + .getValue(); + return this; + } + + public SkuResourceImpl withSkuSettings(List skuSettings) { + if (isInCreateMode()) { + this.createProperties.withSkuSettings(skuSettings); + return this; + } else { + this.updateProperties.withSkuSettings(skuSettings); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/SkusClientImpl.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/SkusClientImpl.java new file mode 100644 index 0000000000000..afd58714944d5 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/SkusClientImpl.java @@ -0,0 +1,4222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.providerhub.fluent.SkusClient; +import com.azure.resourcemanager.providerhub.fluent.models.SkuResourceInner; +import com.azure.resourcemanager.providerhub.models.ResourceTypeSku; +import com.azure.resourcemanager.providerhub.models.SkuResourceArrayResponseWithContinuation; +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 { + private final ClientLogger logger = new ClientLogger(SkusClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SkusService service; + + /** The service client containing this operation class. */ + private final ProviderHubImpl client; + + /** + * Initializes an instance of SkusClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SkusClientImpl(ProviderHubImpl client) { + this.service = RestProxy.create(SkusService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ProviderHubSkus to be used by the proxy service to perform REST + * calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ProviderHubSkus") + private interface SkusService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}" + + "/resourcetypeRegistrations/{resourceType}/skus/{sku}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("providerNamespace") String providerNamespace, + @PathParam("resourceType") String resourceType, + @PathParam("sku") String sku, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}" + + "/resourcetypeRegistrations/{resourceType}/skus/{sku}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("providerNamespace") String providerNamespace, + @PathParam("resourceType") String resourceType, + @PathParam("sku") String sku, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ResourceTypeSku properties, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}" + + "/resourcetypeRegistrations/{resourceType}/skus/{sku}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("providerNamespace") String providerNamespace, + @PathParam("resourceType") String resourceType, + @PathParam("sku") String sku, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}" + + "/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/skus" + + "/{sku}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getNestedResourceTypeFirst( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("providerNamespace") String providerNamespace, + @PathParam("resourceType") String resourceType, + @PathParam("nestedResourceTypeFirst") String nestedResourceTypeFirst, + @PathParam("sku") String sku, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}" + + "/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/skus" + + "/{sku}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdateNestedResourceTypeFirst( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("providerNamespace") String providerNamespace, + @PathParam("resourceType") String resourceType, + @PathParam("nestedResourceTypeFirst") String nestedResourceTypeFirst, + @PathParam("sku") String sku, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ResourceTypeSku properties, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}" + + "/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/skus" + + "/{sku}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> deleteNestedResourceTypeFirst( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("providerNamespace") String providerNamespace, + @PathParam("resourceType") String resourceType, + @PathParam("nestedResourceTypeFirst") String nestedResourceTypeFirst, + @PathParam("sku") String sku, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}" + + "/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}" + + "/resourcetypeRegistrations/{nestedResourceTypeSecond}/skus/{sku}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getNestedResourceTypeSecond( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("providerNamespace") String providerNamespace, + @PathParam("resourceType") String resourceType, + @PathParam("nestedResourceTypeFirst") String nestedResourceTypeFirst, + @PathParam("nestedResourceTypeSecond") String nestedResourceTypeSecond, + @PathParam("sku") String sku, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}" + + "/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}" + + "/resourcetypeRegistrations/{nestedResourceTypeSecond}/skus/{sku}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdateNestedResourceTypeSecond( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("providerNamespace") String providerNamespace, + @PathParam("resourceType") String resourceType, + @PathParam("nestedResourceTypeFirst") String nestedResourceTypeFirst, + @PathParam("nestedResourceTypeSecond") String nestedResourceTypeSecond, + @PathParam("sku") String sku, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ResourceTypeSku properties, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}" + + "/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}" + + "/resourcetypeRegistrations/{nestedResourceTypeSecond}/skus/{sku}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> deleteNestedResourceTypeSecond( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("providerNamespace") String providerNamespace, + @PathParam("resourceType") String resourceType, + @PathParam("nestedResourceTypeFirst") String nestedResourceTypeFirst, + @PathParam("nestedResourceTypeSecond") String nestedResourceTypeSecond, + @PathParam("sku") String sku, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}" + + "/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}" + + "/resourcetypeRegistrations/{nestedResourceTypeSecond}/resourcetypeRegistrations" + + "/{nestedResourceTypeThird}/skus/{sku}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getNestedResourceTypeThird( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("providerNamespace") String providerNamespace, + @PathParam("resourceType") String resourceType, + @PathParam("nestedResourceTypeFirst") String nestedResourceTypeFirst, + @PathParam("nestedResourceTypeSecond") String nestedResourceTypeSecond, + @PathParam("nestedResourceTypeThird") String nestedResourceTypeThird, + @PathParam("sku") String sku, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}" + + "/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}" + + "/resourcetypeRegistrations/{nestedResourceTypeSecond}/resourcetypeRegistrations" + + "/{nestedResourceTypeThird}/skus/{sku}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdateNestedResourceTypeThird( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("providerNamespace") String providerNamespace, + @PathParam("resourceType") String resourceType, + @PathParam("nestedResourceTypeFirst") String nestedResourceTypeFirst, + @PathParam("nestedResourceTypeSecond") String nestedResourceTypeSecond, + @PathParam("nestedResourceTypeThird") String nestedResourceTypeThird, + @PathParam("sku") String sku, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ResourceTypeSku properties, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}" + + "/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}" + + "/resourcetypeRegistrations/{nestedResourceTypeSecond}/resourcetypeRegistrations" + + "/{nestedResourceTypeThird}/skus/{sku}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> deleteNestedResourceTypeThird( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("providerNamespace") String providerNamespace, + @PathParam("resourceType") String resourceType, + @PathParam("nestedResourceTypeFirst") String nestedResourceTypeFirst, + @PathParam("nestedResourceTypeSecond") String nestedResourceTypeSecond, + @PathParam("nestedResourceTypeThird") String nestedResourceTypeThird, + @PathParam("sku") String sku, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}" + + "/resourcetypeRegistrations/{resourceType}/skus") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceTypeRegistrations( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("providerNamespace") String providerNamespace, + @PathParam("resourceType") String resourceType, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}" + + "/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/skus") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceTypeRegistrationsNestedResourceTypeFirst( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("providerNamespace") String providerNamespace, + @PathParam("resourceType") String resourceType, + @PathParam("nestedResourceTypeFirst") String nestedResourceTypeFirst, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}" + + "/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}" + + "/resourcetypeRegistrations/{nestedResourceTypeSecond}/skus") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> + listByResourceTypeRegistrationsNestedResourceTypeSecond( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("providerNamespace") String providerNamespace, + @PathParam("resourceType") String resourceType, + @PathParam("nestedResourceTypeFirst") String nestedResourceTypeFirst, + @PathParam("nestedResourceTypeSecond") String nestedResourceTypeSecond, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}" + + "/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}" + + "/resourcetypeRegistrations/{nestedResourceTypeSecond}/resourcetypeRegistrations" + + "/{nestedResourceTypeThird}/skus") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceTypeRegistrationsNestedResourceTypeThird( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("providerNamespace") String providerNamespace, + @PathParam("resourceType") String resourceType, + @PathParam("nestedResourceTypeFirst") String nestedResourceTypeFirst, + @PathParam("nestedResourceTypeSecond") String nestedResourceTypeSecond, + @PathParam("nestedResourceTypeThird") String nestedResourceTypeThird, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceTypeRegistrationsNext( + @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> + listByResourceTypeRegistrationsNestedResourceTypeFirstNext( + @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> + listByResourceTypeRegistrationsNestedResourceTypeSecondNext( + @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> + listByResourceTypeRegistrationsNestedResourceTypeThirdNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the sku details for the given resource type and sku name. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param sku The SKU. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sku details for the given resource type and sku name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String providerNamespace, String resourceType, String sku) { + 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 (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (sku == null) { + return Mono.error(new IllegalArgumentException("Parameter sku is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + resourceType, + sku, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the sku details for the given resource type and sku name. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param sku The SKU. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sku details for the given resource type and sku name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String providerNamespace, String resourceType, String sku, 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 (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (sku == null) { + return Mono.error(new IllegalArgumentException("Parameter sku 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(), + providerNamespace, + resourceType, + sku, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the sku details for the given resource type and sku name. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param sku The SKU. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sku details for the given resource type and sku name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String providerNamespace, String resourceType, String sku) { + return getWithResponseAsync(providerNamespace, resourceType, sku) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the sku details for the given resource type and sku name. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param sku The SKU. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sku details for the given resource type and sku name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SkuResourceInner get(String providerNamespace, String resourceType, String sku) { + return getAsync(providerNamespace, resourceType, sku).block(); + } + + /** + * Gets the sku details for the given resource type and sku name. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param sku The SKU. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sku details for the given resource type and sku name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String providerNamespace, String resourceType, String sku, Context context) { + return getWithResponseAsync(providerNamespace, resourceType, sku, context).block(); + } + + /** + * Creates or updates the resource type skus in the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param sku The SKU. + * @param properties The required body parameters supplied to the resource sku operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String providerNamespace, String resourceType, String sku, ResourceTypeSku properties) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (sku == null) { + return Mono.error(new IllegalArgumentException("Parameter sku is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + resourceType, + sku, + this.client.getApiVersion(), + properties, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates the resource type skus in the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param sku The SKU. + * @param properties The required body parameters supplied to the resource sku operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String providerNamespace, String resourceType, String sku, ResourceTypeSku properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (sku == null) { + return Mono.error(new IllegalArgumentException("Parameter sku is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + resourceType, + sku, + this.client.getApiVersion(), + properties, + accept, + context); + } + + /** + * Creates or updates the resource type skus in the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param sku The SKU. + * @param properties The required body parameters supplied to the resource sku operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String providerNamespace, String resourceType, String sku, ResourceTypeSku properties) { + return createOrUpdateWithResponseAsync(providerNamespace, resourceType, sku, properties) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates the resource type skus in the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param sku The SKU. + * @param properties The required body parameters supplied to the resource sku operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SkuResourceInner createOrUpdate( + String providerNamespace, String resourceType, String sku, ResourceTypeSku properties) { + return createOrUpdateAsync(providerNamespace, resourceType, sku, properties).block(); + } + + /** + * Creates or updates the resource type skus in the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param sku The SKU. + * @param properties The required body parameters supplied to the resource sku operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String providerNamespace, String resourceType, String sku, ResourceTypeSku properties, Context context) { + return createOrUpdateWithResponseAsync(providerNamespace, resourceType, sku, properties, context).block(); + } + + /** + * Deletes a resource type sku. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param sku The SKU. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String providerNamespace, String resourceType, String sku) { + 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 (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (sku == null) { + return Mono.error(new IllegalArgumentException("Parameter sku is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + resourceType, + sku, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a resource type sku. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param sku The SKU. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String providerNamespace, String resourceType, String sku, 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 (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (sku == null) { + return Mono.error(new IllegalArgumentException("Parameter sku 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(), + providerNamespace, + resourceType, + sku, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes a resource type sku. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param sku The SKU. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String providerNamespace, String resourceType, String sku) { + return deleteWithResponseAsync(providerNamespace, resourceType, sku) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes a resource type sku. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param sku The SKU. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 providerNamespace, String resourceType, String sku) { + deleteAsync(providerNamespace, resourceType, sku).block(); + } + + /** + * Deletes a resource type sku. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param sku The SKU. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String providerNamespace, String resourceType, String sku, Context context) { + return deleteWithResponseAsync(providerNamespace, resourceType, sku, context).block(); + } + + /** + * Gets the sku details for the given resource type and sku name. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param sku The SKU. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sku details for the given resource type and sku name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getNestedResourceTypeFirstWithResponseAsync( + String providerNamespace, String resourceType, String nestedResourceTypeFirst, String sku) { + 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 (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (nestedResourceTypeFirst == null) { + return Mono + .error( + new IllegalArgumentException("Parameter nestedResourceTypeFirst is required and cannot be null.")); + } + if (sku == null) { + return Mono.error(new IllegalArgumentException("Parameter sku is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getNestedResourceTypeFirst( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + resourceType, + nestedResourceTypeFirst, + sku, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the sku details for the given resource type and sku name. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param sku The SKU. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sku details for the given resource type and sku name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getNestedResourceTypeFirstWithResponseAsync( + String providerNamespace, String resourceType, String nestedResourceTypeFirst, String sku, 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 (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (nestedResourceTypeFirst == null) { + return Mono + .error( + new IllegalArgumentException("Parameter nestedResourceTypeFirst is required and cannot be null.")); + } + if (sku == null) { + return Mono.error(new IllegalArgumentException("Parameter sku is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getNestedResourceTypeFirst( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + resourceType, + nestedResourceTypeFirst, + sku, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the sku details for the given resource type and sku name. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param sku The SKU. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sku details for the given resource type and sku name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getNestedResourceTypeFirstAsync( + String providerNamespace, String resourceType, String nestedResourceTypeFirst, String sku) { + return getNestedResourceTypeFirstWithResponseAsync( + providerNamespace, resourceType, nestedResourceTypeFirst, sku) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the sku details for the given resource type and sku name. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param sku The SKU. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sku details for the given resource type and sku name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SkuResourceInner getNestedResourceTypeFirst( + String providerNamespace, String resourceType, String nestedResourceTypeFirst, String sku) { + return getNestedResourceTypeFirstAsync(providerNamespace, resourceType, nestedResourceTypeFirst, sku).block(); + } + + /** + * Gets the sku details for the given resource type and sku name. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param sku The SKU. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sku details for the given resource type and sku name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getNestedResourceTypeFirstWithResponse( + String providerNamespace, String resourceType, String nestedResourceTypeFirst, String sku, Context context) { + return getNestedResourceTypeFirstWithResponseAsync( + providerNamespace, resourceType, nestedResourceTypeFirst, sku, context) + .block(); + } + + /** + * Creates or updates the resource type skus in the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param sku The SKU. + * @param properties The required body parameters supplied to the resource sku operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateNestedResourceTypeFirstWithResponseAsync( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String sku, + ResourceTypeSku properties) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (nestedResourceTypeFirst == null) { + return Mono + .error( + new IllegalArgumentException("Parameter nestedResourceTypeFirst is required and cannot be null.")); + } + if (sku == null) { + return Mono.error(new IllegalArgumentException("Parameter sku is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdateNestedResourceTypeFirst( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + resourceType, + nestedResourceTypeFirst, + sku, + this.client.getApiVersion(), + properties, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates the resource type skus in the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param sku The SKU. + * @param properties The required body parameters supplied to the resource sku operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateNestedResourceTypeFirstWithResponseAsync( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String sku, + ResourceTypeSku properties, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (nestedResourceTypeFirst == null) { + return Mono + .error( + new IllegalArgumentException("Parameter nestedResourceTypeFirst is required and cannot be null.")); + } + if (sku == null) { + return Mono.error(new IllegalArgumentException("Parameter sku is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdateNestedResourceTypeFirst( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + resourceType, + nestedResourceTypeFirst, + sku, + this.client.getApiVersion(), + properties, + accept, + context); + } + + /** + * Creates or updates the resource type skus in the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param sku The SKU. + * @param properties The required body parameters supplied to the resource sku operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateNestedResourceTypeFirstAsync( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String sku, + ResourceTypeSku properties) { + return createOrUpdateNestedResourceTypeFirstWithResponseAsync( + providerNamespace, resourceType, nestedResourceTypeFirst, sku, properties) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates the resource type skus in the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param sku The SKU. + * @param properties The required body parameters supplied to the resource sku operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SkuResourceInner createOrUpdateNestedResourceTypeFirst( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String sku, + ResourceTypeSku properties) { + return createOrUpdateNestedResourceTypeFirstAsync( + providerNamespace, resourceType, nestedResourceTypeFirst, sku, properties) + .block(); + } + + /** + * Creates or updates the resource type skus in the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param sku The SKU. + * @param properties The required body parameters supplied to the resource sku operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateNestedResourceTypeFirstWithResponse( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String sku, + ResourceTypeSku properties, + Context context) { + return createOrUpdateNestedResourceTypeFirstWithResponseAsync( + providerNamespace, resourceType, nestedResourceTypeFirst, sku, properties, context) + .block(); + } + + /** + * Deletes a resource type sku. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param sku The SKU. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteNestedResourceTypeFirstWithResponseAsync( + String providerNamespace, String resourceType, String nestedResourceTypeFirst, String sku) { + 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 (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (nestedResourceTypeFirst == null) { + return Mono + .error( + new IllegalArgumentException("Parameter nestedResourceTypeFirst is required and cannot be null.")); + } + if (sku == null) { + return Mono.error(new IllegalArgumentException("Parameter sku is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deleteNestedResourceTypeFirst( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + resourceType, + nestedResourceTypeFirst, + sku, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a resource type sku. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param sku The SKU. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteNestedResourceTypeFirstWithResponseAsync( + String providerNamespace, String resourceType, String nestedResourceTypeFirst, String sku, 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 (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (nestedResourceTypeFirst == null) { + return Mono + .error( + new IllegalArgumentException("Parameter nestedResourceTypeFirst is required and cannot be null.")); + } + if (sku == null) { + return Mono.error(new IllegalArgumentException("Parameter sku is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .deleteNestedResourceTypeFirst( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + resourceType, + nestedResourceTypeFirst, + sku, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes a resource type sku. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param sku The SKU. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteNestedResourceTypeFirstAsync( + String providerNamespace, String resourceType, String nestedResourceTypeFirst, String sku) { + return deleteNestedResourceTypeFirstWithResponseAsync( + providerNamespace, resourceType, nestedResourceTypeFirst, sku) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes a resource type sku. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param sku The SKU. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 deleteNestedResourceTypeFirst( + String providerNamespace, String resourceType, String nestedResourceTypeFirst, String sku) { + deleteNestedResourceTypeFirstAsync(providerNamespace, resourceType, nestedResourceTypeFirst, sku).block(); + } + + /** + * Deletes a resource type sku. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param sku The SKU. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteNestedResourceTypeFirstWithResponse( + String providerNamespace, String resourceType, String nestedResourceTypeFirst, String sku, Context context) { + return deleteNestedResourceTypeFirstWithResponseAsync( + providerNamespace, resourceType, nestedResourceTypeFirst, sku, context) + .block(); + } + + /** + * Gets the sku details for the given resource type and sku name. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param sku The SKU. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sku details for the given resource type and sku name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getNestedResourceTypeSecondWithResponseAsync( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String sku) { + 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 (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (nestedResourceTypeFirst == null) { + return Mono + .error( + new IllegalArgumentException("Parameter nestedResourceTypeFirst is required and cannot be null.")); + } + if (nestedResourceTypeSecond == null) { + return Mono + .error( + new IllegalArgumentException("Parameter nestedResourceTypeSecond is required and cannot be null.")); + } + if (sku == null) { + return Mono.error(new IllegalArgumentException("Parameter sku is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getNestedResourceTypeSecond( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + resourceType, + nestedResourceTypeFirst, + nestedResourceTypeSecond, + sku, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the sku details for the given resource type and sku name. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param sku The SKU. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sku details for the given resource type and sku name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getNestedResourceTypeSecondWithResponseAsync( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String sku, + 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 (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (nestedResourceTypeFirst == null) { + return Mono + .error( + new IllegalArgumentException("Parameter nestedResourceTypeFirst is required and cannot be null.")); + } + if (nestedResourceTypeSecond == null) { + return Mono + .error( + new IllegalArgumentException("Parameter nestedResourceTypeSecond is required and cannot be null.")); + } + if (sku == null) { + return Mono.error(new IllegalArgumentException("Parameter sku is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getNestedResourceTypeSecond( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + resourceType, + nestedResourceTypeFirst, + nestedResourceTypeSecond, + sku, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the sku details for the given resource type and sku name. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param sku The SKU. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sku details for the given resource type and sku name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getNestedResourceTypeSecondAsync( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String sku) { + return getNestedResourceTypeSecondWithResponseAsync( + providerNamespace, resourceType, nestedResourceTypeFirst, nestedResourceTypeSecond, sku) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the sku details for the given resource type and sku name. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param sku The SKU. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sku details for the given resource type and sku name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SkuResourceInner getNestedResourceTypeSecond( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String sku) { + return getNestedResourceTypeSecondAsync( + providerNamespace, resourceType, nestedResourceTypeFirst, nestedResourceTypeSecond, sku) + .block(); + } + + /** + * Gets the sku details for the given resource type and sku name. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param sku The SKU. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sku details for the given resource type and sku name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getNestedResourceTypeSecondWithResponse( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String sku, + Context context) { + return getNestedResourceTypeSecondWithResponseAsync( + providerNamespace, resourceType, nestedResourceTypeFirst, nestedResourceTypeSecond, sku, context) + .block(); + } + + /** + * Creates or updates the resource type skus in the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param sku The SKU. + * @param properties The required body parameters supplied to the resource sku operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateNestedResourceTypeSecondWithResponseAsync( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String sku, + ResourceTypeSku properties) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (nestedResourceTypeFirst == null) { + return Mono + .error( + new IllegalArgumentException("Parameter nestedResourceTypeFirst is required and cannot be null.")); + } + if (nestedResourceTypeSecond == null) { + return Mono + .error( + new IllegalArgumentException("Parameter nestedResourceTypeSecond is required and cannot be null.")); + } + if (sku == null) { + return Mono.error(new IllegalArgumentException("Parameter sku is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdateNestedResourceTypeSecond( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + resourceType, + nestedResourceTypeFirst, + nestedResourceTypeSecond, + sku, + this.client.getApiVersion(), + properties, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates the resource type skus in the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param sku The SKU. + * @param properties The required body parameters supplied to the resource sku operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateNestedResourceTypeSecondWithResponseAsync( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String sku, + ResourceTypeSku properties, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (nestedResourceTypeFirst == null) { + return Mono + .error( + new IllegalArgumentException("Parameter nestedResourceTypeFirst is required and cannot be null.")); + } + if (nestedResourceTypeSecond == null) { + return Mono + .error( + new IllegalArgumentException("Parameter nestedResourceTypeSecond is required and cannot be null.")); + } + if (sku == null) { + return Mono.error(new IllegalArgumentException("Parameter sku is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdateNestedResourceTypeSecond( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + resourceType, + nestedResourceTypeFirst, + nestedResourceTypeSecond, + sku, + this.client.getApiVersion(), + properties, + accept, + context); + } + + /** + * Creates or updates the resource type skus in the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param sku The SKU. + * @param properties The required body parameters supplied to the resource sku operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateNestedResourceTypeSecondAsync( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String sku, + ResourceTypeSku properties) { + return createOrUpdateNestedResourceTypeSecondWithResponseAsync( + providerNamespace, resourceType, nestedResourceTypeFirst, nestedResourceTypeSecond, sku, properties) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates the resource type skus in the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param sku The SKU. + * @param properties The required body parameters supplied to the resource sku operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SkuResourceInner createOrUpdateNestedResourceTypeSecond( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String sku, + ResourceTypeSku properties) { + return createOrUpdateNestedResourceTypeSecondAsync( + providerNamespace, resourceType, nestedResourceTypeFirst, nestedResourceTypeSecond, sku, properties) + .block(); + } + + /** + * Creates or updates the resource type skus in the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param sku The SKU. + * @param properties The required body parameters supplied to the resource sku operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateNestedResourceTypeSecondWithResponse( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String sku, + ResourceTypeSku properties, + Context context) { + return createOrUpdateNestedResourceTypeSecondWithResponseAsync( + providerNamespace, + resourceType, + nestedResourceTypeFirst, + nestedResourceTypeSecond, + sku, + properties, + context) + .block(); + } + + /** + * Deletes a resource type sku. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param sku The SKU. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteNestedResourceTypeSecondWithResponseAsync( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String sku) { + 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 (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (nestedResourceTypeFirst == null) { + return Mono + .error( + new IllegalArgumentException("Parameter nestedResourceTypeFirst is required and cannot be null.")); + } + if (nestedResourceTypeSecond == null) { + return Mono + .error( + new IllegalArgumentException("Parameter nestedResourceTypeSecond is required and cannot be null.")); + } + if (sku == null) { + return Mono.error(new IllegalArgumentException("Parameter sku is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deleteNestedResourceTypeSecond( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + resourceType, + nestedResourceTypeFirst, + nestedResourceTypeSecond, + sku, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a resource type sku. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param sku The SKU. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteNestedResourceTypeSecondWithResponseAsync( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String sku, + 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 (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (nestedResourceTypeFirst == null) { + return Mono + .error( + new IllegalArgumentException("Parameter nestedResourceTypeFirst is required and cannot be null.")); + } + if (nestedResourceTypeSecond == null) { + return Mono + .error( + new IllegalArgumentException("Parameter nestedResourceTypeSecond is required and cannot be null.")); + } + if (sku == null) { + return Mono.error(new IllegalArgumentException("Parameter sku is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .deleteNestedResourceTypeSecond( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + resourceType, + nestedResourceTypeFirst, + nestedResourceTypeSecond, + sku, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes a resource type sku. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param sku The SKU. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteNestedResourceTypeSecondAsync( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String sku) { + return deleteNestedResourceTypeSecondWithResponseAsync( + providerNamespace, resourceType, nestedResourceTypeFirst, nestedResourceTypeSecond, sku) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes a resource type sku. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param sku The SKU. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 deleteNestedResourceTypeSecond( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String sku) { + deleteNestedResourceTypeSecondAsync( + providerNamespace, resourceType, nestedResourceTypeFirst, nestedResourceTypeSecond, sku) + .block(); + } + + /** + * Deletes a resource type sku. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param sku The SKU. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteNestedResourceTypeSecondWithResponse( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String sku, + Context context) { + return deleteNestedResourceTypeSecondWithResponseAsync( + providerNamespace, resourceType, nestedResourceTypeFirst, nestedResourceTypeSecond, sku, context) + .block(); + } + + /** + * Gets the sku details for the given resource type and sku name. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param nestedResourceTypeThird The third child resource type. + * @param sku The SKU. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sku details for the given resource type and sku name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getNestedResourceTypeThirdWithResponseAsync( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String nestedResourceTypeThird, + String sku) { + 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 (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (nestedResourceTypeFirst == null) { + return Mono + .error( + new IllegalArgumentException("Parameter nestedResourceTypeFirst is required and cannot be null.")); + } + if (nestedResourceTypeSecond == null) { + return Mono + .error( + new IllegalArgumentException("Parameter nestedResourceTypeSecond is required and cannot be null.")); + } + if (nestedResourceTypeThird == null) { + return Mono + .error( + new IllegalArgumentException("Parameter nestedResourceTypeThird is required and cannot be null.")); + } + if (sku == null) { + return Mono.error(new IllegalArgumentException("Parameter sku is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getNestedResourceTypeThird( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + resourceType, + nestedResourceTypeFirst, + nestedResourceTypeSecond, + nestedResourceTypeThird, + sku, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the sku details for the given resource type and sku name. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param nestedResourceTypeThird The third child resource type. + * @param sku The SKU. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sku details for the given resource type and sku name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getNestedResourceTypeThirdWithResponseAsync( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String nestedResourceTypeThird, + String sku, + 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 (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (nestedResourceTypeFirst == null) { + return Mono + .error( + new IllegalArgumentException("Parameter nestedResourceTypeFirst is required and cannot be null.")); + } + if (nestedResourceTypeSecond == null) { + return Mono + .error( + new IllegalArgumentException("Parameter nestedResourceTypeSecond is required and cannot be null.")); + } + if (nestedResourceTypeThird == null) { + return Mono + .error( + new IllegalArgumentException("Parameter nestedResourceTypeThird is required and cannot be null.")); + } + if (sku == null) { + return Mono.error(new IllegalArgumentException("Parameter sku is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getNestedResourceTypeThird( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + resourceType, + nestedResourceTypeFirst, + nestedResourceTypeSecond, + nestedResourceTypeThird, + sku, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the sku details for the given resource type and sku name. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param nestedResourceTypeThird The third child resource type. + * @param sku The SKU. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sku details for the given resource type and sku name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getNestedResourceTypeThirdAsync( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String nestedResourceTypeThird, + String sku) { + return getNestedResourceTypeThirdWithResponseAsync( + providerNamespace, + resourceType, + nestedResourceTypeFirst, + nestedResourceTypeSecond, + nestedResourceTypeThird, + sku) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the sku details for the given resource type and sku name. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param nestedResourceTypeThird The third child resource type. + * @param sku The SKU. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sku details for the given resource type and sku name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SkuResourceInner getNestedResourceTypeThird( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String nestedResourceTypeThird, + String sku) { + return getNestedResourceTypeThirdAsync( + providerNamespace, + resourceType, + nestedResourceTypeFirst, + nestedResourceTypeSecond, + nestedResourceTypeThird, + sku) + .block(); + } + + /** + * Gets the sku details for the given resource type and sku name. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param nestedResourceTypeThird The third child resource type. + * @param sku The SKU. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sku details for the given resource type and sku name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getNestedResourceTypeThirdWithResponse( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String nestedResourceTypeThird, + String sku, + Context context) { + return getNestedResourceTypeThirdWithResponseAsync( + providerNamespace, + resourceType, + nestedResourceTypeFirst, + nestedResourceTypeSecond, + nestedResourceTypeThird, + sku, + context) + .block(); + } + + /** + * Creates or updates the resource type skus in the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param nestedResourceTypeThird The third child resource type. + * @param sku The SKU. + * @param properties The required body parameters supplied to the resource sku operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateNestedResourceTypeThirdWithResponseAsync( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String nestedResourceTypeThird, + String sku, + ResourceTypeSku properties) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (nestedResourceTypeFirst == null) { + return Mono + .error( + new IllegalArgumentException("Parameter nestedResourceTypeFirst is required and cannot be null.")); + } + if (nestedResourceTypeSecond == null) { + return Mono + .error( + new IllegalArgumentException("Parameter nestedResourceTypeSecond is required and cannot be null.")); + } + if (nestedResourceTypeThird == null) { + return Mono + .error( + new IllegalArgumentException("Parameter nestedResourceTypeThird is required and cannot be null.")); + } + if (sku == null) { + return Mono.error(new IllegalArgumentException("Parameter sku is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdateNestedResourceTypeThird( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + resourceType, + nestedResourceTypeFirst, + nestedResourceTypeSecond, + nestedResourceTypeThird, + sku, + this.client.getApiVersion(), + properties, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates the resource type skus in the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param nestedResourceTypeThird The third child resource type. + * @param sku The SKU. + * @param properties The required body parameters supplied to the resource sku operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateNestedResourceTypeThirdWithResponseAsync( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String nestedResourceTypeThird, + String sku, + ResourceTypeSku properties, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (nestedResourceTypeFirst == null) { + return Mono + .error( + new IllegalArgumentException("Parameter nestedResourceTypeFirst is required and cannot be null.")); + } + if (nestedResourceTypeSecond == null) { + return Mono + .error( + new IllegalArgumentException("Parameter nestedResourceTypeSecond is required and cannot be null.")); + } + if (nestedResourceTypeThird == null) { + return Mono + .error( + new IllegalArgumentException("Parameter nestedResourceTypeThird is required and cannot be null.")); + } + if (sku == null) { + return Mono.error(new IllegalArgumentException("Parameter sku is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdateNestedResourceTypeThird( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + resourceType, + nestedResourceTypeFirst, + nestedResourceTypeSecond, + nestedResourceTypeThird, + sku, + this.client.getApiVersion(), + properties, + accept, + context); + } + + /** + * Creates or updates the resource type skus in the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param nestedResourceTypeThird The third child resource type. + * @param sku The SKU. + * @param properties The required body parameters supplied to the resource sku operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateNestedResourceTypeThirdAsync( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String nestedResourceTypeThird, + String sku, + ResourceTypeSku properties) { + return createOrUpdateNestedResourceTypeThirdWithResponseAsync( + providerNamespace, + resourceType, + nestedResourceTypeFirst, + nestedResourceTypeSecond, + nestedResourceTypeThird, + sku, + properties) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates the resource type skus in the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param nestedResourceTypeThird The third child resource type. + * @param sku The SKU. + * @param properties The required body parameters supplied to the resource sku operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SkuResourceInner createOrUpdateNestedResourceTypeThird( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String nestedResourceTypeThird, + String sku, + ResourceTypeSku properties) { + return createOrUpdateNestedResourceTypeThirdAsync( + providerNamespace, + resourceType, + nestedResourceTypeFirst, + nestedResourceTypeSecond, + nestedResourceTypeThird, + sku, + properties) + .block(); + } + + /** + * Creates or updates the resource type skus in the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param nestedResourceTypeThird The third child resource type. + * @param sku The SKU. + * @param properties The required body parameters supplied to the resource sku operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateNestedResourceTypeThirdWithResponse( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String nestedResourceTypeThird, + String sku, + ResourceTypeSku properties, + Context context) { + return createOrUpdateNestedResourceTypeThirdWithResponseAsync( + providerNamespace, + resourceType, + nestedResourceTypeFirst, + nestedResourceTypeSecond, + nestedResourceTypeThird, + sku, + properties, + context) + .block(); + } + + /** + * Deletes a resource type sku. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param nestedResourceTypeThird The third child resource type. + * @param sku The SKU. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteNestedResourceTypeThirdWithResponseAsync( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String nestedResourceTypeThird, + String sku) { + 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 (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (nestedResourceTypeFirst == null) { + return Mono + .error( + new IllegalArgumentException("Parameter nestedResourceTypeFirst is required and cannot be null.")); + } + if (nestedResourceTypeSecond == null) { + return Mono + .error( + new IllegalArgumentException("Parameter nestedResourceTypeSecond is required and cannot be null.")); + } + if (nestedResourceTypeThird == null) { + return Mono + .error( + new IllegalArgumentException("Parameter nestedResourceTypeThird is required and cannot be null.")); + } + if (sku == null) { + return Mono.error(new IllegalArgumentException("Parameter sku is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deleteNestedResourceTypeThird( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + resourceType, + nestedResourceTypeFirst, + nestedResourceTypeSecond, + nestedResourceTypeThird, + sku, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a resource type sku. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param nestedResourceTypeThird The third child resource type. + * @param sku The SKU. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteNestedResourceTypeThirdWithResponseAsync( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String nestedResourceTypeThird, + String sku, + 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 (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (nestedResourceTypeFirst == null) { + return Mono + .error( + new IllegalArgumentException("Parameter nestedResourceTypeFirst is required and cannot be null.")); + } + if (nestedResourceTypeSecond == null) { + return Mono + .error( + new IllegalArgumentException("Parameter nestedResourceTypeSecond is required and cannot be null.")); + } + if (nestedResourceTypeThird == null) { + return Mono + .error( + new IllegalArgumentException("Parameter nestedResourceTypeThird is required and cannot be null.")); + } + if (sku == null) { + return Mono.error(new IllegalArgumentException("Parameter sku is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .deleteNestedResourceTypeThird( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + resourceType, + nestedResourceTypeFirst, + nestedResourceTypeSecond, + nestedResourceTypeThird, + sku, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes a resource type sku. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param nestedResourceTypeThird The third child resource type. + * @param sku The SKU. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteNestedResourceTypeThirdAsync( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String nestedResourceTypeThird, + String sku) { + return deleteNestedResourceTypeThirdWithResponseAsync( + providerNamespace, + resourceType, + nestedResourceTypeFirst, + nestedResourceTypeSecond, + nestedResourceTypeThird, + sku) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes a resource type sku. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param nestedResourceTypeThird The third child resource type. + * @param sku The SKU. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 deleteNestedResourceTypeThird( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String nestedResourceTypeThird, + String sku) { + deleteNestedResourceTypeThirdAsync( + providerNamespace, + resourceType, + nestedResourceTypeFirst, + nestedResourceTypeSecond, + nestedResourceTypeThird, + sku) + .block(); + } + + /** + * Deletes a resource type sku. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param nestedResourceTypeThird The third child resource type. + * @param sku The SKU. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteNestedResourceTypeThirdWithResponse( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String nestedResourceTypeThird, + String sku, + Context context) { + return deleteNestedResourceTypeThirdWithResponseAsync( + providerNamespace, + resourceType, + nestedResourceTypeFirst, + nestedResourceTypeSecond, + nestedResourceTypeThird, + sku, + context) + .block(); + } + + /** + * Gets the list of skus for the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of skus for the given resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceTypeRegistrationsSinglePageAsync( + String providerNamespace, String resourceType) { + 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 (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceTypeRegistrations( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + resourceType, + 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())); + } + + /** + * Gets the list of skus for the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of skus for the given resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceTypeRegistrationsSinglePageAsync( + String providerNamespace, String resourceType, 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 (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceTypeRegistrations( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + resourceType, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the list of skus for the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of skus for the given resource type. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceTypeRegistrationsAsync( + String providerNamespace, String resourceType) { + return new PagedFlux<>( + () -> listByResourceTypeRegistrationsSinglePageAsync(providerNamespace, resourceType), + nextLink -> listByResourceTypeRegistrationsNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of skus for the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of skus for the given resource type. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceTypeRegistrationsAsync( + String providerNamespace, String resourceType, Context context) { + return new PagedFlux<>( + () -> listByResourceTypeRegistrationsSinglePageAsync(providerNamespace, resourceType, context), + nextLink -> listByResourceTypeRegistrationsNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the list of skus for the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of skus for the given resource type. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceTypeRegistrations( + String providerNamespace, String resourceType) { + return new PagedIterable<>(listByResourceTypeRegistrationsAsync(providerNamespace, resourceType)); + } + + /** + * Gets the list of skus for the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of skus for the given resource type. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceTypeRegistrations( + String providerNamespace, String resourceType, Context context) { + return new PagedIterable<>(listByResourceTypeRegistrationsAsync(providerNamespace, resourceType, context)); + } + + /** + * Gets the list of skus for the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of skus for the given resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceTypeRegistrationsNestedResourceTypeFirstSinglePageAsync( + String providerNamespace, String resourceType, String nestedResourceTypeFirst) { + 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 (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (nestedResourceTypeFirst == null) { + return Mono + .error( + new IllegalArgumentException("Parameter nestedResourceTypeFirst is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceTypeRegistrationsNestedResourceTypeFirst( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + resourceType, + nestedResourceTypeFirst, + 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())); + } + + /** + * Gets the list of skus for the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of skus for the given resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceTypeRegistrationsNestedResourceTypeFirstSinglePageAsync( + String providerNamespace, String resourceType, String nestedResourceTypeFirst, 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 (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (nestedResourceTypeFirst == null) { + return Mono + .error( + new IllegalArgumentException("Parameter nestedResourceTypeFirst is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceTypeRegistrationsNestedResourceTypeFirst( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + resourceType, + nestedResourceTypeFirst, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the list of skus for the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of skus for the given resource type. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceTypeRegistrationsNestedResourceTypeFirstAsync( + String providerNamespace, String resourceType, String nestedResourceTypeFirst) { + return new PagedFlux<>( + () -> + listByResourceTypeRegistrationsNestedResourceTypeFirstSinglePageAsync( + providerNamespace, resourceType, nestedResourceTypeFirst), + nextLink -> listByResourceTypeRegistrationsNestedResourceTypeFirstNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of skus for the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of skus for the given resource type. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceTypeRegistrationsNestedResourceTypeFirstAsync( + String providerNamespace, String resourceType, String nestedResourceTypeFirst, Context context) { + return new PagedFlux<>( + () -> + listByResourceTypeRegistrationsNestedResourceTypeFirstSinglePageAsync( + providerNamespace, resourceType, nestedResourceTypeFirst, context), + nextLink -> listByResourceTypeRegistrationsNestedResourceTypeFirstNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the list of skus for the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of skus for the given resource type. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceTypeRegistrationsNestedResourceTypeFirst( + String providerNamespace, String resourceType, String nestedResourceTypeFirst) { + return new PagedIterable<>( + listByResourceTypeRegistrationsNestedResourceTypeFirstAsync( + providerNamespace, resourceType, nestedResourceTypeFirst)); + } + + /** + * Gets the list of skus for the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of skus for the given resource type. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceTypeRegistrationsNestedResourceTypeFirst( + String providerNamespace, String resourceType, String nestedResourceTypeFirst, Context context) { + return new PagedIterable<>( + listByResourceTypeRegistrationsNestedResourceTypeFirstAsync( + providerNamespace, resourceType, nestedResourceTypeFirst, context)); + } + + /** + * Gets the list of skus for the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of skus for the given resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceTypeRegistrationsNestedResourceTypeSecondSinglePageAsync( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond) { + 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 (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (nestedResourceTypeFirst == null) { + return Mono + .error( + new IllegalArgumentException("Parameter nestedResourceTypeFirst is required and cannot be null.")); + } + if (nestedResourceTypeSecond == null) { + return Mono + .error( + new IllegalArgumentException("Parameter nestedResourceTypeSecond is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceTypeRegistrationsNestedResourceTypeSecond( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + resourceType, + nestedResourceTypeFirst, + nestedResourceTypeSecond, + 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())); + } + + /** + * Gets the list of skus for the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of skus for the given resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceTypeRegistrationsNestedResourceTypeSecondSinglePageAsync( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + 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 (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (nestedResourceTypeFirst == null) { + return Mono + .error( + new IllegalArgumentException("Parameter nestedResourceTypeFirst is required and cannot be null.")); + } + if (nestedResourceTypeSecond == null) { + return Mono + .error( + new IllegalArgumentException("Parameter nestedResourceTypeSecond is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceTypeRegistrationsNestedResourceTypeSecond( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + resourceType, + nestedResourceTypeFirst, + nestedResourceTypeSecond, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the list of skus for the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of skus for the given resource type. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceTypeRegistrationsNestedResourceTypeSecondAsync( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond) { + return new PagedFlux<>( + () -> + listByResourceTypeRegistrationsNestedResourceTypeSecondSinglePageAsync( + providerNamespace, resourceType, nestedResourceTypeFirst, nestedResourceTypeSecond), + nextLink -> listByResourceTypeRegistrationsNestedResourceTypeSecondNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of skus for the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of skus for the given resource type. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceTypeRegistrationsNestedResourceTypeSecondAsync( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + Context context) { + return new PagedFlux<>( + () -> + listByResourceTypeRegistrationsNestedResourceTypeSecondSinglePageAsync( + providerNamespace, resourceType, nestedResourceTypeFirst, nestedResourceTypeSecond, context), + nextLink -> listByResourceTypeRegistrationsNestedResourceTypeSecondNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the list of skus for the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of skus for the given resource type. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceTypeRegistrationsNestedResourceTypeSecond( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond) { + return new PagedIterable<>( + listByResourceTypeRegistrationsNestedResourceTypeSecondAsync( + providerNamespace, resourceType, nestedResourceTypeFirst, nestedResourceTypeSecond)); + } + + /** + * Gets the list of skus for the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of skus for the given resource type. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceTypeRegistrationsNestedResourceTypeSecond( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + Context context) { + return new PagedIterable<>( + listByResourceTypeRegistrationsNestedResourceTypeSecondAsync( + providerNamespace, resourceType, nestedResourceTypeFirst, nestedResourceTypeSecond, context)); + } + + /** + * Gets the list of skus for the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param nestedResourceTypeThird The third child resource type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of skus for the given resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceTypeRegistrationsNestedResourceTypeThirdSinglePageAsync( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String nestedResourceTypeThird) { + 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 (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (nestedResourceTypeFirst == null) { + return Mono + .error( + new IllegalArgumentException("Parameter nestedResourceTypeFirst is required and cannot be null.")); + } + if (nestedResourceTypeSecond == null) { + return Mono + .error( + new IllegalArgumentException("Parameter nestedResourceTypeSecond is required and cannot be null.")); + } + if (nestedResourceTypeThird == null) { + return Mono + .error( + new IllegalArgumentException("Parameter nestedResourceTypeThird is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceTypeRegistrationsNestedResourceTypeThird( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + resourceType, + nestedResourceTypeFirst, + nestedResourceTypeSecond, + nestedResourceTypeThird, + 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())); + } + + /** + * Gets the list of skus for the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param nestedResourceTypeThird The third child resource type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of skus for the given resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceTypeRegistrationsNestedResourceTypeThirdSinglePageAsync( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String nestedResourceTypeThird, + 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 (providerNamespace == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (nestedResourceTypeFirst == null) { + return Mono + .error( + new IllegalArgumentException("Parameter nestedResourceTypeFirst is required and cannot be null.")); + } + if (nestedResourceTypeSecond == null) { + return Mono + .error( + new IllegalArgumentException("Parameter nestedResourceTypeSecond is required and cannot be null.")); + } + if (nestedResourceTypeThird == null) { + return Mono + .error( + new IllegalArgumentException("Parameter nestedResourceTypeThird is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceTypeRegistrationsNestedResourceTypeThird( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + providerNamespace, + resourceType, + nestedResourceTypeFirst, + nestedResourceTypeSecond, + nestedResourceTypeThird, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the list of skus for the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param nestedResourceTypeThird The third child resource type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of skus for the given resource type. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceTypeRegistrationsNestedResourceTypeThirdAsync( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String nestedResourceTypeThird) { + return new PagedFlux<>( + () -> + listByResourceTypeRegistrationsNestedResourceTypeThirdSinglePageAsync( + providerNamespace, + resourceType, + nestedResourceTypeFirst, + nestedResourceTypeSecond, + nestedResourceTypeThird), + nextLink -> listByResourceTypeRegistrationsNestedResourceTypeThirdNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of skus for the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param nestedResourceTypeThird The third child resource type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of skus for the given resource type. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceTypeRegistrationsNestedResourceTypeThirdAsync( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String nestedResourceTypeThird, + Context context) { + return new PagedFlux<>( + () -> + listByResourceTypeRegistrationsNestedResourceTypeThirdSinglePageAsync( + providerNamespace, + resourceType, + nestedResourceTypeFirst, + nestedResourceTypeSecond, + nestedResourceTypeThird, + context), + nextLink -> listByResourceTypeRegistrationsNestedResourceTypeThirdNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the list of skus for the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param nestedResourceTypeThird The third child resource type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of skus for the given resource type. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceTypeRegistrationsNestedResourceTypeThird( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String nestedResourceTypeThird) { + return new PagedIterable<>( + listByResourceTypeRegistrationsNestedResourceTypeThirdAsync( + providerNamespace, + resourceType, + nestedResourceTypeFirst, + nestedResourceTypeSecond, + nestedResourceTypeThird)); + } + + /** + * Gets the list of skus for the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param nestedResourceTypeThird The third child resource type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of skus for the given resource type. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceTypeRegistrationsNestedResourceTypeThird( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String nestedResourceTypeThird, + Context context) { + return new PagedIterable<>( + listByResourceTypeRegistrationsNestedResourceTypeThirdAsync( + providerNamespace, + resourceType, + nestedResourceTypeFirst, + nestedResourceTypeSecond, + nestedResourceTypeThird, + context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceTypeRegistrationsNextSinglePageAsync(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.listByResourceTypeRegistrationsNext(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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceTypeRegistrationsNextSinglePageAsync( + 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 + .listByResourceTypeRegistrationsNext(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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceTypeRegistrationsNestedResourceTypeFirstNextSinglePageAsync(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 + .listByResourceTypeRegistrationsNestedResourceTypeFirstNext( + 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceTypeRegistrationsNestedResourceTypeFirstNextSinglePageAsync(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 + .listByResourceTypeRegistrationsNestedResourceTypeFirstNext( + 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceTypeRegistrationsNestedResourceTypeSecondNextSinglePageAsync(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 + .listByResourceTypeRegistrationsNestedResourceTypeSecondNext( + 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceTypeRegistrationsNestedResourceTypeSecondNextSinglePageAsync(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 + .listByResourceTypeRegistrationsNestedResourceTypeSecondNext( + 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceTypeRegistrationsNestedResourceTypeThirdNextSinglePageAsync(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 + .listByResourceTypeRegistrationsNestedResourceTypeThirdNext( + 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceTypeRegistrationsNestedResourceTypeThirdNextSinglePageAsync(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 + .listByResourceTypeRegistrationsNestedResourceTypeThirdNext( + 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/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/SkusImpl.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/SkusImpl.java new file mode 100644 index 0000000000000..0044ce459de9b --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/SkusImpl.java @@ -0,0 +1,654 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.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.providerhub.fluent.SkusClient; +import com.azure.resourcemanager.providerhub.fluent.models.SkuResourceInner; +import com.azure.resourcemanager.providerhub.models.ResourceTypeSku; +import com.azure.resourcemanager.providerhub.models.SkuResource; +import com.azure.resourcemanager.providerhub.models.Skus; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SkusImpl implements Skus { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SkusImpl.class); + + private final SkusClient innerClient; + + private final com.azure.resourcemanager.providerhub.ProviderHubManager serviceManager; + + public SkusImpl(SkusClient innerClient, com.azure.resourcemanager.providerhub.ProviderHubManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public SkuResource get(String providerNamespace, String resourceType, String sku) { + SkuResourceInner inner = this.serviceClient().get(providerNamespace, resourceType, sku); + if (inner != null) { + return new SkuResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String providerNamespace, String resourceType, String sku, Context context) { + Response inner = + this.serviceClient().getWithResponse(providerNamespace, resourceType, sku, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SkuResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String providerNamespace, String resourceType, String sku) { + this.serviceClient().delete(providerNamespace, resourceType, sku); + } + + public Response deleteWithResponse( + String providerNamespace, String resourceType, String sku, Context context) { + return this.serviceClient().deleteWithResponse(providerNamespace, resourceType, sku, context); + } + + public SkuResource getNestedResourceTypeFirst( + String providerNamespace, String resourceType, String nestedResourceTypeFirst, String sku) { + SkuResourceInner inner = + this + .serviceClient() + .getNestedResourceTypeFirst(providerNamespace, resourceType, nestedResourceTypeFirst, sku); + if (inner != null) { + return new SkuResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getNestedResourceTypeFirstWithResponse( + String providerNamespace, String resourceType, String nestedResourceTypeFirst, String sku, Context context) { + Response inner = + this + .serviceClient() + .getNestedResourceTypeFirstWithResponse( + providerNamespace, resourceType, nestedResourceTypeFirst, sku, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SkuResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SkuResource createOrUpdateNestedResourceTypeFirst( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String sku, + ResourceTypeSku properties) { + SkuResourceInner inner = + this + .serviceClient() + .createOrUpdateNestedResourceTypeFirst( + providerNamespace, resourceType, nestedResourceTypeFirst, sku, properties); + if (inner != null) { + return new SkuResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createOrUpdateNestedResourceTypeFirstWithResponse( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String sku, + ResourceTypeSku properties, + Context context) { + Response inner = + this + .serviceClient() + .createOrUpdateNestedResourceTypeFirstWithResponse( + providerNamespace, resourceType, nestedResourceTypeFirst, sku, properties, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SkuResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteNestedResourceTypeFirst( + String providerNamespace, String resourceType, String nestedResourceTypeFirst, String sku) { + this + .serviceClient() + .deleteNestedResourceTypeFirst(providerNamespace, resourceType, nestedResourceTypeFirst, sku); + } + + public Response deleteNestedResourceTypeFirstWithResponse( + String providerNamespace, String resourceType, String nestedResourceTypeFirst, String sku, Context context) { + return this + .serviceClient() + .deleteNestedResourceTypeFirstWithResponse( + providerNamespace, resourceType, nestedResourceTypeFirst, sku, context); + } + + public SkuResource getNestedResourceTypeSecond( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String sku) { + SkuResourceInner inner = + this + .serviceClient() + .getNestedResourceTypeSecond( + providerNamespace, resourceType, nestedResourceTypeFirst, nestedResourceTypeSecond, sku); + if (inner != null) { + return new SkuResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getNestedResourceTypeSecondWithResponse( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String sku, + Context context) { + Response inner = + this + .serviceClient() + .getNestedResourceTypeSecondWithResponse( + providerNamespace, resourceType, nestedResourceTypeFirst, nestedResourceTypeSecond, sku, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SkuResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SkuResource createOrUpdateNestedResourceTypeSecond( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String sku, + ResourceTypeSku properties) { + SkuResourceInner inner = + this + .serviceClient() + .createOrUpdateNestedResourceTypeSecond( + providerNamespace, + resourceType, + nestedResourceTypeFirst, + nestedResourceTypeSecond, + sku, + properties); + if (inner != null) { + return new SkuResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createOrUpdateNestedResourceTypeSecondWithResponse( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String sku, + ResourceTypeSku properties, + Context context) { + Response inner = + this + .serviceClient() + .createOrUpdateNestedResourceTypeSecondWithResponse( + providerNamespace, + resourceType, + nestedResourceTypeFirst, + nestedResourceTypeSecond, + sku, + properties, + context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SkuResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteNestedResourceTypeSecond( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String sku) { + this + .serviceClient() + .deleteNestedResourceTypeSecond( + providerNamespace, resourceType, nestedResourceTypeFirst, nestedResourceTypeSecond, sku); + } + + public Response deleteNestedResourceTypeSecondWithResponse( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String sku, + Context context) { + return this + .serviceClient() + .deleteNestedResourceTypeSecondWithResponse( + providerNamespace, resourceType, nestedResourceTypeFirst, nestedResourceTypeSecond, sku, context); + } + + public SkuResource getNestedResourceTypeThird( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String nestedResourceTypeThird, + String sku) { + SkuResourceInner inner = + this + .serviceClient() + .getNestedResourceTypeThird( + providerNamespace, + resourceType, + nestedResourceTypeFirst, + nestedResourceTypeSecond, + nestedResourceTypeThird, + sku); + if (inner != null) { + return new SkuResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getNestedResourceTypeThirdWithResponse( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String nestedResourceTypeThird, + String sku, + Context context) { + Response inner = + this + .serviceClient() + .getNestedResourceTypeThirdWithResponse( + providerNamespace, + resourceType, + nestedResourceTypeFirst, + nestedResourceTypeSecond, + nestedResourceTypeThird, + sku, + context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SkuResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SkuResource createOrUpdateNestedResourceTypeThird( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String nestedResourceTypeThird, + String sku, + ResourceTypeSku properties) { + SkuResourceInner inner = + this + .serviceClient() + .createOrUpdateNestedResourceTypeThird( + providerNamespace, + resourceType, + nestedResourceTypeFirst, + nestedResourceTypeSecond, + nestedResourceTypeThird, + sku, + properties); + if (inner != null) { + return new SkuResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createOrUpdateNestedResourceTypeThirdWithResponse( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String nestedResourceTypeThird, + String sku, + ResourceTypeSku properties, + Context context) { + Response inner = + this + .serviceClient() + .createOrUpdateNestedResourceTypeThirdWithResponse( + providerNamespace, + resourceType, + nestedResourceTypeFirst, + nestedResourceTypeSecond, + nestedResourceTypeThird, + sku, + properties, + context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SkuResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteNestedResourceTypeThird( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String nestedResourceTypeThird, + String sku) { + this + .serviceClient() + .deleteNestedResourceTypeThird( + providerNamespace, + resourceType, + nestedResourceTypeFirst, + nestedResourceTypeSecond, + nestedResourceTypeThird, + sku); + } + + public Response deleteNestedResourceTypeThirdWithResponse( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String nestedResourceTypeThird, + String sku, + Context context) { + return this + .serviceClient() + .deleteNestedResourceTypeThirdWithResponse( + providerNamespace, + resourceType, + nestedResourceTypeFirst, + nestedResourceTypeSecond, + nestedResourceTypeThird, + sku, + context); + } + + public PagedIterable listByResourceTypeRegistrations(String providerNamespace, String resourceType) { + PagedIterable inner = + this.serviceClient().listByResourceTypeRegistrations(providerNamespace, resourceType); + return Utils.mapPage(inner, inner1 -> new SkuResourceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceTypeRegistrations( + String providerNamespace, String resourceType, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceTypeRegistrations(providerNamespace, resourceType, context); + return Utils.mapPage(inner, inner1 -> new SkuResourceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceTypeRegistrationsNestedResourceTypeFirst( + String providerNamespace, String resourceType, String nestedResourceTypeFirst) { + PagedIterable inner = + this + .serviceClient() + .listByResourceTypeRegistrationsNestedResourceTypeFirst( + providerNamespace, resourceType, nestedResourceTypeFirst); + return Utils.mapPage(inner, inner1 -> new SkuResourceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceTypeRegistrationsNestedResourceTypeFirst( + String providerNamespace, String resourceType, String nestedResourceTypeFirst, Context context) { + PagedIterable inner = + this + .serviceClient() + .listByResourceTypeRegistrationsNestedResourceTypeFirst( + providerNamespace, resourceType, nestedResourceTypeFirst, context); + return Utils.mapPage(inner, inner1 -> new SkuResourceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceTypeRegistrationsNestedResourceTypeSecond( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond) { + PagedIterable inner = + this + .serviceClient() + .listByResourceTypeRegistrationsNestedResourceTypeSecond( + providerNamespace, resourceType, nestedResourceTypeFirst, nestedResourceTypeSecond); + return Utils.mapPage(inner, inner1 -> new SkuResourceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceTypeRegistrationsNestedResourceTypeSecond( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + Context context) { + PagedIterable inner = + this + .serviceClient() + .listByResourceTypeRegistrationsNestedResourceTypeSecond( + providerNamespace, resourceType, nestedResourceTypeFirst, nestedResourceTypeSecond, context); + return Utils.mapPage(inner, inner1 -> new SkuResourceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceTypeRegistrationsNestedResourceTypeThird( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String nestedResourceTypeThird) { + PagedIterable inner = + this + .serviceClient() + .listByResourceTypeRegistrationsNestedResourceTypeThird( + providerNamespace, + resourceType, + nestedResourceTypeFirst, + nestedResourceTypeSecond, + nestedResourceTypeThird); + return Utils.mapPage(inner, inner1 -> new SkuResourceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceTypeRegistrationsNestedResourceTypeThird( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String nestedResourceTypeThird, + Context context) { + PagedIterable inner = + this + .serviceClient() + .listByResourceTypeRegistrationsNestedResourceTypeThird( + providerNamespace, + resourceType, + nestedResourceTypeFirst, + nestedResourceTypeSecond, + nestedResourceTypeThird, + context); + return Utils.mapPage(inner, inner1 -> new SkuResourceImpl(inner1, this.manager())); + } + + public SkuResource getById(String id) { + String providerNamespace = Utils.getValueFromIdByName(id, "providerRegistrations"); + if (providerNamespace == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'providerRegistrations'.", + id))); + } + String resourceType = Utils.getValueFromIdByName(id, "resourcetypeRegistrations"); + if (resourceType == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'resourcetypeRegistrations'.", + id))); + } + String sku = Utils.getValueFromIdByName(id, "skus"); + if (sku == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'skus'.", id))); + } + return this.getWithResponse(providerNamespace, resourceType, sku, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String providerNamespace = Utils.getValueFromIdByName(id, "providerRegistrations"); + if (providerNamespace == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'providerRegistrations'.", + id))); + } + String resourceType = Utils.getValueFromIdByName(id, "resourcetypeRegistrations"); + if (resourceType == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'resourcetypeRegistrations'.", + id))); + } + String sku = Utils.getValueFromIdByName(id, "skus"); + if (sku == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'skus'.", id))); + } + return this.getWithResponse(providerNamespace, resourceType, sku, context); + } + + public void deleteById(String id) { + String providerNamespace = Utils.getValueFromIdByName(id, "providerRegistrations"); + if (providerNamespace == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'providerRegistrations'.", + id))); + } + String resourceType = Utils.getValueFromIdByName(id, "resourcetypeRegistrations"); + if (resourceType == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'resourcetypeRegistrations'.", + id))); + } + String sku = Utils.getValueFromIdByName(id, "skus"); + if (sku == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'skus'.", id))); + } + this.deleteWithResponse(providerNamespace, resourceType, sku, Context.NONE).getValue(); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String providerNamespace = Utils.getValueFromIdByName(id, "providerRegistrations"); + if (providerNamespace == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'providerRegistrations'.", + id))); + } + String resourceType = Utils.getValueFromIdByName(id, "resourcetypeRegistrations"); + if (resourceType == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'resourcetypeRegistrations'.", + id))); + } + String sku = Utils.getValueFromIdByName(id, "skus"); + if (sku == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'skus'.", id))); + } + return this.deleteWithResponse(providerNamespace, resourceType, sku, context); + } + + private SkusClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.providerhub.ProviderHubManager manager() { + return this.serviceManager; + } + + public SkuResourceImpl define(String name) { + return new SkuResourceImpl(name, this.manager()); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/Utils.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/Utils.java new file mode 100644 index 0000000000000..e8553c3ecf2b2 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/Utils.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.implementation; + +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.util.CoreUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import reactor.core.publisher.Flux; + +final class Utils { + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterator itr = Arrays.stream(id.split("/")).iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null) { + return null; + } + String parameterNameParentheses = "{" + parameterName + "}"; + List idSegmentsReverted = Arrays.asList(id.split("/")); + List pathSegments = Arrays.asList(pathTemplate.split("/")); + Collections.reverse(idSegmentsReverted); + Iterator idItrReverted = idSegmentsReverted.iterator(); + int pathIndex = pathSegments.size(); + while (idItrReverted.hasNext() && pathIndex > 0) { + String idSegment = idItrReverted.next(); + String pathSegment = pathSegments.get(--pathIndex); + if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { + if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { + if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { + List segments = new ArrayList<>(); + segments.add(idSegment); + idItrReverted.forEachRemaining(segments::add); + Collections.reverse(segments); + if (segments.size() > 0 && segments.get(0).isEmpty()) { + segments.remove(0); + } + return String.join("/", segments); + } else { + return idSegment; + } + } + } + } + return null; + } + + static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { + return new PagedIterableImpl(pageIterable, mapper); + } + + private static final class PagedIterableImpl extends PagedIterable { + + private final PagedIterable pagedIterable; + private final Function mapper; + private final Function, PagedResponse> pageMapper; + + private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { + super( + PagedFlux + .create( + () -> + (continuationToken, pageSize) -> + Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + this.pagedIterable = pagedIterable; + this.mapper = mapper; + this.pageMapper = getPageMapper(mapper); + } + + private static Function, PagedResponse> getPageMapper(Function mapper) { + return page -> + new PagedResponseBase( + page.getRequest(), + page.getStatusCode(), + page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), + page.getContinuationToken(), + null); + } + + @Override + public Stream stream() { + return pagedIterable.stream().map(mapper); + } + + @Override + public Stream> streamByPage() { + return pagedIterable.streamByPage().map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken) { + return pagedIterable.streamByPage(continuationToken).map(pageMapper); + } + + @Override + public Stream> streamByPage(int preferredPageSize) { + return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken, int preferredPageSize) { + return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + } + + @Override + public Iterator iterator() { + return new IteratorImpl(pagedIterable.iterator(), mapper); + } + + @Override + public Iterable> iterableByPage() { + return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + } + } + + private static final class IteratorImpl implements Iterator { + + private final Iterator iterator; + private final Function mapper; + + private IteratorImpl(Iterator iterator, Function mapper) { + this.iterator = iterator; + this.mapper = mapper; + } + + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public S next() { + return mapper.apply(iterator.next()); + } + + @Override + public void remove() { + iterator.remove(); + } + } + + private static final class IterableImpl implements Iterable { + + private final Iterable iterable; + private final Function mapper; + + private IterableImpl(Iterable iterable, Function mapper) { + this.iterable = iterable; + this.mapper = mapper; + } + + @Override + public Iterator iterator() { + return new IteratorImpl(iterable.iterator(), mapper); + } + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/package-info.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/package-info.java new file mode 100644 index 0000000000000..a8a4cbb8581b7 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/implementation/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the implementations for ProviderHub. Microsoft ProviderHub. */ +package com.azure.resourcemanager.providerhub.implementation; diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/AuthorizationActionMapping.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/AuthorizationActionMapping.java new file mode 100644 index 0000000000000..8c0a46716bb97 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/AuthorizationActionMapping.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.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The AuthorizationActionMapping model. */ +@Fluent +public final class AuthorizationActionMapping { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AuthorizationActionMapping.class); + + /* + * The original property. + */ + @JsonProperty(value = "original") + private String original; + + /* + * The desired property. + */ + @JsonProperty(value = "desired") + private String desired; + + /** + * Get the original property: The original property. + * + * @return the original value. + */ + public String original() { + return this.original; + } + + /** + * Set the original property: The original property. + * + * @param original the original value to set. + * @return the AuthorizationActionMapping object itself. + */ + public AuthorizationActionMapping withOriginal(String original) { + this.original = original; + return this; + } + + /** + * Get the desired property: The desired property. + * + * @return the desired value. + */ + public String desired() { + return this.desired; + } + + /** + * Set the desired property: The desired property. + * + * @param desired the desired value to set. + * @return the AuthorizationActionMapping object itself. + */ + public AuthorizationActionMapping withDesired(String desired) { + this.desired = desired; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/CanaryTrafficRegionRolloutConfiguration.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/CanaryTrafficRegionRolloutConfiguration.java new file mode 100644 index 0000000000000..2747da47b6030 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/CanaryTrafficRegionRolloutConfiguration.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The CanaryTrafficRegionRolloutConfiguration model. */ +@Fluent +public class CanaryTrafficRegionRolloutConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CanaryTrafficRegionRolloutConfiguration.class); + + /* + * The skipRegions property. + */ + @JsonProperty(value = "skipRegions") + private List skipRegions; + + /* + * The regions property. + */ + @JsonProperty(value = "regions") + private List regions; + + /** + * Get the skipRegions property: The skipRegions property. + * + * @return the skipRegions value. + */ + public List skipRegions() { + return this.skipRegions; + } + + /** + * Set the skipRegions property: The skipRegions property. + * + * @param skipRegions the skipRegions value to set. + * @return the CanaryTrafficRegionRolloutConfiguration object itself. + */ + public CanaryTrafficRegionRolloutConfiguration withSkipRegions(List skipRegions) { + this.skipRegions = skipRegions; + return this; + } + + /** + * Get the regions property: The regions property. + * + * @return the regions value. + */ + public List regions() { + return this.regions; + } + + /** + * Set the regions property: The regions property. + * + * @param regions the regions value to set. + * @return the CanaryTrafficRegionRolloutConfiguration object itself. + */ + public CanaryTrafficRegionRolloutConfiguration withRegions(List regions) { + this.regions = regions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/CheckNameAvailabilitySpecifications.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/CheckNameAvailabilitySpecifications.java new file mode 100644 index 0000000000000..cc3b09ae1b8b0 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/CheckNameAvailabilitySpecifications.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The CheckNameAvailabilitySpecifications model. */ +@Fluent +public class CheckNameAvailabilitySpecifications { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CheckNameAvailabilitySpecifications.class); + + /* + * The enableDefaultValidation property. + */ + @JsonProperty(value = "enableDefaultValidation") + private Boolean enableDefaultValidation; + + /* + * The resourceTypesWithCustomValidation property. + */ + @JsonProperty(value = "resourceTypesWithCustomValidation") + private List resourceTypesWithCustomValidation; + + /** + * Get the enableDefaultValidation property: The enableDefaultValidation property. + * + * @return the enableDefaultValidation value. + */ + public Boolean enableDefaultValidation() { + return this.enableDefaultValidation; + } + + /** + * Set the enableDefaultValidation property: The enableDefaultValidation property. + * + * @param enableDefaultValidation the enableDefaultValidation value to set. + * @return the CheckNameAvailabilitySpecifications object itself. + */ + public CheckNameAvailabilitySpecifications withEnableDefaultValidation(Boolean enableDefaultValidation) { + this.enableDefaultValidation = enableDefaultValidation; + return this; + } + + /** + * Get the resourceTypesWithCustomValidation property: The resourceTypesWithCustomValidation property. + * + * @return the resourceTypesWithCustomValidation value. + */ + public List resourceTypesWithCustomValidation() { + return this.resourceTypesWithCustomValidation; + } + + /** + * Set the resourceTypesWithCustomValidation property: The resourceTypesWithCustomValidation property. + * + * @param resourceTypesWithCustomValidation the resourceTypesWithCustomValidation value to set. + * @return the CheckNameAvailabilitySpecifications object itself. + */ + public CheckNameAvailabilitySpecifications withResourceTypesWithCustomValidation( + List resourceTypesWithCustomValidation) { + this.resourceTypesWithCustomValidation = resourceTypesWithCustomValidation; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/CheckinManifestInfo.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/CheckinManifestInfo.java new file mode 100644 index 0000000000000..6044076fcac99 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/CheckinManifestInfo.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.providerhub.models; + +import com.azure.resourcemanager.providerhub.fluent.models.CheckinManifestInfoInner; + +/** An immutable client-side representation of CheckinManifestInfo. */ +public interface CheckinManifestInfo { + /** + * Gets the isCheckedIn property: The isCheckedIn property. + * + * @return the isCheckedIn value. + */ + boolean isCheckedIn(); + + /** + * Gets the statusMessage property: The statusMessage property. + * + * @return the statusMessage value. + */ + String statusMessage(); + + /** + * Gets the pullRequest property: The pullRequest property. + * + * @return the pullRequest value. + */ + String pullRequest(); + + /** + * Gets the commitId property: The commitId property. + * + * @return the commitId value. + */ + String commitId(); + + /** + * Gets the inner com.azure.resourcemanager.providerhub.fluent.models.CheckinManifestInfoInner object. + * + * @return the inner object. + */ + CheckinManifestInfoInner innerModel(); +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/CheckinManifestParams.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/CheckinManifestParams.java new file mode 100644 index 0000000000000..72f00a2105c33 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/CheckinManifestParams.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The CheckinManifestParams model. */ +@Fluent +public final class CheckinManifestParams { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CheckinManifestParams.class); + + /* + * The environment supplied to the checkin manifest operation. + */ + @JsonProperty(value = "environment", required = true) + private String environment; + + /* + * The baseline ARM manifest location supplied to the checkin manifest + * operation. + */ + @JsonProperty(value = "baselineArmManifestLocation", required = true) + private String baselineArmManifestLocation; + + /** + * Get the environment property: The environment supplied to the checkin manifest operation. + * + * @return the environment value. + */ + public String environment() { + return this.environment; + } + + /** + * Set the environment property: The environment supplied to the checkin manifest operation. + * + * @param environment the environment value to set. + * @return the CheckinManifestParams object itself. + */ + public CheckinManifestParams withEnvironment(String environment) { + this.environment = environment; + return this; + } + + /** + * Get the baselineArmManifestLocation property: The baseline ARM manifest location supplied to the checkin manifest + * operation. + * + * @return the baselineArmManifestLocation value. + */ + public String baselineArmManifestLocation() { + return this.baselineArmManifestLocation; + } + + /** + * Set the baselineArmManifestLocation property: The baseline ARM manifest location supplied to the checkin manifest + * operation. + * + * @param baselineArmManifestLocation the baselineArmManifestLocation value to set. + * @return the CheckinManifestParams object itself. + */ + public CheckinManifestParams withBaselineArmManifestLocation(String baselineArmManifestLocation) { + this.baselineArmManifestLocation = baselineArmManifestLocation; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (environment() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property environment in model CheckinManifestParams")); + } + if (baselineArmManifestLocation() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property baselineArmManifestLocation in model CheckinManifestParams")); + } + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/CustomRollout.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/CustomRollout.java new file mode 100644 index 0000000000000..e18978ffc465c --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/CustomRollout.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.providerhub.fluent.models.CustomRolloutInner; + +/** An immutable client-side representation of CustomRollout. */ +public interface CustomRollout { + /** + * 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 properties property: Properties of the rollout. + * + * @return the properties value. + */ + CustomRolloutProperties properties(); + + /** + * Gets the inner com.azure.resourcemanager.providerhub.fluent.models.CustomRolloutInner object. + * + * @return the inner object. + */ + CustomRolloutInner innerModel(); + + /** The entirety of the CustomRollout definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithParentResource, + DefinitionStages.WithProperties, + DefinitionStages.WithCreate { + } + /** The CustomRollout definition stages. */ + interface DefinitionStages { + /** The first stage of the CustomRollout definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the CustomRollout definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies providerNamespace. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @return the next definition stage. + */ + WithProperties withExistingProviderRegistration(String providerNamespace); + } + /** The stage of the CustomRollout definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Properties of the rollout.. + * + * @param properties Properties of the rollout. + * @return the next definition stage. + */ + WithCreate withProperties(CustomRolloutProperties properties); + } + /** + * The stage of the CustomRollout 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 { + /** + * Executes the create request. + * + * @return the created resource. + */ + CustomRollout create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + CustomRollout create(Context context); + } + } + /** + * Begins update for the CustomRollout resource. + * + * @return the stage of resource update. + */ + CustomRollout.Update update(); + + /** The template for CustomRollout update. */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + CustomRollout apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + CustomRollout apply(Context context); + } + /** The CustomRollout update stages. */ + interface UpdateStages { + /** The stage of the CustomRollout update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Properties of the rollout.. + * + * @param properties Properties of the rollout. + * @return the next definition stage. + */ + Update withProperties(CustomRolloutProperties properties); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + CustomRollout refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + CustomRollout refresh(Context context); +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/CustomRolloutArrayResponseWithContinuation.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/CustomRolloutArrayResponseWithContinuation.java new file mode 100644 index 0000000000000..559feb4c74281 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/CustomRolloutArrayResponseWithContinuation.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.providerhub.fluent.models.CustomRolloutInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The CustomRolloutArrayResponseWithContinuation model. */ +@Fluent +public final class CustomRolloutArrayResponseWithContinuation { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomRolloutArrayResponseWithContinuation.class); + + /* + * The value property. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get to the next set of results, if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the CustomRolloutArrayResponseWithContinuation object itself. + */ + public CustomRolloutArrayResponseWithContinuation withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get to the next set of results, if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get to the next set of results, if there are any. + * + * @param nextLink the nextLink value to set. + * @return the CustomRolloutArrayResponseWithContinuation object itself. + */ + public CustomRolloutArrayResponseWithContinuation withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/CustomRolloutProperties.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/CustomRolloutProperties.java new file mode 100644 index 0000000000000..73b17542e3e66 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/CustomRolloutProperties.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** Properties of the rollout. */ +@Immutable +public final class CustomRolloutProperties extends CustomRolloutPropertiesAutoGenerated { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomRolloutProperties.class); + + /** {@inheritDoc} */ + @Override + public CustomRolloutProperties withProvisioningState(ProvisioningState provisioningState) { + super.withProvisioningState(provisioningState); + return this; + } + + /** {@inheritDoc} */ + @Override + public CustomRolloutProperties withSpecification(CustomRolloutPropertiesSpecification specification) { + super.withSpecification(specification); + return this; + } + + /** {@inheritDoc} */ + @Override + public CustomRolloutProperties withStatus(CustomRolloutPropertiesStatus status) { + super.withStatus(status); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/CustomRolloutPropertiesAutoGenerated.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/CustomRolloutPropertiesAutoGenerated.java new file mode 100644 index 0000000000000..31f250f768e1b --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/CustomRolloutPropertiesAutoGenerated.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The CustomRolloutPropertiesAutoGenerated model. */ +@Fluent +public class CustomRolloutPropertiesAutoGenerated { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomRolloutPropertiesAutoGenerated.class); + + /* + * The provisioningState property. + */ + @JsonProperty(value = "provisioningState") + private ProvisioningState provisioningState; + + /* + * The specification property. + */ + @JsonProperty(value = "specification", required = true) + private CustomRolloutPropertiesSpecification specification; + + /* + * The status property. + */ + @JsonProperty(value = "status") + private CustomRolloutPropertiesStatus status; + + /** + * Get the provisioningState property: The provisioningState property. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: The provisioningState property. + * + * @param provisioningState the provisioningState value to set. + * @return the CustomRolloutPropertiesAutoGenerated object itself. + */ + public CustomRolloutPropertiesAutoGenerated withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the specification property: The specification property. + * + * @return the specification value. + */ + public CustomRolloutPropertiesSpecification specification() { + return this.specification; + } + + /** + * Set the specification property: The specification property. + * + * @param specification the specification value to set. + * @return the CustomRolloutPropertiesAutoGenerated object itself. + */ + public CustomRolloutPropertiesAutoGenerated withSpecification(CustomRolloutPropertiesSpecification specification) { + this.specification = specification; + return this; + } + + /** + * Get the status property: The status property. + * + * @return the status value. + */ + public CustomRolloutPropertiesStatus status() { + return this.status; + } + + /** + * Set the status property: The status property. + * + * @param status the status value to set. + * @return the CustomRolloutPropertiesAutoGenerated object itself. + */ + public CustomRolloutPropertiesAutoGenerated withStatus(CustomRolloutPropertiesStatus status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (specification() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property specification in model CustomRolloutPropertiesAutoGenerated")); + } else { + specification().validate(); + } + if (status() != null) { + status().validate(); + } + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/CustomRolloutPropertiesSpecification.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/CustomRolloutPropertiesSpecification.java new file mode 100644 index 0000000000000..65778173a5a9c --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/CustomRolloutPropertiesSpecification.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.providerhub.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.providerhub.fluent.models.ResourceTypeRegistrationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.List; + +/** The CustomRolloutPropertiesSpecification model. */ +@Immutable +public final class CustomRolloutPropertiesSpecification extends CustomRolloutSpecification { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomRolloutPropertiesSpecification.class); + + /** {@inheritDoc} */ + @Override + public CustomRolloutPropertiesSpecification withCanary(CustomRolloutSpecificationCanary canary) { + super.withCanary(canary); + return this; + } + + /** {@inheritDoc} */ + @Override + public CustomRolloutPropertiesSpecification withProviderRegistration( + CustomRolloutSpecificationProviderRegistration providerRegistration) { + super.withProviderRegistration(providerRegistration); + return this; + } + + /** {@inheritDoc} */ + @Override + public CustomRolloutPropertiesSpecification withResourceTypeRegistrations( + List resourceTypeRegistrations) { + super.withResourceTypeRegistrations(resourceTypeRegistrations); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/CustomRolloutPropertiesStatus.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/CustomRolloutPropertiesStatus.java new file mode 100644 index 0000000000000..ef02a728a9386 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/CustomRolloutPropertiesStatus.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.List; +import java.util.Map; + +/** The CustomRolloutPropertiesStatus model. */ +@Immutable +public final class CustomRolloutPropertiesStatus extends CustomRolloutStatus { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomRolloutPropertiesStatus.class); + + /** {@inheritDoc} */ + @Override + public CustomRolloutPropertiesStatus withCompletedRegions(List completedRegions) { + super.withCompletedRegions(completedRegions); + return this; + } + + /** {@inheritDoc} */ + @Override + public CustomRolloutPropertiesStatus withFailedOrSkippedRegions( + Map failedOrSkippedRegions) { + super.withFailedOrSkippedRegions(failedOrSkippedRegions); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/CustomRolloutSpecification.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/CustomRolloutSpecification.java new file mode 100644 index 0000000000000..7aff773212ac1 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/CustomRolloutSpecification.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.providerhub.fluent.models.ResourceTypeRegistrationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The CustomRolloutSpecification model. */ +@Fluent +public class CustomRolloutSpecification { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomRolloutSpecification.class); + + /* + * The canary property. + */ + @JsonProperty(value = "canary", required = true) + private CustomRolloutSpecificationCanary canary; + + /* + * The providerRegistration property. + */ + @JsonProperty(value = "providerRegistration") + private CustomRolloutSpecificationProviderRegistration providerRegistration; + + /* + * The resourceTypeRegistrations property. + */ + @JsonProperty(value = "resourceTypeRegistrations") + private List resourceTypeRegistrations; + + /** + * Get the canary property: The canary property. + * + * @return the canary value. + */ + public CustomRolloutSpecificationCanary canary() { + return this.canary; + } + + /** + * Set the canary property: The canary property. + * + * @param canary the canary value to set. + * @return the CustomRolloutSpecification object itself. + */ + public CustomRolloutSpecification withCanary(CustomRolloutSpecificationCanary canary) { + this.canary = canary; + return this; + } + + /** + * Get the providerRegistration property: The providerRegistration property. + * + * @return the providerRegistration value. + */ + public CustomRolloutSpecificationProviderRegistration providerRegistration() { + return this.providerRegistration; + } + + /** + * Set the providerRegistration property: The providerRegistration property. + * + * @param providerRegistration the providerRegistration value to set. + * @return the CustomRolloutSpecification object itself. + */ + public CustomRolloutSpecification withProviderRegistration( + CustomRolloutSpecificationProviderRegistration providerRegistration) { + this.providerRegistration = providerRegistration; + return this; + } + + /** + * Get the resourceTypeRegistrations property: The resourceTypeRegistrations property. + * + * @return the resourceTypeRegistrations value. + */ + public List resourceTypeRegistrations() { + return this.resourceTypeRegistrations; + } + + /** + * Set the resourceTypeRegistrations property: The resourceTypeRegistrations property. + * + * @param resourceTypeRegistrations the resourceTypeRegistrations value to set. + * @return the CustomRolloutSpecification object itself. + */ + public CustomRolloutSpecification withResourceTypeRegistrations( + List resourceTypeRegistrations) { + this.resourceTypeRegistrations = resourceTypeRegistrations; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (canary() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property canary in model CustomRolloutSpecification")); + } else { + canary().validate(); + } + if (providerRegistration() != null) { + providerRegistration().validate(); + } + if (resourceTypeRegistrations() != null) { + resourceTypeRegistrations().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/CustomRolloutSpecificationCanary.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/CustomRolloutSpecificationCanary.java new file mode 100644 index 0000000000000..e6d23915a3f7d --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/CustomRolloutSpecificationCanary.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.List; + +/** The CustomRolloutSpecificationCanary model. */ +@Immutable +public final class CustomRolloutSpecificationCanary extends TrafficRegions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomRolloutSpecificationCanary.class); + + /** {@inheritDoc} */ + @Override + public CustomRolloutSpecificationCanary withRegions(List regions) { + super.withRegions(regions); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/CustomRolloutSpecificationProviderRegistration.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/CustomRolloutSpecificationProviderRegistration.java new file mode 100644 index 0000000000000..feb87a4ae0daf --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/CustomRolloutSpecificationProviderRegistration.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.providerhub.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.providerhub.fluent.models.ProviderRegistrationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** The CustomRolloutSpecificationProviderRegistration model. */ +@Immutable +public final class CustomRolloutSpecificationProviderRegistration extends ProviderRegistrationInner { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(CustomRolloutSpecificationProviderRegistration.class); + + /** {@inheritDoc} */ + @Override + public CustomRolloutSpecificationProviderRegistration withProperties(ProviderRegistrationProperties properties) { + super.withProperties(properties); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/CustomRolloutStatus.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/CustomRolloutStatus.java new file mode 100644 index 0000000000000..81effe245e48c --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/CustomRolloutStatus.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** The CustomRolloutStatus model. */ +@Fluent +public class CustomRolloutStatus { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomRolloutStatus.class); + + /* + * The completedRegions property. + */ + @JsonProperty(value = "completedRegions") + private List completedRegions; + + /* + * Dictionary of + */ + @JsonProperty(value = "failedOrSkippedRegions") + private Map failedOrSkippedRegions; + + /** + * Get the completedRegions property: The completedRegions property. + * + * @return the completedRegions value. + */ + public List completedRegions() { + return this.completedRegions; + } + + /** + * Set the completedRegions property: The completedRegions property. + * + * @param completedRegions the completedRegions value to set. + * @return the CustomRolloutStatus object itself. + */ + public CustomRolloutStatus withCompletedRegions(List completedRegions) { + this.completedRegions = completedRegions; + return this; + } + + /** + * Get the failedOrSkippedRegions property: Dictionary of <ExtendedErrorInfo>. + * + * @return the failedOrSkippedRegions value. + */ + public Map failedOrSkippedRegions() { + return this.failedOrSkippedRegions; + } + + /** + * Set the failedOrSkippedRegions property: Dictionary of <ExtendedErrorInfo>. + * + * @param failedOrSkippedRegions the failedOrSkippedRegions value to set. + * @return the CustomRolloutStatus object itself. + */ + public CustomRolloutStatus withFailedOrSkippedRegions(Map failedOrSkippedRegions) { + this.failedOrSkippedRegions = failedOrSkippedRegions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (failedOrSkippedRegions() != null) { + failedOrSkippedRegions() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/CustomRollouts.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/CustomRollouts.java new file mode 100644 index 0000000000000..170fff0e6b131 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/CustomRollouts.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.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 CustomRollouts. */ +public interface CustomRollouts { + /** + * Gets the custom rollout details. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param rolloutName The rollout name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom rollout details. + */ + CustomRollout get(String providerNamespace, String rolloutName); + + /** + * Gets the custom rollout details. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param rolloutName The rollout name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom rollout details. + */ + Response getWithResponse(String providerNamespace, String rolloutName, Context context); + + /** + * Gets the list of the custom rollouts for the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the custom rollouts for the given provider. + */ + PagedIterable listByProviderRegistration(String providerNamespace); + + /** + * Gets the list of the custom rollouts for the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the custom rollouts for the given provider. + */ + PagedIterable listByProviderRegistration(String providerNamespace, Context context); + + /** + * Gets the custom rollout details. + * + * @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 custom rollout details. + */ + CustomRollout getById(String id); + + /** + * Gets the custom rollout details. + * + * @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 custom rollout details. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new CustomRollout resource. + * + * @param name resource name. + * @return the first stage of the new CustomRollout definition. + */ + CustomRollout.DefinitionStages.Blank define(String name); +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/DefaultRollout.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/DefaultRollout.java new file mode 100644 index 0000000000000..feb344bbd467c --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/DefaultRollout.java @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.providerhub.fluent.models.DefaultRolloutInner; + +/** An immutable client-side representation of DefaultRollout. */ +public interface DefaultRollout { + /** + * 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 properties property: Properties of the rollout. + * + * @return the properties value. + */ + DefaultRolloutProperties properties(); + + /** + * Gets the inner com.azure.resourcemanager.providerhub.fluent.models.DefaultRolloutInner object. + * + * @return the inner object. + */ + DefaultRolloutInner innerModel(); + + /** The entirety of the DefaultRollout definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The DefaultRollout definition stages. */ + interface DefinitionStages { + /** The first stage of the DefaultRollout definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the DefaultRollout definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies providerNamespace. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @return the next definition stage. + */ + WithCreate withExistingProviderRegistration(String providerNamespace); + } + /** + * The stage of the DefaultRollout 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + DefaultRollout create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + DefaultRollout create(Context context); + } + /** The stage of the DefaultRollout definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Properties of the rollout.. + * + * @param properties Properties of the rollout. + * @return the next definition stage. + */ + WithCreate withProperties(DefaultRolloutProperties properties); + } + } + /** + * Begins update for the DefaultRollout resource. + * + * @return the stage of resource update. + */ + DefaultRollout.Update update(); + + /** The template for DefaultRollout update. */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + DefaultRollout apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + DefaultRollout apply(Context context); + } + /** The DefaultRollout update stages. */ + interface UpdateStages { + /** The stage of the DefaultRollout update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Properties of the rollout.. + * + * @param properties Properties of the rollout. + * @return the next definition stage. + */ + Update withProperties(DefaultRolloutProperties properties); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + DefaultRollout refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + DefaultRollout refresh(Context context); + + /** + * Stops or cancels the rollout, if in progress. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stop(); + + /** + * Stops or cancels the rollout, if in progress. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + Response stopWithResponse(Context context); +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/DefaultRolloutArrayResponseWithContinuation.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/DefaultRolloutArrayResponseWithContinuation.java new file mode 100644 index 0000000000000..cdbe4e2573740 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/DefaultRolloutArrayResponseWithContinuation.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.providerhub.fluent.models.DefaultRolloutInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The DefaultRolloutArrayResponseWithContinuation model. */ +@Fluent +public final class DefaultRolloutArrayResponseWithContinuation { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DefaultRolloutArrayResponseWithContinuation.class); + + /* + * The value property. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get to the next set of results, if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the DefaultRolloutArrayResponseWithContinuation object itself. + */ + public DefaultRolloutArrayResponseWithContinuation withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get to the next set of results, if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get to the next set of results, if there are any. + * + * @param nextLink the nextLink value to set. + * @return the DefaultRolloutArrayResponseWithContinuation object itself. + */ + public DefaultRolloutArrayResponseWithContinuation withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/DefaultRolloutProperties.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/DefaultRolloutProperties.java new file mode 100644 index 0000000000000..ce2afa942e0db --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/DefaultRolloutProperties.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** Properties of the rollout. */ +@Immutable +public final class DefaultRolloutProperties extends DefaultRolloutPropertiesAutoGenerated { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DefaultRolloutProperties.class); + + /** {@inheritDoc} */ + @Override + public DefaultRolloutProperties withProvisioningState(ProvisioningState provisioningState) { + super.withProvisioningState(provisioningState); + return this; + } + + /** {@inheritDoc} */ + @Override + public DefaultRolloutProperties withSpecification(DefaultRolloutPropertiesSpecification specification) { + super.withSpecification(specification); + return this; + } + + /** {@inheritDoc} */ + @Override + public DefaultRolloutProperties withStatus(DefaultRolloutPropertiesStatus status) { + super.withStatus(status); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/DefaultRolloutPropertiesAutoGenerated.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/DefaultRolloutPropertiesAutoGenerated.java new file mode 100644 index 0000000000000..e58123e63b247 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/DefaultRolloutPropertiesAutoGenerated.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The DefaultRolloutPropertiesAutoGenerated model. */ +@Fluent +public class DefaultRolloutPropertiesAutoGenerated { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DefaultRolloutPropertiesAutoGenerated.class); + + /* + * The provisioningState property. + */ + @JsonProperty(value = "provisioningState") + private ProvisioningState provisioningState; + + /* + * The specification property. + */ + @JsonProperty(value = "specification") + private DefaultRolloutPropertiesSpecification specification; + + /* + * The status property. + */ + @JsonProperty(value = "status") + private DefaultRolloutPropertiesStatus status; + + /** + * Get the provisioningState property: The provisioningState property. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: The provisioningState property. + * + * @param provisioningState the provisioningState value to set. + * @return the DefaultRolloutPropertiesAutoGenerated object itself. + */ + public DefaultRolloutPropertiesAutoGenerated withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the specification property: The specification property. + * + * @return the specification value. + */ + public DefaultRolloutPropertiesSpecification specification() { + return this.specification; + } + + /** + * Set the specification property: The specification property. + * + * @param specification the specification value to set. + * @return the DefaultRolloutPropertiesAutoGenerated object itself. + */ + public DefaultRolloutPropertiesAutoGenerated withSpecification( + DefaultRolloutPropertiesSpecification specification) { + this.specification = specification; + return this; + } + + /** + * Get the status property: The status property. + * + * @return the status value. + */ + public DefaultRolloutPropertiesStatus status() { + return this.status; + } + + /** + * Set the status property: The status property. + * + * @param status the status value to set. + * @return the DefaultRolloutPropertiesAutoGenerated object itself. + */ + public DefaultRolloutPropertiesAutoGenerated withStatus(DefaultRolloutPropertiesStatus status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (specification() != null) { + specification().validate(); + } + if (status() != null) { + status().validate(); + } + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/DefaultRolloutPropertiesSpecification.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/DefaultRolloutPropertiesSpecification.java new file mode 100644 index 0000000000000..2e403eaed67b2 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/DefaultRolloutPropertiesSpecification.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.providerhub.fluent.models.ResourceTypeRegistrationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.List; + +/** The DefaultRolloutPropertiesSpecification model. */ +@Immutable +public final class DefaultRolloutPropertiesSpecification extends DefaultRolloutSpecification { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DefaultRolloutPropertiesSpecification.class); + + /** {@inheritDoc} */ + @Override + public DefaultRolloutPropertiesSpecification withCanary(DefaultRolloutSpecificationCanary canary) { + super.withCanary(canary); + return this; + } + + /** {@inheritDoc} */ + @Override + public DefaultRolloutPropertiesSpecification withLowTraffic(DefaultRolloutSpecificationLowTraffic lowTraffic) { + super.withLowTraffic(lowTraffic); + return this; + } + + /** {@inheritDoc} */ + @Override + public DefaultRolloutPropertiesSpecification withMediumTraffic( + DefaultRolloutSpecificationMediumTraffic mediumTraffic) { + super.withMediumTraffic(mediumTraffic); + return this; + } + + /** {@inheritDoc} */ + @Override + public DefaultRolloutPropertiesSpecification withHighTraffic(DefaultRolloutSpecificationHighTraffic highTraffic) { + super.withHighTraffic(highTraffic); + return this; + } + + /** {@inheritDoc} */ + @Override + public DefaultRolloutPropertiesSpecification withRestOfTheWorldGroupOne( + DefaultRolloutSpecificationRestOfTheWorldGroupOne restOfTheWorldGroupOne) { + super.withRestOfTheWorldGroupOne(restOfTheWorldGroupOne); + return this; + } + + /** {@inheritDoc} */ + @Override + public DefaultRolloutPropertiesSpecification withRestOfTheWorldGroupTwo( + DefaultRolloutSpecificationRestOfTheWorldGroupTwo restOfTheWorldGroupTwo) { + super.withRestOfTheWorldGroupTwo(restOfTheWorldGroupTwo); + return this; + } + + /** {@inheritDoc} */ + @Override + public DefaultRolloutPropertiesSpecification withProviderRegistration( + DefaultRolloutSpecificationProviderRegistration providerRegistration) { + super.withProviderRegistration(providerRegistration); + return this; + } + + /** {@inheritDoc} */ + @Override + public DefaultRolloutPropertiesSpecification withResourceTypeRegistrations( + List resourceTypeRegistrations) { + super.withResourceTypeRegistrations(resourceTypeRegistrations); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/DefaultRolloutPropertiesStatus.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/DefaultRolloutPropertiesStatus.java new file mode 100644 index 0000000000000..71c7fc84b78bf --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/DefaultRolloutPropertiesStatus.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** The DefaultRolloutPropertiesStatus model. */ +@Immutable +public final class DefaultRolloutPropertiesStatus extends DefaultRolloutStatus { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DefaultRolloutPropertiesStatus.class); + + /** {@inheritDoc} */ + @Override + public DefaultRolloutPropertiesStatus withNextTrafficRegion(TrafficRegionCategory nextTrafficRegion) { + super.withNextTrafficRegion(nextTrafficRegion); + return this; + } + + /** {@inheritDoc} */ + @Override + public DefaultRolloutPropertiesStatus withNextTrafficRegionScheduledTime( + OffsetDateTime nextTrafficRegionScheduledTime) { + super.withNextTrafficRegionScheduledTime(nextTrafficRegionScheduledTime); + return this; + } + + /** {@inheritDoc} */ + @Override + public DefaultRolloutPropertiesStatus withSubscriptionReregistrationResult( + SubscriptionReregistrationResult subscriptionReregistrationResult) { + super.withSubscriptionReregistrationResult(subscriptionReregistrationResult); + return this; + } + + /** {@inheritDoc} */ + @Override + public DefaultRolloutPropertiesStatus withCompletedRegions(List completedRegions) { + super.withCompletedRegions(completedRegions); + return this; + } + + /** {@inheritDoc} */ + @Override + public DefaultRolloutPropertiesStatus withFailedOrSkippedRegions( + Map failedOrSkippedRegions) { + super.withFailedOrSkippedRegions(failedOrSkippedRegions); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/DefaultRolloutSpecification.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/DefaultRolloutSpecification.java new file mode 100644 index 0000000000000..7fb80b8771fe6 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/DefaultRolloutSpecification.java @@ -0,0 +1,262 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.providerhub.fluent.models.ResourceTypeRegistrationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The DefaultRolloutSpecification model. */ +@Fluent +public class DefaultRolloutSpecification { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DefaultRolloutSpecification.class); + + /* + * The canary property. + */ + @JsonProperty(value = "canary") + private DefaultRolloutSpecificationCanary canary; + + /* + * The lowTraffic property. + */ + @JsonProperty(value = "lowTraffic") + private DefaultRolloutSpecificationLowTraffic lowTraffic; + + /* + * The mediumTraffic property. + */ + @JsonProperty(value = "mediumTraffic") + private DefaultRolloutSpecificationMediumTraffic mediumTraffic; + + /* + * The highTraffic property. + */ + @JsonProperty(value = "highTraffic") + private DefaultRolloutSpecificationHighTraffic highTraffic; + + /* + * The restOfTheWorldGroupOne property. + */ + @JsonProperty(value = "restOfTheWorldGroupOne") + private DefaultRolloutSpecificationRestOfTheWorldGroupOne restOfTheWorldGroupOne; + + /* + * The restOfTheWorldGroupTwo property. + */ + @JsonProperty(value = "restOfTheWorldGroupTwo") + private DefaultRolloutSpecificationRestOfTheWorldGroupTwo restOfTheWorldGroupTwo; + + /* + * The providerRegistration property. + */ + @JsonProperty(value = "providerRegistration") + private DefaultRolloutSpecificationProviderRegistration providerRegistration; + + /* + * The resourceTypeRegistrations property. + */ + @JsonProperty(value = "resourceTypeRegistrations") + private List resourceTypeRegistrations; + + /** + * Get the canary property: The canary property. + * + * @return the canary value. + */ + public DefaultRolloutSpecificationCanary canary() { + return this.canary; + } + + /** + * Set the canary property: The canary property. + * + * @param canary the canary value to set. + * @return the DefaultRolloutSpecification object itself. + */ + public DefaultRolloutSpecification withCanary(DefaultRolloutSpecificationCanary canary) { + this.canary = canary; + return this; + } + + /** + * Get the lowTraffic property: The lowTraffic property. + * + * @return the lowTraffic value. + */ + public DefaultRolloutSpecificationLowTraffic lowTraffic() { + return this.lowTraffic; + } + + /** + * Set the lowTraffic property: The lowTraffic property. + * + * @param lowTraffic the lowTraffic value to set. + * @return the DefaultRolloutSpecification object itself. + */ + public DefaultRolloutSpecification withLowTraffic(DefaultRolloutSpecificationLowTraffic lowTraffic) { + this.lowTraffic = lowTraffic; + return this; + } + + /** + * Get the mediumTraffic property: The mediumTraffic property. + * + * @return the mediumTraffic value. + */ + public DefaultRolloutSpecificationMediumTraffic mediumTraffic() { + return this.mediumTraffic; + } + + /** + * Set the mediumTraffic property: The mediumTraffic property. + * + * @param mediumTraffic the mediumTraffic value to set. + * @return the DefaultRolloutSpecification object itself. + */ + public DefaultRolloutSpecification withMediumTraffic(DefaultRolloutSpecificationMediumTraffic mediumTraffic) { + this.mediumTraffic = mediumTraffic; + return this; + } + + /** + * Get the highTraffic property: The highTraffic property. + * + * @return the highTraffic value. + */ + public DefaultRolloutSpecificationHighTraffic highTraffic() { + return this.highTraffic; + } + + /** + * Set the highTraffic property: The highTraffic property. + * + * @param highTraffic the highTraffic value to set. + * @return the DefaultRolloutSpecification object itself. + */ + public DefaultRolloutSpecification withHighTraffic(DefaultRolloutSpecificationHighTraffic highTraffic) { + this.highTraffic = highTraffic; + return this; + } + + /** + * Get the restOfTheWorldGroupOne property: The restOfTheWorldGroupOne property. + * + * @return the restOfTheWorldGroupOne value. + */ + public DefaultRolloutSpecificationRestOfTheWorldGroupOne restOfTheWorldGroupOne() { + return this.restOfTheWorldGroupOne; + } + + /** + * Set the restOfTheWorldGroupOne property: The restOfTheWorldGroupOne property. + * + * @param restOfTheWorldGroupOne the restOfTheWorldGroupOne value to set. + * @return the DefaultRolloutSpecification object itself. + */ + public DefaultRolloutSpecification withRestOfTheWorldGroupOne( + DefaultRolloutSpecificationRestOfTheWorldGroupOne restOfTheWorldGroupOne) { + this.restOfTheWorldGroupOne = restOfTheWorldGroupOne; + return this; + } + + /** + * Get the restOfTheWorldGroupTwo property: The restOfTheWorldGroupTwo property. + * + * @return the restOfTheWorldGroupTwo value. + */ + public DefaultRolloutSpecificationRestOfTheWorldGroupTwo restOfTheWorldGroupTwo() { + return this.restOfTheWorldGroupTwo; + } + + /** + * Set the restOfTheWorldGroupTwo property: The restOfTheWorldGroupTwo property. + * + * @param restOfTheWorldGroupTwo the restOfTheWorldGroupTwo value to set. + * @return the DefaultRolloutSpecification object itself. + */ + public DefaultRolloutSpecification withRestOfTheWorldGroupTwo( + DefaultRolloutSpecificationRestOfTheWorldGroupTwo restOfTheWorldGroupTwo) { + this.restOfTheWorldGroupTwo = restOfTheWorldGroupTwo; + return this; + } + + /** + * Get the providerRegistration property: The providerRegistration property. + * + * @return the providerRegistration value. + */ + public DefaultRolloutSpecificationProviderRegistration providerRegistration() { + return this.providerRegistration; + } + + /** + * Set the providerRegistration property: The providerRegistration property. + * + * @param providerRegistration the providerRegistration value to set. + * @return the DefaultRolloutSpecification object itself. + */ + public DefaultRolloutSpecification withProviderRegistration( + DefaultRolloutSpecificationProviderRegistration providerRegistration) { + this.providerRegistration = providerRegistration; + return this; + } + + /** + * Get the resourceTypeRegistrations property: The resourceTypeRegistrations property. + * + * @return the resourceTypeRegistrations value. + */ + public List resourceTypeRegistrations() { + return this.resourceTypeRegistrations; + } + + /** + * Set the resourceTypeRegistrations property: The resourceTypeRegistrations property. + * + * @param resourceTypeRegistrations the resourceTypeRegistrations value to set. + * @return the DefaultRolloutSpecification object itself. + */ + public DefaultRolloutSpecification withResourceTypeRegistrations( + List resourceTypeRegistrations) { + this.resourceTypeRegistrations = resourceTypeRegistrations; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (canary() != null) { + canary().validate(); + } + if (lowTraffic() != null) { + lowTraffic().validate(); + } + if (mediumTraffic() != null) { + mediumTraffic().validate(); + } + if (highTraffic() != null) { + highTraffic().validate(); + } + if (restOfTheWorldGroupOne() != null) { + restOfTheWorldGroupOne().validate(); + } + if (restOfTheWorldGroupTwo() != null) { + restOfTheWorldGroupTwo().validate(); + } + if (providerRegistration() != null) { + providerRegistration().validate(); + } + if (resourceTypeRegistrations() != null) { + resourceTypeRegistrations().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/DefaultRolloutSpecificationCanary.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/DefaultRolloutSpecificationCanary.java new file mode 100644 index 0000000000000..ac1dc593c6811 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/DefaultRolloutSpecificationCanary.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.List; + +/** The DefaultRolloutSpecificationCanary model. */ +@Immutable +public final class DefaultRolloutSpecificationCanary extends CanaryTrafficRegionRolloutConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DefaultRolloutSpecificationCanary.class); + + /** {@inheritDoc} */ + @Override + public DefaultRolloutSpecificationCanary withSkipRegions(List skipRegions) { + super.withSkipRegions(skipRegions); + return this; + } + + /** {@inheritDoc} */ + @Override + public DefaultRolloutSpecificationCanary withRegions(List regions) { + super.withRegions(regions); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/DefaultRolloutSpecificationHighTraffic.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/DefaultRolloutSpecificationHighTraffic.java new file mode 100644 index 0000000000000..9521b99f5d061 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/DefaultRolloutSpecificationHighTraffic.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.providerhub.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.time.Duration; +import java.util.List; + +/** The DefaultRolloutSpecificationHighTraffic model. */ +@Immutable +public final class DefaultRolloutSpecificationHighTraffic extends TrafficRegionRolloutConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DefaultRolloutSpecificationHighTraffic.class); + + /** {@inheritDoc} */ + @Override + public DefaultRolloutSpecificationHighTraffic withWaitDuration(Duration waitDuration) { + super.withWaitDuration(waitDuration); + return this; + } + + /** {@inheritDoc} */ + @Override + public DefaultRolloutSpecificationHighTraffic withRegions(List regions) { + super.withRegions(regions); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/DefaultRolloutSpecificationLowTraffic.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/DefaultRolloutSpecificationLowTraffic.java new file mode 100644 index 0000000000000..07e2001675bc7 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/DefaultRolloutSpecificationLowTraffic.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.providerhub.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.time.Duration; +import java.util.List; + +/** The DefaultRolloutSpecificationLowTraffic model. */ +@Immutable +public final class DefaultRolloutSpecificationLowTraffic extends TrafficRegionRolloutConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DefaultRolloutSpecificationLowTraffic.class); + + /** {@inheritDoc} */ + @Override + public DefaultRolloutSpecificationLowTraffic withWaitDuration(Duration waitDuration) { + super.withWaitDuration(waitDuration); + return this; + } + + /** {@inheritDoc} */ + @Override + public DefaultRolloutSpecificationLowTraffic withRegions(List regions) { + super.withRegions(regions); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/DefaultRolloutSpecificationMediumTraffic.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/DefaultRolloutSpecificationMediumTraffic.java new file mode 100644 index 0000000000000..53724e04efc57 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/DefaultRolloutSpecificationMediumTraffic.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.providerhub.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.time.Duration; +import java.util.List; + +/** The DefaultRolloutSpecificationMediumTraffic model. */ +@Immutable +public final class DefaultRolloutSpecificationMediumTraffic extends TrafficRegionRolloutConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DefaultRolloutSpecificationMediumTraffic.class); + + /** {@inheritDoc} */ + @Override + public DefaultRolloutSpecificationMediumTraffic withWaitDuration(Duration waitDuration) { + super.withWaitDuration(waitDuration); + return this; + } + + /** {@inheritDoc} */ + @Override + public DefaultRolloutSpecificationMediumTraffic withRegions(List regions) { + super.withRegions(regions); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/DefaultRolloutSpecificationProviderRegistration.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/DefaultRolloutSpecificationProviderRegistration.java new file mode 100644 index 0000000000000..152cbf7cbecca --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/DefaultRolloutSpecificationProviderRegistration.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.providerhub.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.providerhub.fluent.models.ProviderRegistrationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** The DefaultRolloutSpecificationProviderRegistration model. */ +@Immutable +public final class DefaultRolloutSpecificationProviderRegistration extends ProviderRegistrationInner { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(DefaultRolloutSpecificationProviderRegistration.class); + + /** {@inheritDoc} */ + @Override + public DefaultRolloutSpecificationProviderRegistration withProperties(ProviderRegistrationProperties properties) { + super.withProperties(properties); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/DefaultRolloutSpecificationRestOfTheWorldGroupOne.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/DefaultRolloutSpecificationRestOfTheWorldGroupOne.java new file mode 100644 index 0000000000000..14098dabf63a2 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/DefaultRolloutSpecificationRestOfTheWorldGroupOne.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.time.Duration; +import java.util.List; + +/** The DefaultRolloutSpecificationRestOfTheWorldGroupOne model. */ +@Immutable +public final class DefaultRolloutSpecificationRestOfTheWorldGroupOne extends TrafficRegionRolloutConfiguration { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(DefaultRolloutSpecificationRestOfTheWorldGroupOne.class); + + /** {@inheritDoc} */ + @Override + public DefaultRolloutSpecificationRestOfTheWorldGroupOne withWaitDuration(Duration waitDuration) { + super.withWaitDuration(waitDuration); + return this; + } + + /** {@inheritDoc} */ + @Override + public DefaultRolloutSpecificationRestOfTheWorldGroupOne withRegions(List regions) { + super.withRegions(regions); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/DefaultRolloutSpecificationRestOfTheWorldGroupTwo.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/DefaultRolloutSpecificationRestOfTheWorldGroupTwo.java new file mode 100644 index 0000000000000..838bc93c1fb2e --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/DefaultRolloutSpecificationRestOfTheWorldGroupTwo.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.time.Duration; +import java.util.List; + +/** The DefaultRolloutSpecificationRestOfTheWorldGroupTwo model. */ +@Immutable +public final class DefaultRolloutSpecificationRestOfTheWorldGroupTwo extends TrafficRegionRolloutConfiguration { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(DefaultRolloutSpecificationRestOfTheWorldGroupTwo.class); + + /** {@inheritDoc} */ + @Override + public DefaultRolloutSpecificationRestOfTheWorldGroupTwo withWaitDuration(Duration waitDuration) { + super.withWaitDuration(waitDuration); + return this; + } + + /** {@inheritDoc} */ + @Override + public DefaultRolloutSpecificationRestOfTheWorldGroupTwo withRegions(List regions) { + super.withRegions(regions); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/DefaultRolloutStatus.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/DefaultRolloutStatus.java new file mode 100644 index 0000000000000..32a7dc5be234b --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/DefaultRolloutStatus.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** The DefaultRolloutStatus model. */ +@Fluent +public class DefaultRolloutStatus extends RolloutStatusBase { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DefaultRolloutStatus.class); + + /* + * The nextTrafficRegion property. + */ + @JsonProperty(value = "nextTrafficRegion") + private TrafficRegionCategory nextTrafficRegion; + + /* + * The nextTrafficRegionScheduledTime property. + */ + @JsonProperty(value = "nextTrafficRegionScheduledTime") + private OffsetDateTime nextTrafficRegionScheduledTime; + + /* + * The subscriptionReregistrationResult property. + */ + @JsonProperty(value = "subscriptionReregistrationResult") + private SubscriptionReregistrationResult subscriptionReregistrationResult; + + /** + * Get the nextTrafficRegion property: The nextTrafficRegion property. + * + * @return the nextTrafficRegion value. + */ + public TrafficRegionCategory nextTrafficRegion() { + return this.nextTrafficRegion; + } + + /** + * Set the nextTrafficRegion property: The nextTrafficRegion property. + * + * @param nextTrafficRegion the nextTrafficRegion value to set. + * @return the DefaultRolloutStatus object itself. + */ + public DefaultRolloutStatus withNextTrafficRegion(TrafficRegionCategory nextTrafficRegion) { + this.nextTrafficRegion = nextTrafficRegion; + return this; + } + + /** + * Get the nextTrafficRegionScheduledTime property: The nextTrafficRegionScheduledTime property. + * + * @return the nextTrafficRegionScheduledTime value. + */ + public OffsetDateTime nextTrafficRegionScheduledTime() { + return this.nextTrafficRegionScheduledTime; + } + + /** + * Set the nextTrafficRegionScheduledTime property: The nextTrafficRegionScheduledTime property. + * + * @param nextTrafficRegionScheduledTime the nextTrafficRegionScheduledTime value to set. + * @return the DefaultRolloutStatus object itself. + */ + public DefaultRolloutStatus withNextTrafficRegionScheduledTime(OffsetDateTime nextTrafficRegionScheduledTime) { + this.nextTrafficRegionScheduledTime = nextTrafficRegionScheduledTime; + return this; + } + + /** + * Get the subscriptionReregistrationResult property: The subscriptionReregistrationResult property. + * + * @return the subscriptionReregistrationResult value. + */ + public SubscriptionReregistrationResult subscriptionReregistrationResult() { + return this.subscriptionReregistrationResult; + } + + /** + * Set the subscriptionReregistrationResult property: The subscriptionReregistrationResult property. + * + * @param subscriptionReregistrationResult the subscriptionReregistrationResult value to set. + * @return the DefaultRolloutStatus object itself. + */ + public DefaultRolloutStatus withSubscriptionReregistrationResult( + SubscriptionReregistrationResult subscriptionReregistrationResult) { + this.subscriptionReregistrationResult = subscriptionReregistrationResult; + return this; + } + + /** {@inheritDoc} */ + @Override + public DefaultRolloutStatus withCompletedRegions(List completedRegions) { + super.withCompletedRegions(completedRegions); + return this; + } + + /** {@inheritDoc} */ + @Override + public DefaultRolloutStatus withFailedOrSkippedRegions(Map failedOrSkippedRegions) { + super.withFailedOrSkippedRegions(failedOrSkippedRegions); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/DefaultRollouts.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/DefaultRollouts.java new file mode 100644 index 0000000000000..12337451d8644 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/DefaultRollouts.java @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.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 DefaultRollouts. */ +public interface DefaultRollouts { + /** + * Gets the default rollout details. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param rolloutName The rollout name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the default rollout details. + */ + DefaultRollout get(String providerNamespace, String rolloutName); + + /** + * Gets the default rollout details. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param rolloutName The rollout name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the default rollout details. + */ + Response getWithResponse(String providerNamespace, String rolloutName, Context context); + + /** + * Deletes the rollout resource. Rollout must be in terminal state. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param rolloutName The rollout name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String providerNamespace, String rolloutName); + + /** + * Deletes the rollout resource. Rollout must be in terminal state. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param rolloutName The rollout name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse(String providerNamespace, String rolloutName, Context context); + + /** + * Gets the list of the rollouts for the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the rollouts for the given provider. + */ + PagedIterable listByProviderRegistration(String providerNamespace); + + /** + * Gets the list of the rollouts for the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the rollouts for the given provider. + */ + PagedIterable listByProviderRegistration(String providerNamespace, Context context); + + /** + * Stops or cancels the rollout, if in progress. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param rolloutName The rollout name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stop(String providerNamespace, String rolloutName); + + /** + * Stops or cancels the rollout, if in progress. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param rolloutName The rollout name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response stopWithResponse(String providerNamespace, String rolloutName, Context context); + + /** + * Gets the default rollout details. + * + * @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 default rollout details. + */ + DefaultRollout getById(String id); + + /** + * Gets the default rollout details. + * + * @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 default rollout details. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the rollout resource. Rollout must be in terminal state. + * + * @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); + + /** + * Deletes the rollout resource. Rollout must be in terminal state. + * + * @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 response. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new DefaultRollout resource. + * + * @param name resource name. + * @return the first stage of the new DefaultRollout definition. + */ + DefaultRollout.DefinitionStages.Blank define(String name); +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/Error.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/Error.java new file mode 100644 index 0000000000000..b608fff80a3db --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/Error.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Standard error object. */ +@Immutable +public class Error { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Error.class); + + /* + * Server-defined set of error codes. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /* + * Human-readable representation of the error. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /* + * Target of the error. + */ + @JsonProperty(value = "target", access = JsonProperty.Access.WRITE_ONLY) + private String target; + + /* + * Array of details about specific errors that led to this reported error. + */ + @JsonProperty(value = "details", access = JsonProperty.Access.WRITE_ONLY) + private List details; + + /* + * Object containing more specific information than the current object + * about the error. + */ + @JsonProperty(value = "innerError", access = JsonProperty.Access.WRITE_ONLY) + private ErrorInnerError innerError; + + /** + * Get the code property: Server-defined set of error codes. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Get the message property: Human-readable representation of the error. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Get the target property: Target of the error. + * + * @return the target value. + */ + public String target() { + return this.target; + } + + /** + * Get the details property: Array of details about specific errors that led to this reported error. + * + * @return the details value. + */ + public List details() { + return this.details; + } + + /** + * Get the innerError property: Object containing more specific information than the current object about the error. + * + * @return the innerError value. + */ + public ErrorInnerError innerError() { + return this.innerError; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (details() != null) { + details().forEach(e -> e.validate()); + } + if (innerError() != null) { + innerError().validate(); + } + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ErrorInnerError.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ErrorInnerError.java new file mode 100644 index 0000000000000..449d181e78cab --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ErrorInnerError.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.providerhub.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** Object containing more specific information than the current object about the error. */ +@Immutable +public final class ErrorInnerError extends InnerError { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ErrorInnerError.class); + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ExtendedErrorInfo.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ExtendedErrorInfo.java new file mode 100644 index 0000000000000..c07461d9887cd --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ExtendedErrorInfo.java @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The ExtendedErrorInfo model. */ +@Fluent +public final class ExtendedErrorInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExtendedErrorInfo.class); + + /* + * The code property. + */ + @JsonProperty(value = "code") + private String code; + + /* + * The target property. + */ + @JsonProperty(value = "target") + private String target; + + /* + * The message property. + */ + @JsonProperty(value = "message") + private String message; + + /* + * The details property. + */ + @JsonProperty(value = "details") + private List details; + + /* + * The additionalInfo property. + */ + @JsonProperty(value = "additionalInfo") + private List additionalInfo; + + /** + * Get the code property: The code property. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Set the code property: The code property. + * + * @param code the code value to set. + * @return the ExtendedErrorInfo object itself. + */ + public ExtendedErrorInfo withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the target property: The target property. + * + * @return the target value. + */ + public String target() { + return this.target; + } + + /** + * Set the target property: The target property. + * + * @param target the target value to set. + * @return the ExtendedErrorInfo object itself. + */ + public ExtendedErrorInfo withTarget(String target) { + this.target = target; + return this; + } + + /** + * Get the message property: The message property. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: The message property. + * + * @param message the message value to set. + * @return the ExtendedErrorInfo object itself. + */ + public ExtendedErrorInfo withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the details property: The details property. + * + * @return the details value. + */ + public List details() { + return this.details; + } + + /** + * Set the details property: The details property. + * + * @param details the details value to set. + * @return the ExtendedErrorInfo object itself. + */ + public ExtendedErrorInfo withDetails(List details) { + this.details = details; + return this; + } + + /** + * Get the additionalInfo property: The additionalInfo property. + * + * @return the additionalInfo value. + */ + public List additionalInfo() { + return this.additionalInfo; + } + + /** + * Set the additionalInfo property: The additionalInfo property. + * + * @param additionalInfo the additionalInfo value to set. + * @return the ExtendedErrorInfo object itself. + */ + public ExtendedErrorInfo withAdditionalInfo(List additionalInfo) { + this.additionalInfo = additionalInfo; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (details() != null) { + details().forEach(e -> e.validate()); + } + if (additionalInfo() != null) { + additionalInfo().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ExtendedLocationOptions.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ExtendedLocationOptions.java new file mode 100644 index 0000000000000..b0048e92753fc --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ExtendedLocationOptions.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.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ExtendedLocationOptions model. */ +@Fluent +public final class ExtendedLocationOptions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExtendedLocationOptions.class); + + /* + * The type property. + */ + @JsonProperty(value = "type") + private String type; + + /* + * The supportedPolicy property. + */ + @JsonProperty(value = "supportedPolicy") + private String supportedPolicy; + + /** + * Get the type property: The type property. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The type property. + * + * @param type the type value to set. + * @return the ExtendedLocationOptions object itself. + */ + public ExtendedLocationOptions withType(String type) { + this.type = type; + return this; + } + + /** + * Get the supportedPolicy property: The supportedPolicy property. + * + * @return the supportedPolicy value. + */ + public String supportedPolicy() { + return this.supportedPolicy; + } + + /** + * Set the supportedPolicy property: The supportedPolicy property. + * + * @param supportedPolicy the supportedPolicy value to set. + * @return the ExtendedLocationOptions object itself. + */ + public ExtendedLocationOptions withSupportedPolicy(String supportedPolicy) { + this.supportedPolicy = supportedPolicy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ExtensionCategory.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ExtensionCategory.java new file mode 100644 index 0000000000000..bb41904b9772e --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ExtensionCategory.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ExtensionCategory. */ +public final class ExtensionCategory extends ExpandableStringEnum { + /** Static value NotSpecified for ExtensionCategory. */ + public static final ExtensionCategory NOT_SPECIFIED = fromString("NotSpecified"); + + /** Static value ResourceCreationValidate for ExtensionCategory. */ + public static final ExtensionCategory RESOURCE_CREATION_VALIDATE = fromString("ResourceCreationValidate"); + + /** Static value ResourceCreationBegin for ExtensionCategory. */ + public static final ExtensionCategory RESOURCE_CREATION_BEGIN = fromString("ResourceCreationBegin"); + + /** Static value ResourceCreationCompleted for ExtensionCategory. */ + public static final ExtensionCategory RESOURCE_CREATION_COMPLETED = fromString("ResourceCreationCompleted"); + + /** Static value ResourceReadValidate for ExtensionCategory. */ + public static final ExtensionCategory RESOURCE_READ_VALIDATE = fromString("ResourceReadValidate"); + + /** Static value ResourceReadBegin for ExtensionCategory. */ + public static final ExtensionCategory RESOURCE_READ_BEGIN = fromString("ResourceReadBegin"); + + /** Static value ResourcePatchValidate for ExtensionCategory. */ + public static final ExtensionCategory RESOURCE_PATCH_VALIDATE = fromString("ResourcePatchValidate"); + + /** Static value ResourcePatchCompleted for ExtensionCategory. */ + public static final ExtensionCategory RESOURCE_PATCH_COMPLETED = fromString("ResourcePatchCompleted"); + + /** Static value ResourceDeletionValidate for ExtensionCategory. */ + public static final ExtensionCategory RESOURCE_DELETION_VALIDATE = fromString("ResourceDeletionValidate"); + + /** Static value ResourceDeletionBegin for ExtensionCategory. */ + public static final ExtensionCategory RESOURCE_DELETION_BEGIN = fromString("ResourceDeletionBegin"); + + /** Static value ResourceDeletionCompleted for ExtensionCategory. */ + public static final ExtensionCategory RESOURCE_DELETION_COMPLETED = fromString("ResourceDeletionCompleted"); + + /** Static value ResourcePostAction for ExtensionCategory. */ + public static final ExtensionCategory RESOURCE_POST_ACTION = fromString("ResourcePostAction"); + + /** Static value SubscriptionLifecycleNotification for ExtensionCategory. */ + public static final ExtensionCategory SUBSCRIPTION_LIFECYCLE_NOTIFICATION = + fromString("SubscriptionLifecycleNotification"); + + /** Static value ResourcePatchBegin for ExtensionCategory. */ + public static final ExtensionCategory RESOURCE_PATCH_BEGIN = fromString("ResourcePatchBegin"); + + /** Static value ResourceMoveBegin for ExtensionCategory. */ + public static final ExtensionCategory RESOURCE_MOVE_BEGIN = fromString("ResourceMoveBegin"); + + /** Static value ResourceMoveCompleted for ExtensionCategory. */ + public static final ExtensionCategory RESOURCE_MOVE_COMPLETED = fromString("ResourceMoveCompleted"); + + /** + * Creates or finds a ExtensionCategory from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExtensionCategory. + */ + @JsonCreator + public static ExtensionCategory fromString(String name) { + return fromString(name, ExtensionCategory.class); + } + + /** @return known ExtensionCategory values. */ + public static Collection values() { + return values(ExtensionCategory.class); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ExtensionOptionType.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ExtensionOptionType.java new file mode 100644 index 0000000000000..f080de1eb6430 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ExtensionOptionType.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.providerhub.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ExtensionOptionType. */ +public final class ExtensionOptionType extends ExpandableStringEnum { + /** Static value NotSpecified for ExtensionOptionType. */ + public static final ExtensionOptionType NOT_SPECIFIED = fromString("NotSpecified"); + + /** Static value DoNotMergeExistingReadOnlyAndSecretProperties for ExtensionOptionType. */ + public static final ExtensionOptionType DO_NOT_MERGE_EXISTING_READ_ONLY_AND_SECRET_PROPERTIES = + fromString("DoNotMergeExistingReadOnlyAndSecretProperties"); + + /** Static value IncludeInternalMetadata for ExtensionOptionType. */ + public static final ExtensionOptionType INCLUDE_INTERNAL_METADATA = fromString("IncludeInternalMetadata"); + + /** + * Creates or finds a ExtensionOptionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExtensionOptionType. + */ + @JsonCreator + public static ExtensionOptionType fromString(String name) { + return fromString(name, ExtensionOptionType.class); + } + + /** @return known ExtensionOptionType values. */ + public static Collection values() { + return values(ExtensionOptionType.class); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ExtensionOptions.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ExtensionOptions.java new file mode 100644 index 0000000000000..f73807c0804f0 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ExtensionOptions.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The ExtensionOptions model. */ +@Fluent +public class ExtensionOptions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExtensionOptions.class); + + /* + * The request property. + */ + @JsonProperty(value = "request") + private List request; + + /* + * The response property. + */ + @JsonProperty(value = "response") + private List response; + + /** + * Get the request property: The request property. + * + * @return the request value. + */ + public List request() { + return this.request; + } + + /** + * Set the request property: The request property. + * + * @param request the request value to set. + * @return the ExtensionOptions object itself. + */ + public ExtensionOptions withRequest(List request) { + this.request = request; + return this; + } + + /** + * Get the response property: The response property. + * + * @return the response value. + */ + public List response() { + return this.response; + } + + /** + * Set the response property: The response property. + * + * @param response the response value to set. + * @return the ExtensionOptions object itself. + */ + public ExtensionOptions withResponse(List response) { + this.response = response; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/FeaturesPolicy.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/FeaturesPolicy.java new file mode 100644 index 0000000000000..9d10d792e3808 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/FeaturesPolicy.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.providerhub.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for FeaturesPolicy. */ +public final class FeaturesPolicy extends ExpandableStringEnum { + /** Static value Any for FeaturesPolicy. */ + public static final FeaturesPolicy ANY = fromString("Any"); + + /** Static value All for FeaturesPolicy. */ + public static final FeaturesPolicy ALL = fromString("All"); + + /** + * Creates or finds a FeaturesPolicy from its string representation. + * + * @param name a name to look for. + * @return the corresponding FeaturesPolicy. + */ + @JsonCreator + public static FeaturesPolicy fromString(String name) { + return fromString(name, FeaturesPolicy.class); + } + + /** @return known FeaturesPolicy values. */ + public static Collection values() { + return values(FeaturesPolicy.class); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/FeaturesRule.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/FeaturesRule.java new file mode 100644 index 0000000000000..26d04ad1b2cec --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/FeaturesRule.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.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The FeaturesRule model. */ +@Fluent +public class FeaturesRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FeaturesRule.class); + + /* + * The requiredFeaturesPolicy property. + */ + @JsonProperty(value = "requiredFeaturesPolicy", required = true) + private FeaturesPolicy requiredFeaturesPolicy; + + /** + * Get the requiredFeaturesPolicy property: The requiredFeaturesPolicy property. + * + * @return the requiredFeaturesPolicy value. + */ + public FeaturesPolicy requiredFeaturesPolicy() { + return this.requiredFeaturesPolicy; + } + + /** + * Set the requiredFeaturesPolicy property: The requiredFeaturesPolicy property. + * + * @param requiredFeaturesPolicy the requiredFeaturesPolicy value to set. + * @return the FeaturesRule object itself. + */ + public FeaturesRule withRequiredFeaturesPolicy(FeaturesPolicy requiredFeaturesPolicy) { + this.requiredFeaturesPolicy = requiredFeaturesPolicy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (requiredFeaturesPolicy() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property requiredFeaturesPolicy in model FeaturesRule")); + } + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/IdentityManagement.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/IdentityManagement.java new file mode 100644 index 0000000000000..6a704fc65fc04 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/IdentityManagement.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.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The IdentityManagement model. */ +@Fluent +public class IdentityManagement { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IdentityManagement.class); + + /* + * The type property. + */ + @JsonProperty(value = "type") + private IdentityManagementTypes type; + + /** + * Get the type property: The type property. + * + * @return the type value. + */ + public IdentityManagementTypes type() { + return this.type; + } + + /** + * Set the type property: The type property. + * + * @param type the type value to set. + * @return the IdentityManagement object itself. + */ + public IdentityManagement withType(IdentityManagementTypes type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/IdentityManagementProperties.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/IdentityManagementProperties.java new file mode 100644 index 0000000000000..2af729577f2c2 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/IdentityManagementProperties.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.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The IdentityManagementProperties model. */ +@Fluent +public class IdentityManagementProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IdentityManagementProperties.class); + + /* + * The type property. + */ + @JsonProperty(value = "type") + private IdentityManagementTypes type; + + /* + * The applicationId property. + */ + @JsonProperty(value = "applicationId") + private String applicationId; + + /** + * Get the type property: The type property. + * + * @return the type value. + */ + public IdentityManagementTypes type() { + return this.type; + } + + /** + * Set the type property: The type property. + * + * @param type the type value to set. + * @return the IdentityManagementProperties object itself. + */ + public IdentityManagementProperties withType(IdentityManagementTypes type) { + this.type = type; + return this; + } + + /** + * Get the applicationId property: The applicationId property. + * + * @return the applicationId value. + */ + public String applicationId() { + return this.applicationId; + } + + /** + * Set the applicationId property: The applicationId property. + * + * @param applicationId the applicationId value to set. + * @return the IdentityManagementProperties object itself. + */ + public IdentityManagementProperties withApplicationId(String applicationId) { + this.applicationId = applicationId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/IdentityManagementTypes.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/IdentityManagementTypes.java new file mode 100644 index 0000000000000..02fffd3bbb162 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/IdentityManagementTypes.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for IdentityManagementTypes. */ +public final class IdentityManagementTypes extends ExpandableStringEnum { + /** Static value NotSpecified for IdentityManagementTypes. */ + public static final IdentityManagementTypes NOT_SPECIFIED = fromString("NotSpecified"); + + /** Static value SystemAssigned for IdentityManagementTypes. */ + public static final IdentityManagementTypes SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** Static value UserAssigned for IdentityManagementTypes. */ + public static final IdentityManagementTypes USER_ASSIGNED = fromString("UserAssigned"); + + /** Static value Actor for IdentityManagementTypes. */ + public static final IdentityManagementTypes ACTOR = fromString("Actor"); + + /** Static value DelegatedResourceIdentity for IdentityManagementTypes. */ + public static final IdentityManagementTypes DELEGATED_RESOURCE_IDENTITY = fromString("DelegatedResourceIdentity"); + + /** + * Creates or finds a IdentityManagementTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding IdentityManagementTypes. + */ + @JsonCreator + public static IdentityManagementTypes fromString(String name) { + return fromString(name, IdentityManagementTypes.class); + } + + /** @return known IdentityManagementTypes values. */ + public static Collection values() { + return values(IdentityManagementTypes.class); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/InnerError.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/InnerError.java new file mode 100644 index 0000000000000..61f848505e69f --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/InnerError.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.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.HashMap; +import java.util.Map; + +/** Inner error containing list of errors. */ +@Fluent +public class InnerError { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InnerError.class); + + /* + * Specific error code than was provided by the containing error. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /* + * Object containing more specific information than the current object + * about the error. + */ + @JsonProperty(value = "innerError", access = JsonProperty.Access.WRITE_ONLY) + private Object innerError; + + /* + * Inner error containing list of errors. + */ + @JsonIgnore private Map additionalProperties; + + /** + * Get the code property: Specific error code than was provided by the containing error. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Get the innerError property: Object containing more specific information than the current object about the error. + * + * @return the innerError value. + */ + public Object innerError() { + return this.innerError; + } + + /** + * Get the additionalProperties property: Inner error containing list of errors. + * + * @return the additionalProperties value. + */ + @JsonAnyGetter + public Map additionalProperties() { + return this.additionalProperties; + } + + /** + * Set the additionalProperties property: Inner error containing list of errors. + * + * @param additionalProperties the additionalProperties value to set. + * @return the InnerError object itself. + */ + public InnerError withAdditionalProperties(Map additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + + @JsonAnySetter + void withAdditionalProperties(String key, Object value) { + if (additionalProperties == null) { + additionalProperties = new HashMap<>(); + } + additionalProperties.put(key, value); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/LightHouseAuthorization.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/LightHouseAuthorization.java new file mode 100644 index 0000000000000..f13735ee1bc2b --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/LightHouseAuthorization.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The LightHouseAuthorization model. */ +@Fluent +public final class LightHouseAuthorization { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LightHouseAuthorization.class); + + /* + * The principalId property. + */ + @JsonProperty(value = "principalId", required = true) + private String principalId; + + /* + * The roleDefinitionId property. + */ + @JsonProperty(value = "roleDefinitionId", required = true) + private String roleDefinitionId; + + /** + * Get the principalId property: The principalId property. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Set the principalId property: The principalId property. + * + * @param principalId the principalId value to set. + * @return the LightHouseAuthorization object itself. + */ + public LightHouseAuthorization withPrincipalId(String principalId) { + this.principalId = principalId; + return this; + } + + /** + * Get the roleDefinitionId property: The roleDefinitionId property. + * + * @return the roleDefinitionId value. + */ + public String roleDefinitionId() { + return this.roleDefinitionId; + } + + /** + * Set the roleDefinitionId property: The roleDefinitionId property. + * + * @param roleDefinitionId the roleDefinitionId value to set. + * @return the LightHouseAuthorization object itself. + */ + public LightHouseAuthorization withRoleDefinitionId(String roleDefinitionId) { + this.roleDefinitionId = roleDefinitionId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (principalId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property principalId in model LightHouseAuthorization")); + } + if (roleDefinitionId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property roleDefinitionId in model LightHouseAuthorization")); + } + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/LinkedAccessCheck.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/LinkedAccessCheck.java new file mode 100644 index 0000000000000..95fdea8d7f228 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/LinkedAccessCheck.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.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The LinkedAccessCheck model. */ +@Fluent +public final class LinkedAccessCheck { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LinkedAccessCheck.class); + + /* + * The actionName property. + */ + @JsonProperty(value = "actionName") + private String actionName; + + /* + * The linkedProperty property. + */ + @JsonProperty(value = "linkedProperty") + private String linkedProperty; + + /* + * The linkedAction property. + */ + @JsonProperty(value = "linkedAction") + private String linkedAction; + + /* + * The linkedActionVerb property. + */ + @JsonProperty(value = "linkedActionVerb") + private String linkedActionVerb; + + /* + * The linkedType property. + */ + @JsonProperty(value = "linkedType") + private String linkedType; + + /** + * Get the actionName property: The actionName property. + * + * @return the actionName value. + */ + public String actionName() { + return this.actionName; + } + + /** + * Set the actionName property: The actionName property. + * + * @param actionName the actionName value to set. + * @return the LinkedAccessCheck object itself. + */ + public LinkedAccessCheck withActionName(String actionName) { + this.actionName = actionName; + return this; + } + + /** + * Get the linkedProperty property: The linkedProperty property. + * + * @return the linkedProperty value. + */ + public String linkedProperty() { + return this.linkedProperty; + } + + /** + * Set the linkedProperty property: The linkedProperty property. + * + * @param linkedProperty the linkedProperty value to set. + * @return the LinkedAccessCheck object itself. + */ + public LinkedAccessCheck withLinkedProperty(String linkedProperty) { + this.linkedProperty = linkedProperty; + return this; + } + + /** + * Get the linkedAction property: The linkedAction property. + * + * @return the linkedAction value. + */ + public String linkedAction() { + return this.linkedAction; + } + + /** + * Set the linkedAction property: The linkedAction property. + * + * @param linkedAction the linkedAction value to set. + * @return the LinkedAccessCheck object itself. + */ + public LinkedAccessCheck withLinkedAction(String linkedAction) { + this.linkedAction = linkedAction; + return this; + } + + /** + * Get the linkedActionVerb property: The linkedActionVerb property. + * + * @return the linkedActionVerb value. + */ + public String linkedActionVerb() { + return this.linkedActionVerb; + } + + /** + * Set the linkedActionVerb property: The linkedActionVerb property. + * + * @param linkedActionVerb the linkedActionVerb value to set. + * @return the LinkedAccessCheck object itself. + */ + public LinkedAccessCheck withLinkedActionVerb(String linkedActionVerb) { + this.linkedActionVerb = linkedActionVerb; + return this; + } + + /** + * Get the linkedType property: The linkedType property. + * + * @return the linkedType value. + */ + public String linkedType() { + return this.linkedType; + } + + /** + * Set the linkedType property: The linkedType property. + * + * @param linkedType the linkedType value to set. + * @return the LinkedAccessCheck object itself. + */ + public LinkedAccessCheck withLinkedType(String linkedType) { + this.linkedType = linkedType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/LinkedAction.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/LinkedAction.java new file mode 100644 index 0000000000000..1af9905a8e1d9 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/LinkedAction.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for LinkedAction. */ +public final class LinkedAction extends ExpandableStringEnum { + /** Static value NotSpecified for LinkedAction. */ + public static final LinkedAction NOT_SPECIFIED = fromString("NotSpecified"); + + /** Static value Blocked for LinkedAction. */ + public static final LinkedAction BLOCKED = fromString("Blocked"); + + /** Static value Validate for LinkedAction. */ + public static final LinkedAction VALIDATE = fromString("Validate"); + + /** Static value Enabled for LinkedAction. */ + public static final LinkedAction ENABLED = fromString("Enabled"); + + /** + * Creates or finds a LinkedAction from its string representation. + * + * @param name a name to look for. + * @return the corresponding LinkedAction. + */ + @JsonCreator + public static LinkedAction fromString(String name) { + return fromString(name, LinkedAction.class); + } + + /** @return known LinkedAction values. */ + public static Collection values() { + return values(LinkedAction.class); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/LinkedOperation.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/LinkedOperation.java new file mode 100644 index 0000000000000..d21074cf22089 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/LinkedOperation.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.providerhub.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for LinkedOperation. */ +public final class LinkedOperation extends ExpandableStringEnum { + /** Static value None for LinkedOperation. */ + public static final LinkedOperation NONE = fromString("None"); + + /** Static value CrossResourceGroupResourceMove for LinkedOperation. */ + public static final LinkedOperation CROSS_RESOURCE_GROUP_RESOURCE_MOVE = + fromString("CrossResourceGroupResourceMove"); + + /** Static value CrossSubscriptionResourceMove for LinkedOperation. */ + public static final LinkedOperation CROSS_SUBSCRIPTION_RESOURCE_MOVE = fromString("CrossSubscriptionResourceMove"); + + /** + * Creates or finds a LinkedOperation from its string representation. + * + * @param name a name to look for. + * @return the corresponding LinkedOperation. + */ + @JsonCreator + public static LinkedOperation fromString(String name) { + return fromString(name, LinkedOperation.class); + } + + /** @return known LinkedOperation values. */ + public static Collection values() { + return values(LinkedOperation.class); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/LinkedOperationRule.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/LinkedOperationRule.java new file mode 100644 index 0000000000000..a99d8c4874cf2 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/LinkedOperationRule.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The LinkedOperationRule model. */ +@Fluent +public final class LinkedOperationRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LinkedOperationRule.class); + + /* + * The linkedOperation property. + */ + @JsonProperty(value = "linkedOperation", required = true) + private LinkedOperation linkedOperation; + + /* + * The linkedAction property. + */ + @JsonProperty(value = "linkedAction", required = true) + private LinkedAction linkedAction; + + /** + * Get the linkedOperation property: The linkedOperation property. + * + * @return the linkedOperation value. + */ + public LinkedOperation linkedOperation() { + return this.linkedOperation; + } + + /** + * Set the linkedOperation property: The linkedOperation property. + * + * @param linkedOperation the linkedOperation value to set. + * @return the LinkedOperationRule object itself. + */ + public LinkedOperationRule withLinkedOperation(LinkedOperation linkedOperation) { + this.linkedOperation = linkedOperation; + return this; + } + + /** + * Get the linkedAction property: The linkedAction property. + * + * @return the linkedAction value. + */ + public LinkedAction linkedAction() { + return this.linkedAction; + } + + /** + * Set the linkedAction property: The linkedAction property. + * + * @param linkedAction the linkedAction value to set. + * @return the LinkedOperationRule object itself. + */ + public LinkedOperationRule withLinkedAction(LinkedAction linkedAction) { + this.linkedAction = linkedAction; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (linkedOperation() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property linkedOperation in model LinkedOperationRule")); + } + if (linkedAction() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property linkedAction in model LinkedOperationRule")); + } + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/LoggingDetails.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/LoggingDetails.java new file mode 100644 index 0000000000000..7a745c66e6dec --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/LoggingDetails.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.providerhub.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for LoggingDetails. */ +public final class LoggingDetails extends ExpandableStringEnum { + /** Static value None for LoggingDetails. */ + public static final LoggingDetails NONE = fromString("None"); + + /** Static value Body for LoggingDetails. */ + public static final LoggingDetails BODY = fromString("Body"); + + /** + * Creates or finds a LoggingDetails from its string representation. + * + * @param name a name to look for. + * @return the corresponding LoggingDetails. + */ + @JsonCreator + public static LoggingDetails fromString(String name) { + return fromString(name, LoggingDetails.class); + } + + /** @return known LoggingDetails values. */ + public static Collection values() { + return values(LoggingDetails.class); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/LoggingDirections.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/LoggingDirections.java new file mode 100644 index 0000000000000..18c60542ed496 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/LoggingDirections.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for LoggingDirections. */ +public final class LoggingDirections extends ExpandableStringEnum { + /** Static value None for LoggingDirections. */ + public static final LoggingDirections NONE = fromString("None"); + + /** Static value Request for LoggingDirections. */ + public static final LoggingDirections REQUEST = fromString("Request"); + + /** Static value Response for LoggingDirections. */ + public static final LoggingDirections RESPONSE = fromString("Response"); + + /** + * Creates or finds a LoggingDirections from its string representation. + * + * @param name a name to look for. + * @return the corresponding LoggingDirections. + */ + @JsonCreator + public static LoggingDirections fromString(String name) { + return fromString(name, LoggingDirections.class); + } + + /** @return known LoggingDirections values. */ + public static Collection values() { + return values(LoggingDirections.class); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/LoggingHiddenPropertyPath.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/LoggingHiddenPropertyPath.java new file mode 100644 index 0000000000000..9eca81b47cdd3 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/LoggingHiddenPropertyPath.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The LoggingHiddenPropertyPath model. */ +@Fluent +public class LoggingHiddenPropertyPath { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoggingHiddenPropertyPath.class); + + /* + * The hiddenPathsOnRequest property. + */ + @JsonProperty(value = "hiddenPathsOnRequest") + private List hiddenPathsOnRequest; + + /* + * The hiddenPathsOnResponse property. + */ + @JsonProperty(value = "hiddenPathsOnResponse") + private List hiddenPathsOnResponse; + + /** + * Get the hiddenPathsOnRequest property: The hiddenPathsOnRequest property. + * + * @return the hiddenPathsOnRequest value. + */ + public List hiddenPathsOnRequest() { + return this.hiddenPathsOnRequest; + } + + /** + * Set the hiddenPathsOnRequest property: The hiddenPathsOnRequest property. + * + * @param hiddenPathsOnRequest the hiddenPathsOnRequest value to set. + * @return the LoggingHiddenPropertyPath object itself. + */ + public LoggingHiddenPropertyPath withHiddenPathsOnRequest(List hiddenPathsOnRequest) { + this.hiddenPathsOnRequest = hiddenPathsOnRequest; + return this; + } + + /** + * Get the hiddenPathsOnResponse property: The hiddenPathsOnResponse property. + * + * @return the hiddenPathsOnResponse value. + */ + public List hiddenPathsOnResponse() { + return this.hiddenPathsOnResponse; + } + + /** + * Set the hiddenPathsOnResponse property: The hiddenPathsOnResponse property. + * + * @param hiddenPathsOnResponse the hiddenPathsOnResponse value to set. + * @return the LoggingHiddenPropertyPath object itself. + */ + public LoggingHiddenPropertyPath withHiddenPathsOnResponse(List hiddenPathsOnResponse) { + this.hiddenPathsOnResponse = hiddenPathsOnResponse; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/LoggingRule.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/LoggingRule.java new file mode 100644 index 0000000000000..991f5cdf62ab4 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/LoggingRule.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The LoggingRule model. */ +@Fluent +public final class LoggingRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoggingRule.class); + + /* + * The action property. + */ + @JsonProperty(value = "action", required = true) + private String action; + + /* + * The direction property. + */ + @JsonProperty(value = "direction", required = true) + private LoggingDirections direction; + + /* + * The detailLevel property. + */ + @JsonProperty(value = "detailLevel", required = true) + private LoggingDetails detailLevel; + + /* + * The hiddenPropertyPaths property. + */ + @JsonProperty(value = "hiddenPropertyPaths") + private LoggingRuleHiddenPropertyPaths hiddenPropertyPaths; + + /** + * Get the action property: The action property. + * + * @return the action value. + */ + public String action() { + return this.action; + } + + /** + * Set the action property: The action property. + * + * @param action the action value to set. + * @return the LoggingRule object itself. + */ + public LoggingRule withAction(String action) { + this.action = action; + return this; + } + + /** + * Get the direction property: The direction property. + * + * @return the direction value. + */ + public LoggingDirections direction() { + return this.direction; + } + + /** + * Set the direction property: The direction property. + * + * @param direction the direction value to set. + * @return the LoggingRule object itself. + */ + public LoggingRule withDirection(LoggingDirections direction) { + this.direction = direction; + return this; + } + + /** + * Get the detailLevel property: The detailLevel property. + * + * @return the detailLevel value. + */ + public LoggingDetails detailLevel() { + return this.detailLevel; + } + + /** + * Set the detailLevel property: The detailLevel property. + * + * @param detailLevel the detailLevel value to set. + * @return the LoggingRule object itself. + */ + public LoggingRule withDetailLevel(LoggingDetails detailLevel) { + this.detailLevel = detailLevel; + return this; + } + + /** + * Get the hiddenPropertyPaths property: The hiddenPropertyPaths property. + * + * @return the hiddenPropertyPaths value. + */ + public LoggingRuleHiddenPropertyPaths hiddenPropertyPaths() { + return this.hiddenPropertyPaths; + } + + /** + * Set the hiddenPropertyPaths property: The hiddenPropertyPaths property. + * + * @param hiddenPropertyPaths the hiddenPropertyPaths value to set. + * @return the LoggingRule object itself. + */ + public LoggingRule withHiddenPropertyPaths(LoggingRuleHiddenPropertyPaths hiddenPropertyPaths) { + this.hiddenPropertyPaths = hiddenPropertyPaths; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (action() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property action in model LoggingRule")); + } + if (direction() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property direction in model LoggingRule")); + } + if (detailLevel() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property detailLevel in model LoggingRule")); + } + if (hiddenPropertyPaths() != null) { + hiddenPropertyPaths().validate(); + } + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/LoggingRuleHiddenPropertyPaths.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/LoggingRuleHiddenPropertyPaths.java new file mode 100644 index 0000000000000..60dfb80775590 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/LoggingRuleHiddenPropertyPaths.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.List; + +/** The LoggingRuleHiddenPropertyPaths model. */ +@Immutable +public final class LoggingRuleHiddenPropertyPaths extends LoggingHiddenPropertyPath { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoggingRuleHiddenPropertyPaths.class); + + /** {@inheritDoc} */ + @Override + public LoggingRuleHiddenPropertyPaths withHiddenPathsOnRequest(List hiddenPathsOnRequest) { + super.withHiddenPathsOnRequest(hiddenPathsOnRequest); + return this; + } + + /** {@inheritDoc} */ + @Override + public LoggingRuleHiddenPropertyPaths withHiddenPathsOnResponse(List hiddenPathsOnResponse) { + super.withHiddenPathsOnResponse(hiddenPathsOnResponse); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ManifestResourceDeletionPolicy.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ManifestResourceDeletionPolicy.java new file mode 100644 index 0000000000000..c219d38f02f97 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ManifestResourceDeletionPolicy.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ManifestResourceDeletionPolicy. */ +public final class ManifestResourceDeletionPolicy extends ExpandableStringEnum { + /** Static value NotSpecified for ManifestResourceDeletionPolicy. */ + public static final ManifestResourceDeletionPolicy NOT_SPECIFIED = fromString("NotSpecified"); + + /** Static value Cascade for ManifestResourceDeletionPolicy. */ + public static final ManifestResourceDeletionPolicy CASCADE = fromString("Cascade"); + + /** Static value Force for ManifestResourceDeletionPolicy. */ + public static final ManifestResourceDeletionPolicy FORCE = fromString("Force"); + + /** + * Creates or finds a ManifestResourceDeletionPolicy from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManifestResourceDeletionPolicy. + */ + @JsonCreator + public static ManifestResourceDeletionPolicy fromString(String name) { + return fromString(name, ManifestResourceDeletionPolicy.class); + } + + /** @return known ManifestResourceDeletionPolicy values. */ + public static Collection values() { + return values(ManifestResourceDeletionPolicy.class); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/MessageScope.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/MessageScope.java new file mode 100644 index 0000000000000..cd45984a6e212 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/MessageScope.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.providerhub.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MessageScope. */ +public final class MessageScope extends ExpandableStringEnum { + /** Static value NotSpecified for MessageScope. */ + public static final MessageScope NOT_SPECIFIED = fromString("NotSpecified"); + + /** Static value RegisteredSubscriptions for MessageScope. */ + public static final MessageScope REGISTERED_SUBSCRIPTIONS = fromString("RegisteredSubscriptions"); + + /** + * Creates or finds a MessageScope from its string representation. + * + * @param name a name to look for. + * @return the corresponding MessageScope. + */ + @JsonCreator + public static MessageScope fromString(String name) { + return fromString(name, MessageScope.class); + } + + /** @return known MessageScope values. */ + public static Collection values() { + return values(MessageScope.class); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/NotificationEndpoint.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/NotificationEndpoint.java new file mode 100644 index 0000000000000..0db2d702f1e9f --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/NotificationEndpoint.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The NotificationEndpoint model. */ +@Fluent +public final class NotificationEndpoint { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NotificationEndpoint.class); + + /* + * The notificationDestination property. + */ + @JsonProperty(value = "notificationDestination") + private String notificationDestination; + + /* + * The locations property. + */ + @JsonProperty(value = "locations") + private List locations; + + /** + * Get the notificationDestination property: The notificationDestination property. + * + * @return the notificationDestination value. + */ + public String notificationDestination() { + return this.notificationDestination; + } + + /** + * Set the notificationDestination property: The notificationDestination property. + * + * @param notificationDestination the notificationDestination value to set. + * @return the NotificationEndpoint object itself. + */ + public NotificationEndpoint withNotificationDestination(String notificationDestination) { + this.notificationDestination = notificationDestination; + return this; + } + + /** + * Get the locations property: The locations property. + * + * @return the locations value. + */ + public List locations() { + return this.locations; + } + + /** + * Set the locations property: The locations property. + * + * @param locations the locations value to set. + * @return the NotificationEndpoint object itself. + */ + public NotificationEndpoint withLocations(List locations) { + this.locations = locations; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/NotificationMode.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/NotificationMode.java new file mode 100644 index 0000000000000..e3656dff679ca --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/NotificationMode.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for NotificationMode. */ +public final class NotificationMode extends ExpandableStringEnum { + /** Static value NotSpecified for NotificationMode. */ + public static final NotificationMode NOT_SPECIFIED = fromString("NotSpecified"); + + /** Static value EventHub for NotificationMode. */ + public static final NotificationMode EVENT_HUB = fromString("EventHub"); + + /** Static value WebHook for NotificationMode. */ + public static final NotificationMode WEB_HOOK = fromString("WebHook"); + + /** + * Creates or finds a NotificationMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding NotificationMode. + */ + @JsonCreator + public static NotificationMode fromString(String name) { + return fromString(name, NotificationMode.class); + } + + /** @return known NotificationMode values. */ + public static Collection values() { + return values(NotificationMode.class); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/NotificationRegistration.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/NotificationRegistration.java new file mode 100644 index 0000000000000..0fb7215d66973 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/NotificationRegistration.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.providerhub.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.providerhub.fluent.models.NotificationRegistrationInner; + +/** An immutable client-side representation of NotificationRegistration. */ +public interface NotificationRegistration { + /** + * 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 properties property: The properties property. + * + * @return the properties value. + */ + NotificationRegistrationProperties properties(); + + /** + * Gets the inner com.azure.resourcemanager.providerhub.fluent.models.NotificationRegistrationInner object. + * + * @return the inner object. + */ + NotificationRegistrationInner innerModel(); + + /** The entirety of the NotificationRegistration definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The NotificationRegistration definition stages. */ + interface DefinitionStages { + /** The first stage of the NotificationRegistration definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the NotificationRegistration definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies providerNamespace. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @return the next definition stage. + */ + WithCreate withExistingProviderRegistration(String providerNamespace); + } + /** + * The stage of the NotificationRegistration 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + NotificationRegistration create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + NotificationRegistration create(Context context); + } + /** The stage of the NotificationRegistration definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: The properties property.. + * + * @param properties The properties property. + * @return the next definition stage. + */ + WithCreate withProperties(NotificationRegistrationProperties properties); + } + } + /** + * Begins update for the NotificationRegistration resource. + * + * @return the stage of resource update. + */ + NotificationRegistration.Update update(); + + /** The template for NotificationRegistration update. */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + NotificationRegistration apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + NotificationRegistration apply(Context context); + } + /** The NotificationRegistration update stages. */ + interface UpdateStages { + /** The stage of the NotificationRegistration update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: The properties property.. + * + * @param properties The properties property. + * @return the next definition stage. + */ + Update withProperties(NotificationRegistrationProperties properties); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + NotificationRegistration refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + NotificationRegistration refresh(Context context); +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/NotificationRegistrationArrayResponseWithContinuation.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/NotificationRegistrationArrayResponseWithContinuation.java new file mode 100644 index 0000000000000..503e5e72f0deb --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/NotificationRegistrationArrayResponseWithContinuation.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.providerhub.fluent.models.NotificationRegistrationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The NotificationRegistrationArrayResponseWithContinuation model. */ +@Fluent +public final class NotificationRegistrationArrayResponseWithContinuation { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(NotificationRegistrationArrayResponseWithContinuation.class); + + /* + * The value property. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get to the next set of results, if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the NotificationRegistrationArrayResponseWithContinuation object itself. + */ + public NotificationRegistrationArrayResponseWithContinuation withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get to the next set of results, if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get to the next set of results, if there are any. + * + * @param nextLink the nextLink value to set. + * @return the NotificationRegistrationArrayResponseWithContinuation object itself. + */ + public NotificationRegistrationArrayResponseWithContinuation withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/NotificationRegistrationProperties.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/NotificationRegistrationProperties.java new file mode 100644 index 0000000000000..9e3eb293d3921 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/NotificationRegistrationProperties.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.providerhub.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.List; + +/** The NotificationRegistrationProperties model. */ +@Immutable +public final class NotificationRegistrationProperties extends NotificationRegistrationPropertiesAutoGenerated { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NotificationRegistrationProperties.class); + + /** {@inheritDoc} */ + @Override + public NotificationRegistrationProperties withNotificationMode(NotificationMode notificationMode) { + super.withNotificationMode(notificationMode); + return this; + } + + /** {@inheritDoc} */ + @Override + public NotificationRegistrationProperties withMessageScope(MessageScope messageScope) { + super.withMessageScope(messageScope); + return this; + } + + /** {@inheritDoc} */ + @Override + public NotificationRegistrationProperties withIncludedEvents(List includedEvents) { + super.withIncludedEvents(includedEvents); + return this; + } + + /** {@inheritDoc} */ + @Override + public NotificationRegistrationProperties withNotificationEndpoints( + List notificationEndpoints) { + super.withNotificationEndpoints(notificationEndpoints); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/NotificationRegistrationPropertiesAutoGenerated.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/NotificationRegistrationPropertiesAutoGenerated.java new file mode 100644 index 0000000000000..00215cfcdecb7 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/NotificationRegistrationPropertiesAutoGenerated.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The NotificationRegistrationPropertiesAutoGenerated model. */ +@Fluent +public class NotificationRegistrationPropertiesAutoGenerated { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(NotificationRegistrationPropertiesAutoGenerated.class); + + /* + * The notificationMode property. + */ + @JsonProperty(value = "notificationMode") + private NotificationMode notificationMode; + + /* + * The messageScope property. + */ + @JsonProperty(value = "messageScope") + private MessageScope messageScope; + + /* + * The includedEvents property. + */ + @JsonProperty(value = "includedEvents") + private List includedEvents; + + /* + * The notificationEndpoints property. + */ + @JsonProperty(value = "notificationEndpoints") + private List notificationEndpoints; + + /** + * Get the notificationMode property: The notificationMode property. + * + * @return the notificationMode value. + */ + public NotificationMode notificationMode() { + return this.notificationMode; + } + + /** + * Set the notificationMode property: The notificationMode property. + * + * @param notificationMode the notificationMode value to set. + * @return the NotificationRegistrationPropertiesAutoGenerated object itself. + */ + public NotificationRegistrationPropertiesAutoGenerated withNotificationMode(NotificationMode notificationMode) { + this.notificationMode = notificationMode; + return this; + } + + /** + * Get the messageScope property: The messageScope property. + * + * @return the messageScope value. + */ + public MessageScope messageScope() { + return this.messageScope; + } + + /** + * Set the messageScope property: The messageScope property. + * + * @param messageScope the messageScope value to set. + * @return the NotificationRegistrationPropertiesAutoGenerated object itself. + */ + public NotificationRegistrationPropertiesAutoGenerated withMessageScope(MessageScope messageScope) { + this.messageScope = messageScope; + return this; + } + + /** + * Get the includedEvents property: The includedEvents property. + * + * @return the includedEvents value. + */ + public List includedEvents() { + return this.includedEvents; + } + + /** + * Set the includedEvents property: The includedEvents property. + * + * @param includedEvents the includedEvents value to set. + * @return the NotificationRegistrationPropertiesAutoGenerated object itself. + */ + public NotificationRegistrationPropertiesAutoGenerated withIncludedEvents(List includedEvents) { + this.includedEvents = includedEvents; + return this; + } + + /** + * Get the notificationEndpoints property: The notificationEndpoints property. + * + * @return the notificationEndpoints value. + */ + public List notificationEndpoints() { + return this.notificationEndpoints; + } + + /** + * Set the notificationEndpoints property: The notificationEndpoints property. + * + * @param notificationEndpoints the notificationEndpoints value to set. + * @return the NotificationRegistrationPropertiesAutoGenerated object itself. + */ + public NotificationRegistrationPropertiesAutoGenerated withNotificationEndpoints( + List notificationEndpoints) { + this.notificationEndpoints = notificationEndpoints; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (notificationEndpoints() != null) { + notificationEndpoints().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/NotificationRegistrations.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/NotificationRegistrations.java new file mode 100644 index 0000000000000..1ff3cfeedd9d7 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/NotificationRegistrations.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.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 NotificationRegistrations. */ +public interface NotificationRegistrations { + /** + * Gets the notification registration details. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param notificationRegistrationName The notification registration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the notification registration details. + */ + NotificationRegistration get(String providerNamespace, String notificationRegistrationName); + + /** + * Gets the notification registration details. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param notificationRegistrationName The notification registration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the notification registration details. + */ + Response getWithResponse( + String providerNamespace, String notificationRegistrationName, Context context); + + /** + * Deletes a notification registration. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param notificationRegistrationName The notification registration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 providerNamespace, String notificationRegistrationName); + + /** + * Deletes a notification registration. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param notificationRegistrationName The notification registration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + Response deleteWithResponse(String providerNamespace, String notificationRegistrationName, Context context); + + /** + * Gets the list of the notification registrations for the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the notification registrations for the given provider. + */ + PagedIterable listByProviderRegistration(String providerNamespace); + + /** + * Gets the list of the notification registrations for the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the notification registrations for the given provider. + */ + PagedIterable listByProviderRegistration(String providerNamespace, Context context); + + /** + * Gets the notification registration details. + * + * @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 notification registration details. + */ + NotificationRegistration getById(String id); + + /** + * Gets the notification registration details. + * + * @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 notification registration details. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a notification registration. + * + * @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); + + /** + * Deletes a notification registration. + * + * @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 response. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new NotificationRegistration resource. + * + * @param name resource name. + * @return the first stage of the new NotificationRegistration definition. + */ + NotificationRegistration.DefinitionStages.Blank define(String name); +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/Operations.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/Operations.java new file mode 100644 index 0000000000000..6b9880c9d511f --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/Operations.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.providerhub.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import java.util.List; + +/** Resource collection API of Operations. */ +public interface Operations { + /** + * Lists all the operations supported by Microsoft.ProviderHub. + * + * @throws com.azure.core.management.exception.ManagementException 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. + */ + PagedIterable list(); + + /** + * Lists all the operations supported by Microsoft.ProviderHub. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + PagedIterable list(Context context); + + /** + * Gets the operations supported by the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operations supported by the given provider. + */ + List listByProviderRegistration(String providerNamespace); + + /** + * Gets the operations supported by the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operations supported by the given provider. + */ + Response> listByProviderRegistrationWithResponse( + String providerNamespace, Context context); + + /** + * Creates or updates the operation supported by the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param operationsPutContent The operations content properties supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + OperationsContent createOrUpdate(String providerNamespace, OperationsPutContent operationsPutContent); + + /** + * Creates or updates the operation supported by the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param operationsPutContent The operations content properties supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response createOrUpdateWithResponse( + String providerNamespace, OperationsPutContent operationsPutContent, Context context); + + /** + * Deletes an operation. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 providerNamespace); + + /** + * Deletes an operation. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + Response deleteWithResponse(String providerNamespace, Context context); +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/OperationsContent.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/OperationsContent.java new file mode 100644 index 0000000000000..f0dfd362312d9 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/OperationsContent.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.resourcemanager.providerhub.fluent.models.OperationsContentInner; + +/** An immutable client-side representation of OperationsContent. */ +public interface OperationsContent { + /** + * 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 namePropertiesName property: Name of the operation. + * + * @return the namePropertiesName value. + */ + String namePropertiesName(); + + /** + * Gets the isDataAction property: Indicates whether the operation applies to data-plane. + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * Gets the origin property: The origin property. + * + * @return the origin value. + */ + OperationsDefinitionOrigin origin(); + + /** + * Gets the display property: Display information of the operation. + * + * @return the display value. + */ + OperationsDefinitionDisplay display(); + + /** + * Gets the actionType property: The actionType property. + * + * @return the actionType value. + */ + OperationsDefinitionActionType actionType(); + + /** + * Gets the properties property: Any object. + * + * @return the properties value. + */ + Object properties(); + + /** + * Gets the inner com.azure.resourcemanager.providerhub.fluent.models.OperationsContentInner object. + * + * @return the inner object. + */ + OperationsContentInner innerModel(); +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/OperationsDefinition.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/OperationsDefinition.java new file mode 100644 index 0000000000000..a1a8ec4e67aa2 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/OperationsDefinition.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.providerhub.models; + +import com.azure.resourcemanager.providerhub.fluent.models.OperationsDefinitionInner; + +/** An immutable client-side representation of OperationsDefinition. */ +public interface OperationsDefinition { + /** + * Gets the name property: Name of the operation. + * + * @return the name value. + */ + String name(); + + /** + * Gets the isDataAction property: Indicates whether the operation applies to data-plane. + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * Gets the origin property: The origin property. + * + * @return the origin value. + */ + OperationsDefinitionOrigin origin(); + + /** + * Gets the display property: Display information of the operation. + * + * @return the display value. + */ + OperationsDefinitionDisplay display(); + + /** + * Gets the actionType property: The actionType property. + * + * @return the actionType value. + */ + OperationsDefinitionActionType actionType(); + + /** + * Gets the properties property: Any object. + * + * @return the properties value. + */ + Object properties(); + + /** + * Gets the inner com.azure.resourcemanager.providerhub.fluent.models.OperationsDefinitionInner object. + * + * @return the inner object. + */ + OperationsDefinitionInner innerModel(); +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/OperationsDefinitionActionType.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/OperationsDefinitionActionType.java new file mode 100644 index 0000000000000..661ff1b6ba7c0 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/OperationsDefinitionActionType.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.providerhub.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for OperationsDefinitionActionType. */ +public final class OperationsDefinitionActionType extends ExpandableStringEnum { + /** Static value NotSpecified for OperationsDefinitionActionType. */ + public static final OperationsDefinitionActionType NOT_SPECIFIED = fromString("NotSpecified"); + + /** Static value Internal for OperationsDefinitionActionType. */ + public static final OperationsDefinitionActionType INTERNAL = fromString("Internal"); + + /** + * Creates or finds a OperationsDefinitionActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding OperationsDefinitionActionType. + */ + @JsonCreator + public static OperationsDefinitionActionType fromString(String name) { + return fromString(name, OperationsDefinitionActionType.class); + } + + /** @return known OperationsDefinitionActionType values. */ + public static Collection values() { + return values(OperationsDefinitionActionType.class); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/OperationsDefinitionArrayResponseWithContinuation.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/OperationsDefinitionArrayResponseWithContinuation.java new file mode 100644 index 0000000000000..251ccb0cde8ee --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/OperationsDefinitionArrayResponseWithContinuation.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.providerhub.fluent.models.OperationsDefinitionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The OperationsDefinitionArrayResponseWithContinuation model. */ +@Fluent +public final class OperationsDefinitionArrayResponseWithContinuation { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(OperationsDefinitionArrayResponseWithContinuation.class); + + /* + * The value property. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get to the next set of results, if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the OperationsDefinitionArrayResponseWithContinuation object itself. + */ + public OperationsDefinitionArrayResponseWithContinuation withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get to the next set of results, if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get to the next set of results, if there are any. + * + * @param nextLink the nextLink value to set. + * @return the OperationsDefinitionArrayResponseWithContinuation object itself. + */ + public OperationsDefinitionArrayResponseWithContinuation withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/OperationsDefinitionDisplay.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/OperationsDefinitionDisplay.java new file mode 100644 index 0000000000000..42db4e4e8284c --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/OperationsDefinitionDisplay.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.providerhub.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** Display information of the operation. */ +@Immutable +public final class OperationsDefinitionDisplay extends OperationsDisplayDefinition { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsDefinitionDisplay.class); + + /** {@inheritDoc} */ + @Override + public OperationsDefinitionDisplay withProvider(String provider) { + super.withProvider(provider); + return this; + } + + /** {@inheritDoc} */ + @Override + public OperationsDefinitionDisplay withResource(String resource) { + super.withResource(resource); + return this; + } + + /** {@inheritDoc} */ + @Override + public OperationsDefinitionDisplay withOperation(String operation) { + super.withOperation(operation); + return this; + } + + /** {@inheritDoc} */ + @Override + public OperationsDefinitionDisplay withDescription(String description) { + super.withDescription(description); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/OperationsDefinitionOrigin.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/OperationsDefinitionOrigin.java new file mode 100644 index 0000000000000..dd3400d37425b --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/OperationsDefinitionOrigin.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for OperationsDefinitionOrigin. */ +public final class OperationsDefinitionOrigin extends ExpandableStringEnum { + /** Static value NotSpecified for OperationsDefinitionOrigin. */ + public static final OperationsDefinitionOrigin NOT_SPECIFIED = fromString("NotSpecified"); + + /** Static value User for OperationsDefinitionOrigin. */ + public static final OperationsDefinitionOrigin USER = fromString("User"); + + /** Static value System for OperationsDefinitionOrigin. */ + public static final OperationsDefinitionOrigin SYSTEM = fromString("System"); + + /** + * Creates or finds a OperationsDefinitionOrigin from its string representation. + * + * @param name a name to look for. + * @return the corresponding OperationsDefinitionOrigin. + */ + @JsonCreator + public static OperationsDefinitionOrigin fromString(String name) { + return fromString(name, OperationsDefinitionOrigin.class); + } + + /** @return known OperationsDefinitionOrigin values. */ + public static Collection values() { + return values(OperationsDefinitionOrigin.class); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/OperationsDisplayDefinition.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/OperationsDisplayDefinition.java new file mode 100644 index 0000000000000..4ddd69504284b --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/OperationsDisplayDefinition.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The OperationsDisplayDefinition model. */ +@Fluent +public class OperationsDisplayDefinition { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsDisplayDefinition.class); + + /* + * The provider property. + */ + @JsonProperty(value = "provider", required = true) + private String provider; + + /* + * The resource property. + */ + @JsonProperty(value = "resource", required = true) + private String resource; + + /* + * The operation property. + */ + @JsonProperty(value = "operation", required = true) + private String operation; + + /* + * The description property. + */ + @JsonProperty(value = "description", required = true) + private String description; + + /** + * Get the provider property: The provider property. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider property: The provider property. + * + * @param provider the provider value to set. + * @return the OperationsDisplayDefinition object itself. + */ + public OperationsDisplayDefinition withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the resource property: The resource property. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource property: The resource property. + * + * @param resource the resource value to set. + * @return the OperationsDisplayDefinition object itself. + */ + public OperationsDisplayDefinition withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the operation property: The operation property. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation property: The operation property. + * + * @param operation the operation value to set. + * @return the OperationsDisplayDefinition object itself. + */ + public OperationsDisplayDefinition withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the description property: The description property. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description property. + * + * @param description the description value to set. + * @return the OperationsDisplayDefinition object itself. + */ + public OperationsDisplayDefinition withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (provider() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property provider in model OperationsDisplayDefinition")); + } + if (resource() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property resource in model OperationsDisplayDefinition")); + } + if (operation() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property operation in model OperationsDisplayDefinition")); + } + if (description() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property description in model OperationsDisplayDefinition")); + } + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/OperationsPutContent.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/OperationsPutContent.java new file mode 100644 index 0000000000000..ce934fd317cbd --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/OperationsPutContent.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.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.providerhub.fluent.models.OperationsDefinitionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The OperationsPutContent model. */ +@Fluent +public final class OperationsPutContent { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsPutContent.class); + + /* + * The contents property. + */ + @JsonProperty(value = "contents", required = true) + private List contents; + + /** + * Get the contents property: The contents property. + * + * @return the contents value. + */ + public List contents() { + return this.contents; + } + + /** + * Set the contents property: The contents property. + * + * @param contents the contents value to set. + * @return the OperationsPutContent object itself. + */ + public OperationsPutContent withContents(List contents) { + this.contents = contents; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (contents() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property contents in model OperationsPutContent")); + } else { + contents().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/OptInHeaderType.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/OptInHeaderType.java new file mode 100644 index 0000000000000..2f66f889973d8 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/OptInHeaderType.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.providerhub.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for OptInHeaderType. */ +public final class OptInHeaderType extends ExpandableStringEnum { + /** Static value NotSpecified for OptInHeaderType. */ + public static final OptInHeaderType NOT_SPECIFIED = fromString("NotSpecified"); + + /** Static value SignedUserToken for OptInHeaderType. */ + public static final OptInHeaderType SIGNED_USER_TOKEN = fromString("SignedUserToken"); + + /** Static value ClientGroupMembership for OptInHeaderType. */ + public static final OptInHeaderType CLIENT_GROUP_MEMBERSHIP = fromString("ClientGroupMembership"); + + /** Static value SignedAuxiliaryTokens for OptInHeaderType. */ + public static final OptInHeaderType SIGNED_AUXILIARY_TOKENS = fromString("SignedAuxiliaryTokens"); + + /** Static value UnboundedClientGroupMembership for OptInHeaderType. */ + public static final OptInHeaderType UNBOUNDED_CLIENT_GROUP_MEMBERSHIP = + fromString("UnboundedClientGroupMembership"); + + /** + * Creates or finds a OptInHeaderType from its string representation. + * + * @param name a name to look for. + * @return the corresponding OptInHeaderType. + */ + @JsonCreator + public static OptInHeaderType fromString(String name) { + return fromString(name, OptInHeaderType.class); + } + + /** @return known OptInHeaderType values. */ + public static Collection values() { + return values(OptInHeaderType.class); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/PreflightOption.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/PreflightOption.java new file mode 100644 index 0000000000000..9d9b8f6f5df67 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/PreflightOption.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PreflightOption. */ +public final class PreflightOption extends ExpandableStringEnum { + /** Static value None for PreflightOption. */ + public static final PreflightOption NONE = fromString("None"); + + /** Static value ContinueDeploymentOnFailure for PreflightOption. */ + public static final PreflightOption CONTINUE_DEPLOYMENT_ON_FAILURE = fromString("ContinueDeploymentOnFailure"); + + /** Static value DefaultValidationOnly for PreflightOption. */ + public static final PreflightOption DEFAULT_VALIDATION_ONLY = fromString("DefaultValidationOnly"); + + /** + * Creates or finds a PreflightOption from its string representation. + * + * @param name a name to look for. + * @return the corresponding PreflightOption. + */ + @JsonCreator + public static PreflightOption fromString(String name) { + return fromString(name, PreflightOption.class); + } + + /** @return known PreflightOption values. */ + public static Collection values() { + return values(PreflightOption.class); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ProviderHubMetadata.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ProviderHubMetadata.java new file mode 100644 index 0000000000000..65ae80da72f84 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ProviderHubMetadata.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.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The ProviderHubMetadata model. */ +@Fluent +public class ProviderHubMetadata { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProviderHubMetadata.class); + + /* + * The providerAuthorizations property. + */ + @JsonProperty(value = "providerAuthorizations") + private List providerAuthorizations; + + /* + * The providerAuthentication property. + */ + @JsonProperty(value = "providerAuthentication") + private ProviderHubMetadataProviderAuthentication providerAuthentication; + + /* + * The thirdPartyProviderAuthorization property. + */ + @JsonProperty(value = "thirdPartyProviderAuthorization") + private ProviderHubMetadataThirdPartyProviderAuthorization thirdPartyProviderAuthorization; + + /** + * Get the providerAuthorizations property: The providerAuthorizations property. + * + * @return the providerAuthorizations value. + */ + public List providerAuthorizations() { + return this.providerAuthorizations; + } + + /** + * Set the providerAuthorizations property: The providerAuthorizations property. + * + * @param providerAuthorizations the providerAuthorizations value to set. + * @return the ProviderHubMetadata object itself. + */ + public ProviderHubMetadata withProviderAuthorizations(List providerAuthorizations) { + this.providerAuthorizations = providerAuthorizations; + return this; + } + + /** + * Get the providerAuthentication property: The providerAuthentication property. + * + * @return the providerAuthentication value. + */ + public ProviderHubMetadataProviderAuthentication providerAuthentication() { + return this.providerAuthentication; + } + + /** + * Set the providerAuthentication property: The providerAuthentication property. + * + * @param providerAuthentication the providerAuthentication value to set. + * @return the ProviderHubMetadata object itself. + */ + public ProviderHubMetadata withProviderAuthentication( + ProviderHubMetadataProviderAuthentication providerAuthentication) { + this.providerAuthentication = providerAuthentication; + return this; + } + + /** + * Get the thirdPartyProviderAuthorization property: The thirdPartyProviderAuthorization property. + * + * @return the thirdPartyProviderAuthorization value. + */ + public ProviderHubMetadataThirdPartyProviderAuthorization thirdPartyProviderAuthorization() { + return this.thirdPartyProviderAuthorization; + } + + /** + * Set the thirdPartyProviderAuthorization property: The thirdPartyProviderAuthorization property. + * + * @param thirdPartyProviderAuthorization the thirdPartyProviderAuthorization value to set. + * @return the ProviderHubMetadata object itself. + */ + public ProviderHubMetadata withThirdPartyProviderAuthorization( + ProviderHubMetadataThirdPartyProviderAuthorization thirdPartyProviderAuthorization) { + this.thirdPartyProviderAuthorization = thirdPartyProviderAuthorization; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (providerAuthorizations() != null) { + providerAuthorizations().forEach(e -> e.validate()); + } + if (providerAuthentication() != null) { + providerAuthentication().validate(); + } + if (thirdPartyProviderAuthorization() != null) { + thirdPartyProviderAuthorization().validate(); + } + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ProviderHubMetadataProviderAuthentication.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ProviderHubMetadataProviderAuthentication.java new file mode 100644 index 0000000000000..996d949785e34 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ProviderHubMetadataProviderAuthentication.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.List; + +/** The ProviderHubMetadataProviderAuthentication model. */ +@Immutable +public final class ProviderHubMetadataProviderAuthentication extends ResourceProviderAuthentication { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProviderHubMetadataProviderAuthentication.class); + + /** {@inheritDoc} */ + @Override + public ProviderHubMetadataProviderAuthentication withAllowedAudiences(List allowedAudiences) { + super.withAllowedAudiences(allowedAudiences); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ProviderHubMetadataThirdPartyProviderAuthorization.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ProviderHubMetadataThirdPartyProviderAuthorization.java new file mode 100644 index 0000000000000..b1404ab028b6d --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ProviderHubMetadataThirdPartyProviderAuthorization.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.List; + +/** The ProviderHubMetadataThirdPartyProviderAuthorization model. */ +@Immutable +public final class ProviderHubMetadataThirdPartyProviderAuthorization extends ThirdPartyProviderAuthorization { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ProviderHubMetadataThirdPartyProviderAuthorization.class); + + /** {@inheritDoc} */ + @Override + public ProviderHubMetadataThirdPartyProviderAuthorization withAuthorizations( + List authorizations) { + super.withAuthorizations(authorizations); + return this; + } + + /** {@inheritDoc} */ + @Override + public ProviderHubMetadataThirdPartyProviderAuthorization withManagedByTenantId(String managedByTenantId) { + super.withManagedByTenantId(managedByTenantId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ProviderRegistration.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ProviderRegistration.java new file mode 100644 index 0000000000000..834c26a89990b --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ProviderRegistration.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.providerhub.models; + +import com.azure.resourcemanager.providerhub.fluent.models.ProviderRegistrationInner; + +/** An immutable client-side representation of ProviderRegistration. */ +public interface ProviderRegistration { + /** + * 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 properties property: The properties property. + * + * @return the properties value. + */ + ProviderRegistrationProperties properties(); + + /** + * Gets the inner com.azure.resourcemanager.providerhub.fluent.models.ProviderRegistrationInner object. + * + * @return the inner object. + */ + ProviderRegistrationInner innerModel(); +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ProviderRegistrationArrayResponseWithContinuation.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ProviderRegistrationArrayResponseWithContinuation.java new file mode 100644 index 0000000000000..e55a2aa9f029f --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ProviderRegistrationArrayResponseWithContinuation.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.providerhub.fluent.models.ProviderRegistrationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The ProviderRegistrationArrayResponseWithContinuation model. */ +@Fluent +public final class ProviderRegistrationArrayResponseWithContinuation { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ProviderRegistrationArrayResponseWithContinuation.class); + + /* + * The value property. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get to the next set of results, if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the ProviderRegistrationArrayResponseWithContinuation object itself. + */ + public ProviderRegistrationArrayResponseWithContinuation withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get to the next set of results, if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get to the next set of results, if there are any. + * + * @param nextLink the nextLink value to set. + * @return the ProviderRegistrationArrayResponseWithContinuation object itself. + */ + public ProviderRegistrationArrayResponseWithContinuation withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ProviderRegistrationProperties.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ProviderRegistrationProperties.java new file mode 100644 index 0000000000000..135cfa461ebfb --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ProviderRegistrationProperties.java @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.List; + +/** The ProviderRegistrationProperties model. */ +@Immutable +public final class ProviderRegistrationProperties extends ProviderRegistrationPropertiesAutoGenerated { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProviderRegistrationProperties.class); + + /** {@inheritDoc} */ + @Override + public ProviderRegistrationProperties withProviderHubMetadata( + ProviderRegistrationPropertiesProviderHubMetadata providerHubMetadata) { + super.withProviderHubMetadata(providerHubMetadata); + return this; + } + + /** {@inheritDoc} */ + @Override + public ProviderRegistrationProperties withProvisioningState(ProvisioningState provisioningState) { + super.withProvisioningState(provisioningState); + return this; + } + + /** {@inheritDoc} */ + @Override + public ProviderRegistrationProperties withSubscriptionLifecycleNotificationSpecifications( + ProviderRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications + subscriptionLifecycleNotificationSpecifications) { + super.withSubscriptionLifecycleNotificationSpecifications(subscriptionLifecycleNotificationSpecifications); + return this; + } + + /** {@inheritDoc} */ + @Override + public ProviderRegistrationProperties withProviderAuthentication( + ResourceProviderManifestPropertiesProviderAuthentication providerAuthentication) { + super.withProviderAuthentication(providerAuthentication); + return this; + } + + /** {@inheritDoc} */ + @Override + public ProviderRegistrationProperties withProviderAuthorizations( + List providerAuthorizations) { + super.withProviderAuthorizations(providerAuthorizations); + return this; + } + + /** {@inheritDoc} */ + @Override + public ProviderRegistrationProperties withNamespace(String namespace) { + super.withNamespace(namespace); + return this; + } + + /** {@inheritDoc} */ + @Override + public ProviderRegistrationProperties withProviderVersion(String providerVersion) { + super.withProviderVersion(providerVersion); + return this; + } + + /** {@inheritDoc} */ + @Override + public ProviderRegistrationProperties withProviderType(ResourceProviderType providerType) { + super.withProviderType(providerType); + return this; + } + + /** {@inheritDoc} */ + @Override + public ProviderRegistrationProperties withRequiredFeatures(List requiredFeatures) { + super.withRequiredFeatures(requiredFeatures); + return this; + } + + /** {@inheritDoc} */ + @Override + public ProviderRegistrationProperties withFeaturesRule( + ResourceProviderManifestPropertiesFeaturesRule featuresRule) { + super.withFeaturesRule(featuresRule); + return this; + } + + /** {@inheritDoc} */ + @Override + public ProviderRegistrationProperties withRequestHeaderOptions( + ResourceProviderManifestPropertiesRequestHeaderOptions requestHeaderOptions) { + super.withRequestHeaderOptions(requestHeaderOptions); + return this; + } + + /** {@inheritDoc} */ + @Override + public ProviderRegistrationProperties withManagement(ResourceProviderManifestPropertiesManagement management) { + super.withManagement(management); + return this; + } + + /** {@inheritDoc} */ + @Override + public ProviderRegistrationProperties withCapabilities(List capabilities) { + super.withCapabilities(capabilities); + return this; + } + + /** {@inheritDoc} */ + @Override + public ProviderRegistrationProperties withMetadata(Object metadata) { + super.withMetadata(metadata); + return this; + } + + /** {@inheritDoc} */ + @Override + public ProviderRegistrationProperties withTemplateDeploymentOptions( + ResourceProviderManifestPropertiesTemplateDeploymentOptions templateDeploymentOptions) { + super.withTemplateDeploymentOptions(templateDeploymentOptions); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ProviderRegistrationPropertiesAutoGenerated.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ProviderRegistrationPropertiesAutoGenerated.java new file mode 100644 index 0000000000000..c2c11211e88c0 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ProviderRegistrationPropertiesAutoGenerated.java @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The ProviderRegistrationPropertiesAutoGenerated model. */ +@Fluent +public class ProviderRegistrationPropertiesAutoGenerated extends ResourceProviderManifestProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProviderRegistrationPropertiesAutoGenerated.class); + + /* + * The providerHubMetadata property. + */ + @JsonProperty(value = "providerHubMetadata") + private ProviderRegistrationPropertiesProviderHubMetadata providerHubMetadata; + + /* + * The provisioningState property. + */ + @JsonProperty(value = "provisioningState") + private ProvisioningState provisioningState; + + /* + * The subscriptionLifecycleNotificationSpecifications property. + */ + @JsonProperty(value = "subscriptionLifecycleNotificationSpecifications") + private ProviderRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications + subscriptionLifecycleNotificationSpecifications; + + /** + * Get the providerHubMetadata property: The providerHubMetadata property. + * + * @return the providerHubMetadata value. + */ + public ProviderRegistrationPropertiesProviderHubMetadata providerHubMetadata() { + return this.providerHubMetadata; + } + + /** + * Set the providerHubMetadata property: The providerHubMetadata property. + * + * @param providerHubMetadata the providerHubMetadata value to set. + * @return the ProviderRegistrationPropertiesAutoGenerated object itself. + */ + public ProviderRegistrationPropertiesAutoGenerated withProviderHubMetadata( + ProviderRegistrationPropertiesProviderHubMetadata providerHubMetadata) { + this.providerHubMetadata = providerHubMetadata; + return this; + } + + /** + * Get the provisioningState property: The provisioningState property. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: The provisioningState property. + * + * @param provisioningState the provisioningState value to set. + * @return the ProviderRegistrationPropertiesAutoGenerated object itself. + */ + public ProviderRegistrationPropertiesAutoGenerated withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the subscriptionLifecycleNotificationSpecifications property: The + * subscriptionLifecycleNotificationSpecifications property. + * + * @return the subscriptionLifecycleNotificationSpecifications value. + */ + public ProviderRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications + subscriptionLifecycleNotificationSpecifications() { + return this.subscriptionLifecycleNotificationSpecifications; + } + + /** + * Set the subscriptionLifecycleNotificationSpecifications property: The + * subscriptionLifecycleNotificationSpecifications property. + * + * @param subscriptionLifecycleNotificationSpecifications the subscriptionLifecycleNotificationSpecifications value + * to set. + * @return the ProviderRegistrationPropertiesAutoGenerated object itself. + */ + public ProviderRegistrationPropertiesAutoGenerated withSubscriptionLifecycleNotificationSpecifications( + ProviderRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications + subscriptionLifecycleNotificationSpecifications) { + this.subscriptionLifecycleNotificationSpecifications = subscriptionLifecycleNotificationSpecifications; + return this; + } + + /** {@inheritDoc} */ + @Override + public ProviderRegistrationPropertiesAutoGenerated withProviderAuthentication( + ResourceProviderManifestPropertiesProviderAuthentication providerAuthentication) { + super.withProviderAuthentication(providerAuthentication); + return this; + } + + /** {@inheritDoc} */ + @Override + public ProviderRegistrationPropertiesAutoGenerated withProviderAuthorizations( + List providerAuthorizations) { + super.withProviderAuthorizations(providerAuthorizations); + return this; + } + + /** {@inheritDoc} */ + @Override + public ProviderRegistrationPropertiesAutoGenerated withNamespace(String namespace) { + super.withNamespace(namespace); + return this; + } + + /** {@inheritDoc} */ + @Override + public ProviderRegistrationPropertiesAutoGenerated withProviderVersion(String providerVersion) { + super.withProviderVersion(providerVersion); + return this; + } + + /** {@inheritDoc} */ + @Override + public ProviderRegistrationPropertiesAutoGenerated withProviderType(ResourceProviderType providerType) { + super.withProviderType(providerType); + return this; + } + + /** {@inheritDoc} */ + @Override + public ProviderRegistrationPropertiesAutoGenerated withRequiredFeatures(List requiredFeatures) { + super.withRequiredFeatures(requiredFeatures); + return this; + } + + /** {@inheritDoc} */ + @Override + public ProviderRegistrationPropertiesAutoGenerated withFeaturesRule( + ResourceProviderManifestPropertiesFeaturesRule featuresRule) { + super.withFeaturesRule(featuresRule); + return this; + } + + /** {@inheritDoc} */ + @Override + public ProviderRegistrationPropertiesAutoGenerated withRequestHeaderOptions( + ResourceProviderManifestPropertiesRequestHeaderOptions requestHeaderOptions) { + super.withRequestHeaderOptions(requestHeaderOptions); + return this; + } + + /** {@inheritDoc} */ + @Override + public ProviderRegistrationPropertiesAutoGenerated withManagement( + ResourceProviderManifestPropertiesManagement management) { + super.withManagement(management); + return this; + } + + /** {@inheritDoc} */ + @Override + public ProviderRegistrationPropertiesAutoGenerated withCapabilities( + List capabilities) { + super.withCapabilities(capabilities); + return this; + } + + /** {@inheritDoc} */ + @Override + public ProviderRegistrationPropertiesAutoGenerated withMetadata(Object metadata) { + super.withMetadata(metadata); + return this; + } + + /** {@inheritDoc} */ + @Override + public ProviderRegistrationPropertiesAutoGenerated withTemplateDeploymentOptions( + ResourceProviderManifestPropertiesTemplateDeploymentOptions templateDeploymentOptions) { + super.withTemplateDeploymentOptions(templateDeploymentOptions); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (providerHubMetadata() != null) { + providerHubMetadata().validate(); + } + if (subscriptionLifecycleNotificationSpecifications() != null) { + subscriptionLifecycleNotificationSpecifications().validate(); + } + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ProviderRegistrationPropertiesProviderHubMetadata.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ProviderRegistrationPropertiesProviderHubMetadata.java new file mode 100644 index 0000000000000..016b3da290cbe --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ProviderRegistrationPropertiesProviderHubMetadata.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.providerhub.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.List; + +/** The ProviderRegistrationPropertiesProviderHubMetadata model. */ +@Immutable +public final class ProviderRegistrationPropertiesProviderHubMetadata extends ProviderHubMetadata { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ProviderRegistrationPropertiesProviderHubMetadata.class); + + /** {@inheritDoc} */ + @Override + public ProviderRegistrationPropertiesProviderHubMetadata withProviderAuthorizations( + List providerAuthorizations) { + super.withProviderAuthorizations(providerAuthorizations); + return this; + } + + /** {@inheritDoc} */ + @Override + public ProviderRegistrationPropertiesProviderHubMetadata withProviderAuthentication( + ProviderHubMetadataProviderAuthentication providerAuthentication) { + super.withProviderAuthentication(providerAuthentication); + return this; + } + + /** {@inheritDoc} */ + @Override + public ProviderRegistrationPropertiesProviderHubMetadata withThirdPartyProviderAuthorization( + ProviderHubMetadataThirdPartyProviderAuthorization thirdPartyProviderAuthorization) { + super.withThirdPartyProviderAuthorization(thirdPartyProviderAuthorization); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ProviderRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ProviderRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications.java new file mode 100644 index 0000000000000..b89c3a4399afd --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ProviderRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.time.Duration; +import java.util.List; + +/** The ProviderRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications model. */ +@Immutable +public final class ProviderRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications + extends SubscriptionLifecycleNotificationSpecifications { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(ProviderRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications.class); + + /** {@inheritDoc} */ + @Override + public ProviderRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications + withSubscriptionStateOverrideActions(List subscriptionStateOverrideActions) { + super.withSubscriptionStateOverrideActions(subscriptionStateOverrideActions); + return this; + } + + /** {@inheritDoc} */ + @Override + public ProviderRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications withSoftDeleteTtl( + Duration softDeleteTtl) { + super.withSoftDeleteTtl(softDeleteTtl); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ProviderRegistrations.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ProviderRegistrations.java new file mode 100644 index 0000000000000..6a701db11812c --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ProviderRegistrations.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.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.providerhub.fluent.models.ProviderRegistrationInner; +import java.util.List; + +/** Resource collection API of ProviderRegistrations. */ +public interface ProviderRegistrations { + /** + * Gets the provider registration details. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the provider registration details. + */ + ProviderRegistration get(String providerNamespace); + + /** + * Gets the provider registration details. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the provider registration details. + */ + Response getWithResponse(String providerNamespace, Context context); + + /** + * Creates or updates the provider registration. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param properties The provider registration properties supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + ProviderRegistration createOrUpdate(String providerNamespace, ProviderRegistrationInner properties); + + /** + * Creates or updates the provider registration. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param properties The provider registration properties supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + ProviderRegistration createOrUpdate( + String providerNamespace, ProviderRegistrationInner properties, Context context); + + /** + * Deletes a provider registration. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 providerNamespace); + + /** + * Deletes a provider registration. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + Response deleteWithResponse(String providerNamespace, Context context); + + /** + * Gets the list of the provider registrations in the subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the provider registrations in the subscription. + */ + PagedIterable list(); + + /** + * Gets the list of the provider registrations in the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the provider registrations in the subscription. + */ + PagedIterable list(Context context); + + /** + * Generates the operations api for the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return array of OperationsDefinition. + */ + List generateOperations(String providerNamespace); + + /** + * Generates the operations api for the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return array of OperationsDefinition. + */ + Response> generateOperationsWithResponse(String providerNamespace, Context context); +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ProvisioningState.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ProvisioningState.java new file mode 100644 index 0000000000000..937539c4675b6 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ProvisioningState.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ProvisioningState. */ +public final class ProvisioningState extends ExpandableStringEnum { + /** Static value NotSpecified for ProvisioningState. */ + public static final ProvisioningState NOT_SPECIFIED = fromString("NotSpecified"); + + /** Static value Accepted for ProvisioningState. */ + public static final ProvisioningState ACCEPTED = fromString("Accepted"); + + /** Static value Running for ProvisioningState. */ + public static final ProvisioningState RUNNING = fromString("Running"); + + /** Static value Creating for ProvisioningState. */ + public static final ProvisioningState CREATING = fromString("Creating"); + + /** Static value Created for ProvisioningState. */ + public static final ProvisioningState CREATED = fromString("Created"); + + /** Static value Deleting for ProvisioningState. */ + public static final ProvisioningState DELETING = fromString("Deleting"); + + /** Static value Deleted for ProvisioningState. */ + public static final ProvisioningState DELETED = fromString("Deleted"); + + /** Static value Canceled for ProvisioningState. */ + public static final ProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Failed for ProvisioningState. */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** Static value Succeeded for ProvisioningState. */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value MovingResources for ProvisioningState. */ + public static final ProvisioningState MOVING_RESOURCES = fromString("MovingResources"); + + /** Static value TransientFailure for ProvisioningState. */ + public static final ProvisioningState TRANSIENT_FAILURE = fromString("TransientFailure"); + + /** Static value RolloutInProgress for ProvisioningState. */ + public static final ProvisioningState ROLLOUT_IN_PROGRESS = fromString("RolloutInProgress"); + + /** + * Creates or finds a ProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProvisioningState. + */ + @JsonCreator + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** @return known ProvisioningState values. */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ReRegisterSubscriptionMetadata.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ReRegisterSubscriptionMetadata.java new file mode 100644 index 0000000000000..5ef118c2442a7 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ReRegisterSubscriptionMetadata.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.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ReRegisterSubscriptionMetadata model. */ +@Fluent +public class ReRegisterSubscriptionMetadata { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ReRegisterSubscriptionMetadata.class); + + /* + * The enabled property. + */ + @JsonProperty(value = "enabled", required = true) + private boolean enabled; + + /* + * The concurrencyLimit property. + */ + @JsonProperty(value = "concurrencyLimit") + private Integer concurrencyLimit; + + /** + * Get the enabled property: The enabled property. + * + * @return the enabled value. + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: The enabled property. + * + * @param enabled the enabled value to set. + * @return the ReRegisterSubscriptionMetadata object itself. + */ + public ReRegisterSubscriptionMetadata withEnabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the concurrencyLimit property: The concurrencyLimit property. + * + * @return the concurrencyLimit value. + */ + public Integer concurrencyLimit() { + return this.concurrencyLimit; + } + + /** + * Set the concurrencyLimit property: The concurrencyLimit property. + * + * @param concurrencyLimit the concurrencyLimit value to set. + * @return the ReRegisterSubscriptionMetadata object itself. + */ + public ReRegisterSubscriptionMetadata withConcurrencyLimit(Integer concurrencyLimit) { + this.concurrencyLimit = concurrencyLimit; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/Regionality.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/Regionality.java new file mode 100644 index 0000000000000..670ee20d06098 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/Regionality.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Regionality. */ +public final class Regionality extends ExpandableStringEnum { + /** Static value NotSpecified for Regionality. */ + public static final Regionality NOT_SPECIFIED = fromString("NotSpecified"); + + /** Static value Global for Regionality. */ + public static final Regionality GLOBAL = fromString("Global"); + + /** Static value Regional for Regionality. */ + public static final Regionality REGIONAL = fromString("Regional"); + + /** + * Creates or finds a Regionality from its string representation. + * + * @param name a name to look for. + * @return the corresponding Regionality. + */ + @JsonCreator + public static Regionality fromString(String name) { + return fromString(name, Regionality.class); + } + + /** @return known Regionality values. */ + public static Collection values() { + return values(Regionality.class); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/RequestHeaderOptions.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/RequestHeaderOptions.java new file mode 100644 index 0000000000000..5080a8b761906 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/RequestHeaderOptions.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.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The RequestHeaderOptions model. */ +@Fluent +public class RequestHeaderOptions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RequestHeaderOptions.class); + + /* + * The optInHeaders property. + */ + @JsonProperty(value = "optInHeaders") + private OptInHeaderType optInHeaders; + + /** + * Get the optInHeaders property: The optInHeaders property. + * + * @return the optInHeaders value. + */ + public OptInHeaderType optInHeaders() { + return this.optInHeaders; + } + + /** + * Set the optInHeaders property: The optInHeaders property. + * + * @param optInHeaders the optInHeaders value to set. + * @return the RequestHeaderOptions object itself. + */ + public RequestHeaderOptions withOptInHeaders(OptInHeaderType optInHeaders) { + this.optInHeaders = optInHeaders; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceDeletionPolicy.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceDeletionPolicy.java new file mode 100644 index 0000000000000..59db963410e92 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceDeletionPolicy.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.providerhub.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ResourceDeletionPolicy. */ +public final class ResourceDeletionPolicy extends ExpandableStringEnum { + /** Static value NotSpecified for ResourceDeletionPolicy. */ + public static final ResourceDeletionPolicy NOT_SPECIFIED = fromString("NotSpecified"); + + /** Static value CascadeDeleteAll for ResourceDeletionPolicy. */ + public static final ResourceDeletionPolicy CASCADE_DELETE_ALL = fromString("CascadeDeleteAll"); + + /** Static value CascadeDeleteProxyOnlyChildren for ResourceDeletionPolicy. */ + public static final ResourceDeletionPolicy CASCADE_DELETE_PROXY_ONLY_CHILDREN = + fromString("CascadeDeleteProxyOnlyChildren"); + + /** + * Creates or finds a ResourceDeletionPolicy from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResourceDeletionPolicy. + */ + @JsonCreator + public static ResourceDeletionPolicy fromString(String name) { + return fromString(name, ResourceDeletionPolicy.class); + } + + /** @return known ResourceDeletionPolicy values. */ + public static Collection values() { + return values(ResourceDeletionPolicy.class); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceMovePolicy.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceMovePolicy.java new file mode 100644 index 0000000000000..586e423f7a0b2 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceMovePolicy.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ResourceMovePolicy model. */ +@Fluent +public class ResourceMovePolicy { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceMovePolicy.class); + + /* + * The validationRequired property. + */ + @JsonProperty(value = "validationRequired") + private Boolean validationRequired; + + /* + * The crossResourceGroupMoveEnabled property. + */ + @JsonProperty(value = "crossResourceGroupMoveEnabled") + private Boolean crossResourceGroupMoveEnabled; + + /* + * The crossSubscriptionMoveEnabled property. + */ + @JsonProperty(value = "crossSubscriptionMoveEnabled") + private Boolean crossSubscriptionMoveEnabled; + + /** + * Get the validationRequired property: The validationRequired property. + * + * @return the validationRequired value. + */ + public Boolean validationRequired() { + return this.validationRequired; + } + + /** + * Set the validationRequired property: The validationRequired property. + * + * @param validationRequired the validationRequired value to set. + * @return the ResourceMovePolicy object itself. + */ + public ResourceMovePolicy withValidationRequired(Boolean validationRequired) { + this.validationRequired = validationRequired; + return this; + } + + /** + * Get the crossResourceGroupMoveEnabled property: The crossResourceGroupMoveEnabled property. + * + * @return the crossResourceGroupMoveEnabled value. + */ + public Boolean crossResourceGroupMoveEnabled() { + return this.crossResourceGroupMoveEnabled; + } + + /** + * Set the crossResourceGroupMoveEnabled property: The crossResourceGroupMoveEnabled property. + * + * @param crossResourceGroupMoveEnabled the crossResourceGroupMoveEnabled value to set. + * @return the ResourceMovePolicy object itself. + */ + public ResourceMovePolicy withCrossResourceGroupMoveEnabled(Boolean crossResourceGroupMoveEnabled) { + this.crossResourceGroupMoveEnabled = crossResourceGroupMoveEnabled; + return this; + } + + /** + * Get the crossSubscriptionMoveEnabled property: The crossSubscriptionMoveEnabled property. + * + * @return the crossSubscriptionMoveEnabled value. + */ + public Boolean crossSubscriptionMoveEnabled() { + return this.crossSubscriptionMoveEnabled; + } + + /** + * Set the crossSubscriptionMoveEnabled property: The crossSubscriptionMoveEnabled property. + * + * @param crossSubscriptionMoveEnabled the crossSubscriptionMoveEnabled value to set. + * @return the ResourceMovePolicy object itself. + */ + public ResourceMovePolicy withCrossSubscriptionMoveEnabled(Boolean crossSubscriptionMoveEnabled) { + this.crossSubscriptionMoveEnabled = crossSubscriptionMoveEnabled; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviderAuthentication.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviderAuthentication.java new file mode 100644 index 0000000000000..9e8a085084720 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviderAuthentication.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The ResourceProviderAuthentication model. */ +@Fluent +public class ResourceProviderAuthentication { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceProviderAuthentication.class); + + /* + * The allowedAudiences property. + */ + @JsonProperty(value = "allowedAudiences", required = true) + private List allowedAudiences; + + /** + * Get the allowedAudiences property: The allowedAudiences property. + * + * @return the allowedAudiences value. + */ + public List allowedAudiences() { + return this.allowedAudiences; + } + + /** + * Set the allowedAudiences property: The allowedAudiences property. + * + * @param allowedAudiences the allowedAudiences value to set. + * @return the ResourceProviderAuthentication object itself. + */ + public ResourceProviderAuthentication withAllowedAudiences(List allowedAudiences) { + this.allowedAudiences = allowedAudiences; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (allowedAudiences() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property allowedAudiences in model ResourceProviderAuthentication")); + } + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviderAuthorization.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviderAuthorization.java new file mode 100644 index 0000000000000..806546752457e --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviderAuthorization.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ResourceProviderAuthorization model. */ +@Fluent +public final class ResourceProviderAuthorization { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceProviderAuthorization.class); + + /* + * The applicationId property. + */ + @JsonProperty(value = "applicationId") + private String applicationId; + + /* + * The roleDefinitionId property. + */ + @JsonProperty(value = "roleDefinitionId") + private String roleDefinitionId; + + /* + * The managedByRoleDefinitionId property. + */ + @JsonProperty(value = "managedByRoleDefinitionId") + private String managedByRoleDefinitionId; + + /** + * Get the applicationId property: The applicationId property. + * + * @return the applicationId value. + */ + public String applicationId() { + return this.applicationId; + } + + /** + * Set the applicationId property: The applicationId property. + * + * @param applicationId the applicationId value to set. + * @return the ResourceProviderAuthorization object itself. + */ + public ResourceProviderAuthorization withApplicationId(String applicationId) { + this.applicationId = applicationId; + return this; + } + + /** + * Get the roleDefinitionId property: The roleDefinitionId property. + * + * @return the roleDefinitionId value. + */ + public String roleDefinitionId() { + return this.roleDefinitionId; + } + + /** + * Set the roleDefinitionId property: The roleDefinitionId property. + * + * @param roleDefinitionId the roleDefinitionId value to set. + * @return the ResourceProviderAuthorization object itself. + */ + public ResourceProviderAuthorization withRoleDefinitionId(String roleDefinitionId) { + this.roleDefinitionId = roleDefinitionId; + return this; + } + + /** + * Get the managedByRoleDefinitionId property: The managedByRoleDefinitionId property. + * + * @return the managedByRoleDefinitionId value. + */ + public String managedByRoleDefinitionId() { + return this.managedByRoleDefinitionId; + } + + /** + * Set the managedByRoleDefinitionId property: The managedByRoleDefinitionId property. + * + * @param managedByRoleDefinitionId the managedByRoleDefinitionId value to set. + * @return the ResourceProviderAuthorization object itself. + */ + public ResourceProviderAuthorization withManagedByRoleDefinitionId(String managedByRoleDefinitionId) { + this.managedByRoleDefinitionId = managedByRoleDefinitionId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviderCapabilities.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviderCapabilities.java new file mode 100644 index 0000000000000..022b388720dfb --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviderCapabilities.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The ResourceProviderCapabilities model. */ +@Fluent +public final class ResourceProviderCapabilities { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceProviderCapabilities.class); + + /* + * The quotaId property. + */ + @JsonProperty(value = "quotaId", required = true) + private String quotaId; + + /* + * The effect property. + */ + @JsonProperty(value = "effect", required = true) + private ResourceProviderCapabilitiesEffect effect; + + /* + * The requiredFeatures property. + */ + @JsonProperty(value = "requiredFeatures") + private List requiredFeatures; + + /** + * Get the quotaId property: The quotaId property. + * + * @return the quotaId value. + */ + public String quotaId() { + return this.quotaId; + } + + /** + * Set the quotaId property: The quotaId property. + * + * @param quotaId the quotaId value to set. + * @return the ResourceProviderCapabilities object itself. + */ + public ResourceProviderCapabilities withQuotaId(String quotaId) { + this.quotaId = quotaId; + return this; + } + + /** + * Get the effect property: The effect property. + * + * @return the effect value. + */ + public ResourceProviderCapabilitiesEffect effect() { + return this.effect; + } + + /** + * Set the effect property: The effect property. + * + * @param effect the effect value to set. + * @return the ResourceProviderCapabilities object itself. + */ + public ResourceProviderCapabilities withEffect(ResourceProviderCapabilitiesEffect effect) { + this.effect = effect; + return this; + } + + /** + * Get the requiredFeatures property: The requiredFeatures property. + * + * @return the requiredFeatures value. + */ + public List requiredFeatures() { + return this.requiredFeatures; + } + + /** + * Set the requiredFeatures property: The requiredFeatures property. + * + * @param requiredFeatures the requiredFeatures value to set. + * @return the ResourceProviderCapabilities object itself. + */ + public ResourceProviderCapabilities withRequiredFeatures(List requiredFeatures) { + this.requiredFeatures = requiredFeatures; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (quotaId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property quotaId in model ResourceProviderCapabilities")); + } + if (effect() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property effect in model ResourceProviderCapabilities")); + } + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviderCapabilitiesEffect.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviderCapabilitiesEffect.java new file mode 100644 index 0000000000000..9b4e34c2aa868 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviderCapabilitiesEffect.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ResourceProviderCapabilitiesEffect. */ +public final class ResourceProviderCapabilitiesEffect extends ExpandableStringEnum { + /** Static value NotSpecified for ResourceProviderCapabilitiesEffect. */ + public static final ResourceProviderCapabilitiesEffect NOT_SPECIFIED = fromString("NotSpecified"); + + /** Static value Allow for ResourceProviderCapabilitiesEffect. */ + public static final ResourceProviderCapabilitiesEffect ALLOW = fromString("Allow"); + + /** Static value Disallow for ResourceProviderCapabilitiesEffect. */ + public static final ResourceProviderCapabilitiesEffect DISALLOW = fromString("Disallow"); + + /** + * Creates or finds a ResourceProviderCapabilitiesEffect from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResourceProviderCapabilitiesEffect. + */ + @JsonCreator + public static ResourceProviderCapabilitiesEffect fromString(String name) { + return fromString(name, ResourceProviderCapabilitiesEffect.class); + } + + /** @return known ResourceProviderCapabilitiesEffect values. */ + public static Collection values() { + return values(ResourceProviderCapabilitiesEffect.class); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviderEndpoint.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviderEndpoint.java new file mode 100644 index 0000000000000..6287ec67427dc --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviderEndpoint.java @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.Duration; +import java.util.List; + +/** The ResourceProviderEndpoint model. */ +@Fluent +public final class ResourceProviderEndpoint { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceProviderEndpoint.class); + + /* + * The enabled property. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * The apiVersions property. + */ + @JsonProperty(value = "apiVersions") + private List apiVersions; + + /* + * The endpointUri property. + */ + @JsonProperty(value = "endpointUri") + private String endpointUri; + + /* + * The locations property. + */ + @JsonProperty(value = "locations") + private List locations; + + /* + * The requiredFeatures property. + */ + @JsonProperty(value = "requiredFeatures") + private List requiredFeatures; + + /* + * The featuresRule property. + */ + @JsonProperty(value = "featuresRule") + private ResourceProviderEndpointFeaturesRule featuresRule; + + /* + * The timeout property. + */ + @JsonProperty(value = "timeout") + private Duration timeout; + + /** + * Get the enabled property: The enabled property. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: The enabled property. + * + * @param enabled the enabled value to set. + * @return the ResourceProviderEndpoint object itself. + */ + public ResourceProviderEndpoint withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the apiVersions property: The apiVersions property. + * + * @return the apiVersions value. + */ + public List apiVersions() { + return this.apiVersions; + } + + /** + * Set the apiVersions property: The apiVersions property. + * + * @param apiVersions the apiVersions value to set. + * @return the ResourceProviderEndpoint object itself. + */ + public ResourceProviderEndpoint withApiVersions(List apiVersions) { + this.apiVersions = apiVersions; + return this; + } + + /** + * Get the endpointUri property: The endpointUri property. + * + * @return the endpointUri value. + */ + public String endpointUri() { + return this.endpointUri; + } + + /** + * Set the endpointUri property: The endpointUri property. + * + * @param endpointUri the endpointUri value to set. + * @return the ResourceProviderEndpoint object itself. + */ + public ResourceProviderEndpoint withEndpointUri(String endpointUri) { + this.endpointUri = endpointUri; + return this; + } + + /** + * Get the locations property: The locations property. + * + * @return the locations value. + */ + public List locations() { + return this.locations; + } + + /** + * Set the locations property: The locations property. + * + * @param locations the locations value to set. + * @return the ResourceProviderEndpoint object itself. + */ + public ResourceProviderEndpoint withLocations(List locations) { + this.locations = locations; + return this; + } + + /** + * Get the requiredFeatures property: The requiredFeatures property. + * + * @return the requiredFeatures value. + */ + public List requiredFeatures() { + return this.requiredFeatures; + } + + /** + * Set the requiredFeatures property: The requiredFeatures property. + * + * @param requiredFeatures the requiredFeatures value to set. + * @return the ResourceProviderEndpoint object itself. + */ + public ResourceProviderEndpoint withRequiredFeatures(List requiredFeatures) { + this.requiredFeatures = requiredFeatures; + return this; + } + + /** + * Get the featuresRule property: The featuresRule property. + * + * @return the featuresRule value. + */ + public ResourceProviderEndpointFeaturesRule featuresRule() { + return this.featuresRule; + } + + /** + * Set the featuresRule property: The featuresRule property. + * + * @param featuresRule the featuresRule value to set. + * @return the ResourceProviderEndpoint object itself. + */ + public ResourceProviderEndpoint withFeaturesRule(ResourceProviderEndpointFeaturesRule featuresRule) { + this.featuresRule = featuresRule; + return this; + } + + /** + * Get the timeout property: The timeout property. + * + * @return the timeout value. + */ + public Duration timeout() { + return this.timeout; + } + + /** + * Set the timeout property: The timeout property. + * + * @param timeout the timeout value to set. + * @return the ResourceProviderEndpoint object itself. + */ + public ResourceProviderEndpoint withTimeout(Duration timeout) { + this.timeout = timeout; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (featuresRule() != null) { + featuresRule().validate(); + } + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviderEndpointFeaturesRule.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviderEndpointFeaturesRule.java new file mode 100644 index 0000000000000..75d768908053b --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviderEndpointFeaturesRule.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** The ResourceProviderEndpointFeaturesRule model. */ +@Immutable +public final class ResourceProviderEndpointFeaturesRule extends FeaturesRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceProviderEndpointFeaturesRule.class); + + /** {@inheritDoc} */ + @Override + public ResourceProviderEndpointFeaturesRule withRequiredFeaturesPolicy(FeaturesPolicy requiredFeaturesPolicy) { + super.withRequiredFeaturesPolicy(requiredFeaturesPolicy); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviderManagement.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviderManagement.java new file mode 100644 index 0000000000000..60c752601e9b3 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviderManagement.java @@ -0,0 +1,237 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The ResourceProviderManagement model. */ +@Fluent +public class ResourceProviderManagement { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceProviderManagement.class); + + /* + * The schemaOwners property. + */ + @JsonProperty(value = "schemaOwners") + private List schemaOwners; + + /* + * The manifestOwners property. + */ + @JsonProperty(value = "manifestOwners") + private List manifestOwners; + + /* + * The incidentRoutingService property. + */ + @JsonProperty(value = "incidentRoutingService") + private String incidentRoutingService; + + /* + * The incidentRoutingTeam property. + */ + @JsonProperty(value = "incidentRoutingTeam") + private String incidentRoutingTeam; + + /* + * The incidentContactEmail property. + */ + @JsonProperty(value = "incidentContactEmail") + private String incidentContactEmail; + + /* + * The serviceTreeInfos property. + */ + @JsonProperty(value = "serviceTreeInfos") + private List serviceTreeInfos; + + /* + * The resourceAccessPolicy property. + */ + @JsonProperty(value = "resourceAccessPolicy") + private ResourceProviderManagementResourceAccessPolicy resourceAccessPolicy; + + /* + * The resourceAccessRoles property. + */ + @JsonProperty(value = "resourceAccessRoles") + private List resourceAccessRoles; + + /** + * Get the schemaOwners property: The schemaOwners property. + * + * @return the schemaOwners value. + */ + public List schemaOwners() { + return this.schemaOwners; + } + + /** + * Set the schemaOwners property: The schemaOwners property. + * + * @param schemaOwners the schemaOwners value to set. + * @return the ResourceProviderManagement object itself. + */ + public ResourceProviderManagement withSchemaOwners(List schemaOwners) { + this.schemaOwners = schemaOwners; + return this; + } + + /** + * Get the manifestOwners property: The manifestOwners property. + * + * @return the manifestOwners value. + */ + public List manifestOwners() { + return this.manifestOwners; + } + + /** + * Set the manifestOwners property: The manifestOwners property. + * + * @param manifestOwners the manifestOwners value to set. + * @return the ResourceProviderManagement object itself. + */ + public ResourceProviderManagement withManifestOwners(List manifestOwners) { + this.manifestOwners = manifestOwners; + return this; + } + + /** + * Get the incidentRoutingService property: The incidentRoutingService property. + * + * @return the incidentRoutingService value. + */ + public String incidentRoutingService() { + return this.incidentRoutingService; + } + + /** + * Set the incidentRoutingService property: The incidentRoutingService property. + * + * @param incidentRoutingService the incidentRoutingService value to set. + * @return the ResourceProviderManagement object itself. + */ + public ResourceProviderManagement withIncidentRoutingService(String incidentRoutingService) { + this.incidentRoutingService = incidentRoutingService; + return this; + } + + /** + * Get the incidentRoutingTeam property: The incidentRoutingTeam property. + * + * @return the incidentRoutingTeam value. + */ + public String incidentRoutingTeam() { + return this.incidentRoutingTeam; + } + + /** + * Set the incidentRoutingTeam property: The incidentRoutingTeam property. + * + * @param incidentRoutingTeam the incidentRoutingTeam value to set. + * @return the ResourceProviderManagement object itself. + */ + public ResourceProviderManagement withIncidentRoutingTeam(String incidentRoutingTeam) { + this.incidentRoutingTeam = incidentRoutingTeam; + return this; + } + + /** + * Get the incidentContactEmail property: The incidentContactEmail property. + * + * @return the incidentContactEmail value. + */ + public String incidentContactEmail() { + return this.incidentContactEmail; + } + + /** + * Set the incidentContactEmail property: The incidentContactEmail property. + * + * @param incidentContactEmail the incidentContactEmail value to set. + * @return the ResourceProviderManagement object itself. + */ + public ResourceProviderManagement withIncidentContactEmail(String incidentContactEmail) { + this.incidentContactEmail = incidentContactEmail; + return this; + } + + /** + * Get the serviceTreeInfos property: The serviceTreeInfos property. + * + * @return the serviceTreeInfos value. + */ + public List serviceTreeInfos() { + return this.serviceTreeInfos; + } + + /** + * Set the serviceTreeInfos property: The serviceTreeInfos property. + * + * @param serviceTreeInfos the serviceTreeInfos value to set. + * @return the ResourceProviderManagement object itself. + */ + public ResourceProviderManagement withServiceTreeInfos(List serviceTreeInfos) { + this.serviceTreeInfos = serviceTreeInfos; + return this; + } + + /** + * Get the resourceAccessPolicy property: The resourceAccessPolicy property. + * + * @return the resourceAccessPolicy value. + */ + public ResourceProviderManagementResourceAccessPolicy resourceAccessPolicy() { + return this.resourceAccessPolicy; + } + + /** + * Set the resourceAccessPolicy property: The resourceAccessPolicy property. + * + * @param resourceAccessPolicy the resourceAccessPolicy value to set. + * @return the ResourceProviderManagement object itself. + */ + public ResourceProviderManagement withResourceAccessPolicy( + ResourceProviderManagementResourceAccessPolicy resourceAccessPolicy) { + this.resourceAccessPolicy = resourceAccessPolicy; + return this; + } + + /** + * Get the resourceAccessRoles property: The resourceAccessRoles property. + * + * @return the resourceAccessRoles value. + */ + public List resourceAccessRoles() { + return this.resourceAccessRoles; + } + + /** + * Set the resourceAccessRoles property: The resourceAccessRoles property. + * + * @param resourceAccessRoles the resourceAccessRoles value to set. + * @return the ResourceProviderManagement object itself. + */ + public ResourceProviderManagement withResourceAccessRoles(List resourceAccessRoles) { + this.resourceAccessRoles = resourceAccessRoles; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (serviceTreeInfos() != null) { + serviceTreeInfos().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviderManagementResourceAccessPolicy.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviderManagementResourceAccessPolicy.java new file mode 100644 index 0000000000000..05d6ec50ba4f4 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviderManagementResourceAccessPolicy.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ResourceProviderManagementResourceAccessPolicy. */ +public final class ResourceProviderManagementResourceAccessPolicy + extends ExpandableStringEnum { + /** Static value NotSpecified for ResourceProviderManagementResourceAccessPolicy. */ + public static final ResourceProviderManagementResourceAccessPolicy NOT_SPECIFIED = fromString("NotSpecified"); + + /** Static value AcisReadAllowed for ResourceProviderManagementResourceAccessPolicy. */ + public static final ResourceProviderManagementResourceAccessPolicy ACIS_READ_ALLOWED = + fromString("AcisReadAllowed"); + + /** Static value AcisActionAllowed for ResourceProviderManagementResourceAccessPolicy. */ + public static final ResourceProviderManagementResourceAccessPolicy ACIS_ACTION_ALLOWED = + fromString("AcisActionAllowed"); + + /** + * Creates or finds a ResourceProviderManagementResourceAccessPolicy from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResourceProviderManagementResourceAccessPolicy. + */ + @JsonCreator + public static ResourceProviderManagementResourceAccessPolicy fromString(String name) { + return fromString(name, ResourceProviderManagementResourceAccessPolicy.class); + } + + /** @return known ResourceProviderManagementResourceAccessPolicy values. */ + public static Collection values() { + return values(ResourceProviderManagementResourceAccessPolicy.class); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviderManifest.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviderManifest.java new file mode 100644 index 0000000000000..cabf75f3f2c15 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviderManifest.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.providerhub.models; + +import com.azure.resourcemanager.providerhub.fluent.models.ResourceProviderManifestInner; +import java.util.List; + +/** An immutable client-side representation of ResourceProviderManifest. */ +public interface ResourceProviderManifest { + /** + * Gets the providerAuthentication property: The providerAuthentication property. + * + * @return the providerAuthentication value. + */ + ResourceProviderManifestProviderAuthentication providerAuthentication(); + + /** + * Gets the providerAuthorizations property: The providerAuthorizations property. + * + * @return the providerAuthorizations value. + */ + List providerAuthorizations(); + + /** + * Gets the namespace property: The namespace property. + * + * @return the namespace value. + */ + String namespace(); + + /** + * Gets the providerVersion property: The providerVersion property. + * + * @return the providerVersion value. + */ + String providerVersion(); + + /** + * Gets the providerType property: The providerType property. + * + * @return the providerType value. + */ + ResourceProviderType providerType(); + + /** + * Gets the requiredFeatures property: The requiredFeatures property. + * + * @return the requiredFeatures value. + */ + List requiredFeatures(); + + /** + * Gets the featuresRule property: The featuresRule property. + * + * @return the featuresRule value. + */ + ResourceProviderManifestFeaturesRule featuresRule(); + + /** + * Gets the requestHeaderOptions property: The requestHeaderOptions property. + * + * @return the requestHeaderOptions value. + */ + ResourceProviderManifestRequestHeaderOptions requestHeaderOptions(); + + /** + * Gets the resourceTypes property: The resourceTypes property. + * + * @return the resourceTypes value. + */ + List resourceTypes(); + + /** + * Gets the management property: The management property. + * + * @return the management value. + */ + ResourceProviderManifestManagement management(); + + /** + * Gets the capabilities property: The capabilities property. + * + * @return the capabilities value. + */ + List capabilities(); + + /** + * Gets the metadata property: Any object. + * + * @return the metadata value. + */ + Object metadata(); + + /** + * Gets the globalNotificationEndpoints property: The globalNotificationEndpoints property. + * + * @return the globalNotificationEndpoints value. + */ + List globalNotificationEndpoints(); + + /** + * Gets the reRegisterSubscriptionMetadata property: The reRegisterSubscriptionMetadata property. + * + * @return the reRegisterSubscriptionMetadata value. + */ + ResourceProviderManifestReRegisterSubscriptionMetadata reRegisterSubscriptionMetadata(); + + /** + * Gets the inner com.azure.resourcemanager.providerhub.fluent.models.ResourceProviderManifestInner object. + * + * @return the inner object. + */ + ResourceProviderManifestInner innerModel(); +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviderManifestFeaturesRule.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviderManifestFeaturesRule.java new file mode 100644 index 0000000000000..ab3a8530f700a --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviderManifestFeaturesRule.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** The ResourceProviderManifestFeaturesRule model. */ +@Immutable +public final class ResourceProviderManifestFeaturesRule extends FeaturesRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceProviderManifestFeaturesRule.class); + + /** {@inheritDoc} */ + @Override + public ResourceProviderManifestFeaturesRule withRequiredFeaturesPolicy(FeaturesPolicy requiredFeaturesPolicy) { + super.withRequiredFeaturesPolicy(requiredFeaturesPolicy); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviderManifestManagement.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviderManifestManagement.java new file mode 100644 index 0000000000000..4affe57d6423f --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviderManifestManagement.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.List; + +/** The ResourceProviderManifestManagement model. */ +@Immutable +public final class ResourceProviderManifestManagement extends ResourceProviderManagement { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceProviderManifestManagement.class); + + /** {@inheritDoc} */ + @Override + public ResourceProviderManifestManagement withSchemaOwners(List schemaOwners) { + super.withSchemaOwners(schemaOwners); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceProviderManifestManagement withManifestOwners(List manifestOwners) { + super.withManifestOwners(manifestOwners); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceProviderManifestManagement withIncidentRoutingService(String incidentRoutingService) { + super.withIncidentRoutingService(incidentRoutingService); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceProviderManifestManagement withIncidentRoutingTeam(String incidentRoutingTeam) { + super.withIncidentRoutingTeam(incidentRoutingTeam); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceProviderManifestManagement withIncidentContactEmail(String incidentContactEmail) { + super.withIncidentContactEmail(incidentContactEmail); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceProviderManifestManagement withServiceTreeInfos(List serviceTreeInfos) { + super.withServiceTreeInfos(serviceTreeInfos); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceProviderManifestManagement withResourceAccessPolicy( + ResourceProviderManagementResourceAccessPolicy resourceAccessPolicy) { + super.withResourceAccessPolicy(resourceAccessPolicy); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceProviderManifestManagement withResourceAccessRoles(List resourceAccessRoles) { + super.withResourceAccessRoles(resourceAccessRoles); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviderManifestProperties.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviderManifestProperties.java new file mode 100644 index 0000000000000..77c715b30376a --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviderManifestProperties.java @@ -0,0 +1,363 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The ResourceProviderManifestProperties model. */ +@Fluent +public class ResourceProviderManifestProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceProviderManifestProperties.class); + + /* + * The providerAuthentication property. + */ + @JsonProperty(value = "providerAuthentication") + private ResourceProviderManifestPropertiesProviderAuthentication providerAuthentication; + + /* + * The providerAuthorizations property. + */ + @JsonProperty(value = "providerAuthorizations") + private List providerAuthorizations; + + /* + * The namespace property. + */ + @JsonProperty(value = "namespace") + private String namespace; + + /* + * The providerVersion property. + */ + @JsonProperty(value = "providerVersion") + private String providerVersion; + + /* + * The providerType property. + */ + @JsonProperty(value = "providerType") + private ResourceProviderType providerType; + + /* + * The requiredFeatures property. + */ + @JsonProperty(value = "requiredFeatures") + private List requiredFeatures; + + /* + * The featuresRule property. + */ + @JsonProperty(value = "featuresRule") + private ResourceProviderManifestPropertiesFeaturesRule featuresRule; + + /* + * The requestHeaderOptions property. + */ + @JsonProperty(value = "requestHeaderOptions") + private ResourceProviderManifestPropertiesRequestHeaderOptions requestHeaderOptions; + + /* + * The management property. + */ + @JsonProperty(value = "management") + private ResourceProviderManifestPropertiesManagement management; + + /* + * The capabilities property. + */ + @JsonProperty(value = "capabilities") + private List capabilities; + + /* + * Any object + */ + @JsonProperty(value = "metadata") + private Object metadata; + + /* + * The templateDeploymentOptions property. + */ + @JsonProperty(value = "templateDeploymentOptions") + private ResourceProviderManifestPropertiesTemplateDeploymentOptions templateDeploymentOptions; + + /** + * Get the providerAuthentication property: The providerAuthentication property. + * + * @return the providerAuthentication value. + */ + public ResourceProviderManifestPropertiesProviderAuthentication providerAuthentication() { + return this.providerAuthentication; + } + + /** + * Set the providerAuthentication property: The providerAuthentication property. + * + * @param providerAuthentication the providerAuthentication value to set. + * @return the ResourceProviderManifestProperties object itself. + */ + public ResourceProviderManifestProperties withProviderAuthentication( + ResourceProviderManifestPropertiesProviderAuthentication providerAuthentication) { + this.providerAuthentication = providerAuthentication; + return this; + } + + /** + * Get the providerAuthorizations property: The providerAuthorizations property. + * + * @return the providerAuthorizations value. + */ + public List providerAuthorizations() { + return this.providerAuthorizations; + } + + /** + * Set the providerAuthorizations property: The providerAuthorizations property. + * + * @param providerAuthorizations the providerAuthorizations value to set. + * @return the ResourceProviderManifestProperties object itself. + */ + public ResourceProviderManifestProperties withProviderAuthorizations( + List providerAuthorizations) { + this.providerAuthorizations = providerAuthorizations; + return this; + } + + /** + * Get the namespace property: The namespace property. + * + * @return the namespace value. + */ + public String namespace() { + return this.namespace; + } + + /** + * Set the namespace property: The namespace property. + * + * @param namespace the namespace value to set. + * @return the ResourceProviderManifestProperties object itself. + */ + public ResourceProviderManifestProperties withNamespace(String namespace) { + this.namespace = namespace; + return this; + } + + /** + * Get the providerVersion property: The providerVersion property. + * + * @return the providerVersion value. + */ + public String providerVersion() { + return this.providerVersion; + } + + /** + * Set the providerVersion property: The providerVersion property. + * + * @param providerVersion the providerVersion value to set. + * @return the ResourceProviderManifestProperties object itself. + */ + public ResourceProviderManifestProperties withProviderVersion(String providerVersion) { + this.providerVersion = providerVersion; + return this; + } + + /** + * Get the providerType property: The providerType property. + * + * @return the providerType value. + */ + public ResourceProviderType providerType() { + return this.providerType; + } + + /** + * Set the providerType property: The providerType property. + * + * @param providerType the providerType value to set. + * @return the ResourceProviderManifestProperties object itself. + */ + public ResourceProviderManifestProperties withProviderType(ResourceProviderType providerType) { + this.providerType = providerType; + return this; + } + + /** + * Get the requiredFeatures property: The requiredFeatures property. + * + * @return the requiredFeatures value. + */ + public List requiredFeatures() { + return this.requiredFeatures; + } + + /** + * Set the requiredFeatures property: The requiredFeatures property. + * + * @param requiredFeatures the requiredFeatures value to set. + * @return the ResourceProviderManifestProperties object itself. + */ + public ResourceProviderManifestProperties withRequiredFeatures(List requiredFeatures) { + this.requiredFeatures = requiredFeatures; + return this; + } + + /** + * Get the featuresRule property: The featuresRule property. + * + * @return the featuresRule value. + */ + public ResourceProviderManifestPropertiesFeaturesRule featuresRule() { + return this.featuresRule; + } + + /** + * Set the featuresRule property: The featuresRule property. + * + * @param featuresRule the featuresRule value to set. + * @return the ResourceProviderManifestProperties object itself. + */ + public ResourceProviderManifestProperties withFeaturesRule( + ResourceProviderManifestPropertiesFeaturesRule featuresRule) { + this.featuresRule = featuresRule; + return this; + } + + /** + * Get the requestHeaderOptions property: The requestHeaderOptions property. + * + * @return the requestHeaderOptions value. + */ + public ResourceProviderManifestPropertiesRequestHeaderOptions requestHeaderOptions() { + return this.requestHeaderOptions; + } + + /** + * Set the requestHeaderOptions property: The requestHeaderOptions property. + * + * @param requestHeaderOptions the requestHeaderOptions value to set. + * @return the ResourceProviderManifestProperties object itself. + */ + public ResourceProviderManifestProperties withRequestHeaderOptions( + ResourceProviderManifestPropertiesRequestHeaderOptions requestHeaderOptions) { + this.requestHeaderOptions = requestHeaderOptions; + return this; + } + + /** + * Get the management property: The management property. + * + * @return the management value. + */ + public ResourceProviderManifestPropertiesManagement management() { + return this.management; + } + + /** + * Set the management property: The management property. + * + * @param management the management value to set. + * @return the ResourceProviderManifestProperties object itself. + */ + public ResourceProviderManifestProperties withManagement(ResourceProviderManifestPropertiesManagement management) { + this.management = management; + return this; + } + + /** + * Get the capabilities property: The capabilities property. + * + * @return the capabilities value. + */ + public List capabilities() { + return this.capabilities; + } + + /** + * Set the capabilities property: The capabilities property. + * + * @param capabilities the capabilities value to set. + * @return the ResourceProviderManifestProperties object itself. + */ + public ResourceProviderManifestProperties withCapabilities(List capabilities) { + this.capabilities = capabilities; + return this; + } + + /** + * Get the metadata property: Any object. + * + * @return the metadata value. + */ + public Object metadata() { + return this.metadata; + } + + /** + * Set the metadata property: Any object. + * + * @param metadata the metadata value to set. + * @return the ResourceProviderManifestProperties object itself. + */ + public ResourceProviderManifestProperties withMetadata(Object metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get the templateDeploymentOptions property: The templateDeploymentOptions property. + * + * @return the templateDeploymentOptions value. + */ + public ResourceProviderManifestPropertiesTemplateDeploymentOptions templateDeploymentOptions() { + return this.templateDeploymentOptions; + } + + /** + * Set the templateDeploymentOptions property: The templateDeploymentOptions property. + * + * @param templateDeploymentOptions the templateDeploymentOptions value to set. + * @return the ResourceProviderManifestProperties object itself. + */ + public ResourceProviderManifestProperties withTemplateDeploymentOptions( + ResourceProviderManifestPropertiesTemplateDeploymentOptions templateDeploymentOptions) { + this.templateDeploymentOptions = templateDeploymentOptions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (providerAuthentication() != null) { + providerAuthentication().validate(); + } + if (providerAuthorizations() != null) { + providerAuthorizations().forEach(e -> e.validate()); + } + if (featuresRule() != null) { + featuresRule().validate(); + } + if (requestHeaderOptions() != null) { + requestHeaderOptions().validate(); + } + if (management() != null) { + management().validate(); + } + if (capabilities() != null) { + capabilities().forEach(e -> e.validate()); + } + if (templateDeploymentOptions() != null) { + templateDeploymentOptions().validate(); + } + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviderManifestPropertiesFeaturesRule.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviderManifestPropertiesFeaturesRule.java new file mode 100644 index 0000000000000..0141cd43f263d --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviderManifestPropertiesFeaturesRule.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.providerhub.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** The ResourceProviderManifestPropertiesFeaturesRule model. */ +@Immutable +public final class ResourceProviderManifestPropertiesFeaturesRule extends FeaturesRule { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ResourceProviderManifestPropertiesFeaturesRule.class); + + /** {@inheritDoc} */ + @Override + public ResourceProviderManifestPropertiesFeaturesRule withRequiredFeaturesPolicy( + FeaturesPolicy requiredFeaturesPolicy) { + super.withRequiredFeaturesPolicy(requiredFeaturesPolicy); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviderManifestPropertiesManagement.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviderManifestPropertiesManagement.java new file mode 100644 index 0000000000000..4fb6d0fc2388b --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviderManifestPropertiesManagement.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.providerhub.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.List; + +/** The ResourceProviderManifestPropertiesManagement model. */ +@Immutable +public final class ResourceProviderManifestPropertiesManagement extends ResourceProviderManagement { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ResourceProviderManifestPropertiesManagement.class); + + /** {@inheritDoc} */ + @Override + public ResourceProviderManifestPropertiesManagement withSchemaOwners(List schemaOwners) { + super.withSchemaOwners(schemaOwners); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceProviderManifestPropertiesManagement withManifestOwners(List manifestOwners) { + super.withManifestOwners(manifestOwners); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceProviderManifestPropertiesManagement withIncidentRoutingService(String incidentRoutingService) { + super.withIncidentRoutingService(incidentRoutingService); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceProviderManifestPropertiesManagement withIncidentRoutingTeam(String incidentRoutingTeam) { + super.withIncidentRoutingTeam(incidentRoutingTeam); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceProviderManifestPropertiesManagement withIncidentContactEmail(String incidentContactEmail) { + super.withIncidentContactEmail(incidentContactEmail); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceProviderManifestPropertiesManagement withServiceTreeInfos(List serviceTreeInfos) { + super.withServiceTreeInfos(serviceTreeInfos); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceProviderManifestPropertiesManagement withResourceAccessPolicy( + ResourceProviderManagementResourceAccessPolicy resourceAccessPolicy) { + super.withResourceAccessPolicy(resourceAccessPolicy); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceProviderManifestPropertiesManagement withResourceAccessRoles(List resourceAccessRoles) { + super.withResourceAccessRoles(resourceAccessRoles); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviderManifestPropertiesProviderAuthentication.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviderManifestPropertiesProviderAuthentication.java new file mode 100644 index 0000000000000..0586d62fd38ce --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviderManifestPropertiesProviderAuthentication.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.List; + +/** The ResourceProviderManifestPropertiesProviderAuthentication model. */ +@Immutable +public final class ResourceProviderManifestPropertiesProviderAuthentication extends ResourceProviderAuthentication { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(ResourceProviderManifestPropertiesProviderAuthentication.class); + + /** {@inheritDoc} */ + @Override + public ResourceProviderManifestPropertiesProviderAuthentication withAllowedAudiences( + List allowedAudiences) { + super.withAllowedAudiences(allowedAudiences); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviderManifestPropertiesRequestHeaderOptions.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviderManifestPropertiesRequestHeaderOptions.java new file mode 100644 index 0000000000000..80822ab76a91a --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviderManifestPropertiesRequestHeaderOptions.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** The ResourceProviderManifestPropertiesRequestHeaderOptions model. */ +@Immutable +public final class ResourceProviderManifestPropertiesRequestHeaderOptions extends RequestHeaderOptions { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ResourceProviderManifestPropertiesRequestHeaderOptions.class); + + /** {@inheritDoc} */ + @Override + public ResourceProviderManifestPropertiesRequestHeaderOptions withOptInHeaders(OptInHeaderType optInHeaders) { + super.withOptInHeaders(optInHeaders); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviderManifestPropertiesTemplateDeploymentOptions.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviderManifestPropertiesTemplateDeploymentOptions.java new file mode 100644 index 0000000000000..5d2510067d865 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviderManifestPropertiesTemplateDeploymentOptions.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.providerhub.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.List; + +/** The ResourceProviderManifestPropertiesTemplateDeploymentOptions model. */ +@Immutable +public final class ResourceProviderManifestPropertiesTemplateDeploymentOptions extends TemplateDeploymentOptions { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(ResourceProviderManifestPropertiesTemplateDeploymentOptions.class); + + /** {@inheritDoc} */ + @Override + public ResourceProviderManifestPropertiesTemplateDeploymentOptions withPreflightSupported( + Boolean preflightSupported) { + super.withPreflightSupported(preflightSupported); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceProviderManifestPropertiesTemplateDeploymentOptions withPreflightOptions( + List preflightOptions) { + super.withPreflightOptions(preflightOptions); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviderManifestProviderAuthentication.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviderManifestProviderAuthentication.java new file mode 100644 index 0000000000000..78d096d35a418 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviderManifestProviderAuthentication.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.providerhub.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.List; + +/** The ResourceProviderManifestProviderAuthentication model. */ +@Immutable +public final class ResourceProviderManifestProviderAuthentication extends ResourceProviderAuthentication { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ResourceProviderManifestProviderAuthentication.class); + + /** {@inheritDoc} */ + @Override + public ResourceProviderManifestProviderAuthentication withAllowedAudiences(List allowedAudiences) { + super.withAllowedAudiences(allowedAudiences); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviderManifestReRegisterSubscriptionMetadata.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviderManifestReRegisterSubscriptionMetadata.java new file mode 100644 index 0000000000000..988e4135c5496 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviderManifestReRegisterSubscriptionMetadata.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** The ResourceProviderManifestReRegisterSubscriptionMetadata model. */ +@Immutable +public final class ResourceProviderManifestReRegisterSubscriptionMetadata extends ReRegisterSubscriptionMetadata { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ResourceProviderManifestReRegisterSubscriptionMetadata.class); + + /** {@inheritDoc} */ + @Override + public ResourceProviderManifestReRegisterSubscriptionMetadata withEnabled(boolean enabled) { + super.withEnabled(enabled); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceProviderManifestReRegisterSubscriptionMetadata withConcurrencyLimit(Integer concurrencyLimit) { + super.withConcurrencyLimit(concurrencyLimit); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviderManifestRequestHeaderOptions.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviderManifestRequestHeaderOptions.java new file mode 100644 index 0000000000000..9e7d590e8960a --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviderManifestRequestHeaderOptions.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** The ResourceProviderManifestRequestHeaderOptions model. */ +@Immutable +public final class ResourceProviderManifestRequestHeaderOptions extends RequestHeaderOptions { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ResourceProviderManifestRequestHeaderOptions.class); + + /** {@inheritDoc} */ + @Override + public ResourceProviderManifestRequestHeaderOptions withOptInHeaders(OptInHeaderType optInHeaders) { + super.withOptInHeaders(optInHeaders); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviderType.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviderType.java new file mode 100644 index 0000000000000..aa677d4405429 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviderType.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ResourceProviderType. */ +public final class ResourceProviderType extends ExpandableStringEnum { + /** Static value NotSpecified for ResourceProviderType. */ + public static final ResourceProviderType NOT_SPECIFIED = fromString("NotSpecified"); + + /** Static value Internal for ResourceProviderType. */ + public static final ResourceProviderType INTERNAL = fromString("Internal"); + + /** Static value External for ResourceProviderType. */ + public static final ResourceProviderType EXTERNAL = fromString("External"); + + /** Static value Hidden for ResourceProviderType. */ + public static final ResourceProviderType HIDDEN = fromString("Hidden"); + + /** Static value RegistrationFree for ResourceProviderType. */ + public static final ResourceProviderType REGISTRATION_FREE = fromString("RegistrationFree"); + + /** Static value LegacyRegistrationRequired for ResourceProviderType. */ + public static final ResourceProviderType LEGACY_REGISTRATION_REQUIRED = fromString("LegacyRegistrationRequired"); + + /** Static value TenantOnly for ResourceProviderType. */ + public static final ResourceProviderType TENANT_ONLY = fromString("TenantOnly"); + + /** Static value AuthorizationFree for ResourceProviderType. */ + public static final ResourceProviderType AUTHORIZATION_FREE = fromString("AuthorizationFree"); + + /** + * Creates or finds a ResourceProviderType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResourceProviderType. + */ + @JsonCreator + public static ResourceProviderType fromString(String name) { + return fromString(name, ResourceProviderType.class); + } + + /** @return known ResourceProviderType values. */ + public static Collection values() { + return values(ResourceProviderType.class); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviders.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviders.java new file mode 100644 index 0000000000000..94161abd8c42b --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceProviders.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ResourceProviders. */ +public interface ResourceProviders { + /** + * Generates the manifest for the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + ResourceProviderManifest generateManifest(String providerNamespace); + + /** + * Generates the manifest for the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + Response generateManifestWithResponse(String providerNamespace, Context context); + + /** + * Checkin the manifest. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param checkinManifestParams The required body parameters supplied to the checkin manifest operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + CheckinManifestInfo checkinManifest(String providerNamespace, CheckinManifestParams checkinManifestParams); + + /** + * Checkin the manifest. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param checkinManifestParams The required body parameters supplied to the checkin manifest operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response checkinManifestWithResponse( + String providerNamespace, CheckinManifestParams checkinManifestParams, Context context); +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceType.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceType.java new file mode 100644 index 0000000000000..ce909aaa1b5c2 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceType.java @@ -0,0 +1,688 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The ResourceType model. */ +@Fluent +public final class ResourceType { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceType.class); + + /* + * The name property. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The routingType property. + */ + @JsonProperty(value = "routingType") + private RoutingType routingType; + + /* + * The resourceValidation property. + */ + @JsonProperty(value = "resourceValidation") + private ResourceValidation resourceValidation; + + /* + * The allowedUnauthorizedActions property. + */ + @JsonProperty(value = "allowedUnauthorizedActions") + private List allowedUnauthorizedActions; + + /* + * The authorizationActionMappings property. + */ + @JsonProperty(value = "authorizationActionMappings") + private List authorizationActionMappings; + + /* + * The linkedAccessChecks property. + */ + @JsonProperty(value = "linkedAccessChecks") + private List linkedAccessChecks; + + /* + * The defaultApiVersion property. + */ + @JsonProperty(value = "defaultApiVersion") + private String defaultApiVersion; + + /* + * The loggingRules property. + */ + @JsonProperty(value = "loggingRules") + private List loggingRules; + + /* + * The throttlingRules property. + */ + @JsonProperty(value = "throttlingRules") + private List throttlingRules; + + /* + * The endpoints property. + */ + @JsonProperty(value = "endpoints") + private List endpoints; + + /* + * The marketplaceType property. + */ + @JsonProperty(value = "marketplaceType") + private ResourceTypeMarketplaceType marketplaceType; + + /* + * The identityManagement property. + */ + @JsonProperty(value = "identityManagement") + private ResourceTypeIdentityManagement identityManagement; + + /* + * Any object + */ + @JsonProperty(value = "metadata") + private Object metadata; + + /* + * The requiredFeatures property. + */ + @JsonProperty(value = "requiredFeatures") + private List requiredFeatures; + + /* + * The featuresRule property. + */ + @JsonProperty(value = "featuresRule") + private ResourceTypeFeaturesRule featuresRule; + + /* + * The subscriptionStateRules property. + */ + @JsonProperty(value = "subscriptionStateRules") + private List subscriptionStateRules; + + /* + * The serviceTreeInfos property. + */ + @JsonProperty(value = "serviceTreeInfos") + private List serviceTreeInfos; + + /* + * The requestHeaderOptions property. + */ + @JsonProperty(value = "requestHeaderOptions") + private ResourceTypeRequestHeaderOptions requestHeaderOptions; + + /* + * The skuLink property. + */ + @JsonProperty(value = "skuLink") + private String skuLink; + + /* + * The disallowedActionVerbs property. + */ + @JsonProperty(value = "disallowedActionVerbs") + private List disallowedActionVerbs; + + /* + * The templateDeploymentPolicy property. + */ + @JsonProperty(value = "templateDeploymentPolicy") + private ResourceTypeTemplateDeploymentPolicy templateDeploymentPolicy; + + /* + * The extendedLocations property. + */ + @JsonProperty(value = "extendedLocations") + private List extendedLocations; + + /* + * The linkedOperationRules property. + */ + @JsonProperty(value = "linkedOperationRules") + private List linkedOperationRules; + + /* + * The resourceDeletionPolicy property. + */ + @JsonProperty(value = "resourceDeletionPolicy") + private ManifestResourceDeletionPolicy resourceDeletionPolicy; + + /** + * Get the name property: The name property. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name property. + * + * @param name the name value to set. + * @return the ResourceType object itself. + */ + public ResourceType withName(String name) { + this.name = name; + return this; + } + + /** + * Get the routingType property: The routingType property. + * + * @return the routingType value. + */ + public RoutingType routingType() { + return this.routingType; + } + + /** + * Set the routingType property: The routingType property. + * + * @param routingType the routingType value to set. + * @return the ResourceType object itself. + */ + public ResourceType withRoutingType(RoutingType routingType) { + this.routingType = routingType; + return this; + } + + /** + * Get the resourceValidation property: The resourceValidation property. + * + * @return the resourceValidation value. + */ + public ResourceValidation resourceValidation() { + return this.resourceValidation; + } + + /** + * Set the resourceValidation property: The resourceValidation property. + * + * @param resourceValidation the resourceValidation value to set. + * @return the ResourceType object itself. + */ + public ResourceType withResourceValidation(ResourceValidation resourceValidation) { + this.resourceValidation = resourceValidation; + return this; + } + + /** + * Get the allowedUnauthorizedActions property: The allowedUnauthorizedActions property. + * + * @return the allowedUnauthorizedActions value. + */ + public List allowedUnauthorizedActions() { + return this.allowedUnauthorizedActions; + } + + /** + * Set the allowedUnauthorizedActions property: The allowedUnauthorizedActions property. + * + * @param allowedUnauthorizedActions the allowedUnauthorizedActions value to set. + * @return the ResourceType object itself. + */ + public ResourceType withAllowedUnauthorizedActions(List allowedUnauthorizedActions) { + this.allowedUnauthorizedActions = allowedUnauthorizedActions; + return this; + } + + /** + * Get the authorizationActionMappings property: The authorizationActionMappings property. + * + * @return the authorizationActionMappings value. + */ + public List authorizationActionMappings() { + return this.authorizationActionMappings; + } + + /** + * Set the authorizationActionMappings property: The authorizationActionMappings property. + * + * @param authorizationActionMappings the authorizationActionMappings value to set. + * @return the ResourceType object itself. + */ + public ResourceType withAuthorizationActionMappings(List authorizationActionMappings) { + this.authorizationActionMappings = authorizationActionMappings; + return this; + } + + /** + * Get the linkedAccessChecks property: The linkedAccessChecks property. + * + * @return the linkedAccessChecks value. + */ + public List linkedAccessChecks() { + return this.linkedAccessChecks; + } + + /** + * Set the linkedAccessChecks property: The linkedAccessChecks property. + * + * @param linkedAccessChecks the linkedAccessChecks value to set. + * @return the ResourceType object itself. + */ + public ResourceType withLinkedAccessChecks(List linkedAccessChecks) { + this.linkedAccessChecks = linkedAccessChecks; + return this; + } + + /** + * Get the defaultApiVersion property: The defaultApiVersion property. + * + * @return the defaultApiVersion value. + */ + public String defaultApiVersion() { + return this.defaultApiVersion; + } + + /** + * Set the defaultApiVersion property: The defaultApiVersion property. + * + * @param defaultApiVersion the defaultApiVersion value to set. + * @return the ResourceType object itself. + */ + public ResourceType withDefaultApiVersion(String defaultApiVersion) { + this.defaultApiVersion = defaultApiVersion; + return this; + } + + /** + * Get the loggingRules property: The loggingRules property. + * + * @return the loggingRules value. + */ + public List loggingRules() { + return this.loggingRules; + } + + /** + * Set the loggingRules property: The loggingRules property. + * + * @param loggingRules the loggingRules value to set. + * @return the ResourceType object itself. + */ + public ResourceType withLoggingRules(List loggingRules) { + this.loggingRules = loggingRules; + return this; + } + + /** + * Get the throttlingRules property: The throttlingRules property. + * + * @return the throttlingRules value. + */ + public List throttlingRules() { + return this.throttlingRules; + } + + /** + * Set the throttlingRules property: The throttlingRules property. + * + * @param throttlingRules the throttlingRules value to set. + * @return the ResourceType object itself. + */ + public ResourceType withThrottlingRules(List throttlingRules) { + this.throttlingRules = throttlingRules; + return this; + } + + /** + * Get the endpoints property: The endpoints property. + * + * @return the endpoints value. + */ + public List endpoints() { + return this.endpoints; + } + + /** + * Set the endpoints property: The endpoints property. + * + * @param endpoints the endpoints value to set. + * @return the ResourceType object itself. + */ + public ResourceType withEndpoints(List endpoints) { + this.endpoints = endpoints; + return this; + } + + /** + * Get the marketplaceType property: The marketplaceType property. + * + * @return the marketplaceType value. + */ + public ResourceTypeMarketplaceType marketplaceType() { + return this.marketplaceType; + } + + /** + * Set the marketplaceType property: The marketplaceType property. + * + * @param marketplaceType the marketplaceType value to set. + * @return the ResourceType object itself. + */ + public ResourceType withMarketplaceType(ResourceTypeMarketplaceType marketplaceType) { + this.marketplaceType = marketplaceType; + return this; + } + + /** + * Get the identityManagement property: The identityManagement property. + * + * @return the identityManagement value. + */ + public ResourceTypeIdentityManagement identityManagement() { + return this.identityManagement; + } + + /** + * Set the identityManagement property: The identityManagement property. + * + * @param identityManagement the identityManagement value to set. + * @return the ResourceType object itself. + */ + public ResourceType withIdentityManagement(ResourceTypeIdentityManagement identityManagement) { + this.identityManagement = identityManagement; + return this; + } + + /** + * Get the metadata property: Any object. + * + * @return the metadata value. + */ + public Object metadata() { + return this.metadata; + } + + /** + * Set the metadata property: Any object. + * + * @param metadata the metadata value to set. + * @return the ResourceType object itself. + */ + public ResourceType withMetadata(Object metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get the requiredFeatures property: The requiredFeatures property. + * + * @return the requiredFeatures value. + */ + public List requiredFeatures() { + return this.requiredFeatures; + } + + /** + * Set the requiredFeatures property: The requiredFeatures property. + * + * @param requiredFeatures the requiredFeatures value to set. + * @return the ResourceType object itself. + */ + public ResourceType withRequiredFeatures(List requiredFeatures) { + this.requiredFeatures = requiredFeatures; + return this; + } + + /** + * Get the featuresRule property: The featuresRule property. + * + * @return the featuresRule value. + */ + public ResourceTypeFeaturesRule featuresRule() { + return this.featuresRule; + } + + /** + * Set the featuresRule property: The featuresRule property. + * + * @param featuresRule the featuresRule value to set. + * @return the ResourceType object itself. + */ + public ResourceType withFeaturesRule(ResourceTypeFeaturesRule featuresRule) { + this.featuresRule = featuresRule; + return this; + } + + /** + * Get the subscriptionStateRules property: The subscriptionStateRules property. + * + * @return the subscriptionStateRules value. + */ + public List subscriptionStateRules() { + return this.subscriptionStateRules; + } + + /** + * Set the subscriptionStateRules property: The subscriptionStateRules property. + * + * @param subscriptionStateRules the subscriptionStateRules value to set. + * @return the ResourceType object itself. + */ + public ResourceType withSubscriptionStateRules(List subscriptionStateRules) { + this.subscriptionStateRules = subscriptionStateRules; + return this; + } + + /** + * Get the serviceTreeInfos property: The serviceTreeInfos property. + * + * @return the serviceTreeInfos value. + */ + public List serviceTreeInfos() { + return this.serviceTreeInfos; + } + + /** + * Set the serviceTreeInfos property: The serviceTreeInfos property. + * + * @param serviceTreeInfos the serviceTreeInfos value to set. + * @return the ResourceType object itself. + */ + public ResourceType withServiceTreeInfos(List serviceTreeInfos) { + this.serviceTreeInfos = serviceTreeInfos; + return this; + } + + /** + * Get the requestHeaderOptions property: The requestHeaderOptions property. + * + * @return the requestHeaderOptions value. + */ + public ResourceTypeRequestHeaderOptions requestHeaderOptions() { + return this.requestHeaderOptions; + } + + /** + * Set the requestHeaderOptions property: The requestHeaderOptions property. + * + * @param requestHeaderOptions the requestHeaderOptions value to set. + * @return the ResourceType object itself. + */ + public ResourceType withRequestHeaderOptions(ResourceTypeRequestHeaderOptions requestHeaderOptions) { + this.requestHeaderOptions = requestHeaderOptions; + return this; + } + + /** + * Get the skuLink property: The skuLink property. + * + * @return the skuLink value. + */ + public String skuLink() { + return this.skuLink; + } + + /** + * Set the skuLink property: The skuLink property. + * + * @param skuLink the skuLink value to set. + * @return the ResourceType object itself. + */ + public ResourceType withSkuLink(String skuLink) { + this.skuLink = skuLink; + return this; + } + + /** + * Get the disallowedActionVerbs property: The disallowedActionVerbs property. + * + * @return the disallowedActionVerbs value. + */ + public List disallowedActionVerbs() { + return this.disallowedActionVerbs; + } + + /** + * Set the disallowedActionVerbs property: The disallowedActionVerbs property. + * + * @param disallowedActionVerbs the disallowedActionVerbs value to set. + * @return the ResourceType object itself. + */ + public ResourceType withDisallowedActionVerbs(List disallowedActionVerbs) { + this.disallowedActionVerbs = disallowedActionVerbs; + return this; + } + + /** + * Get the templateDeploymentPolicy property: The templateDeploymentPolicy property. + * + * @return the templateDeploymentPolicy value. + */ + public ResourceTypeTemplateDeploymentPolicy templateDeploymentPolicy() { + return this.templateDeploymentPolicy; + } + + /** + * Set the templateDeploymentPolicy property: The templateDeploymentPolicy property. + * + * @param templateDeploymentPolicy the templateDeploymentPolicy value to set. + * @return the ResourceType object itself. + */ + public ResourceType withTemplateDeploymentPolicy(ResourceTypeTemplateDeploymentPolicy templateDeploymentPolicy) { + this.templateDeploymentPolicy = templateDeploymentPolicy; + return this; + } + + /** + * Get the extendedLocations property: The extendedLocations property. + * + * @return the extendedLocations value. + */ + public List extendedLocations() { + return this.extendedLocations; + } + + /** + * Set the extendedLocations property: The extendedLocations property. + * + * @param extendedLocations the extendedLocations value to set. + * @return the ResourceType object itself. + */ + public ResourceType withExtendedLocations(List extendedLocations) { + this.extendedLocations = extendedLocations; + return this; + } + + /** + * Get the linkedOperationRules property: The linkedOperationRules property. + * + * @return the linkedOperationRules value. + */ + public List linkedOperationRules() { + return this.linkedOperationRules; + } + + /** + * Set the linkedOperationRules property: The linkedOperationRules property. + * + * @param linkedOperationRules the linkedOperationRules value to set. + * @return the ResourceType object itself. + */ + public ResourceType withLinkedOperationRules(List linkedOperationRules) { + this.linkedOperationRules = linkedOperationRules; + return this; + } + + /** + * Get the resourceDeletionPolicy property: The resourceDeletionPolicy property. + * + * @return the resourceDeletionPolicy value. + */ + public ManifestResourceDeletionPolicy resourceDeletionPolicy() { + return this.resourceDeletionPolicy; + } + + /** + * Set the resourceDeletionPolicy property: The resourceDeletionPolicy property. + * + * @param resourceDeletionPolicy the resourceDeletionPolicy value to set. + * @return the ResourceType object itself. + */ + public ResourceType withResourceDeletionPolicy(ManifestResourceDeletionPolicy resourceDeletionPolicy) { + this.resourceDeletionPolicy = resourceDeletionPolicy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (authorizationActionMappings() != null) { + authorizationActionMappings().forEach(e -> e.validate()); + } + if (linkedAccessChecks() != null) { + linkedAccessChecks().forEach(e -> e.validate()); + } + if (loggingRules() != null) { + loggingRules().forEach(e -> e.validate()); + } + if (throttlingRules() != null) { + throttlingRules().forEach(e -> e.validate()); + } + if (endpoints() != null) { + endpoints().forEach(e -> e.validate()); + } + if (identityManagement() != null) { + identityManagement().validate(); + } + if (featuresRule() != null) { + featuresRule().validate(); + } + if (subscriptionStateRules() != null) { + subscriptionStateRules().forEach(e -> e.validate()); + } + if (serviceTreeInfos() != null) { + serviceTreeInfos().forEach(e -> e.validate()); + } + if (requestHeaderOptions() != null) { + requestHeaderOptions().validate(); + } + if (templateDeploymentPolicy() != null) { + templateDeploymentPolicy().validate(); + } + if (extendedLocations() != null) { + extendedLocations().forEach(e -> e.validate()); + } + if (linkedOperationRules() != null) { + linkedOperationRules().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeEndpoint.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeEndpoint.java new file mode 100644 index 0000000000000..c72767646b88f --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeEndpoint.java @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.Duration; +import java.util.List; + +/** The ResourceTypeEndpoint model. */ +@Fluent +public final class ResourceTypeEndpoint { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceTypeEndpoint.class); + + /* + * The enabled property. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * The apiVersions property. + */ + @JsonProperty(value = "apiVersions") + private List apiVersions; + + /* + * The locations property. + */ + @JsonProperty(value = "locations") + private List locations; + + /* + * The requiredFeatures property. + */ + @JsonProperty(value = "requiredFeatures") + private List requiredFeatures; + + /* + * The featuresRule property. + */ + @JsonProperty(value = "featuresRule") + private ResourceTypeEndpointFeaturesRule featuresRule; + + /* + * The extensions property. + */ + @JsonProperty(value = "extensions") + private List extensions; + + /* + * The timeout property. + */ + @JsonProperty(value = "timeout") + private Duration timeout; + + /** + * Get the enabled property: The enabled property. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: The enabled property. + * + * @param enabled the enabled value to set. + * @return the ResourceTypeEndpoint object itself. + */ + public ResourceTypeEndpoint withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the apiVersions property: The apiVersions property. + * + * @return the apiVersions value. + */ + public List apiVersions() { + return this.apiVersions; + } + + /** + * Set the apiVersions property: The apiVersions property. + * + * @param apiVersions the apiVersions value to set. + * @return the ResourceTypeEndpoint object itself. + */ + public ResourceTypeEndpoint withApiVersions(List apiVersions) { + this.apiVersions = apiVersions; + return this; + } + + /** + * Get the locations property: The locations property. + * + * @return the locations value. + */ + public List locations() { + return this.locations; + } + + /** + * Set the locations property: The locations property. + * + * @param locations the locations value to set. + * @return the ResourceTypeEndpoint object itself. + */ + public ResourceTypeEndpoint withLocations(List locations) { + this.locations = locations; + return this; + } + + /** + * Get the requiredFeatures property: The requiredFeatures property. + * + * @return the requiredFeatures value. + */ + public List requiredFeatures() { + return this.requiredFeatures; + } + + /** + * Set the requiredFeatures property: The requiredFeatures property. + * + * @param requiredFeatures the requiredFeatures value to set. + * @return the ResourceTypeEndpoint object itself. + */ + public ResourceTypeEndpoint withRequiredFeatures(List requiredFeatures) { + this.requiredFeatures = requiredFeatures; + return this; + } + + /** + * Get the featuresRule property: The featuresRule property. + * + * @return the featuresRule value. + */ + public ResourceTypeEndpointFeaturesRule featuresRule() { + return this.featuresRule; + } + + /** + * Set the featuresRule property: The featuresRule property. + * + * @param featuresRule the featuresRule value to set. + * @return the ResourceTypeEndpoint object itself. + */ + public ResourceTypeEndpoint withFeaturesRule(ResourceTypeEndpointFeaturesRule featuresRule) { + this.featuresRule = featuresRule; + return this; + } + + /** + * Get the extensions property: The extensions property. + * + * @return the extensions value. + */ + public List extensions() { + return this.extensions; + } + + /** + * Set the extensions property: The extensions property. + * + * @param extensions the extensions value to set. + * @return the ResourceTypeEndpoint object itself. + */ + public ResourceTypeEndpoint withExtensions(List extensions) { + this.extensions = extensions; + return this; + } + + /** + * Get the timeout property: The timeout property. + * + * @return the timeout value. + */ + public Duration timeout() { + return this.timeout; + } + + /** + * Set the timeout property: The timeout property. + * + * @param timeout the timeout value to set. + * @return the ResourceTypeEndpoint object itself. + */ + public ResourceTypeEndpoint withTimeout(Duration timeout) { + this.timeout = timeout; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (featuresRule() != null) { + featuresRule().validate(); + } + if (extensions() != null) { + extensions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeEndpointFeaturesRule.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeEndpointFeaturesRule.java new file mode 100644 index 0000000000000..b1b44499e5083 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeEndpointFeaturesRule.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** The ResourceTypeEndpointFeaturesRule model. */ +@Immutable +public final class ResourceTypeEndpointFeaturesRule extends FeaturesRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceTypeEndpointFeaturesRule.class); + + /** {@inheritDoc} */ + @Override + public ResourceTypeEndpointFeaturesRule withRequiredFeaturesPolicy(FeaturesPolicy requiredFeaturesPolicy) { + super.withRequiredFeaturesPolicy(requiredFeaturesPolicy); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeExtension.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeExtension.java new file mode 100644 index 0000000000000..c5863ae016807 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeExtension.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.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.Duration; +import java.util.List; + +/** The ResourceTypeExtension model. */ +@Fluent +public final class ResourceTypeExtension { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceTypeExtension.class); + + /* + * The endpointUri property. + */ + @JsonProperty(value = "endpointUri") + private String endpointUri; + + /* + * The extensionCategories property. + */ + @JsonProperty(value = "extensionCategories") + private List extensionCategories; + + /* + * The timeout property. + */ + @JsonProperty(value = "timeout") + private Duration timeout; + + /** + * Get the endpointUri property: The endpointUri property. + * + * @return the endpointUri value. + */ + public String endpointUri() { + return this.endpointUri; + } + + /** + * Set the endpointUri property: The endpointUri property. + * + * @param endpointUri the endpointUri value to set. + * @return the ResourceTypeExtension object itself. + */ + public ResourceTypeExtension withEndpointUri(String endpointUri) { + this.endpointUri = endpointUri; + return this; + } + + /** + * Get the extensionCategories property: The extensionCategories property. + * + * @return the extensionCategories value. + */ + public List extensionCategories() { + return this.extensionCategories; + } + + /** + * Set the extensionCategories property: The extensionCategories property. + * + * @param extensionCategories the extensionCategories value to set. + * @return the ResourceTypeExtension object itself. + */ + public ResourceTypeExtension withExtensionCategories(List extensionCategories) { + this.extensionCategories = extensionCategories; + return this; + } + + /** + * Get the timeout property: The timeout property. + * + * @return the timeout value. + */ + public Duration timeout() { + return this.timeout; + } + + /** + * Set the timeout property: The timeout property. + * + * @param timeout the timeout value to set. + * @return the ResourceTypeExtension object itself. + */ + public ResourceTypeExtension withTimeout(Duration timeout) { + this.timeout = timeout; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeExtensionOptions.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeExtensionOptions.java new file mode 100644 index 0000000000000..73b4ea0f33ea9 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeExtensionOptions.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ResourceTypeExtensionOptions model. */ +@Fluent +public class ResourceTypeExtensionOptions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceTypeExtensionOptions.class); + + /* + * The resourceCreationBegin property. + */ + @JsonProperty(value = "resourceCreationBegin") + private ResourceTypeExtensionOptionsResourceCreationBegin resourceCreationBegin; + + /** + * Get the resourceCreationBegin property: The resourceCreationBegin property. + * + * @return the resourceCreationBegin value. + */ + public ResourceTypeExtensionOptionsResourceCreationBegin resourceCreationBegin() { + return this.resourceCreationBegin; + } + + /** + * Set the resourceCreationBegin property: The resourceCreationBegin property. + * + * @param resourceCreationBegin the resourceCreationBegin value to set. + * @return the ResourceTypeExtensionOptions object itself. + */ + public ResourceTypeExtensionOptions withResourceCreationBegin( + ResourceTypeExtensionOptionsResourceCreationBegin resourceCreationBegin) { + this.resourceCreationBegin = resourceCreationBegin; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (resourceCreationBegin() != null) { + resourceCreationBegin().validate(); + } + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeExtensionOptionsResourceCreationBegin.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeExtensionOptionsResourceCreationBegin.java new file mode 100644 index 0000000000000..00ef8f4f4cf46 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeExtensionOptionsResourceCreationBegin.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.providerhub.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.List; + +/** The ResourceTypeExtensionOptionsResourceCreationBegin model. */ +@Immutable +public final class ResourceTypeExtensionOptionsResourceCreationBegin extends ExtensionOptions { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ResourceTypeExtensionOptionsResourceCreationBegin.class); + + /** {@inheritDoc} */ + @Override + public ResourceTypeExtensionOptionsResourceCreationBegin withRequest(List request) { + super.withRequest(request); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceTypeExtensionOptionsResourceCreationBegin withResponse(List response) { + super.withResponse(response); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeFeaturesRule.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeFeaturesRule.java new file mode 100644 index 0000000000000..7ac1b1e825549 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeFeaturesRule.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** The ResourceTypeFeaturesRule model. */ +@Immutable +public final class ResourceTypeFeaturesRule extends FeaturesRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceTypeFeaturesRule.class); + + /** {@inheritDoc} */ + @Override + public ResourceTypeFeaturesRule withRequiredFeaturesPolicy(FeaturesPolicy requiredFeaturesPolicy) { + super.withRequiredFeaturesPolicy(requiredFeaturesPolicy); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeIdentityManagement.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeIdentityManagement.java new file mode 100644 index 0000000000000..3b5b214b5f600 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeIdentityManagement.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** The ResourceTypeIdentityManagement model. */ +@Immutable +public final class ResourceTypeIdentityManagement extends IdentityManagement { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceTypeIdentityManagement.class); + + /** {@inheritDoc} */ + @Override + public ResourceTypeIdentityManagement withType(IdentityManagementTypes type) { + super.withType(type); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeMarketplaceType.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeMarketplaceType.java new file mode 100644 index 0000000000000..06445004f295a --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeMarketplaceType.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ResourceTypeMarketplaceType. */ +public final class ResourceTypeMarketplaceType extends ExpandableStringEnum { + /** Static value NotSpecified for ResourceTypeMarketplaceType. */ + public static final ResourceTypeMarketplaceType NOT_SPECIFIED = fromString("NotSpecified"); + + /** Static value AddOn for ResourceTypeMarketplaceType. */ + public static final ResourceTypeMarketplaceType ADD_ON = fromString("AddOn"); + + /** Static value Bypass for ResourceTypeMarketplaceType. */ + public static final ResourceTypeMarketplaceType BYPASS = fromString("Bypass"); + + /** Static value Store for ResourceTypeMarketplaceType. */ + public static final ResourceTypeMarketplaceType STORE = fromString("Store"); + + /** + * Creates or finds a ResourceTypeMarketplaceType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResourceTypeMarketplaceType. + */ + @JsonCreator + public static ResourceTypeMarketplaceType fromString(String name) { + return fromString(name, ResourceTypeMarketplaceType.class); + } + + /** @return known ResourceTypeMarketplaceType values. */ + public static Collection values() { + return values(ResourceTypeMarketplaceType.class); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeRegistration.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeRegistration.java new file mode 100644 index 0000000000000..88539579c0612 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeRegistration.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.providerhub.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.providerhub.fluent.models.ResourceTypeRegistrationInner; + +/** An immutable client-side representation of ResourceTypeRegistration. */ +public interface ResourceTypeRegistration { + /** + * 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 properties property: The properties property. + * + * @return the properties value. + */ + ResourceTypeRegistrationProperties properties(); + + /** + * Gets the inner com.azure.resourcemanager.providerhub.fluent.models.ResourceTypeRegistrationInner object. + * + * @return the inner object. + */ + ResourceTypeRegistrationInner innerModel(); + + /** The entirety of the ResourceTypeRegistration definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The ResourceTypeRegistration definition stages. */ + interface DefinitionStages { + /** The first stage of the ResourceTypeRegistration definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the ResourceTypeRegistration definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies providerNamespace. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @return the next definition stage. + */ + WithCreate withExistingProviderRegistration(String providerNamespace); + } + /** + * The stage of the ResourceTypeRegistration 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + ResourceTypeRegistration create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ResourceTypeRegistration create(Context context); + } + /** The stage of the ResourceTypeRegistration definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: The properties property.. + * + * @param properties The properties property. + * @return the next definition stage. + */ + WithCreate withProperties(ResourceTypeRegistrationProperties properties); + } + } + /** + * Begins update for the ResourceTypeRegistration resource. + * + * @return the stage of resource update. + */ + ResourceTypeRegistration.Update update(); + + /** The template for ResourceTypeRegistration update. */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ResourceTypeRegistration apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ResourceTypeRegistration apply(Context context); + } + /** The ResourceTypeRegistration update stages. */ + interface UpdateStages { + /** The stage of the ResourceTypeRegistration update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: The properties property.. + * + * @param properties The properties property. + * @return the next definition stage. + */ + Update withProperties(ResourceTypeRegistrationProperties properties); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ResourceTypeRegistration refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ResourceTypeRegistration refresh(Context context); +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeRegistrationArrayResponseWithContinuation.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeRegistrationArrayResponseWithContinuation.java new file mode 100644 index 0000000000000..dcfa98de604be --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeRegistrationArrayResponseWithContinuation.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.providerhub.fluent.models.ResourceTypeRegistrationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The ResourceTypeRegistrationArrayResponseWithContinuation model. */ +@Fluent +public final class ResourceTypeRegistrationArrayResponseWithContinuation { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ResourceTypeRegistrationArrayResponseWithContinuation.class); + + /* + * The value property. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get to the next set of results, if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the ResourceTypeRegistrationArrayResponseWithContinuation object itself. + */ + public ResourceTypeRegistrationArrayResponseWithContinuation withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get to the next set of results, if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get to the next set of results, if there are any. + * + * @param nextLink the nextLink value to set. + * @return the ResourceTypeRegistrationArrayResponseWithContinuation object itself. + */ + public ResourceTypeRegistrationArrayResponseWithContinuation withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeRegistrationProperties.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeRegistrationProperties.java new file mode 100644 index 0000000000000..1132fa6081458 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeRegistrationProperties.java @@ -0,0 +1,243 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.List; + +/** The ResourceTypeRegistrationProperties model. */ +@Immutable +public final class ResourceTypeRegistrationProperties extends ResourceTypeRegistrationPropertiesAutoGenerated { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceTypeRegistrationProperties.class); + + /** {@inheritDoc} */ + @Override + public ResourceTypeRegistrationProperties withRoutingType(RoutingType routingType) { + super.withRoutingType(routingType); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceTypeRegistrationProperties withRegionality(Regionality regionality) { + super.withRegionality(regionality); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceTypeRegistrationProperties withEndpoints(List endpoints) { + super.withEndpoints(endpoints); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceTypeRegistrationProperties withExtensionOptions( + ResourceTypeRegistrationPropertiesExtensionOptions extensionOptions) { + super.withExtensionOptions(extensionOptions); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceTypeRegistrationProperties withMarketplaceType( + ResourceTypeRegistrationPropertiesMarketplaceType marketplaceType) { + super.withMarketplaceType(marketplaceType); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceTypeRegistrationProperties withSwaggerSpecifications( + List swaggerSpecifications) { + super.withSwaggerSpecifications(swaggerSpecifications); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceTypeRegistrationProperties withAllowedUnauthorizedActions(List allowedUnauthorizedActions) { + super.withAllowedUnauthorizedActions(allowedUnauthorizedActions); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceTypeRegistrationProperties withAuthorizationActionMappings( + List authorizationActionMappings) { + super.withAuthorizationActionMappings(authorizationActionMappings); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceTypeRegistrationProperties withLinkedAccessChecks(List linkedAccessChecks) { + super.withLinkedAccessChecks(linkedAccessChecks); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceTypeRegistrationProperties withDefaultApiVersion(String defaultApiVersion) { + super.withDefaultApiVersion(defaultApiVersion); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceTypeRegistrationProperties withLoggingRules(List loggingRules) { + super.withLoggingRules(loggingRules); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceTypeRegistrationProperties withThrottlingRules(List throttlingRules) { + super.withThrottlingRules(throttlingRules); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceTypeRegistrationProperties withRequiredFeatures(List requiredFeatures) { + super.withRequiredFeatures(requiredFeatures); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceTypeRegistrationProperties withFeaturesRule( + ResourceTypeRegistrationPropertiesFeaturesRule featuresRule) { + super.withFeaturesRule(featuresRule); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceTypeRegistrationProperties withEnableAsyncOperation(Boolean enableAsyncOperation) { + super.withEnableAsyncOperation(enableAsyncOperation); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceTypeRegistrationProperties withProvisioningState(ProvisioningState provisioningState) { + super.withProvisioningState(provisioningState); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceTypeRegistrationProperties withEnableThirdPartyS2S(Boolean enableThirdPartyS2S) { + super.withEnableThirdPartyS2S(enableThirdPartyS2S); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceTypeRegistrationProperties withSubscriptionLifecycleNotificationSpecifications( + ResourceTypeRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications + subscriptionLifecycleNotificationSpecifications) { + super.withSubscriptionLifecycleNotificationSpecifications(subscriptionLifecycleNotificationSpecifications); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceTypeRegistrationProperties withIsPureProxy(Boolean isPureProxy) { + super.withIsPureProxy(isPureProxy); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceTypeRegistrationProperties withIdentityManagement( + ResourceTypeRegistrationPropertiesIdentityManagement identityManagement) { + super.withIdentityManagement(identityManagement); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceTypeRegistrationProperties withCheckNameAvailabilitySpecifications( + ResourceTypeRegistrationPropertiesCheckNameAvailabilitySpecifications checkNameAvailabilitySpecifications) { + super.withCheckNameAvailabilitySpecifications(checkNameAvailabilitySpecifications); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceTypeRegistrationProperties withDisallowedActionVerbs(List disallowedActionVerbs) { + super.withDisallowedActionVerbs(disallowedActionVerbs); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceTypeRegistrationProperties withServiceTreeInfos(List serviceTreeInfos) { + super.withServiceTreeInfos(serviceTreeInfos); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceTypeRegistrationProperties withRequestHeaderOptions( + ResourceTypeRegistrationPropertiesRequestHeaderOptions requestHeaderOptions) { + super.withRequestHeaderOptions(requestHeaderOptions); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceTypeRegistrationProperties withSubscriptionStateRules( + List subscriptionStateRules) { + super.withSubscriptionStateRules(subscriptionStateRules); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceTypeRegistrationProperties withTemplateDeploymentOptions( + ResourceTypeRegistrationPropertiesTemplateDeploymentOptions templateDeploymentOptions) { + super.withTemplateDeploymentOptions(templateDeploymentOptions); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceTypeRegistrationProperties withExtendedLocations(List extendedLocations) { + super.withExtendedLocations(extendedLocations); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceTypeRegistrationProperties withResourceMovePolicy( + ResourceTypeRegistrationPropertiesResourceMovePolicy resourceMovePolicy) { + super.withResourceMovePolicy(resourceMovePolicy); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceTypeRegistrationProperties withResourceDeletionPolicy( + ResourceDeletionPolicy resourceDeletionPolicy) { + super.withResourceDeletionPolicy(resourceDeletionPolicy); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeRegistrationPropertiesAutoGenerated.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeRegistrationPropertiesAutoGenerated.java new file mode 100644 index 0000000000000..7273af11cfbf7 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeRegistrationPropertiesAutoGenerated.java @@ -0,0 +1,855 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The ResourceTypeRegistrationPropertiesAutoGenerated model. */ +@Fluent +public class ResourceTypeRegistrationPropertiesAutoGenerated { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ResourceTypeRegistrationPropertiesAutoGenerated.class); + + /* + * The routingType property. + */ + @JsonProperty(value = "routingType") + private RoutingType routingType; + + /* + * The regionality property. + */ + @JsonProperty(value = "regionality") + private Regionality regionality; + + /* + * The endpoints property. + */ + @JsonProperty(value = "endpoints") + private List endpoints; + + /* + * The extensionOptions property. + */ + @JsonProperty(value = "extensionOptions") + private ResourceTypeRegistrationPropertiesExtensionOptions extensionOptions; + + /* + * The marketplaceType property. + */ + @JsonProperty(value = "marketplaceType") + private ResourceTypeRegistrationPropertiesMarketplaceType marketplaceType; + + /* + * The swaggerSpecifications property. + */ + @JsonProperty(value = "swaggerSpecifications") + private List swaggerSpecifications; + + /* + * The allowedUnauthorizedActions property. + */ + @JsonProperty(value = "allowedUnauthorizedActions") + private List allowedUnauthorizedActions; + + /* + * The authorizationActionMappings property. + */ + @JsonProperty(value = "authorizationActionMappings") + private List authorizationActionMappings; + + /* + * The linkedAccessChecks property. + */ + @JsonProperty(value = "linkedAccessChecks") + private List linkedAccessChecks; + + /* + * The defaultApiVersion property. + */ + @JsonProperty(value = "defaultApiVersion") + private String defaultApiVersion; + + /* + * The loggingRules property. + */ + @JsonProperty(value = "loggingRules") + private List loggingRules; + + /* + * The throttlingRules property. + */ + @JsonProperty(value = "throttlingRules") + private List throttlingRules; + + /* + * The requiredFeatures property. + */ + @JsonProperty(value = "requiredFeatures") + private List requiredFeatures; + + /* + * The featuresRule property. + */ + @JsonProperty(value = "featuresRule") + private ResourceTypeRegistrationPropertiesFeaturesRule featuresRule; + + /* + * The enableAsyncOperation property. + */ + @JsonProperty(value = "enableAsyncOperation") + private Boolean enableAsyncOperation; + + /* + * The provisioningState property. + */ + @JsonProperty(value = "provisioningState") + private ProvisioningState provisioningState; + + /* + * The enableThirdPartyS2S property. + */ + @JsonProperty(value = "enableThirdPartyS2S") + private Boolean enableThirdPartyS2S; + + /* + * The subscriptionLifecycleNotificationSpecifications property. + */ + @JsonProperty(value = "subscriptionLifecycleNotificationSpecifications") + private ResourceTypeRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications + subscriptionLifecycleNotificationSpecifications; + + /* + * The isPureProxy property. + */ + @JsonProperty(value = "isPureProxy") + private Boolean isPureProxy; + + /* + * The identityManagement property. + */ + @JsonProperty(value = "identityManagement") + private ResourceTypeRegistrationPropertiesIdentityManagement identityManagement; + + /* + * The checkNameAvailabilitySpecifications property. + */ + @JsonProperty(value = "checkNameAvailabilitySpecifications") + private ResourceTypeRegistrationPropertiesCheckNameAvailabilitySpecifications checkNameAvailabilitySpecifications; + + /* + * The disallowedActionVerbs property. + */ + @JsonProperty(value = "disallowedActionVerbs") + private List disallowedActionVerbs; + + /* + * The serviceTreeInfos property. + */ + @JsonProperty(value = "serviceTreeInfos") + private List serviceTreeInfos; + + /* + * The requestHeaderOptions property. + */ + @JsonProperty(value = "requestHeaderOptions") + private ResourceTypeRegistrationPropertiesRequestHeaderOptions requestHeaderOptions; + + /* + * The subscriptionStateRules property. + */ + @JsonProperty(value = "subscriptionStateRules") + private List subscriptionStateRules; + + /* + * The templateDeploymentOptions property. + */ + @JsonProperty(value = "templateDeploymentOptions") + private ResourceTypeRegistrationPropertiesTemplateDeploymentOptions templateDeploymentOptions; + + /* + * The extendedLocations property. + */ + @JsonProperty(value = "extendedLocations") + private List extendedLocations; + + /* + * The resourceMovePolicy property. + */ + @JsonProperty(value = "resourceMovePolicy") + private ResourceTypeRegistrationPropertiesResourceMovePolicy resourceMovePolicy; + + /* + * The resourceDeletionPolicy property. + */ + @JsonProperty(value = "resourceDeletionPolicy") + private ResourceDeletionPolicy resourceDeletionPolicy; + + /** + * Get the routingType property: The routingType property. + * + * @return the routingType value. + */ + public RoutingType routingType() { + return this.routingType; + } + + /** + * Set the routingType property: The routingType property. + * + * @param routingType the routingType value to set. + * @return the ResourceTypeRegistrationPropertiesAutoGenerated object itself. + */ + public ResourceTypeRegistrationPropertiesAutoGenerated withRoutingType(RoutingType routingType) { + this.routingType = routingType; + return this; + } + + /** + * Get the regionality property: The regionality property. + * + * @return the regionality value. + */ + public Regionality regionality() { + return this.regionality; + } + + /** + * Set the regionality property: The regionality property. + * + * @param regionality the regionality value to set. + * @return the ResourceTypeRegistrationPropertiesAutoGenerated object itself. + */ + public ResourceTypeRegistrationPropertiesAutoGenerated withRegionality(Regionality regionality) { + this.regionality = regionality; + return this; + } + + /** + * Get the endpoints property: The endpoints property. + * + * @return the endpoints value. + */ + public List endpoints() { + return this.endpoints; + } + + /** + * Set the endpoints property: The endpoints property. + * + * @param endpoints the endpoints value to set. + * @return the ResourceTypeRegistrationPropertiesAutoGenerated object itself. + */ + public ResourceTypeRegistrationPropertiesAutoGenerated withEndpoints(List endpoints) { + this.endpoints = endpoints; + return this; + } + + /** + * Get the extensionOptions property: The extensionOptions property. + * + * @return the extensionOptions value. + */ + public ResourceTypeRegistrationPropertiesExtensionOptions extensionOptions() { + return this.extensionOptions; + } + + /** + * Set the extensionOptions property: The extensionOptions property. + * + * @param extensionOptions the extensionOptions value to set. + * @return the ResourceTypeRegistrationPropertiesAutoGenerated object itself. + */ + public ResourceTypeRegistrationPropertiesAutoGenerated withExtensionOptions( + ResourceTypeRegistrationPropertiesExtensionOptions extensionOptions) { + this.extensionOptions = extensionOptions; + return this; + } + + /** + * Get the marketplaceType property: The marketplaceType property. + * + * @return the marketplaceType value. + */ + public ResourceTypeRegistrationPropertiesMarketplaceType marketplaceType() { + return this.marketplaceType; + } + + /** + * Set the marketplaceType property: The marketplaceType property. + * + * @param marketplaceType the marketplaceType value to set. + * @return the ResourceTypeRegistrationPropertiesAutoGenerated object itself. + */ + public ResourceTypeRegistrationPropertiesAutoGenerated withMarketplaceType( + ResourceTypeRegistrationPropertiesMarketplaceType marketplaceType) { + this.marketplaceType = marketplaceType; + return this; + } + + /** + * Get the swaggerSpecifications property: The swaggerSpecifications property. + * + * @return the swaggerSpecifications value. + */ + public List swaggerSpecifications() { + return this.swaggerSpecifications; + } + + /** + * Set the swaggerSpecifications property: The swaggerSpecifications property. + * + * @param swaggerSpecifications the swaggerSpecifications value to set. + * @return the ResourceTypeRegistrationPropertiesAutoGenerated object itself. + */ + public ResourceTypeRegistrationPropertiesAutoGenerated withSwaggerSpecifications( + List swaggerSpecifications) { + this.swaggerSpecifications = swaggerSpecifications; + return this; + } + + /** + * Get the allowedUnauthorizedActions property: The allowedUnauthorizedActions property. + * + * @return the allowedUnauthorizedActions value. + */ + public List allowedUnauthorizedActions() { + return this.allowedUnauthorizedActions; + } + + /** + * Set the allowedUnauthorizedActions property: The allowedUnauthorizedActions property. + * + * @param allowedUnauthorizedActions the allowedUnauthorizedActions value to set. + * @return the ResourceTypeRegistrationPropertiesAutoGenerated object itself. + */ + public ResourceTypeRegistrationPropertiesAutoGenerated withAllowedUnauthorizedActions( + List allowedUnauthorizedActions) { + this.allowedUnauthorizedActions = allowedUnauthorizedActions; + return this; + } + + /** + * Get the authorizationActionMappings property: The authorizationActionMappings property. + * + * @return the authorizationActionMappings value. + */ + public List authorizationActionMappings() { + return this.authorizationActionMappings; + } + + /** + * Set the authorizationActionMappings property: The authorizationActionMappings property. + * + * @param authorizationActionMappings the authorizationActionMappings value to set. + * @return the ResourceTypeRegistrationPropertiesAutoGenerated object itself. + */ + public ResourceTypeRegistrationPropertiesAutoGenerated withAuthorizationActionMappings( + List authorizationActionMappings) { + this.authorizationActionMappings = authorizationActionMappings; + return this; + } + + /** + * Get the linkedAccessChecks property: The linkedAccessChecks property. + * + * @return the linkedAccessChecks value. + */ + public List linkedAccessChecks() { + return this.linkedAccessChecks; + } + + /** + * Set the linkedAccessChecks property: The linkedAccessChecks property. + * + * @param linkedAccessChecks the linkedAccessChecks value to set. + * @return the ResourceTypeRegistrationPropertiesAutoGenerated object itself. + */ + public ResourceTypeRegistrationPropertiesAutoGenerated withLinkedAccessChecks( + List linkedAccessChecks) { + this.linkedAccessChecks = linkedAccessChecks; + return this; + } + + /** + * Get the defaultApiVersion property: The defaultApiVersion property. + * + * @return the defaultApiVersion value. + */ + public String defaultApiVersion() { + return this.defaultApiVersion; + } + + /** + * Set the defaultApiVersion property: The defaultApiVersion property. + * + * @param defaultApiVersion the defaultApiVersion value to set. + * @return the ResourceTypeRegistrationPropertiesAutoGenerated object itself. + */ + public ResourceTypeRegistrationPropertiesAutoGenerated withDefaultApiVersion(String defaultApiVersion) { + this.defaultApiVersion = defaultApiVersion; + return this; + } + + /** + * Get the loggingRules property: The loggingRules property. + * + * @return the loggingRules value. + */ + public List loggingRules() { + return this.loggingRules; + } + + /** + * Set the loggingRules property: The loggingRules property. + * + * @param loggingRules the loggingRules value to set. + * @return the ResourceTypeRegistrationPropertiesAutoGenerated object itself. + */ + public ResourceTypeRegistrationPropertiesAutoGenerated withLoggingRules(List loggingRules) { + this.loggingRules = loggingRules; + return this; + } + + /** + * Get the throttlingRules property: The throttlingRules property. + * + * @return the throttlingRules value. + */ + public List throttlingRules() { + return this.throttlingRules; + } + + /** + * Set the throttlingRules property: The throttlingRules property. + * + * @param throttlingRules the throttlingRules value to set. + * @return the ResourceTypeRegistrationPropertiesAutoGenerated object itself. + */ + public ResourceTypeRegistrationPropertiesAutoGenerated withThrottlingRules(List throttlingRules) { + this.throttlingRules = throttlingRules; + return this; + } + + /** + * Get the requiredFeatures property: The requiredFeatures property. + * + * @return the requiredFeatures value. + */ + public List requiredFeatures() { + return this.requiredFeatures; + } + + /** + * Set the requiredFeatures property: The requiredFeatures property. + * + * @param requiredFeatures the requiredFeatures value to set. + * @return the ResourceTypeRegistrationPropertiesAutoGenerated object itself. + */ + public ResourceTypeRegistrationPropertiesAutoGenerated withRequiredFeatures(List requiredFeatures) { + this.requiredFeatures = requiredFeatures; + return this; + } + + /** + * Get the featuresRule property: The featuresRule property. + * + * @return the featuresRule value. + */ + public ResourceTypeRegistrationPropertiesFeaturesRule featuresRule() { + return this.featuresRule; + } + + /** + * Set the featuresRule property: The featuresRule property. + * + * @param featuresRule the featuresRule value to set. + * @return the ResourceTypeRegistrationPropertiesAutoGenerated object itself. + */ + public ResourceTypeRegistrationPropertiesAutoGenerated withFeaturesRule( + ResourceTypeRegistrationPropertiesFeaturesRule featuresRule) { + this.featuresRule = featuresRule; + return this; + } + + /** + * Get the enableAsyncOperation property: The enableAsyncOperation property. + * + * @return the enableAsyncOperation value. + */ + public Boolean enableAsyncOperation() { + return this.enableAsyncOperation; + } + + /** + * Set the enableAsyncOperation property: The enableAsyncOperation property. + * + * @param enableAsyncOperation the enableAsyncOperation value to set. + * @return the ResourceTypeRegistrationPropertiesAutoGenerated object itself. + */ + public ResourceTypeRegistrationPropertiesAutoGenerated withEnableAsyncOperation(Boolean enableAsyncOperation) { + this.enableAsyncOperation = enableAsyncOperation; + return this; + } + + /** + * Get the provisioningState property: The provisioningState property. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: The provisioningState property. + * + * @param provisioningState the provisioningState value to set. + * @return the ResourceTypeRegistrationPropertiesAutoGenerated object itself. + */ + public ResourceTypeRegistrationPropertiesAutoGenerated withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the enableThirdPartyS2S property: The enableThirdPartyS2S property. + * + * @return the enableThirdPartyS2S value. + */ + public Boolean enableThirdPartyS2S() { + return this.enableThirdPartyS2S; + } + + /** + * Set the enableThirdPartyS2S property: The enableThirdPartyS2S property. + * + * @param enableThirdPartyS2S the enableThirdPartyS2S value to set. + * @return the ResourceTypeRegistrationPropertiesAutoGenerated object itself. + */ + public ResourceTypeRegistrationPropertiesAutoGenerated withEnableThirdPartyS2S(Boolean enableThirdPartyS2S) { + this.enableThirdPartyS2S = enableThirdPartyS2S; + return this; + } + + /** + * Get the subscriptionLifecycleNotificationSpecifications property: The + * subscriptionLifecycleNotificationSpecifications property. + * + * @return the subscriptionLifecycleNotificationSpecifications value. + */ + public ResourceTypeRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications + subscriptionLifecycleNotificationSpecifications() { + return this.subscriptionLifecycleNotificationSpecifications; + } + + /** + * Set the subscriptionLifecycleNotificationSpecifications property: The + * subscriptionLifecycleNotificationSpecifications property. + * + * @param subscriptionLifecycleNotificationSpecifications the subscriptionLifecycleNotificationSpecifications value + * to set. + * @return the ResourceTypeRegistrationPropertiesAutoGenerated object itself. + */ + public ResourceTypeRegistrationPropertiesAutoGenerated withSubscriptionLifecycleNotificationSpecifications( + ResourceTypeRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications + subscriptionLifecycleNotificationSpecifications) { + this.subscriptionLifecycleNotificationSpecifications = subscriptionLifecycleNotificationSpecifications; + return this; + } + + /** + * Get the isPureProxy property: The isPureProxy property. + * + * @return the isPureProxy value. + */ + public Boolean isPureProxy() { + return this.isPureProxy; + } + + /** + * Set the isPureProxy property: The isPureProxy property. + * + * @param isPureProxy the isPureProxy value to set. + * @return the ResourceTypeRegistrationPropertiesAutoGenerated object itself. + */ + public ResourceTypeRegistrationPropertiesAutoGenerated withIsPureProxy(Boolean isPureProxy) { + this.isPureProxy = isPureProxy; + return this; + } + + /** + * Get the identityManagement property: The identityManagement property. + * + * @return the identityManagement value. + */ + public ResourceTypeRegistrationPropertiesIdentityManagement identityManagement() { + return this.identityManagement; + } + + /** + * Set the identityManagement property: The identityManagement property. + * + * @param identityManagement the identityManagement value to set. + * @return the ResourceTypeRegistrationPropertiesAutoGenerated object itself. + */ + public ResourceTypeRegistrationPropertiesAutoGenerated withIdentityManagement( + ResourceTypeRegistrationPropertiesIdentityManagement identityManagement) { + this.identityManagement = identityManagement; + return this; + } + + /** + * Get the checkNameAvailabilitySpecifications property: The checkNameAvailabilitySpecifications property. + * + * @return the checkNameAvailabilitySpecifications value. + */ + public ResourceTypeRegistrationPropertiesCheckNameAvailabilitySpecifications checkNameAvailabilitySpecifications() { + return this.checkNameAvailabilitySpecifications; + } + + /** + * Set the checkNameAvailabilitySpecifications property: The checkNameAvailabilitySpecifications property. + * + * @param checkNameAvailabilitySpecifications the checkNameAvailabilitySpecifications value to set. + * @return the ResourceTypeRegistrationPropertiesAutoGenerated object itself. + */ + public ResourceTypeRegistrationPropertiesAutoGenerated withCheckNameAvailabilitySpecifications( + ResourceTypeRegistrationPropertiesCheckNameAvailabilitySpecifications checkNameAvailabilitySpecifications) { + this.checkNameAvailabilitySpecifications = checkNameAvailabilitySpecifications; + return this; + } + + /** + * Get the disallowedActionVerbs property: The disallowedActionVerbs property. + * + * @return the disallowedActionVerbs value. + */ + public List disallowedActionVerbs() { + return this.disallowedActionVerbs; + } + + /** + * Set the disallowedActionVerbs property: The disallowedActionVerbs property. + * + * @param disallowedActionVerbs the disallowedActionVerbs value to set. + * @return the ResourceTypeRegistrationPropertiesAutoGenerated object itself. + */ + public ResourceTypeRegistrationPropertiesAutoGenerated withDisallowedActionVerbs( + List disallowedActionVerbs) { + this.disallowedActionVerbs = disallowedActionVerbs; + return this; + } + + /** + * Get the serviceTreeInfos property: The serviceTreeInfos property. + * + * @return the serviceTreeInfos value. + */ + public List serviceTreeInfos() { + return this.serviceTreeInfos; + } + + /** + * Set the serviceTreeInfos property: The serviceTreeInfos property. + * + * @param serviceTreeInfos the serviceTreeInfos value to set. + * @return the ResourceTypeRegistrationPropertiesAutoGenerated object itself. + */ + public ResourceTypeRegistrationPropertiesAutoGenerated withServiceTreeInfos( + List serviceTreeInfos) { + this.serviceTreeInfos = serviceTreeInfos; + return this; + } + + /** + * Get the requestHeaderOptions property: The requestHeaderOptions property. + * + * @return the requestHeaderOptions value. + */ + public ResourceTypeRegistrationPropertiesRequestHeaderOptions requestHeaderOptions() { + return this.requestHeaderOptions; + } + + /** + * Set the requestHeaderOptions property: The requestHeaderOptions property. + * + * @param requestHeaderOptions the requestHeaderOptions value to set. + * @return the ResourceTypeRegistrationPropertiesAutoGenerated object itself. + */ + public ResourceTypeRegistrationPropertiesAutoGenerated withRequestHeaderOptions( + ResourceTypeRegistrationPropertiesRequestHeaderOptions requestHeaderOptions) { + this.requestHeaderOptions = requestHeaderOptions; + return this; + } + + /** + * Get the subscriptionStateRules property: The subscriptionStateRules property. + * + * @return the subscriptionStateRules value. + */ + public List subscriptionStateRules() { + return this.subscriptionStateRules; + } + + /** + * Set the subscriptionStateRules property: The subscriptionStateRules property. + * + * @param subscriptionStateRules the subscriptionStateRules value to set. + * @return the ResourceTypeRegistrationPropertiesAutoGenerated object itself. + */ + public ResourceTypeRegistrationPropertiesAutoGenerated withSubscriptionStateRules( + List subscriptionStateRules) { + this.subscriptionStateRules = subscriptionStateRules; + return this; + } + + /** + * Get the templateDeploymentOptions property: The templateDeploymentOptions property. + * + * @return the templateDeploymentOptions value. + */ + public ResourceTypeRegistrationPropertiesTemplateDeploymentOptions templateDeploymentOptions() { + return this.templateDeploymentOptions; + } + + /** + * Set the templateDeploymentOptions property: The templateDeploymentOptions property. + * + * @param templateDeploymentOptions the templateDeploymentOptions value to set. + * @return the ResourceTypeRegistrationPropertiesAutoGenerated object itself. + */ + public ResourceTypeRegistrationPropertiesAutoGenerated withTemplateDeploymentOptions( + ResourceTypeRegistrationPropertiesTemplateDeploymentOptions templateDeploymentOptions) { + this.templateDeploymentOptions = templateDeploymentOptions; + return this; + } + + /** + * Get the extendedLocations property: The extendedLocations property. + * + * @return the extendedLocations value. + */ + public List extendedLocations() { + return this.extendedLocations; + } + + /** + * Set the extendedLocations property: The extendedLocations property. + * + * @param extendedLocations the extendedLocations value to set. + * @return the ResourceTypeRegistrationPropertiesAutoGenerated object itself. + */ + public ResourceTypeRegistrationPropertiesAutoGenerated withExtendedLocations( + List extendedLocations) { + this.extendedLocations = extendedLocations; + return this; + } + + /** + * Get the resourceMovePolicy property: The resourceMovePolicy property. + * + * @return the resourceMovePolicy value. + */ + public ResourceTypeRegistrationPropertiesResourceMovePolicy resourceMovePolicy() { + return this.resourceMovePolicy; + } + + /** + * Set the resourceMovePolicy property: The resourceMovePolicy property. + * + * @param resourceMovePolicy the resourceMovePolicy value to set. + * @return the ResourceTypeRegistrationPropertiesAutoGenerated object itself. + */ + public ResourceTypeRegistrationPropertiesAutoGenerated withResourceMovePolicy( + ResourceTypeRegistrationPropertiesResourceMovePolicy resourceMovePolicy) { + this.resourceMovePolicy = resourceMovePolicy; + return this; + } + + /** + * Get the resourceDeletionPolicy property: The resourceDeletionPolicy property. + * + * @return the resourceDeletionPolicy value. + */ + public ResourceDeletionPolicy resourceDeletionPolicy() { + return this.resourceDeletionPolicy; + } + + /** + * Set the resourceDeletionPolicy property: The resourceDeletionPolicy property. + * + * @param resourceDeletionPolicy the resourceDeletionPolicy value to set. + * @return the ResourceTypeRegistrationPropertiesAutoGenerated object itself. + */ + public ResourceTypeRegistrationPropertiesAutoGenerated withResourceDeletionPolicy( + ResourceDeletionPolicy resourceDeletionPolicy) { + this.resourceDeletionPolicy = resourceDeletionPolicy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (endpoints() != null) { + endpoints().forEach(e -> e.validate()); + } + if (extensionOptions() != null) { + extensionOptions().validate(); + } + if (swaggerSpecifications() != null) { + swaggerSpecifications().forEach(e -> e.validate()); + } + if (authorizationActionMappings() != null) { + authorizationActionMappings().forEach(e -> e.validate()); + } + if (linkedAccessChecks() != null) { + linkedAccessChecks().forEach(e -> e.validate()); + } + if (loggingRules() != null) { + loggingRules().forEach(e -> e.validate()); + } + if (throttlingRules() != null) { + throttlingRules().forEach(e -> e.validate()); + } + if (featuresRule() != null) { + featuresRule().validate(); + } + if (subscriptionLifecycleNotificationSpecifications() != null) { + subscriptionLifecycleNotificationSpecifications().validate(); + } + if (identityManagement() != null) { + identityManagement().validate(); + } + if (checkNameAvailabilitySpecifications() != null) { + checkNameAvailabilitySpecifications().validate(); + } + if (serviceTreeInfos() != null) { + serviceTreeInfos().forEach(e -> e.validate()); + } + if (requestHeaderOptions() != null) { + requestHeaderOptions().validate(); + } + if (subscriptionStateRules() != null) { + subscriptionStateRules().forEach(e -> e.validate()); + } + if (templateDeploymentOptions() != null) { + templateDeploymentOptions().validate(); + } + if (extendedLocations() != null) { + extendedLocations().forEach(e -> e.validate()); + } + if (resourceMovePolicy() != null) { + resourceMovePolicy().validate(); + } + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeRegistrationPropertiesCheckNameAvailabilitySpecifications.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeRegistrationPropertiesCheckNameAvailabilitySpecifications.java new file mode 100644 index 0000000000000..b246424fbe5d9 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeRegistrationPropertiesCheckNameAvailabilitySpecifications.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.providerhub.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.List; + +/** The ResourceTypeRegistrationPropertiesCheckNameAvailabilitySpecifications model. */ +@Immutable +public final class ResourceTypeRegistrationPropertiesCheckNameAvailabilitySpecifications + extends CheckNameAvailabilitySpecifications { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(ResourceTypeRegistrationPropertiesCheckNameAvailabilitySpecifications.class); + + /** {@inheritDoc} */ + @Override + public ResourceTypeRegistrationPropertiesCheckNameAvailabilitySpecifications withEnableDefaultValidation( + Boolean enableDefaultValidation) { + super.withEnableDefaultValidation(enableDefaultValidation); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceTypeRegistrationPropertiesCheckNameAvailabilitySpecifications withResourceTypesWithCustomValidation( + List resourceTypesWithCustomValidation) { + super.withResourceTypesWithCustomValidation(resourceTypesWithCustomValidation); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeRegistrationPropertiesExtensionOptions.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeRegistrationPropertiesExtensionOptions.java new file mode 100644 index 0000000000000..c769067e41b89 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeRegistrationPropertiesExtensionOptions.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.providerhub.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** The ResourceTypeRegistrationPropertiesExtensionOptions model. */ +@Immutable +public final class ResourceTypeRegistrationPropertiesExtensionOptions extends ResourceTypeExtensionOptions { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ResourceTypeRegistrationPropertiesExtensionOptions.class); + + /** {@inheritDoc} */ + @Override + public ResourceTypeRegistrationPropertiesExtensionOptions withResourceCreationBegin( + ResourceTypeExtensionOptionsResourceCreationBegin resourceCreationBegin) { + super.withResourceCreationBegin(resourceCreationBegin); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeRegistrationPropertiesFeaturesRule.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeRegistrationPropertiesFeaturesRule.java new file mode 100644 index 0000000000000..1ec9240973f12 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeRegistrationPropertiesFeaturesRule.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.providerhub.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** The ResourceTypeRegistrationPropertiesFeaturesRule model. */ +@Immutable +public final class ResourceTypeRegistrationPropertiesFeaturesRule extends FeaturesRule { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ResourceTypeRegistrationPropertiesFeaturesRule.class); + + /** {@inheritDoc} */ + @Override + public ResourceTypeRegistrationPropertiesFeaturesRule withRequiredFeaturesPolicy( + FeaturesPolicy requiredFeaturesPolicy) { + super.withRequiredFeaturesPolicy(requiredFeaturesPolicy); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeRegistrationPropertiesIdentityManagement.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeRegistrationPropertiesIdentityManagement.java new file mode 100644 index 0000000000000..bda757dc531c1 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeRegistrationPropertiesIdentityManagement.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** The ResourceTypeRegistrationPropertiesIdentityManagement model. */ +@Immutable +public final class ResourceTypeRegistrationPropertiesIdentityManagement extends IdentityManagementProperties { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ResourceTypeRegistrationPropertiesIdentityManagement.class); + + /** {@inheritDoc} */ + @Override + public ResourceTypeRegistrationPropertiesIdentityManagement withType(IdentityManagementTypes type) { + super.withType(type); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceTypeRegistrationPropertiesIdentityManagement withApplicationId(String applicationId) { + super.withApplicationId(applicationId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeRegistrationPropertiesMarketplaceType.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeRegistrationPropertiesMarketplaceType.java new file mode 100644 index 0000000000000..7b6346fc18d36 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeRegistrationPropertiesMarketplaceType.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.providerhub.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ResourceTypeRegistrationPropertiesMarketplaceType. */ +public final class ResourceTypeRegistrationPropertiesMarketplaceType + extends ExpandableStringEnum { + /** Static value NotSpecified for ResourceTypeRegistrationPropertiesMarketplaceType. */ + public static final ResourceTypeRegistrationPropertiesMarketplaceType NOT_SPECIFIED = fromString("NotSpecified"); + + /** Static value AddOn for ResourceTypeRegistrationPropertiesMarketplaceType. */ + public static final ResourceTypeRegistrationPropertiesMarketplaceType ADD_ON = fromString("AddOn"); + + /** Static value Bypass for ResourceTypeRegistrationPropertiesMarketplaceType. */ + public static final ResourceTypeRegistrationPropertiesMarketplaceType BYPASS = fromString("Bypass"); + + /** Static value Store for ResourceTypeRegistrationPropertiesMarketplaceType. */ + public static final ResourceTypeRegistrationPropertiesMarketplaceType STORE = fromString("Store"); + + /** + * Creates or finds a ResourceTypeRegistrationPropertiesMarketplaceType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResourceTypeRegistrationPropertiesMarketplaceType. + */ + @JsonCreator + public static ResourceTypeRegistrationPropertiesMarketplaceType fromString(String name) { + return fromString(name, ResourceTypeRegistrationPropertiesMarketplaceType.class); + } + + /** @return known ResourceTypeRegistrationPropertiesMarketplaceType values. */ + public static Collection values() { + return values(ResourceTypeRegistrationPropertiesMarketplaceType.class); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeRegistrationPropertiesRequestHeaderOptions.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeRegistrationPropertiesRequestHeaderOptions.java new file mode 100644 index 0000000000000..4992e8f556a53 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeRegistrationPropertiesRequestHeaderOptions.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** The ResourceTypeRegistrationPropertiesRequestHeaderOptions model. */ +@Immutable +public final class ResourceTypeRegistrationPropertiesRequestHeaderOptions extends RequestHeaderOptions { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ResourceTypeRegistrationPropertiesRequestHeaderOptions.class); + + /** {@inheritDoc} */ + @Override + public ResourceTypeRegistrationPropertiesRequestHeaderOptions withOptInHeaders(OptInHeaderType optInHeaders) { + super.withOptInHeaders(optInHeaders); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeRegistrationPropertiesResourceMovePolicy.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeRegistrationPropertiesResourceMovePolicy.java new file mode 100644 index 0000000000000..e4e192558e2d0 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeRegistrationPropertiesResourceMovePolicy.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.providerhub.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** The ResourceTypeRegistrationPropertiesResourceMovePolicy model. */ +@Immutable +public final class ResourceTypeRegistrationPropertiesResourceMovePolicy extends ResourceMovePolicy { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ResourceTypeRegistrationPropertiesResourceMovePolicy.class); + + /** {@inheritDoc} */ + @Override + public ResourceTypeRegistrationPropertiesResourceMovePolicy withValidationRequired(Boolean validationRequired) { + super.withValidationRequired(validationRequired); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceTypeRegistrationPropertiesResourceMovePolicy withCrossResourceGroupMoveEnabled( + Boolean crossResourceGroupMoveEnabled) { + super.withCrossResourceGroupMoveEnabled(crossResourceGroupMoveEnabled); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceTypeRegistrationPropertiesResourceMovePolicy withCrossSubscriptionMoveEnabled( + Boolean crossSubscriptionMoveEnabled) { + super.withCrossSubscriptionMoveEnabled(crossSubscriptionMoveEnabled); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications.java new file mode 100644 index 0000000000000..1b33ec4e6b99b --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.time.Duration; +import java.util.List; + +/** The ResourceTypeRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications model. */ +@Immutable +public final class ResourceTypeRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications + extends SubscriptionLifecycleNotificationSpecifications { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(ResourceTypeRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications.class); + + /** {@inheritDoc} */ + @Override + public ResourceTypeRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications + withSubscriptionStateOverrideActions(List subscriptionStateOverrideActions) { + super.withSubscriptionStateOverrideActions(subscriptionStateOverrideActions); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceTypeRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications withSoftDeleteTtl( + Duration softDeleteTtl) { + super.withSoftDeleteTtl(softDeleteTtl); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeRegistrationPropertiesTemplateDeploymentOptions.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeRegistrationPropertiesTemplateDeploymentOptions.java new file mode 100644 index 0000000000000..a070088eaee55 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeRegistrationPropertiesTemplateDeploymentOptions.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.providerhub.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.List; + +/** The ResourceTypeRegistrationPropertiesTemplateDeploymentOptions model. */ +@Immutable +public final class ResourceTypeRegistrationPropertiesTemplateDeploymentOptions extends TemplateDeploymentOptions { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(ResourceTypeRegistrationPropertiesTemplateDeploymentOptions.class); + + /** {@inheritDoc} */ + @Override + public ResourceTypeRegistrationPropertiesTemplateDeploymentOptions withPreflightSupported( + Boolean preflightSupported) { + super.withPreflightSupported(preflightSupported); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceTypeRegistrationPropertiesTemplateDeploymentOptions withPreflightOptions( + List preflightOptions) { + super.withPreflightOptions(preflightOptions); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeRegistrations.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeRegistrations.java new file mode 100644 index 0000000000000..0e704e994f3d4 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeRegistrations.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.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 ResourceTypeRegistrations. */ +public interface ResourceTypeRegistrations { + /** + * Gets a resource type details in the given subscription and provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a resource type details in the given subscription and provider. + */ + ResourceTypeRegistration get(String providerNamespace, String resourceType); + + /** + * Gets a resource type details in the given subscription and provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a resource type details in the given subscription and provider. + */ + Response getWithResponse(String providerNamespace, String resourceType, Context context); + + /** + * Deletes a resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String providerNamespace, String resourceType); + + /** + * Deletes a resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse(String providerNamespace, String resourceType, Context context); + + /** + * Gets the list of the resource types for the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the resource types for the given provider. + */ + PagedIterable listByProviderRegistration(String providerNamespace); + + /** + * Gets the list of the resource types for the given provider. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the resource types for the given provider. + */ + PagedIterable listByProviderRegistration(String providerNamespace, Context context); + + /** + * Gets a resource type details in the given subscription and provider. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a resource type details in the given subscription and provider. + */ + ResourceTypeRegistration getById(String id); + + /** + * Gets a resource type details in the given subscription and provider. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a resource type details in the given subscription and provider. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a resource type. + * + * @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); + + /** + * Deletes a resource type. + * + * @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 response. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ResourceTypeRegistration resource. + * + * @param name resource name. + * @return the first stage of the new ResourceTypeRegistration definition. + */ + ResourceTypeRegistration.DefinitionStages.Blank define(String name); +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeRequestHeaderOptions.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeRequestHeaderOptions.java new file mode 100644 index 0000000000000..6e7d423df63db --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeRequestHeaderOptions.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** The ResourceTypeRequestHeaderOptions model. */ +@Immutable +public final class ResourceTypeRequestHeaderOptions extends RequestHeaderOptions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceTypeRequestHeaderOptions.class); + + /** {@inheritDoc} */ + @Override + public ResourceTypeRequestHeaderOptions withOptInHeaders(OptInHeaderType optInHeaders) { + super.withOptInHeaders(optInHeaders); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeSku.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeSku.java new file mode 100644 index 0000000000000..d9570800fe495 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeSku.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.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The ResourceTypeSku model. */ +@Fluent +public class ResourceTypeSku { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceTypeSku.class); + + /* + * The skuSettings property. + */ + @JsonProperty(value = "skuSettings", required = true) + private List skuSettings; + + /** + * Get the skuSettings property: The skuSettings property. + * + * @return the skuSettings value. + */ + public List skuSettings() { + return this.skuSettings; + } + + /** + * Set the skuSettings property: The skuSettings property. + * + * @param skuSettings the skuSettings value to set. + * @return the ResourceTypeSku object itself. + */ + public ResourceTypeSku withSkuSettings(List skuSettings) { + this.skuSettings = skuSettings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (skuSettings() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property skuSettings in model ResourceTypeSku")); + } else { + skuSettings().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeTemplateDeploymentPolicy.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeTemplateDeploymentPolicy.java new file mode 100644 index 0000000000000..433fbff0877ef --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceTypeTemplateDeploymentPolicy.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** The ResourceTypeTemplateDeploymentPolicy model. */ +@Immutable +public final class ResourceTypeTemplateDeploymentPolicy extends TemplateDeploymentPolicy { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceTypeTemplateDeploymentPolicy.class); + + /** {@inheritDoc} */ + @Override + public ResourceTypeTemplateDeploymentPolicy withCapabilities(TemplateDeploymentCapabilities capabilities) { + super.withCapabilities(capabilities); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceTypeTemplateDeploymentPolicy withPreflightOptions( + TemplateDeploymentPreflightOptions preflightOptions) { + super.withPreflightOptions(preflightOptions); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceValidation.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceValidation.java new file mode 100644 index 0000000000000..8acb5f4d49969 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ResourceValidation.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ResourceValidation. */ +public final class ResourceValidation extends ExpandableStringEnum { + /** Static value NotSpecified for ResourceValidation. */ + public static final ResourceValidation NOT_SPECIFIED = fromString("NotSpecified"); + + /** Static value ReservedWords for ResourceValidation. */ + public static final ResourceValidation RESERVED_WORDS = fromString("ReservedWords"); + + /** Static value ProfaneWords for ResourceValidation. */ + public static final ResourceValidation PROFANE_WORDS = fromString("ProfaneWords"); + + /** + * Creates or finds a ResourceValidation from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResourceValidation. + */ + @JsonCreator + public static ResourceValidation fromString(String name) { + return fromString(name, ResourceValidation.class); + } + + /** @return known ResourceValidation values. */ + public static Collection values() { + return values(ResourceValidation.class); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/RolloutStatusBase.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/RolloutStatusBase.java new file mode 100644 index 0000000000000..d8024c3e01cec --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/RolloutStatusBase.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** The RolloutStatusBase model. */ +@Fluent +public class RolloutStatusBase { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RolloutStatusBase.class); + + /* + * The completedRegions property. + */ + @JsonProperty(value = "completedRegions") + private List completedRegions; + + /* + * Dictionary of + */ + @JsonProperty(value = "failedOrSkippedRegions") + private Map failedOrSkippedRegions; + + /** + * Get the completedRegions property: The completedRegions property. + * + * @return the completedRegions value. + */ + public List completedRegions() { + return this.completedRegions; + } + + /** + * Set the completedRegions property: The completedRegions property. + * + * @param completedRegions the completedRegions value to set. + * @return the RolloutStatusBase object itself. + */ + public RolloutStatusBase withCompletedRegions(List completedRegions) { + this.completedRegions = completedRegions; + return this; + } + + /** + * Get the failedOrSkippedRegions property: Dictionary of <ExtendedErrorInfo>. + * + * @return the failedOrSkippedRegions value. + */ + public Map failedOrSkippedRegions() { + return this.failedOrSkippedRegions; + } + + /** + * Set the failedOrSkippedRegions property: Dictionary of <ExtendedErrorInfo>. + * + * @param failedOrSkippedRegions the failedOrSkippedRegions value to set. + * @return the RolloutStatusBase object itself. + */ + public RolloutStatusBase withFailedOrSkippedRegions(Map failedOrSkippedRegions) { + this.failedOrSkippedRegions = failedOrSkippedRegions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (failedOrSkippedRegions() != null) { + failedOrSkippedRegions() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/RoutingType.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/RoutingType.java new file mode 100644 index 0000000000000..9ba7b4ceb8917 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/RoutingType.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.providerhub.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RoutingType. */ +public final class RoutingType extends ExpandableStringEnum { + /** Static value Default for RoutingType. */ + public static final RoutingType DEFAULT = fromString("Default"); + + /** Static value ProxyOnly for RoutingType. */ + public static final RoutingType PROXY_ONLY = fromString("ProxyOnly"); + + /** Static value HostBased for RoutingType. */ + public static final RoutingType HOST_BASED = fromString("HostBased"); + + /** Static value Extension for RoutingType. */ + public static final RoutingType EXTENSION = fromString("Extension"); + + /** Static value Tenant for RoutingType. */ + public static final RoutingType TENANT = fromString("Tenant"); + + /** Static value Fanout for RoutingType. */ + public static final RoutingType FANOUT = fromString("Fanout"); + + /** Static value LocationBased for RoutingType. */ + public static final RoutingType LOCATION_BASED = fromString("LocationBased"); + + /** Static value Failover for RoutingType. */ + public static final RoutingType FAILOVER = fromString("Failover"); + + /** Static value CascadeExtension for RoutingType. */ + public static final RoutingType CASCADE_EXTENSION = fromString("CascadeExtension"); + + /** + * Creates or finds a RoutingType from its string representation. + * + * @param name a name to look for. + * @return the corresponding RoutingType. + */ + @JsonCreator + public static RoutingType fromString(String name) { + return fromString(name, RoutingType.class); + } + + /** @return known RoutingType values. */ + public static Collection values() { + return values(RoutingType.class); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ServiceTreeInfo.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ServiceTreeInfo.java new file mode 100644 index 0000000000000..5b51a43ad291e --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ServiceTreeInfo.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.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ServiceTreeInfo model. */ +@Fluent +public final class ServiceTreeInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceTreeInfo.class); + + /* + * The serviceId property. + */ + @JsonProperty(value = "serviceId") + private String serviceId; + + /* + * The componentId property. + */ + @JsonProperty(value = "componentId") + private String componentId; + + /** + * Get the serviceId property: The serviceId property. + * + * @return the serviceId value. + */ + public String serviceId() { + return this.serviceId; + } + + /** + * Set the serviceId property: The serviceId property. + * + * @param serviceId the serviceId value to set. + * @return the ServiceTreeInfo object itself. + */ + public ServiceTreeInfo withServiceId(String serviceId) { + this.serviceId = serviceId; + return this; + } + + /** + * Get the componentId property: The componentId property. + * + * @return the componentId value. + */ + public String componentId() { + return this.componentId; + } + + /** + * Set the componentId property: The componentId property. + * + * @param componentId the componentId value to set. + * @return the ServiceTreeInfo object itself. + */ + public ServiceTreeInfo withComponentId(String componentId) { + this.componentId = componentId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/SkuCapability.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/SkuCapability.java new file mode 100644 index 0000000000000..df57e27b61f53 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/SkuCapability.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SkuCapability model. */ +@Fluent +public final class SkuCapability { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SkuCapability.class); + + /* + * The name property. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The value property. + */ + @JsonProperty(value = "value", required = true) + private String value; + + /** + * Get the name property: The name property. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name property. + * + * @param name the name value to set. + * @return the SkuCapability object itself. + */ + public SkuCapability withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the SkuCapability object itself. + */ + public SkuCapability withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model SkuCapability")); + } + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model SkuCapability")); + } + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/SkuCapacity.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/SkuCapacity.java new file mode 100644 index 0000000000000..78c6448d1bc84 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/SkuCapacity.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SkuCapacity model. */ +@Fluent +public class SkuCapacity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SkuCapacity.class); + + /* + * The minimum property. + */ + @JsonProperty(value = "minimum", required = true) + private int minimum; + + /* + * The maximum property. + */ + @JsonProperty(value = "maximum") + private Integer maximum; + + /* + * The default property. + */ + @JsonProperty(value = "default") + private Integer defaultProperty; + + /* + * The scaleType property. + */ + @JsonProperty(value = "scaleType") + private SkuScaleType scaleType; + + /** + * Get the minimum property: The minimum property. + * + * @return the minimum value. + */ + public int minimum() { + return this.minimum; + } + + /** + * Set the minimum property: The minimum property. + * + * @param minimum the minimum value to set. + * @return the SkuCapacity object itself. + */ + public SkuCapacity withMinimum(int minimum) { + this.minimum = minimum; + return this; + } + + /** + * Get the maximum property: The maximum property. + * + * @return the maximum value. + */ + public Integer maximum() { + return this.maximum; + } + + /** + * Set the maximum property: The maximum property. + * + * @param maximum the maximum value to set. + * @return the SkuCapacity object itself. + */ + public SkuCapacity withMaximum(Integer maximum) { + this.maximum = maximum; + return this; + } + + /** + * Get the defaultProperty property: The default property. + * + * @return the defaultProperty value. + */ + public Integer defaultProperty() { + return this.defaultProperty; + } + + /** + * Set the defaultProperty property: The default property. + * + * @param defaultProperty the defaultProperty value to set. + * @return the SkuCapacity object itself. + */ + public SkuCapacity withDefaultProperty(Integer defaultProperty) { + this.defaultProperty = defaultProperty; + return this; + } + + /** + * Get the scaleType property: The scaleType property. + * + * @return the scaleType value. + */ + public SkuScaleType scaleType() { + return this.scaleType; + } + + /** + * Set the scaleType property: The scaleType property. + * + * @param scaleType the scaleType value to set. + * @return the SkuCapacity object itself. + */ + public SkuCapacity withScaleType(SkuScaleType scaleType) { + this.scaleType = scaleType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/SkuCost.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/SkuCost.java new file mode 100644 index 0000000000000..13ae3db3eb799 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/SkuCost.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SkuCost model. */ +@Fluent +public final class SkuCost { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SkuCost.class); + + /* + * The meterId property. + */ + @JsonProperty(value = "meterId", required = true) + private String meterId; + + /* + * The quantity property. + */ + @JsonProperty(value = "quantity") + private Integer quantity; + + /* + * The extendedUnit property. + */ + @JsonProperty(value = "extendedUnit") + private String extendedUnit; + + /** + * Get the meterId property: The meterId property. + * + * @return the meterId value. + */ + public String meterId() { + return this.meterId; + } + + /** + * Set the meterId property: The meterId property. + * + * @param meterId the meterId value to set. + * @return the SkuCost object itself. + */ + public SkuCost withMeterId(String meterId) { + this.meterId = meterId; + return this; + } + + /** + * Get the quantity property: The quantity property. + * + * @return the quantity value. + */ + public Integer quantity() { + return this.quantity; + } + + /** + * Set the quantity property: The quantity property. + * + * @param quantity the quantity value to set. + * @return the SkuCost object itself. + */ + public SkuCost withQuantity(Integer quantity) { + this.quantity = quantity; + return this; + } + + /** + * Get the extendedUnit property: The extendedUnit property. + * + * @return the extendedUnit value. + */ + public String extendedUnit() { + return this.extendedUnit; + } + + /** + * Set the extendedUnit property: The extendedUnit property. + * + * @param extendedUnit the extendedUnit value to set. + * @return the SkuCost object itself. + */ + public SkuCost withExtendedUnit(String extendedUnit) { + this.extendedUnit = extendedUnit; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (meterId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property meterId in model SkuCost")); + } + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/SkuLocationInfo.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/SkuLocationInfo.java new file mode 100644 index 0000000000000..c1cfab4b0dbd7 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/SkuLocationInfo.java @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The SkuLocationInfo model. */ +@Fluent +public final class SkuLocationInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SkuLocationInfo.class); + + /* + * The location property. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /* + * The zones property. + */ + @JsonProperty(value = "zones") + private List zones; + + /* + * The zoneDetails property. + */ + @JsonProperty(value = "zoneDetails") + private List zoneDetails; + + /* + * The extendedLocations property. + */ + @JsonProperty(value = "extendedLocations") + private List extendedLocations; + + /* + * The type property. + */ + @JsonProperty(value = "type") + private SkuLocationInfoType type; + + /** + * Get the location property: The location property. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The location property. + * + * @param location the location value to set. + * @return the SkuLocationInfo object itself. + */ + public SkuLocationInfo withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the zones property: The zones property. + * + * @return the zones value. + */ + public List zones() { + return this.zones; + } + + /** + * Set the zones property: The zones property. + * + * @param zones the zones value to set. + * @return the SkuLocationInfo object itself. + */ + public SkuLocationInfo withZones(List zones) { + this.zones = zones; + return this; + } + + /** + * Get the zoneDetails property: The zoneDetails property. + * + * @return the zoneDetails value. + */ + public List zoneDetails() { + return this.zoneDetails; + } + + /** + * Set the zoneDetails property: The zoneDetails property. + * + * @param zoneDetails the zoneDetails value to set. + * @return the SkuLocationInfo object itself. + */ + public SkuLocationInfo withZoneDetails(List zoneDetails) { + this.zoneDetails = zoneDetails; + return this; + } + + /** + * Get the extendedLocations property: The extendedLocations property. + * + * @return the extendedLocations value. + */ + public List extendedLocations() { + return this.extendedLocations; + } + + /** + * Set the extendedLocations property: The extendedLocations property. + * + * @param extendedLocations the extendedLocations value to set. + * @return the SkuLocationInfo object itself. + */ + public SkuLocationInfo withExtendedLocations(List extendedLocations) { + this.extendedLocations = extendedLocations; + return this; + } + + /** + * Get the type property: The type property. + * + * @return the type value. + */ + public SkuLocationInfoType type() { + return this.type; + } + + /** + * Set the type property: The type property. + * + * @param type the type value to set. + * @return the SkuLocationInfo object itself. + */ + public SkuLocationInfo withType(SkuLocationInfoType type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (location() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property location in model SkuLocationInfo")); + } + if (zoneDetails() != null) { + zoneDetails().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/SkuLocationInfoType.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/SkuLocationInfoType.java new file mode 100644 index 0000000000000..6e5b3c5545e46 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/SkuLocationInfoType.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SkuLocationInfoType. */ +public final class SkuLocationInfoType extends ExpandableStringEnum { + /** Static value NotSpecified for SkuLocationInfoType. */ + public static final SkuLocationInfoType NOT_SPECIFIED = fromString("NotSpecified"); + + /** Static value EdgeZone for SkuLocationInfoType. */ + public static final SkuLocationInfoType EDGE_ZONE = fromString("EdgeZone"); + + /** Static value ArcZone for SkuLocationInfoType. */ + public static final SkuLocationInfoType ARC_ZONE = fromString("ArcZone"); + + /** + * Creates or finds a SkuLocationInfoType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SkuLocationInfoType. + */ + @JsonCreator + public static SkuLocationInfoType fromString(String name) { + return fromString(name, SkuLocationInfoType.class); + } + + /** @return known SkuLocationInfoType values. */ + public static Collection values() { + return values(SkuLocationInfoType.class); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/SkuResource.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/SkuResource.java new file mode 100644 index 0000000000000..4d466b5e34883 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/SkuResource.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.providerhub.fluent.models.SkuResourceInner; +import java.util.List; + +/** An immutable client-side representation of SkuResource. */ +public interface SkuResource { + /** + * 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 properties property: The properties property. + * + * @return the properties value. + */ + SkuResourceProperties properties(); + + /** + * Gets the inner com.azure.resourcemanager.providerhub.fluent.models.SkuResourceInner object. + * + * @return the inner object. + */ + SkuResourceInner innerModel(); + + /** The entirety of the SkuResource definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithParentResource, + DefinitionStages.WithSkuSettings, + DefinitionStages.WithCreate { + } + /** The SkuResource definition stages. */ + interface DefinitionStages { + /** The first stage of the SkuResource definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the SkuResource definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies providerNamespace, resourceType. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @return the next definition stage. + */ + WithSkuSettings withExistingResourcetypeRegistration(String providerNamespace, String resourceType); + } + /** The stage of the SkuResource definition allowing to specify skuSettings. */ + interface WithSkuSettings { + /** + * Specifies the skuSettings property: The skuSettings property.. + * + * @param skuSettings The skuSettings property. + * @return the next definition stage. + */ + WithCreate withSkuSettings(List skuSettings); + } + /** + * The stage of the SkuResource 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 { + /** + * Executes the create request. + * + * @return the created resource. + */ + SkuResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SkuResource create(Context context); + } + } + /** + * Begins update for the SkuResource resource. + * + * @return the stage of resource update. + */ + SkuResource.Update update(); + + /** The template for SkuResource update. */ + interface Update extends UpdateStages.WithSkuSettings { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SkuResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SkuResource apply(Context context); + } + /** The SkuResource update stages. */ + interface UpdateStages { + /** The stage of the SkuResource update allowing to specify skuSettings. */ + interface WithSkuSettings { + /** + * Specifies the skuSettings property: The skuSettings property.. + * + * @param skuSettings The skuSettings property. + * @return the next definition stage. + */ + Update withSkuSettings(List skuSettings); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SkuResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SkuResource refresh(Context context); +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/SkuResourceArrayResponseWithContinuation.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/SkuResourceArrayResponseWithContinuation.java new file mode 100644 index 0000000000000..5fe1849604e29 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/SkuResourceArrayResponseWithContinuation.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.providerhub.fluent.models.SkuResourceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The SkuResourceArrayResponseWithContinuation model. */ +@Fluent +public final class SkuResourceArrayResponseWithContinuation { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SkuResourceArrayResponseWithContinuation.class); + + /* + * The value property. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get to the next set of results, if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the SkuResourceArrayResponseWithContinuation object itself. + */ + public SkuResourceArrayResponseWithContinuation withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get to the next set of results, if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get to the next set of results, if there are any. + * + * @param nextLink the nextLink value to set. + * @return the SkuResourceArrayResponseWithContinuation object itself. + */ + public SkuResourceArrayResponseWithContinuation withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/SkuResourceProperties.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/SkuResourceProperties.java new file mode 100644 index 0000000000000..a684de27ba6f6 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/SkuResourceProperties.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.List; + +/** The SkuResourceProperties model. */ +@Immutable +public final class SkuResourceProperties extends ResourceTypeSku { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SkuResourceProperties.class); + + /** {@inheritDoc} */ + @Override + public SkuResourceProperties withSkuSettings(List skuSettings) { + super.withSkuSettings(skuSettings); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/SkuScaleType.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/SkuScaleType.java new file mode 100644 index 0000000000000..ea060b4a12a62 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/SkuScaleType.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SkuScaleType. */ +public final class SkuScaleType extends ExpandableStringEnum { + /** Static value None for SkuScaleType. */ + public static final SkuScaleType NONE = fromString("None"); + + /** Static value Manual for SkuScaleType. */ + public static final SkuScaleType MANUAL = fromString("Manual"); + + /** Static value Automatic for SkuScaleType. */ + public static final SkuScaleType AUTOMATIC = fromString("Automatic"); + + /** + * Creates or finds a SkuScaleType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SkuScaleType. + */ + @JsonCreator + public static SkuScaleType fromString(String name) { + return fromString(name, SkuScaleType.class); + } + + /** @return known SkuScaleType values. */ + public static Collection values() { + return values(SkuScaleType.class); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/SkuSetting.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/SkuSetting.java new file mode 100644 index 0000000000000..3a7889e6d58a5 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/SkuSetting.java @@ -0,0 +1,354 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The SkuSetting model. */ +@Fluent +public final class SkuSetting { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SkuSetting.class); + + /* + * The name property. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The tier property. + */ + @JsonProperty(value = "tier") + private String tier; + + /* + * The size property. + */ + @JsonProperty(value = "size") + private String size; + + /* + * The family property. + */ + @JsonProperty(value = "family") + private String family; + + /* + * The kind property. + */ + @JsonProperty(value = "kind") + private String kind; + + /* + * The locations property. + */ + @JsonProperty(value = "locations") + private List locations; + + /* + * The locationInfo property. + */ + @JsonProperty(value = "locationInfo") + private List locationInfo; + + /* + * The requiredQuotaIds property. + */ + @JsonProperty(value = "requiredQuotaIds") + private List requiredQuotaIds; + + /* + * The requiredFeatures property. + */ + @JsonProperty(value = "requiredFeatures") + private List requiredFeatures; + + /* + * The capacity property. + */ + @JsonProperty(value = "capacity") + private SkuSettingCapacity capacity; + + /* + * The costs property. + */ + @JsonProperty(value = "costs") + private List costs; + + /* + * The capabilities property. + */ + @JsonProperty(value = "capabilities") + private List capabilities; + + /** + * Get the name property: The name property. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name property. + * + * @param name the name value to set. + * @return the SkuSetting object itself. + */ + public SkuSetting withName(String name) { + this.name = name; + return this; + } + + /** + * Get the tier property: The tier property. + * + * @return the tier value. + */ + public String tier() { + return this.tier; + } + + /** + * Set the tier property: The tier property. + * + * @param tier the tier value to set. + * @return the SkuSetting object itself. + */ + public SkuSetting withTier(String tier) { + this.tier = tier; + return this; + } + + /** + * Get the size property: The size property. + * + * @return the size value. + */ + public String size() { + return this.size; + } + + /** + * Set the size property: The size property. + * + * @param size the size value to set. + * @return the SkuSetting object itself. + */ + public SkuSetting withSize(String size) { + this.size = size; + return this; + } + + /** + * Get the family property: The family property. + * + * @return the family value. + */ + public String family() { + return this.family; + } + + /** + * Set the family property: The family property. + * + * @param family the family value to set. + * @return the SkuSetting object itself. + */ + public SkuSetting withFamily(String family) { + this.family = family; + return this; + } + + /** + * Get the kind property: The kind property. + * + * @return the kind value. + */ + public String kind() { + return this.kind; + } + + /** + * Set the kind property: The kind property. + * + * @param kind the kind value to set. + * @return the SkuSetting object itself. + */ + public SkuSetting withKind(String kind) { + this.kind = kind; + return this; + } + + /** + * Get the locations property: The locations property. + * + * @return the locations value. + */ + public List locations() { + return this.locations; + } + + /** + * Set the locations property: The locations property. + * + * @param locations the locations value to set. + * @return the SkuSetting object itself. + */ + public SkuSetting withLocations(List locations) { + this.locations = locations; + return this; + } + + /** + * Get the locationInfo property: The locationInfo property. + * + * @return the locationInfo value. + */ + public List locationInfo() { + return this.locationInfo; + } + + /** + * Set the locationInfo property: The locationInfo property. + * + * @param locationInfo the locationInfo value to set. + * @return the SkuSetting object itself. + */ + public SkuSetting withLocationInfo(List locationInfo) { + this.locationInfo = locationInfo; + return this; + } + + /** + * Get the requiredQuotaIds property: The requiredQuotaIds property. + * + * @return the requiredQuotaIds value. + */ + public List requiredQuotaIds() { + return this.requiredQuotaIds; + } + + /** + * Set the requiredQuotaIds property: The requiredQuotaIds property. + * + * @param requiredQuotaIds the requiredQuotaIds value to set. + * @return the SkuSetting object itself. + */ + public SkuSetting withRequiredQuotaIds(List requiredQuotaIds) { + this.requiredQuotaIds = requiredQuotaIds; + return this; + } + + /** + * Get the requiredFeatures property: The requiredFeatures property. + * + * @return the requiredFeatures value. + */ + public List requiredFeatures() { + return this.requiredFeatures; + } + + /** + * Set the requiredFeatures property: The requiredFeatures property. + * + * @param requiredFeatures the requiredFeatures value to set. + * @return the SkuSetting object itself. + */ + public SkuSetting withRequiredFeatures(List requiredFeatures) { + this.requiredFeatures = requiredFeatures; + return this; + } + + /** + * Get the capacity property: The capacity property. + * + * @return the capacity value. + */ + public SkuSettingCapacity capacity() { + return this.capacity; + } + + /** + * Set the capacity property: The capacity property. + * + * @param capacity the capacity value to set. + * @return the SkuSetting object itself. + */ + public SkuSetting withCapacity(SkuSettingCapacity capacity) { + this.capacity = capacity; + return this; + } + + /** + * Get the costs property: The costs property. + * + * @return the costs value. + */ + public List costs() { + return this.costs; + } + + /** + * Set the costs property: The costs property. + * + * @param costs the costs value to set. + * @return the SkuSetting object itself. + */ + public SkuSetting withCosts(List costs) { + this.costs = costs; + return this; + } + + /** + * Get the capabilities property: The capabilities property. + * + * @return the capabilities value. + */ + public List capabilities() { + return this.capabilities; + } + + /** + * Set the capabilities property: The capabilities property. + * + * @param capabilities the capabilities value to set. + * @return the SkuSetting object itself. + */ + public SkuSetting withCapabilities(List capabilities) { + this.capabilities = capabilities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model SkuSetting")); + } + if (locationInfo() != null) { + locationInfo().forEach(e -> e.validate()); + } + if (capacity() != null) { + capacity().validate(); + } + if (costs() != null) { + costs().forEach(e -> e.validate()); + } + if (capabilities() != null) { + capabilities().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/SkuSettingCapacity.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/SkuSettingCapacity.java new file mode 100644 index 0000000000000..b3a72ba7c363e --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/SkuSettingCapacity.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.providerhub.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** The SkuSettingCapacity model. */ +@Immutable +public final class SkuSettingCapacity extends SkuCapacity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SkuSettingCapacity.class); + + /** {@inheritDoc} */ + @Override + public SkuSettingCapacity withMinimum(int minimum) { + super.withMinimum(minimum); + return this; + } + + /** {@inheritDoc} */ + @Override + public SkuSettingCapacity withMaximum(Integer maximum) { + super.withMaximum(maximum); + return this; + } + + /** {@inheritDoc} */ + @Override + public SkuSettingCapacity withDefaultProperty(Integer defaultProperty) { + super.withDefaultProperty(defaultProperty); + return this; + } + + /** {@inheritDoc} */ + @Override + public SkuSettingCapacity withScaleType(SkuScaleType scaleType) { + super.withScaleType(scaleType); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/SkuZoneDetail.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/SkuZoneDetail.java new file mode 100644 index 0000000000000..4181772ae3d8e --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/SkuZoneDetail.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The SkuZoneDetail model. */ +@Fluent +public final class SkuZoneDetail { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SkuZoneDetail.class); + + /* + * The name property. + */ + @JsonProperty(value = "name") + private List name; + + /* + * The capabilities property. + */ + @JsonProperty(value = "capabilities") + private List capabilities; + + /** + * Get the name property: The name property. + * + * @return the name value. + */ + public List name() { + return this.name; + } + + /** + * Set the name property: The name property. + * + * @param name the name value to set. + * @return the SkuZoneDetail object itself. + */ + public SkuZoneDetail withName(List name) { + this.name = name; + return this; + } + + /** + * Get the capabilities property: The capabilities property. + * + * @return the capabilities value. + */ + public List capabilities() { + return this.capabilities; + } + + /** + * Set the capabilities property: The capabilities property. + * + * @param capabilities the capabilities value to set. + * @return the SkuZoneDetail object itself. + */ + public SkuZoneDetail withCapabilities(List capabilities) { + this.capabilities = capabilities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (capabilities() != null) { + capabilities().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/Skus.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/Skus.java new file mode 100644 index 0000000000000..97a1a92bc5b7a --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/Skus.java @@ -0,0 +1,623 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.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 { + /** + * Gets the sku details for the given resource type and sku name. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param sku The SKU. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sku details for the given resource type and sku name. + */ + SkuResource get(String providerNamespace, String resourceType, String sku); + + /** + * Gets the sku details for the given resource type and sku name. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param sku The SKU. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sku details for the given resource type and sku name. + */ + Response getWithResponse(String providerNamespace, String resourceType, String sku, Context context); + + /** + * Deletes a resource type sku. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param sku The SKU. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 providerNamespace, String resourceType, String sku); + + /** + * Deletes a resource type sku. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param sku The SKU. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + Response deleteWithResponse(String providerNamespace, String resourceType, String sku, Context context); + + /** + * Gets the sku details for the given resource type and sku name. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param sku The SKU. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sku details for the given resource type and sku name. + */ + SkuResource getNestedResourceTypeFirst( + String providerNamespace, String resourceType, String nestedResourceTypeFirst, String sku); + + /** + * Gets the sku details for the given resource type and sku name. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param sku The SKU. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sku details for the given resource type and sku name. + */ + Response getNestedResourceTypeFirstWithResponse( + String providerNamespace, String resourceType, String nestedResourceTypeFirst, String sku, Context context); + + /** + * Creates or updates the resource type skus in the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param sku The SKU. + * @param properties The required body parameters supplied to the resource sku operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + SkuResource createOrUpdateNestedResourceTypeFirst( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String sku, + ResourceTypeSku properties); + + /** + * Creates or updates the resource type skus in the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param sku The SKU. + * @param properties The required body parameters supplied to the resource sku operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response createOrUpdateNestedResourceTypeFirstWithResponse( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String sku, + ResourceTypeSku properties, + Context context); + + /** + * Deletes a resource type sku. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param sku The SKU. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deleteNestedResourceTypeFirst( + String providerNamespace, String resourceType, String nestedResourceTypeFirst, String sku); + + /** + * Deletes a resource type sku. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param sku The SKU. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + Response deleteNestedResourceTypeFirstWithResponse( + String providerNamespace, String resourceType, String nestedResourceTypeFirst, String sku, Context context); + + /** + * Gets the sku details for the given resource type and sku name. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param sku The SKU. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sku details for the given resource type and sku name. + */ + SkuResource getNestedResourceTypeSecond( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String sku); + + /** + * Gets the sku details for the given resource type and sku name. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param sku The SKU. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sku details for the given resource type and sku name. + */ + Response getNestedResourceTypeSecondWithResponse( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String sku, + Context context); + + /** + * Creates or updates the resource type skus in the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param sku The SKU. + * @param properties The required body parameters supplied to the resource sku operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + SkuResource createOrUpdateNestedResourceTypeSecond( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String sku, + ResourceTypeSku properties); + + /** + * Creates or updates the resource type skus in the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param sku The SKU. + * @param properties The required body parameters supplied to the resource sku operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response createOrUpdateNestedResourceTypeSecondWithResponse( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String sku, + ResourceTypeSku properties, + Context context); + + /** + * Deletes a resource type sku. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param sku The SKU. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deleteNestedResourceTypeSecond( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String sku); + + /** + * Deletes a resource type sku. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param sku The SKU. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + Response deleteNestedResourceTypeSecondWithResponse( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String sku, + Context context); + + /** + * Gets the sku details for the given resource type and sku name. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param nestedResourceTypeThird The third child resource type. + * @param sku The SKU. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sku details for the given resource type and sku name. + */ + SkuResource getNestedResourceTypeThird( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String nestedResourceTypeThird, + String sku); + + /** + * Gets the sku details for the given resource type and sku name. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param nestedResourceTypeThird The third child resource type. + * @param sku The SKU. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sku details for the given resource type and sku name. + */ + Response getNestedResourceTypeThirdWithResponse( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String nestedResourceTypeThird, + String sku, + Context context); + + /** + * Creates or updates the resource type skus in the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param nestedResourceTypeThird The third child resource type. + * @param sku The SKU. + * @param properties The required body parameters supplied to the resource sku operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + SkuResource createOrUpdateNestedResourceTypeThird( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String nestedResourceTypeThird, + String sku, + ResourceTypeSku properties); + + /** + * Creates or updates the resource type skus in the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param nestedResourceTypeThird The third child resource type. + * @param sku The SKU. + * @param properties The required body parameters supplied to the resource sku operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response createOrUpdateNestedResourceTypeThirdWithResponse( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String nestedResourceTypeThird, + String sku, + ResourceTypeSku properties, + Context context); + + /** + * Deletes a resource type sku. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param nestedResourceTypeThird The third child resource type. + * @param sku The SKU. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deleteNestedResourceTypeThird( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String nestedResourceTypeThird, + String sku); + + /** + * Deletes a resource type sku. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param nestedResourceTypeThird The third child resource type. + * @param sku The SKU. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + Response deleteNestedResourceTypeThirdWithResponse( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String nestedResourceTypeThird, + String sku, + Context context); + + /** + * Gets the list of skus for the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of skus for the given resource type. + */ + PagedIterable listByResourceTypeRegistrations(String providerNamespace, String resourceType); + + /** + * Gets the list of skus for the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of skus for the given resource type. + */ + PagedIterable listByResourceTypeRegistrations( + String providerNamespace, String resourceType, Context context); + + /** + * Gets the list of skus for the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of skus for the given resource type. + */ + PagedIterable listByResourceTypeRegistrationsNestedResourceTypeFirst( + String providerNamespace, String resourceType, String nestedResourceTypeFirst); + + /** + * Gets the list of skus for the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of skus for the given resource type. + */ + PagedIterable listByResourceTypeRegistrationsNestedResourceTypeFirst( + String providerNamespace, String resourceType, String nestedResourceTypeFirst, Context context); + + /** + * Gets the list of skus for the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of skus for the given resource type. + */ + PagedIterable listByResourceTypeRegistrationsNestedResourceTypeSecond( + String providerNamespace, String resourceType, String nestedResourceTypeFirst, String nestedResourceTypeSecond); + + /** + * Gets the list of skus for the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of skus for the given resource type. + */ + PagedIterable listByResourceTypeRegistrationsNestedResourceTypeSecond( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + Context context); + + /** + * Gets the list of skus for the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param nestedResourceTypeThird The third child resource type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of skus for the given resource type. + */ + PagedIterable listByResourceTypeRegistrationsNestedResourceTypeThird( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String nestedResourceTypeThird); + + /** + * Gets the list of skus for the given resource type. + * + * @param providerNamespace The name of the resource provider hosted within ProviderHub. + * @param resourceType The resource type. + * @param nestedResourceTypeFirst The first child resource type. + * @param nestedResourceTypeSecond The second child resource type. + * @param nestedResourceTypeThird The third child resource type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of skus for the given resource type. + */ + PagedIterable listByResourceTypeRegistrationsNestedResourceTypeThird( + String providerNamespace, + String resourceType, + String nestedResourceTypeFirst, + String nestedResourceTypeSecond, + String nestedResourceTypeThird, + Context context); + + /** + * Gets the sku details for the given resource type and sku name. + * + * @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 sku details for the given resource type and sku name. + */ + SkuResource getById(String id); + + /** + * Gets the sku details for the given resource type and sku name. + * + * @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 sku details for the given resource type and sku name. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a resource type sku. + * + * @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); + + /** + * Deletes a resource type sku. + * + * @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 response. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new SkuResource resource. + * + * @param name resource name. + * @return the first stage of the new SkuResource definition. + */ + SkuResource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/SubscriptionLifecycleNotificationSpecifications.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/SubscriptionLifecycleNotificationSpecifications.java new file mode 100644 index 0000000000000..43d4a988c0c3d --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/SubscriptionLifecycleNotificationSpecifications.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.Duration; +import java.util.List; + +/** The SubscriptionLifecycleNotificationSpecifications model. */ +@Fluent +public class SubscriptionLifecycleNotificationSpecifications { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(SubscriptionLifecycleNotificationSpecifications.class); + + /* + * The subscriptionStateOverrideActions property. + */ + @JsonProperty(value = "subscriptionStateOverrideActions") + private List subscriptionStateOverrideActions; + + /* + * The softDeleteTTL property. + */ + @JsonProperty(value = "softDeleteTTL") + private Duration softDeleteTtl; + + /** + * Get the subscriptionStateOverrideActions property: The subscriptionStateOverrideActions property. + * + * @return the subscriptionStateOverrideActions value. + */ + public List subscriptionStateOverrideActions() { + return this.subscriptionStateOverrideActions; + } + + /** + * Set the subscriptionStateOverrideActions property: The subscriptionStateOverrideActions property. + * + * @param subscriptionStateOverrideActions the subscriptionStateOverrideActions value to set. + * @return the SubscriptionLifecycleNotificationSpecifications object itself. + */ + public SubscriptionLifecycleNotificationSpecifications withSubscriptionStateOverrideActions( + List subscriptionStateOverrideActions) { + this.subscriptionStateOverrideActions = subscriptionStateOverrideActions; + return this; + } + + /** + * Get the softDeleteTtl property: The softDeleteTTL property. + * + * @return the softDeleteTtl value. + */ + public Duration softDeleteTtl() { + return this.softDeleteTtl; + } + + /** + * Set the softDeleteTtl property: The softDeleteTTL property. + * + * @param softDeleteTtl the softDeleteTtl value to set. + * @return the SubscriptionLifecycleNotificationSpecifications object itself. + */ + public SubscriptionLifecycleNotificationSpecifications withSoftDeleteTtl(Duration softDeleteTtl) { + this.softDeleteTtl = softDeleteTtl; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (subscriptionStateOverrideActions() != null) { + subscriptionStateOverrideActions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/SubscriptionNotificationOperation.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/SubscriptionNotificationOperation.java new file mode 100644 index 0000000000000..8eba5a394ff8d --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/SubscriptionNotificationOperation.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.providerhub.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SubscriptionNotificationOperation. */ +public final class SubscriptionNotificationOperation extends ExpandableStringEnum { + /** Static value NotDefined for SubscriptionNotificationOperation. */ + public static final SubscriptionNotificationOperation NOT_DEFINED = fromString("NotDefined"); + + /** Static value DeleteAllResources for SubscriptionNotificationOperation. */ + public static final SubscriptionNotificationOperation DELETE_ALL_RESOURCES = fromString("DeleteAllResources"); + + /** Static value SoftDeleteAllResources for SubscriptionNotificationOperation. */ + public static final SubscriptionNotificationOperation SOFT_DELETE_ALL_RESOURCES = + fromString("SoftDeleteAllResources"); + + /** Static value NoOp for SubscriptionNotificationOperation. */ + public static final SubscriptionNotificationOperation NO_OP = fromString("NoOp"); + + /** Static value BillingCancellation for SubscriptionNotificationOperation. */ + public static final SubscriptionNotificationOperation BILLING_CANCELLATION = fromString("BillingCancellation"); + + /** Static value UndoSoftDelete for SubscriptionNotificationOperation. */ + public static final SubscriptionNotificationOperation UNDO_SOFT_DELETE = fromString("UndoSoftDelete"); + + /** + * Creates or finds a SubscriptionNotificationOperation from its string representation. + * + * @param name a name to look for. + * @return the corresponding SubscriptionNotificationOperation. + */ + @JsonCreator + public static SubscriptionNotificationOperation fromString(String name) { + return fromString(name, SubscriptionNotificationOperation.class); + } + + /** @return known SubscriptionNotificationOperation values. */ + public static Collection values() { + return values(SubscriptionNotificationOperation.class); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/SubscriptionReregistrationResult.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/SubscriptionReregistrationResult.java new file mode 100644 index 0000000000000..73e61ec24a2a8 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/SubscriptionReregistrationResult.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SubscriptionReregistrationResult. */ +public final class SubscriptionReregistrationResult extends ExpandableStringEnum { + /** Static value NotApplicable for SubscriptionReregistrationResult. */ + public static final SubscriptionReregistrationResult NOT_APPLICABLE = fromString("NotApplicable"); + + /** Static value ConditionalUpdate for SubscriptionReregistrationResult. */ + public static final SubscriptionReregistrationResult CONDITIONAL_UPDATE = fromString("ConditionalUpdate"); + + /** Static value ForcedUpdate for SubscriptionReregistrationResult. */ + public static final SubscriptionReregistrationResult FORCED_UPDATE = fromString("ForcedUpdate"); + + /** Static value Failed for SubscriptionReregistrationResult. */ + public static final SubscriptionReregistrationResult FAILED = fromString("Failed"); + + /** + * Creates or finds a SubscriptionReregistrationResult from its string representation. + * + * @param name a name to look for. + * @return the corresponding SubscriptionReregistrationResult. + */ + @JsonCreator + public static SubscriptionReregistrationResult fromString(String name) { + return fromString(name, SubscriptionReregistrationResult.class); + } + + /** @return known SubscriptionReregistrationResult values. */ + public static Collection values() { + return values(SubscriptionReregistrationResult.class); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/SubscriptionState.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/SubscriptionState.java new file mode 100644 index 0000000000000..53e52c0433044 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/SubscriptionState.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SubscriptionState. */ +public final class SubscriptionState extends ExpandableStringEnum { + /** Static value NotDefined for SubscriptionState. */ + public static final SubscriptionState NOT_DEFINED = fromString("NotDefined"); + + /** Static value Enabled for SubscriptionState. */ + public static final SubscriptionState ENABLED = fromString("Enabled"); + + /** Static value Warned for SubscriptionState. */ + public static final SubscriptionState WARNED = fromString("Warned"); + + /** Static value PastDue for SubscriptionState. */ + public static final SubscriptionState PAST_DUE = fromString("PastDue"); + + /** Static value Disabled for SubscriptionState. */ + public static final SubscriptionState DISABLED = fromString("Disabled"); + + /** Static value Deleted for SubscriptionState. */ + public static final SubscriptionState DELETED = fromString("Deleted"); + + /** + * Creates or finds a SubscriptionState from its string representation. + * + * @param name a name to look for. + * @return the corresponding SubscriptionState. + */ + @JsonCreator + public static SubscriptionState fromString(String name) { + return fromString(name, SubscriptionState.class); + } + + /** @return known SubscriptionState values. */ + public static Collection values() { + return values(SubscriptionState.class); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/SubscriptionStateOverrideAction.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/SubscriptionStateOverrideAction.java new file mode 100644 index 0000000000000..bd434e4623f3d --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/SubscriptionStateOverrideAction.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SubscriptionStateOverrideAction model. */ +@Fluent +public final class SubscriptionStateOverrideAction { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SubscriptionStateOverrideAction.class); + + /* + * The state property. + */ + @JsonProperty(value = "state", required = true) + private SubscriptionTransitioningState state; + + /* + * The action property. + */ + @JsonProperty(value = "action", required = true) + private SubscriptionNotificationOperation action; + + /** + * Get the state property: The state property. + * + * @return the state value. + */ + public SubscriptionTransitioningState state() { + return this.state; + } + + /** + * Set the state property: The state property. + * + * @param state the state value to set. + * @return the SubscriptionStateOverrideAction object itself. + */ + public SubscriptionStateOverrideAction withState(SubscriptionTransitioningState state) { + this.state = state; + return this; + } + + /** + * Get the action property: The action property. + * + * @return the action value. + */ + public SubscriptionNotificationOperation action() { + return this.action; + } + + /** + * Set the action property: The action property. + * + * @param action the action value to set. + * @return the SubscriptionStateOverrideAction object itself. + */ + public SubscriptionStateOverrideAction withAction(SubscriptionNotificationOperation action) { + this.action = action; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (state() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property state in model SubscriptionStateOverrideAction")); + } + if (action() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property action in model SubscriptionStateOverrideAction")); + } + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/SubscriptionStateRule.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/SubscriptionStateRule.java new file mode 100644 index 0000000000000..863a1aa77e897 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/SubscriptionStateRule.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The SubscriptionStateRule model. */ +@Fluent +public final class SubscriptionStateRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SubscriptionStateRule.class); + + /* + * The state property. + */ + @JsonProperty(value = "state") + private SubscriptionState state; + + /* + * The allowedActions property. + */ + @JsonProperty(value = "allowedActions") + private List allowedActions; + + /** + * Get the state property: The state property. + * + * @return the state value. + */ + public SubscriptionState state() { + return this.state; + } + + /** + * Set the state property: The state property. + * + * @param state the state value to set. + * @return the SubscriptionStateRule object itself. + */ + public SubscriptionStateRule withState(SubscriptionState state) { + this.state = state; + return this; + } + + /** + * Get the allowedActions property: The allowedActions property. + * + * @return the allowedActions value. + */ + public List allowedActions() { + return this.allowedActions; + } + + /** + * Set the allowedActions property: The allowedActions property. + * + * @param allowedActions the allowedActions value to set. + * @return the SubscriptionStateRule object itself. + */ + public SubscriptionStateRule withAllowedActions(List allowedActions) { + this.allowedActions = allowedActions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/SubscriptionTransitioningState.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/SubscriptionTransitioningState.java new file mode 100644 index 0000000000000..f2343d015d1a4 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/SubscriptionTransitioningState.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.providerhub.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SubscriptionTransitioningState. */ +public final class SubscriptionTransitioningState extends ExpandableStringEnum { + /** Static value Registered for SubscriptionTransitioningState. */ + public static final SubscriptionTransitioningState REGISTERED = fromString("Registered"); + + /** Static value Unregistered for SubscriptionTransitioningState. */ + public static final SubscriptionTransitioningState UNREGISTERED = fromString("Unregistered"); + + /** Static value Warned for SubscriptionTransitioningState. */ + public static final SubscriptionTransitioningState WARNED = fromString("Warned"); + + /** Static value Suspended for SubscriptionTransitioningState. */ + public static final SubscriptionTransitioningState SUSPENDED = fromString("Suspended"); + + /** Static value Deleted for SubscriptionTransitioningState. */ + public static final SubscriptionTransitioningState DELETED = fromString("Deleted"); + + /** Static value WarnedToRegistered for SubscriptionTransitioningState. */ + public static final SubscriptionTransitioningState WARNED_TO_REGISTERED = fromString("WarnedToRegistered"); + + /** Static value WarnedToSuspended for SubscriptionTransitioningState. */ + public static final SubscriptionTransitioningState WARNED_TO_SUSPENDED = fromString("WarnedToSuspended"); + + /** Static value WarnedToDeleted for SubscriptionTransitioningState. */ + public static final SubscriptionTransitioningState WARNED_TO_DELETED = fromString("WarnedToDeleted"); + + /** Static value WarnedToUnregistered for SubscriptionTransitioningState. */ + public static final SubscriptionTransitioningState WARNED_TO_UNREGISTERED = fromString("WarnedToUnregistered"); + + /** Static value SuspendedToRegistered for SubscriptionTransitioningState. */ + public static final SubscriptionTransitioningState SUSPENDED_TO_REGISTERED = fromString("SuspendedToRegistered"); + + /** Static value SuspendedToWarned for SubscriptionTransitioningState. */ + public static final SubscriptionTransitioningState SUSPENDED_TO_WARNED = fromString("SuspendedToWarned"); + + /** Static value SuspendedToDeleted for SubscriptionTransitioningState. */ + public static final SubscriptionTransitioningState SUSPENDED_TO_DELETED = fromString("SuspendedToDeleted"); + + /** Static value SuspendedToUnregistered for SubscriptionTransitioningState. */ + public static final SubscriptionTransitioningState SUSPENDED_TO_UNREGISTERED = + fromString("SuspendedToUnregistered"); + + /** + * Creates or finds a SubscriptionTransitioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding SubscriptionTransitioningState. + */ + @JsonCreator + public static SubscriptionTransitioningState fromString(String name) { + return fromString(name, SubscriptionTransitioningState.class); + } + + /** @return known SubscriptionTransitioningState values. */ + public static Collection values() { + return values(SubscriptionTransitioningState.class); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/SwaggerSpecification.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/SwaggerSpecification.java new file mode 100644 index 0000000000000..d26cb8dadcbd7 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/SwaggerSpecification.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The SwaggerSpecification model. */ +@Fluent +public final class SwaggerSpecification { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SwaggerSpecification.class); + + /* + * The apiVersions property. + */ + @JsonProperty(value = "apiVersions") + private List apiVersions; + + /* + * The swaggerSpecFolderUri property. + */ + @JsonProperty(value = "swaggerSpecFolderUri") + private String swaggerSpecFolderUri; + + /** + * Get the apiVersions property: The apiVersions property. + * + * @return the apiVersions value. + */ + public List apiVersions() { + return this.apiVersions; + } + + /** + * Set the apiVersions property: The apiVersions property. + * + * @param apiVersions the apiVersions value to set. + * @return the SwaggerSpecification object itself. + */ + public SwaggerSpecification withApiVersions(List apiVersions) { + this.apiVersions = apiVersions; + return this; + } + + /** + * Get the swaggerSpecFolderUri property: The swaggerSpecFolderUri property. + * + * @return the swaggerSpecFolderUri value. + */ + public String swaggerSpecFolderUri() { + return this.swaggerSpecFolderUri; + } + + /** + * Set the swaggerSpecFolderUri property: The swaggerSpecFolderUri property. + * + * @param swaggerSpecFolderUri the swaggerSpecFolderUri value to set. + * @return the SwaggerSpecification object itself. + */ + public SwaggerSpecification withSwaggerSpecFolderUri(String swaggerSpecFolderUri) { + this.swaggerSpecFolderUri = swaggerSpecFolderUri; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/TemplateDeploymentCapabilities.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/TemplateDeploymentCapabilities.java new file mode 100644 index 0000000000000..c3e3926d064fb --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/TemplateDeploymentCapabilities.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.providerhub.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for TemplateDeploymentCapabilities. */ +public final class TemplateDeploymentCapabilities extends ExpandableStringEnum { + /** Static value Default for TemplateDeploymentCapabilities. */ + public static final TemplateDeploymentCapabilities DEFAULT = fromString("Default"); + + /** Static value Preflight for TemplateDeploymentCapabilities. */ + public static final TemplateDeploymentCapabilities PREFLIGHT = fromString("Preflight"); + + /** + * Creates or finds a TemplateDeploymentCapabilities from its string representation. + * + * @param name a name to look for. + * @return the corresponding TemplateDeploymentCapabilities. + */ + @JsonCreator + public static TemplateDeploymentCapabilities fromString(String name) { + return fromString(name, TemplateDeploymentCapabilities.class); + } + + /** @return known TemplateDeploymentCapabilities values. */ + public static Collection values() { + return values(TemplateDeploymentCapabilities.class); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/TemplateDeploymentOptions.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/TemplateDeploymentOptions.java new file mode 100644 index 0000000000000..74ef223804aff --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/TemplateDeploymentOptions.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The TemplateDeploymentOptions model. */ +@Fluent +public class TemplateDeploymentOptions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TemplateDeploymentOptions.class); + + /* + * The preflightSupported property. + */ + @JsonProperty(value = "preflightSupported") + private Boolean preflightSupported; + + /* + * The preflightOptions property. + */ + @JsonProperty(value = "preflightOptions") + private List preflightOptions; + + /** + * Get the preflightSupported property: The preflightSupported property. + * + * @return the preflightSupported value. + */ + public Boolean preflightSupported() { + return this.preflightSupported; + } + + /** + * Set the preflightSupported property: The preflightSupported property. + * + * @param preflightSupported the preflightSupported value to set. + * @return the TemplateDeploymentOptions object itself. + */ + public TemplateDeploymentOptions withPreflightSupported(Boolean preflightSupported) { + this.preflightSupported = preflightSupported; + return this; + } + + /** + * Get the preflightOptions property: The preflightOptions property. + * + * @return the preflightOptions value. + */ + public List preflightOptions() { + return this.preflightOptions; + } + + /** + * Set the preflightOptions property: The preflightOptions property. + * + * @param preflightOptions the preflightOptions value to set. + * @return the TemplateDeploymentOptions object itself. + */ + public TemplateDeploymentOptions withPreflightOptions(List preflightOptions) { + this.preflightOptions = preflightOptions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/TemplateDeploymentPolicy.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/TemplateDeploymentPolicy.java new file mode 100644 index 0000000000000..19d44522a5b01 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/TemplateDeploymentPolicy.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The TemplateDeploymentPolicy model. */ +@Fluent +public class TemplateDeploymentPolicy { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TemplateDeploymentPolicy.class); + + /* + * The capabilities property. + */ + @JsonProperty(value = "capabilities", required = true) + private TemplateDeploymentCapabilities capabilities; + + /* + * The preflightOptions property. + */ + @JsonProperty(value = "preflightOptions", required = true) + private TemplateDeploymentPreflightOptions preflightOptions; + + /** + * Get the capabilities property: The capabilities property. + * + * @return the capabilities value. + */ + public TemplateDeploymentCapabilities capabilities() { + return this.capabilities; + } + + /** + * Set the capabilities property: The capabilities property. + * + * @param capabilities the capabilities value to set. + * @return the TemplateDeploymentPolicy object itself. + */ + public TemplateDeploymentPolicy withCapabilities(TemplateDeploymentCapabilities capabilities) { + this.capabilities = capabilities; + return this; + } + + /** + * Get the preflightOptions property: The preflightOptions property. + * + * @return the preflightOptions value. + */ + public TemplateDeploymentPreflightOptions preflightOptions() { + return this.preflightOptions; + } + + /** + * Set the preflightOptions property: The preflightOptions property. + * + * @param preflightOptions the preflightOptions value to set. + * @return the TemplateDeploymentPolicy object itself. + */ + public TemplateDeploymentPolicy withPreflightOptions(TemplateDeploymentPreflightOptions preflightOptions) { + this.preflightOptions = preflightOptions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (capabilities() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property capabilities in model TemplateDeploymentPolicy")); + } + if (preflightOptions() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property preflightOptions in model TemplateDeploymentPolicy")); + } + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/TemplateDeploymentPreflightOptions.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/TemplateDeploymentPreflightOptions.java new file mode 100644 index 0000000000000..597e8145cd61f --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/TemplateDeploymentPreflightOptions.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for TemplateDeploymentPreflightOptions. */ +public final class TemplateDeploymentPreflightOptions extends ExpandableStringEnum { + /** Static value None for TemplateDeploymentPreflightOptions. */ + public static final TemplateDeploymentPreflightOptions NONE = fromString("None"); + + /** Static value ValidationRequests for TemplateDeploymentPreflightOptions. */ + public static final TemplateDeploymentPreflightOptions VALIDATION_REQUESTS = fromString("ValidationRequests"); + + /** Static value DeploymentRequests for TemplateDeploymentPreflightOptions. */ + public static final TemplateDeploymentPreflightOptions DEPLOYMENT_REQUESTS = fromString("DeploymentRequests"); + + /** Static value TestOnly for TemplateDeploymentPreflightOptions. */ + public static final TemplateDeploymentPreflightOptions TEST_ONLY = fromString("TestOnly"); + + /** Static value RegisteredOnly for TemplateDeploymentPreflightOptions. */ + public static final TemplateDeploymentPreflightOptions REGISTERED_ONLY = fromString("RegisteredOnly"); + + /** + * Creates or finds a TemplateDeploymentPreflightOptions from its string representation. + * + * @param name a name to look for. + * @return the corresponding TemplateDeploymentPreflightOptions. + */ + @JsonCreator + public static TemplateDeploymentPreflightOptions fromString(String name) { + return fromString(name, TemplateDeploymentPreflightOptions.class); + } + + /** @return known TemplateDeploymentPreflightOptions values. */ + public static Collection values() { + return values(TemplateDeploymentPreflightOptions.class); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ThirdPartyProviderAuthorization.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ThirdPartyProviderAuthorization.java new file mode 100644 index 0000000000000..ec43da753ebdd --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ThirdPartyProviderAuthorization.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The ThirdPartyProviderAuthorization model. */ +@Fluent +public class ThirdPartyProviderAuthorization { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ThirdPartyProviderAuthorization.class); + + /* + * The authorizations property. + */ + @JsonProperty(value = "authorizations") + private List authorizations; + + /* + * The managedByTenantId property. + */ + @JsonProperty(value = "managedByTenantId") + private String managedByTenantId; + + /** + * Get the authorizations property: The authorizations property. + * + * @return the authorizations value. + */ + public List authorizations() { + return this.authorizations; + } + + /** + * Set the authorizations property: The authorizations property. + * + * @param authorizations the authorizations value to set. + * @return the ThirdPartyProviderAuthorization object itself. + */ + public ThirdPartyProviderAuthorization withAuthorizations(List authorizations) { + this.authorizations = authorizations; + return this; + } + + /** + * Get the managedByTenantId property: The managedByTenantId property. + * + * @return the managedByTenantId value. + */ + public String managedByTenantId() { + return this.managedByTenantId; + } + + /** + * Set the managedByTenantId property: The managedByTenantId property. + * + * @param managedByTenantId the managedByTenantId value to set. + * @return the ThirdPartyProviderAuthorization object itself. + */ + public ThirdPartyProviderAuthorization withManagedByTenantId(String managedByTenantId) { + this.managedByTenantId = managedByTenantId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (authorizations() != null) { + authorizations().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ThrottlingMetric.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ThrottlingMetric.java new file mode 100644 index 0000000000000..60985dc719bda --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ThrottlingMetric.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.Duration; + +/** The ThrottlingMetric model. */ +@Fluent +public final class ThrottlingMetric { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ThrottlingMetric.class); + + /* + * The type property. + */ + @JsonProperty(value = "type", required = true) + private ThrottlingMetricType type; + + /* + * The limit property. + */ + @JsonProperty(value = "limit", required = true) + private long limit; + + /* + * The interval property. + */ + @JsonProperty(value = "interval") + private Duration interval; + + /** + * Get the type property: The type property. + * + * @return the type value. + */ + public ThrottlingMetricType type() { + return this.type; + } + + /** + * Set the type property: The type property. + * + * @param type the type value to set. + * @return the ThrottlingMetric object itself. + */ + public ThrottlingMetric withType(ThrottlingMetricType type) { + this.type = type; + return this; + } + + /** + * Get the limit property: The limit property. + * + * @return the limit value. + */ + public long limit() { + return this.limit; + } + + /** + * Set the limit property: The limit property. + * + * @param limit the limit value to set. + * @return the ThrottlingMetric object itself. + */ + public ThrottlingMetric withLimit(long limit) { + this.limit = limit; + return this; + } + + /** + * Get the interval property: The interval property. + * + * @return the interval value. + */ + public Duration interval() { + return this.interval; + } + + /** + * Set the interval property: The interval property. + * + * @param interval the interval value to set. + * @return the ThrottlingMetric object itself. + */ + public ThrottlingMetric withInterval(Duration interval) { + this.interval = interval; + 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 ThrottlingMetric")); + } + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ThrottlingMetricType.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ThrottlingMetricType.java new file mode 100644 index 0000000000000..fd5b56053c04f --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ThrottlingMetricType.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ThrottlingMetricType. */ +public final class ThrottlingMetricType extends ExpandableStringEnum { + /** Static value NotSpecified for ThrottlingMetricType. */ + public static final ThrottlingMetricType NOT_SPECIFIED = fromString("NotSpecified"); + + /** Static value NumberOfRequests for ThrottlingMetricType. */ + public static final ThrottlingMetricType NUMBER_OF_REQUESTS = fromString("NumberOfRequests"); + + /** Static value NumberOfResources for ThrottlingMetricType. */ + public static final ThrottlingMetricType NUMBER_OF_RESOURCES = fromString("NumberOfResources"); + + /** + * Creates or finds a ThrottlingMetricType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ThrottlingMetricType. + */ + @JsonCreator + public static ThrottlingMetricType fromString(String name) { + return fromString(name, ThrottlingMetricType.class); + } + + /** @return known ThrottlingMetricType values. */ + public static Collection values() { + return values(ThrottlingMetricType.class); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ThrottlingRule.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ThrottlingRule.java new file mode 100644 index 0000000000000..c3a2823e6fe1b --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/ThrottlingRule.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The ThrottlingRule model. */ +@Fluent +public final class ThrottlingRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ThrottlingRule.class); + + /* + * The action property. + */ + @JsonProperty(value = "action", required = true) + private String action; + + /* + * The metrics property. + */ + @JsonProperty(value = "metrics", required = true) + private List metrics; + + /* + * The requiredFeatures property. + */ + @JsonProperty(value = "requiredFeatures") + private List requiredFeatures; + + /** + * Get the action property: The action property. + * + * @return the action value. + */ + public String action() { + return this.action; + } + + /** + * Set the action property: The action property. + * + * @param action the action value to set. + * @return the ThrottlingRule object itself. + */ + public ThrottlingRule withAction(String action) { + this.action = action; + return this; + } + + /** + * Get the metrics property: The metrics property. + * + * @return the metrics value. + */ + public List metrics() { + return this.metrics; + } + + /** + * Set the metrics property: The metrics property. + * + * @param metrics the metrics value to set. + * @return the ThrottlingRule object itself. + */ + public ThrottlingRule withMetrics(List metrics) { + this.metrics = metrics; + return this; + } + + /** + * Get the requiredFeatures property: The requiredFeatures property. + * + * @return the requiredFeatures value. + */ + public List requiredFeatures() { + return this.requiredFeatures; + } + + /** + * Set the requiredFeatures property: The requiredFeatures property. + * + * @param requiredFeatures the requiredFeatures value to set. + * @return the ThrottlingRule object itself. + */ + public ThrottlingRule withRequiredFeatures(List requiredFeatures) { + this.requiredFeatures = requiredFeatures; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (action() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property action in model ThrottlingRule")); + } + if (metrics() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property metrics in model ThrottlingRule")); + } else { + metrics().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/TrafficRegionCategory.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/TrafficRegionCategory.java new file mode 100644 index 0000000000000..4da45a1faaffd --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/TrafficRegionCategory.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for TrafficRegionCategory. */ +public final class TrafficRegionCategory extends ExpandableStringEnum { + /** Static value NotSpecified for TrafficRegionCategory. */ + public static final TrafficRegionCategory NOT_SPECIFIED = fromString("NotSpecified"); + + /** Static value Canary for TrafficRegionCategory. */ + public static final TrafficRegionCategory CANARY = fromString("Canary"); + + /** Static value LowTraffic for TrafficRegionCategory. */ + public static final TrafficRegionCategory LOW_TRAFFIC = fromString("LowTraffic"); + + /** Static value MediumTraffic for TrafficRegionCategory. */ + public static final TrafficRegionCategory MEDIUM_TRAFFIC = fromString("MediumTraffic"); + + /** Static value HighTraffic for TrafficRegionCategory. */ + public static final TrafficRegionCategory HIGH_TRAFFIC = fromString("HighTraffic"); + + /** Static value None for TrafficRegionCategory. */ + public static final TrafficRegionCategory NONE = fromString("None"); + + /** Static value RestOfTheWorldGroupOne for TrafficRegionCategory. */ + public static final TrafficRegionCategory REST_OF_THE_WORLD_GROUP_ONE = fromString("RestOfTheWorldGroupOne"); + + /** Static value RestOfTheWorldGroupTwo for TrafficRegionCategory. */ + public static final TrafficRegionCategory REST_OF_THE_WORLD_GROUP_TWO = fromString("RestOfTheWorldGroupTwo"); + + /** + * Creates or finds a TrafficRegionCategory from its string representation. + * + * @param name a name to look for. + * @return the corresponding TrafficRegionCategory. + */ + @JsonCreator + public static TrafficRegionCategory fromString(String name) { + return fromString(name, TrafficRegionCategory.class); + } + + /** @return known TrafficRegionCategory values. */ + public static Collection values() { + return values(TrafficRegionCategory.class); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/TrafficRegionRolloutConfiguration.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/TrafficRegionRolloutConfiguration.java new file mode 100644 index 0000000000000..87f7fa7a7e92c --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/TrafficRegionRolloutConfiguration.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.Duration; +import java.util.List; + +/** The TrafficRegionRolloutConfiguration model. */ +@Fluent +public class TrafficRegionRolloutConfiguration extends TrafficRegions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TrafficRegionRolloutConfiguration.class); + + /* + * The waitDuration property. + */ + @JsonProperty(value = "waitDuration") + private Duration waitDuration; + + /** + * Get the waitDuration property: The waitDuration property. + * + * @return the waitDuration value. + */ + public Duration waitDuration() { + return this.waitDuration; + } + + /** + * Set the waitDuration property: The waitDuration property. + * + * @param waitDuration the waitDuration value to set. + * @return the TrafficRegionRolloutConfiguration object itself. + */ + public TrafficRegionRolloutConfiguration withWaitDuration(Duration waitDuration) { + this.waitDuration = waitDuration; + return this; + } + + /** {@inheritDoc} */ + @Override + public TrafficRegionRolloutConfiguration withRegions(List regions) { + super.withRegions(regions); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/TrafficRegions.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/TrafficRegions.java new file mode 100644 index 0000000000000..708d023af8473 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/TrafficRegions.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.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The TrafficRegions model. */ +@Fluent +public class TrafficRegions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TrafficRegions.class); + + /* + * The regions property. + */ + @JsonProperty(value = "regions") + private List regions; + + /** + * Get the regions property: The regions property. + * + * @return the regions value. + */ + public List regions() { + return this.regions; + } + + /** + * Set the regions property: The regions property. + * + * @param regions the regions value to set. + * @return the TrafficRegions object itself. + */ + public TrafficRegions withRegions(List regions) { + this.regions = regions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/TypedErrorInfo.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/TypedErrorInfo.java new file mode 100644 index 0000000000000..8626f49f704fb --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/TypedErrorInfo.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.providerhub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The TypedErrorInfo model. */ +@Fluent +public final class TypedErrorInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TypedErrorInfo.class); + + /* + * The type property. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /* + * Any object + */ + @JsonProperty(value = "info", access = JsonProperty.Access.WRITE_ONLY) + private Object info; + + /** + * Get the type property: The type property. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The type property. + * + * @param type the type value to set. + * @return the TypedErrorInfo object itself. + */ + public TypedErrorInfo withType(String type) { + this.type = type; + return this; + } + + /** + * Get the info property: Any object. + * + * @return the info value. + */ + public Object info() { + return this.info; + } + + /** + * 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 TypedErrorInfo")); + } + } +} diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/package-info.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/package-info.java new file mode 100644 index 0000000000000..987a4f8f01ae0 --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the data models for ProviderHub. Microsoft ProviderHub. */ +package com.azure.resourcemanager.providerhub.models; diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/package-info.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/package-info.java new file mode 100644 index 0000000000000..d6fcfb53673df --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/com/azure/resourcemanager/providerhub/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the classes for ProviderHub. Microsoft ProviderHub. */ +package com.azure.resourcemanager.providerhub; diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/module-info.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/module-info.java new file mode 100644 index 0000000000000..5698b51246f3e --- /dev/null +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/main/java/module-info.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +module com.azure.resourcemanager.providerhub { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.providerhub; + exports com.azure.resourcemanager.providerhub.fluent; + exports com.azure.resourcemanager.providerhub.fluent.models; + exports com.azure.resourcemanager.providerhub.models; + + opens com.azure.resourcemanager.providerhub.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.providerhub.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/providerhub/ci.yml b/sdk/providerhub/ci.yml new file mode 100644 index 0000000000000..61a005e9103bb --- /dev/null +++ b/sdk/providerhub/ci.yml @@ -0,0 +1,33 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - master + - main + - hotfix/* + - release/* + paths: + include: + - sdk/providerhub/ + +pr: + branches: + include: + - master + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/providerhub/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: providerhub + Artifacts: + - name: azure-resourcemanager-providerhub + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerproviderhub diff --git a/sdk/providerhub/pom.xml b/sdk/providerhub/pom.xml new file mode 100644 index 0000000000000..e9cff238a3146 --- /dev/null +++ b/sdk/providerhub/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + com.azure + azure-providerhub-service + pom + 1.0.0 + + + + coverage + + + + + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + report-aggregate + verify + + report-aggregate + + + ${project.reporting.outputDirectory}/test-coverage + + + + + + + + + default + + true + + + azure-resourcemanager-providerhub + + + +