diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index b2e7e9f14af2..ff3d990fd963 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -306,6 +306,7 @@ com.azure.resourcemanager:azure-resourcemanager-postgresqlflexibleserver;1.0.0-b com.azure.resourcemanager:azure-resourcemanager-elastic;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-webpubsub;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-security;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-hybridnetwork;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 0c475ccdb3e4..8c638c5f7fca 100644 --- a/pom.xml +++ b/pom.xml @@ -761,6 +761,7 @@ sdk/healthcareapis sdk/hybridcompute sdk/hybridkubernetes + sdk/hybridnetwork sdk/identity sdk/imagebuilder sdk/iotcentral diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/CHANGELOG.md b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/CHANGELOG.md new file mode 100644 index 000000000000..61c8400543ab --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2021-07-15) + +- Azure Resource Manager HybridNetwork client library for Java. This package contains Microsoft Azure SDK for HybridNetwork Management SDK. The definitions in this swagger specification will be used to manage the Hybrid Network resources. Package tag package-2021-05-01. 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/hybridnetwork/azure-resourcemanager-hybridnetwork/README.md b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/README.md new file mode 100644 index 000000000000..69e1a94824b2 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/README.md @@ -0,0 +1,101 @@ +# Azure Resource Manager HybridNetwork client library for Java + +Azure Resource Manager HybridNetwork client library for Java. + +This package contains Microsoft Azure SDK for HybridNetwork Management SDK. The definitions in this swagger specification will be used to manage the Hybrid Network resources. Package tag package-2021-05-01. 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-hybridnetwork;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-hybridnetwork + 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(); +HybridNetworkManager manager = HybridNetworkManager + .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/main/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/main/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/pom.xml b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/pom.xml new file mode 100644 index 000000000000..075b3526a665 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/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-hybridnetwork + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for HybridNetwork Management + This package contains Microsoft Azure SDK for HybridNetwork Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The definitions in this swagger specification will be used to manage the Hybrid Network resources. Package tag package-2021-05-01. + 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.18.0 + + + com.azure + azure-core-management + 1.3.1 + + + + + + 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/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/HybridNetworkManager.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/HybridNetworkManager.java new file mode 100644 index 000000000000..23417e19fb88 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/HybridNetworkManager.java @@ -0,0 +1,341 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork; + +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.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.http.policy.ArmChallengeAuthenticationPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybridnetwork.fluent.HybridNetworkManagementClient; +import com.azure.resourcemanager.hybridnetwork.implementation.DevicesImpl; +import com.azure.resourcemanager.hybridnetwork.implementation.HybridNetworkManagementClientBuilder; +import com.azure.resourcemanager.hybridnetwork.implementation.NetworkFunctionVendorSkusImpl; +import com.azure.resourcemanager.hybridnetwork.implementation.NetworkFunctionVendorsImpl; +import com.azure.resourcemanager.hybridnetwork.implementation.NetworkFunctionsImpl; +import com.azure.resourcemanager.hybridnetwork.implementation.OperationsImpl; +import com.azure.resourcemanager.hybridnetwork.implementation.RoleInstancesImpl; +import com.azure.resourcemanager.hybridnetwork.implementation.VendorNetworkFunctionsImpl; +import com.azure.resourcemanager.hybridnetwork.implementation.VendorSkuPreviewsImpl; +import com.azure.resourcemanager.hybridnetwork.implementation.VendorSkusImpl; +import com.azure.resourcemanager.hybridnetwork.implementation.VendorsImpl; +import com.azure.resourcemanager.hybridnetwork.models.Devices; +import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionVendorSkus; +import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionVendors; +import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctions; +import com.azure.resourcemanager.hybridnetwork.models.Operations; +import com.azure.resourcemanager.hybridnetwork.models.RoleInstances; +import com.azure.resourcemanager.hybridnetwork.models.VendorNetworkFunctions; +import com.azure.resourcemanager.hybridnetwork.models.VendorSkuPreviews; +import com.azure.resourcemanager.hybridnetwork.models.VendorSkus; +import com.azure.resourcemanager.hybridnetwork.models.Vendors; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * Entry point to HybridNetworkManager. The definitions in this swagger specification will be used to manage the Hybrid + * Network resources. + */ +public final class HybridNetworkManager { + private NetworkFunctions networkFunctions; + + private Devices devices; + + private Operations operations; + + private Vendors vendors; + + private VendorSkus vendorSkus; + + private VendorSkuPreviews vendorSkuPreviews; + + private NetworkFunctionVendors networkFunctionVendors; + + private NetworkFunctionVendorSkus networkFunctionVendorSkus; + + private VendorNetworkFunctions vendorNetworkFunctions; + + private RoleInstances roleInstances; + + private final HybridNetworkManagementClient clientObject; + + private HybridNetworkManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new HybridNetworkManagementClientBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of HybridNetwork service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the HybridNetwork service API instance. + */ + public static HybridNetworkManager 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 HybridNetworkManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new HybridNetworkManager.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 final List scopes = 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; + } + + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the 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 HybridNetwork service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the HybridNetwork service API instance. + */ + public HybridNetworkManager 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.hybridnetwork") + .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 (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } + 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 ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + 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 HybridNetworkManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** @return Resource collection API of NetworkFunctions. */ + public NetworkFunctions networkFunctions() { + if (this.networkFunctions == null) { + this.networkFunctions = new NetworkFunctionsImpl(clientObject.getNetworkFunctions(), this); + } + return networkFunctions; + } + + /** @return Resource collection API of Devices. */ + public Devices devices() { + if (this.devices == null) { + this.devices = new DevicesImpl(clientObject.getDevices(), this); + } + return devices; + } + + /** @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 Vendors. */ + public Vendors vendors() { + if (this.vendors == null) { + this.vendors = new VendorsImpl(clientObject.getVendors(), this); + } + return vendors; + } + + /** @return Resource collection API of VendorSkus. */ + public VendorSkus vendorSkus() { + if (this.vendorSkus == null) { + this.vendorSkus = new VendorSkusImpl(clientObject.getVendorSkus(), this); + } + return vendorSkus; + } + + /** @return Resource collection API of VendorSkuPreviews. */ + public VendorSkuPreviews vendorSkuPreviews() { + if (this.vendorSkuPreviews == null) { + this.vendorSkuPreviews = new VendorSkuPreviewsImpl(clientObject.getVendorSkuPreviews(), this); + } + return vendorSkuPreviews; + } + + /** @return Resource collection API of NetworkFunctionVendors. */ + public NetworkFunctionVendors networkFunctionVendors() { + if (this.networkFunctionVendors == null) { + this.networkFunctionVendors = + new NetworkFunctionVendorsImpl(clientObject.getNetworkFunctionVendors(), this); + } + return networkFunctionVendors; + } + + /** @return Resource collection API of NetworkFunctionVendorSkus. */ + public NetworkFunctionVendorSkus networkFunctionVendorSkus() { + if (this.networkFunctionVendorSkus == null) { + this.networkFunctionVendorSkus = + new NetworkFunctionVendorSkusImpl(clientObject.getNetworkFunctionVendorSkus(), this); + } + return networkFunctionVendorSkus; + } + + /** @return Resource collection API of VendorNetworkFunctions. */ + public VendorNetworkFunctions vendorNetworkFunctions() { + if (this.vendorNetworkFunctions == null) { + this.vendorNetworkFunctions = + new VendorNetworkFunctionsImpl(clientObject.getVendorNetworkFunctions(), this); + } + return vendorNetworkFunctions; + } + + /** @return Resource collection API of RoleInstances. */ + public RoleInstances roleInstances() { + if (this.roleInstances == null) { + this.roleInstances = new RoleInstancesImpl(clientObject.getRoleInstances(), this); + } + return roleInstances; + } + + /** + * @return Wrapped service client HybridNetworkManagementClient providing direct access to the underlying + * auto-generated API implementation, based on Azure REST API. + */ + public HybridNetworkManagementClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/DevicesClient.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/DevicesClient.java new file mode 100644 index 000000000000..5109c2b6fe93 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/DevicesClient.java @@ -0,0 +1,263 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.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.hybridnetwork.fluent.models.DeviceInner; +import com.azure.resourcemanager.hybridnetwork.fluent.models.DeviceRegistrationKeyInner; +import com.azure.resourcemanager.hybridnetwork.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in DevicesClient. */ +public interface DevicesClient { + /** + * Deletes the specified device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The name of the device resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String deviceName); + + /** + * Deletes the specified device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The name of the device resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String deviceName, Context context); + + /** + * Deletes the specified device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The name of the device resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String deviceName); + + /** + * Deletes the specified device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The name of the device resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String deviceName, Context context); + + /** + * Gets information about the specified device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The name of the device resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeviceInner getByResourceGroup(String resourceGroupName, String deviceName); + + /** + * Gets information about the specified device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The name of the device resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String deviceName, Context context); + + /** + * Creates or updates a device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName Resource name for the device resource. + * @param parameters Parameters supplied to the create or update device operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return device resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DeviceInner> beginCreateOrUpdate( + String resourceGroupName, String deviceName, DeviceInner parameters); + + /** + * Creates or updates a device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName Resource name for the device resource. + * @param parameters Parameters supplied to the create or update device 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 device resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DeviceInner> beginCreateOrUpdate( + String resourceGroupName, String deviceName, DeviceInner parameters, Context context); + + /** + * Creates or updates a device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName Resource name for the device resource. + * @param parameters Parameters supplied to the create or update device operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return device resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeviceInner createOrUpdate(String resourceGroupName, String deviceName, DeviceInner parameters); + + /** + * Creates or updates a device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName Resource name for the device resource. + * @param parameters Parameters supplied to the create or update device 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 device resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeviceInner createOrUpdate(String resourceGroupName, String deviceName, DeviceInner parameters, Context context); + + /** + * Updates device tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The name of the device resource. + * @param parameters Parameters supplied to the update device tags operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return device resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeviceInner updateTags(String resourceGroupName, String deviceName, TagsObject parameters); + + /** + * Updates device tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The name of the device resource. + * @param parameters Parameters supplied to the update device tags 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 device resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String deviceName, TagsObject parameters, Context context); + + /** + * Lists all the devices in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for devices API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all the devices in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for devices API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Lists all the device resource in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for devices API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all the device resource in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for devices API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * List the registration key for the device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The name of the device resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the device registration key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeviceRegistrationKeyInner listRegistrationKey(String resourceGroupName, String deviceName); + + /** + * List the registration key for the device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The name of the device resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the device registration key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listRegistrationKeyWithResponse( + String resourceGroupName, String deviceName, Context context); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/HybridNetworkManagementClient.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/HybridNetworkManagementClient.java new file mode 100644 index 000000000000..a9613ddb088e --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/HybridNetworkManagementClient.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.hybridnetwork.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for HybridNetworkManagementClient class. */ +public interface HybridNetworkManagementClient { + /** + * 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 NetworkFunctionsClient object to access its operations. + * + * @return the NetworkFunctionsClient object. + */ + NetworkFunctionsClient getNetworkFunctions(); + + /** + * Gets the DevicesClient object to access its operations. + * + * @return the DevicesClient object. + */ + DevicesClient getDevices(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the VendorsClient object to access its operations. + * + * @return the VendorsClient object. + */ + VendorsClient getVendors(); + + /** + * Gets the VendorSkusClient object to access its operations. + * + * @return the VendorSkusClient object. + */ + VendorSkusClient getVendorSkus(); + + /** + * Gets the VendorSkuPreviewsClient object to access its operations. + * + * @return the VendorSkuPreviewsClient object. + */ + VendorSkuPreviewsClient getVendorSkuPreviews(); + + /** + * Gets the NetworkFunctionVendorsClient object to access its operations. + * + * @return the NetworkFunctionVendorsClient object. + */ + NetworkFunctionVendorsClient getNetworkFunctionVendors(); + + /** + * Gets the NetworkFunctionVendorSkusClient object to access its operations. + * + * @return the NetworkFunctionVendorSkusClient object. + */ + NetworkFunctionVendorSkusClient getNetworkFunctionVendorSkus(); + + /** + * Gets the VendorNetworkFunctionsClient object to access its operations. + * + * @return the VendorNetworkFunctionsClient object. + */ + VendorNetworkFunctionsClient getVendorNetworkFunctions(); + + /** + * Gets the RoleInstancesClient object to access its operations. + * + * @return the RoleInstancesClient object. + */ + RoleInstancesClient getRoleInstances(); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/NetworkFunctionVendorSkusClient.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/NetworkFunctionVendorSkusClient.java new file mode 100644 index 000000000000..6c2238641de2 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/NetworkFunctionVendorSkusClient.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.hybridnetwork.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionSkuRoleDetailsInner; +import com.azure.resourcemanager.hybridnetwork.fluent.models.SkuOverviewInner; + +/** An instance of this class provides access to all the operations defined in NetworkFunctionVendorSkusClient. */ +public interface NetworkFunctionVendorSkusClient { + /** + * Lists all network function vendor sku details in a vendor. + * + * @param vendorName The name of the network function vendor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of available network function skus. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByVendor(String vendorName); + + /** + * Lists all network function vendor sku details in a vendor. + * + * @param vendorName The name of the network function vendor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of available network function skus. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByVendor(String vendorName, Context context); + + /** + * Lists information about network function vendor sku details. + * + * @param vendorName The name of the network function vendor. + * @param vendorSkuName The name of the network function 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 network function sku details. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listBySku(String vendorName, String vendorSkuName); + + /** + * Lists information about network function vendor sku details. + * + * @param vendorName The name of the network function vendor. + * @param vendorSkuName The name of the network function 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 network function sku details. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listBySku( + String vendorName, String vendorSkuName, Context context); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/NetworkFunctionVendorsClient.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/NetworkFunctionVendorsClient.java new file mode 100644 index 000000000000..afb4d4a622c7 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/NetworkFunctionVendorsClient.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.hybridnetwork.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionVendorInner; + +/** An instance of this class provides access to all the operations defined in NetworkFunctionVendorsClient. */ +public interface NetworkFunctionVendorsClient { + /** + * Lists all the available vendor and sku information. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the network function vendor list result. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all the available vendor and sku information. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the network function vendor list result. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/NetworkFunctionsClient.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/NetworkFunctionsClient.java new file mode 100644 index 000000000000..9f2d8f1dc196 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/NetworkFunctionsClient.java @@ -0,0 +1,246 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.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.hybridnetwork.fluent.models.NetworkFunctionInner; +import com.azure.resourcemanager.hybridnetwork.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in NetworkFunctionsClient. */ +public interface NetworkFunctionsClient { + /** + * Deletes the specified network function resource. This operation can take up to 1 hour to complete. This is + * expected service behavior. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName The name of the network function. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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) + SyncPoller, Void> beginDelete(String resourceGroupName, String networkFunctionName); + + /** + * Deletes the specified network function resource. This operation can take up to 1 hour to complete. This is + * expected service behavior. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName The name of the network function. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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) + SyncPoller, Void> beginDelete( + String resourceGroupName, String networkFunctionName, Context context); + + /** + * Deletes the specified network function resource. This operation can take up to 1 hour to complete. This is + * expected service behavior. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName The name of the network function. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String networkFunctionName); + + /** + * Deletes the specified network function resource. This operation can take up to 1 hour to complete. This is + * expected service behavior. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName The name of the network function. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String networkFunctionName, Context context); + + /** + * Gets information about the specified network function resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName The name of the network function resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified network function resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkFunctionInner getByResourceGroup(String resourceGroupName, String networkFunctionName); + + /** + * Gets information about the specified network function resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName The name of the network function resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified network function resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String networkFunctionName, Context context); + + /** + * Creates or updates a network function resource. This operation can take up to 6 hours to complete. This is + * expected service behavior. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName Resource name for the network function resource. + * @param parameters Parameters supplied in the body to the create or update network function operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network function resource response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, NetworkFunctionInner> beginCreateOrUpdate( + String resourceGroupName, String networkFunctionName, NetworkFunctionInner parameters); + + /** + * Creates or updates a network function resource. This operation can take up to 6 hours to complete. This is + * expected service behavior. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName Resource name for the network function resource. + * @param parameters Parameters supplied in the body to the create or update network function 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 network function resource response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, NetworkFunctionInner> beginCreateOrUpdate( + String resourceGroupName, String networkFunctionName, NetworkFunctionInner parameters, Context context); + + /** + * Creates or updates a network function resource. This operation can take up to 6 hours to complete. This is + * expected service behavior. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName Resource name for the network function resource. + * @param parameters Parameters supplied in the body to the create or update network function operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network function resource response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkFunctionInner createOrUpdate( + String resourceGroupName, String networkFunctionName, NetworkFunctionInner parameters); + + /** + * Creates or updates a network function resource. This operation can take up to 6 hours to complete. This is + * expected service behavior. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName Resource name for the network function resource. + * @param parameters Parameters supplied in the body to the create or update network function 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 network function resource response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkFunctionInner createOrUpdate( + String resourceGroupName, String networkFunctionName, NetworkFunctionInner parameters, Context context); + + /** + * Updates the tags for the network function resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName Resource name for the network function resource. + * @param parameters Parameters supplied to the update network function tags operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network function resource response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkFunctionInner updateTags(String resourceGroupName, String networkFunctionName, TagsObject parameters); + + /** + * Updates the tags for the network function resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName Resource name for the network function resource. + * @param parameters Parameters supplied to the update network function tags 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 network function resource response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String networkFunctionName, TagsObject parameters, Context context); + + /** + * Lists all the network functions in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for network function API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all the network functions in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for network function API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Lists all the network function resources in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for network function API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all the network function resources in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for network function API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/OperationsClient.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/OperationsClient.java new file mode 100644 index 000000000000..68853e606ef3 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/OperationsClient.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.hybridnetwork.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridnetwork.fluent.models.OperationInner; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public interface OperationsClient { + /** + * Gets a list of the operations. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of the operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets a list of the operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of the operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/RoleInstancesClient.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/RoleInstancesClient.java new file mode 100644 index 000000000000..215dc4ececaf --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/RoleInstancesClient.java @@ -0,0 +1,264 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.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.hybridnetwork.fluent.models.RoleInstanceInner; + +/** An instance of this class provides access to all the operations defined in RoleInstancesClient. */ +public interface RoleInstancesClient { + /** + * Starts a role instance of a vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param roleInstanceName The name of the role instance of the vendor network function. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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) + SyncPoller, Void> beginStart( + String locationName, String vendorName, String serviceKey, String roleInstanceName); + + /** + * Starts a role instance of a vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param roleInstanceName The name of the role instance of the vendor network function. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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) + SyncPoller, Void> beginStart( + String locationName, String vendorName, String serviceKey, String roleInstanceName, Context context); + + /** + * Starts a role instance of a vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param roleInstanceName The name of the role instance of the vendor network function. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void start(String locationName, String vendorName, String serviceKey, String roleInstanceName); + + /** + * Starts a role instance of a vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param roleInstanceName The name of the role instance of the vendor network function. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void start(String locationName, String vendorName, String serviceKey, String roleInstanceName, Context context); + + /** + * Powers off (stop) a role instance of a vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param roleInstanceName The name of the role instance of the vendor network function. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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) + SyncPoller, Void> beginStop( + String locationName, String vendorName, String serviceKey, String roleInstanceName); + + /** + * Powers off (stop) a role instance of a vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param roleInstanceName The name of the role instance of the vendor network function. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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) + SyncPoller, Void> beginStop( + String locationName, String vendorName, String serviceKey, String roleInstanceName, Context context); + + /** + * Powers off (stop) a role instance of a vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param roleInstanceName The name of the role instance of the vendor network function. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 locationName, String vendorName, String serviceKey, String roleInstanceName); + + /** + * Powers off (stop) a role instance of a vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param roleInstanceName The name of the role instance of the vendor network function. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 locationName, String vendorName, String serviceKey, String roleInstanceName, Context context); + + /** + * Restarts a role instance of a vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param roleInstanceName The name of the role instance of the vendor network function. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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) + SyncPoller, Void> beginRestart( + String locationName, String vendorName, String serviceKey, String roleInstanceName); + + /** + * Restarts a role instance of a vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param roleInstanceName The name of the role instance of the vendor network function. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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) + SyncPoller, Void> beginRestart( + String locationName, String vendorName, String serviceKey, String roleInstanceName, Context context); + + /** + * Restarts a role instance of a vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param roleInstanceName The name of the role instance of the vendor network function. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void restart(String locationName, String vendorName, String serviceKey, String roleInstanceName); + + /** + * Restarts a role instance of a vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param roleInstanceName The name of the role instance of the vendor network function. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void restart(String locationName, String vendorName, String serviceKey, String roleInstanceName, Context context); + + /** + * Gets the information of role instance of vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param roleInstanceName The name of the role instance of the vendor network function. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the information of role instance of vendor network function. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RoleInstanceInner get(String locationName, String vendorName, String serviceKey, String roleInstanceName); + + /** + * Gets the information of role instance of vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param roleInstanceName The name of the role instance of the vendor network function. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the information of role instance of vendor network function. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String locationName, String vendorName, String serviceKey, String roleInstanceName, Context context); + + /** + * Lists the information of role instances of vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of role instances of vendor network function. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String locationName, String vendorName, String serviceKey); + + /** + * Lists the information of role instances of vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of role instances of vendor network function. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String locationName, String vendorName, String serviceKey, Context context); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/VendorNetworkFunctionsClient.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/VendorNetworkFunctionsClient.java new file mode 100644 index 000000000000..86065f5e7395 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/VendorNetworkFunctionsClient.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.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.hybridnetwork.fluent.models.VendorNetworkFunctionInner; + +/** An instance of this class provides access to all the operations defined in VendorNetworkFunctionsClient. */ +public interface VendorNetworkFunctionsClient { + /** + * Gets information about the specified vendor network function. + * + * @param locationName The Azure region where the network function resource was created by the customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified vendor network function. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VendorNetworkFunctionInner get(String locationName, String vendorName, String serviceKey); + + /** + * Gets information about the specified vendor network function. + * + * @param locationName The Azure region where the network function resource was created by the customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified vendor network function. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String locationName, String vendorName, String serviceKey, Context context); + + /** + * Creates or updates a vendor network function. This operation can take up to 6 hours to complete. This is expected + * service behavior. + * + * @param locationName The Azure region where the network function resource was created by the customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param parameters Parameters supplied to the create or update vendor network function operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vendor network function sub resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VendorNetworkFunctionInner> beginCreateOrUpdate( + String locationName, String vendorName, String serviceKey, VendorNetworkFunctionInner parameters); + + /** + * Creates or updates a vendor network function. This operation can take up to 6 hours to complete. This is expected + * service behavior. + * + * @param locationName The Azure region where the network function resource was created by the customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param parameters Parameters supplied to the create or update vendor network function 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 vendor network function sub resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VendorNetworkFunctionInner> beginCreateOrUpdate( + String locationName, + String vendorName, + String serviceKey, + VendorNetworkFunctionInner parameters, + Context context); + + /** + * Creates or updates a vendor network function. This operation can take up to 6 hours to complete. This is expected + * service behavior. + * + * @param locationName The Azure region where the network function resource was created by the customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param parameters Parameters supplied to the create or update vendor network function operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vendor network function sub resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VendorNetworkFunctionInner createOrUpdate( + String locationName, String vendorName, String serviceKey, VendorNetworkFunctionInner parameters); + + /** + * Creates or updates a vendor network function. This operation can take up to 6 hours to complete. This is expected + * service behavior. + * + * @param locationName The Azure region where the network function resource was created by the customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param parameters Parameters supplied to the create or update vendor network function 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 vendor network function sub resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VendorNetworkFunctionInner createOrUpdate( + String locationName, + String vendorName, + String serviceKey, + VendorNetworkFunctionInner parameters, + Context context); + + /** + * Lists all the vendor network function sub resources in an Azure region, filtered by skuType, skuName, + * vendorProvisioningState. + * + * @param locationName The Azure region where the network function resource was created by the customer. + * @param vendorName The name of the vendor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for vendors API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String locationName, String vendorName); + + /** + * Lists all the vendor network function sub resources in an Azure region, filtered by skuType, skuName, + * vendorProvisioningState. + * + * @param locationName The Azure region where the network function resource was created by the customer. + * @param vendorName The name of the vendor. + * @param filter The filter to apply on the operation. The properties you can use for eq (equals) are: skuType, + * skuName and vendorProvisioningState. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for vendors API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String locationName, String vendorName, String filter, Context context); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/VendorSkuPreviewsClient.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/VendorSkuPreviewsClient.java new file mode 100644 index 000000000000..b75ad8410171 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/VendorSkuPreviewsClient.java @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.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.hybridnetwork.fluent.models.PreviewSubscriptionInner; + +/** An instance of this class provides access to all the operations defined in VendorSkuPreviewsClient. */ +public interface VendorSkuPreviewsClient { + /** + * Lists all the preview information of a vendor sku. + * + * @param vendorName The name of the vendor. + * @param skuName The name of 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 a list of customer subscriptions which can use a sku. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String vendorName, String skuName); + + /** + * Lists all the preview information of a vendor sku. + * + * @param vendorName The name of the vendor. + * @param skuName The name of 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 a list of customer subscriptions which can use a sku. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String vendorName, String skuName, Context context); + + /** + * Creates or updates preview information of a vendor sku. + * + * @param vendorName The name of the vendor. + * @param skuName The name of the vendor sku. + * @param previewSubscription Preview subscription ID. + * @param parameters Parameters supplied to the create or update vendor preview subscription operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customer subscription which can use a sku. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, PreviewSubscriptionInner> beginCreateOrUpdate( + String vendorName, String skuName, String previewSubscription, PreviewSubscriptionInner parameters); + + /** + * Creates or updates preview information of a vendor sku. + * + * @param vendorName The name of the vendor. + * @param skuName The name of the vendor sku. + * @param previewSubscription Preview subscription ID. + * @param parameters Parameters supplied to the create or update vendor preview subscription 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 customer subscription which can use a sku. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, PreviewSubscriptionInner> beginCreateOrUpdate( + String vendorName, + String skuName, + String previewSubscription, + PreviewSubscriptionInner parameters, + Context context); + + /** + * Creates or updates preview information of a vendor sku. + * + * @param vendorName The name of the vendor. + * @param skuName The name of the vendor sku. + * @param previewSubscription Preview subscription ID. + * @param parameters Parameters supplied to the create or update vendor preview subscription operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customer subscription which can use a sku. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PreviewSubscriptionInner createOrUpdate( + String vendorName, String skuName, String previewSubscription, PreviewSubscriptionInner parameters); + + /** + * Creates or updates preview information of a vendor sku. + * + * @param vendorName The name of the vendor. + * @param skuName The name of the vendor sku. + * @param previewSubscription Preview subscription ID. + * @param parameters Parameters supplied to the create or update vendor preview subscription 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 customer subscription which can use a sku. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PreviewSubscriptionInner createOrUpdate( + String vendorName, + String skuName, + String previewSubscription, + PreviewSubscriptionInner parameters, + Context context); + + /** + * Gets the preview information of a vendor sku. + * + * @param vendorName The name of the vendor. + * @param skuName The name of the vendor sku. + * @param previewSubscription Preview subscription 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 preview information of a vendor sku. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PreviewSubscriptionInner get(String vendorName, String skuName, String previewSubscription); + + /** + * Gets the preview information of a vendor sku. + * + * @param vendorName The name of the vendor. + * @param skuName The name of the vendor sku. + * @param previewSubscription Preview subscription 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 preview information of a vendor sku. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String vendorName, String skuName, String previewSubscription, Context context); + + /** + * Deletes the preview information of a vendor sku. + * + * @param vendorName The name of the vendor. + * @param skuName The name of the vendor sku. + * @param previewSubscription Preview subscription 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String vendorName, String skuName, String previewSubscription); + + /** + * Deletes the preview information of a vendor sku. + * + * @param vendorName The name of the vendor. + * @param skuName The name of the vendor sku. + * @param previewSubscription Preview subscription 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String vendorName, String skuName, String previewSubscription, Context context); + + /** + * Deletes the preview information of a vendor sku. + * + * @param vendorName The name of the vendor. + * @param skuName The name of the vendor sku. + * @param previewSubscription Preview subscription 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String vendorName, String skuName, String previewSubscription); + + /** + * Deletes the preview information of a vendor sku. + * + * @param vendorName The name of the vendor. + * @param skuName The name of the vendor sku. + * @param previewSubscription Preview subscription 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String vendorName, String skuName, String previewSubscription, Context context); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/VendorSkusClient.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/VendorSkusClient.java new file mode 100644 index 000000000000..c62638145ed2 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/VendorSkusClient.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.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.hybridnetwork.fluent.models.VendorSkuInner; + +/** An instance of this class provides access to all the operations defined in VendorSkusClient. */ +public interface VendorSkusClient { + /** + * Deletes the specified sku. This operation can take up to 2 hours to complete. This is expected service behavior. + * + * @param vendorName The name of the vendor. + * @param skuName The name of 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String vendorName, String skuName); + + /** + * Deletes the specified sku. This operation can take up to 2 hours to complete. This is expected service behavior. + * + * @param vendorName The name of the vendor. + * @param skuName The name of 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String vendorName, String skuName, Context context); + + /** + * Deletes the specified sku. This operation can take up to 2 hours to complete. This is expected service behavior. + * + * @param vendorName The name of the vendor. + * @param skuName The name of 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 vendorName, String skuName); + + /** + * Deletes the specified sku. This operation can take up to 2 hours to complete. This is expected service behavior. + * + * @param vendorName The name of the vendor. + * @param skuName The name of 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String vendorName, String skuName, Context context); + + /** + * Gets information about the specified sku. + * + * @param vendorName The name of the vendor. + * @param skuName The name of 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 information about the specified sku. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VendorSkuInner get(String vendorName, String skuName); + + /** + * Gets information about the specified sku. + * + * @param vendorName The name of the vendor. + * @param skuName The name of 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 information about the specified sku. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String vendorName, String skuName, Context context); + + /** + * Creates or updates a sku. This operation can take up to 2 hours to complete. This is expected service behavior. + * + * @param vendorName The name of the vendor. + * @param skuName The name of the sku. + * @param parameters Parameters supplied to the create or update 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 sku sub resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VendorSkuInner> beginCreateOrUpdate( + String vendorName, String skuName, VendorSkuInner parameters); + + /** + * Creates or updates a sku. This operation can take up to 2 hours to complete. This is expected service behavior. + * + * @param vendorName The name of the vendor. + * @param skuName The name of the sku. + * @param parameters Parameters supplied to the create or update 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 sku sub resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VendorSkuInner> beginCreateOrUpdate( + String vendorName, String skuName, VendorSkuInner parameters, Context context); + + /** + * Creates or updates a sku. This operation can take up to 2 hours to complete. This is expected service behavior. + * + * @param vendorName The name of the vendor. + * @param skuName The name of the sku. + * @param parameters Parameters supplied to the create or update 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 sku sub resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VendorSkuInner createOrUpdate(String vendorName, String skuName, VendorSkuInner parameters); + + /** + * Creates or updates a sku. This operation can take up to 2 hours to complete. This is expected service behavior. + * + * @param vendorName The name of the vendor. + * @param skuName The name of the sku. + * @param parameters Parameters supplied to the create or update 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 sku sub resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VendorSkuInner createOrUpdate(String vendorName, String skuName, VendorSkuInner parameters, Context context); + + /** + * Lists all the skus of a vendor. + * + * @param vendorName The name of the vendor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list vendor sku API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String vendorName); + + /** + * Lists all the skus of a vendor. + * + * @param vendorName The name of the vendor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list vendor sku API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String vendorName, Context context); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/VendorsClient.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/VendorsClient.java new file mode 100644 index 000000000000..f453b7bcdf7c --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/VendorsClient.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.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.hybridnetwork.fluent.models.VendorInner; + +/** An instance of this class provides access to all the operations defined in VendorsClient. */ +public interface VendorsClient { + /** + * Deletes the specified vendor. + * + * @param vendorName The name of the vendor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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) + SyncPoller, Void> beginDelete(String vendorName); + + /** + * Deletes the specified vendor. + * + * @param vendorName The name of the vendor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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) + SyncPoller, Void> beginDelete(String vendorName, Context context); + + /** + * Deletes the specified vendor. + * + * @param vendorName The name of the vendor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 vendorName); + + /** + * Deletes the specified vendor. + * + * @param vendorName The name of the vendor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 vendorName, Context context); + + /** + * Gets information about the specified vendor. + * + * @param vendorName The name of the vendor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified vendor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VendorInner get(String vendorName); + + /** + * Gets information about the specified vendor. + * + * @param vendorName The name of the vendor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified vendor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String vendorName, Context context); + + /** + * Creates or updates a vendor. + * + * @param vendorName The name of the vendor. + * @param parameters Parameters supplied to the create vendor operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vendor resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VendorInner> beginCreateOrUpdate(String vendorName, VendorInner parameters); + + /** + * Creates or updates a vendor. + * + * @param vendorName The name of the vendor. + * @param parameters Parameters supplied to the create vendor 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 vendor resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VendorInner> beginCreateOrUpdate( + String vendorName, VendorInner parameters, Context context); + + /** + * Creates or updates a vendor. + * + * @param vendorName The name of the vendor. + * @param parameters Parameters supplied to the create vendor operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vendor resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VendorInner createOrUpdate(String vendorName, VendorInner parameters); + + /** + * Creates or updates a vendor. + * + * @param vendorName The name of the vendor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vendor resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VendorInner createOrUpdate(String vendorName); + + /** + * Creates or updates a vendor. + * + * @param vendorName The name of the vendor. + * @param parameters Parameters supplied to the create vendor 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 vendor resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VendorInner createOrUpdate(String vendorName, VendorInner parameters, Context context); + + /** + * Lists all the vendors in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for vendors API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all the vendors in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for vendors API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/DeviceInner.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/DeviceInner.java new file mode 100644 index 000000000000..00752f0c65d0 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/DeviceInner.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.hybridnetwork.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.management.SubResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybridnetwork.models.ProvisioningState; +import com.azure.resourcemanager.hybridnetwork.models.Status; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Device resource. */ +@JsonFlatten +@Fluent +public class DeviceInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DeviceInner.class); + + /* + * The system meta data relating to this resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * The current device status. + */ + @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) + private Status status; + + /* + * The provisioning state of the device resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The reference to the Azure stack edge device. Once set, it cannot be + * updated. + */ + @JsonProperty(value = "properties.azureStackEdge") + private SubResource azureStackEdge; + + /* + * The list of network functions deployed on the device. + */ + @JsonProperty(value = "properties.networkFunctions", access = JsonProperty.Access.WRITE_ONLY) + private List networkFunctions; + + /** + * Get the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the status property: The current device status. + * + * @return the status value. + */ + public Status status() { + return this.status; + } + + /** + * Get the provisioningState property: The provisioning state of the device resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the azureStackEdge property: The reference to the Azure stack edge device. Once set, it cannot be updated. + * + * @return the azureStackEdge value. + */ + public SubResource azureStackEdge() { + return this.azureStackEdge; + } + + /** + * Set the azureStackEdge property: The reference to the Azure stack edge device. Once set, it cannot be updated. + * + * @param azureStackEdge the azureStackEdge value to set. + * @return the DeviceInner object itself. + */ + public DeviceInner withAzureStackEdge(SubResource azureStackEdge) { + this.azureStackEdge = azureStackEdge; + return this; + } + + /** + * Get the networkFunctions property: The list of network functions deployed on the device. + * + * @return the networkFunctions value. + */ + public List networkFunctions() { + return this.networkFunctions; + } + + /** {@inheritDoc} */ + @Override + public DeviceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public DeviceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/DeviceRegistrationKeyInner.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/DeviceRegistrationKeyInner.java new file mode 100644 index 000000000000..c057d3f4d5cd --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/DeviceRegistrationKeyInner.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.fluent.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; + +/** The device registration key. */ +@Immutable +public final class DeviceRegistrationKeyInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DeviceRegistrationKeyInner.class); + + /* + * The registration key for the device. + */ + @JsonProperty(value = "registrationKey", access = JsonProperty.Access.WRITE_ONLY) + private String registrationKey; + + /** + * Get the registrationKey property: The registration key for the device. + * + * @return the registrationKey value. + */ + public String registrationKey() { + return this.registrationKey; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/NetworkFunctionInner.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/NetworkFunctionInner.java new file mode 100644 index 000000000000..75f6d233a1c9 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/NetworkFunctionInner.java @@ -0,0 +1,329 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.management.SubResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionUserConfiguration; +import com.azure.resourcemanager.hybridnetwork.models.ProvisioningState; +import com.azure.resourcemanager.hybridnetwork.models.SkuType; +import com.azure.resourcemanager.hybridnetwork.models.VendorProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Network function resource response. */ +@JsonFlatten +@Fluent +public class NetworkFunctionInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkFunctionInner.class); + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /* + * The system meta data relating to this resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * The provisioning state of the network function resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The reference to the device resource. Once set, it cannot be updated. + */ + @JsonProperty(value = "properties.device") + private SubResource device; + + /* + * The sku name for the network function. Once set, it cannot be updated. + */ + @JsonProperty(value = "properties.skuName") + private String skuName; + + /* + * The sku type for the network function. + */ + @JsonProperty(value = "properties.skuType", access = JsonProperty.Access.WRITE_ONLY) + private SkuType skuType; + + /* + * The vendor name for the network function. Once set, it cannot be + * updated. + */ + @JsonProperty(value = "properties.vendorName") + private String vendorName; + + /* + * The service key for the network function resource. + */ + @JsonProperty(value = "properties.serviceKey", access = JsonProperty.Access.WRITE_ONLY) + private String serviceKey; + + /* + * The vendor provisioning state for the network function resource. + */ + @JsonProperty(value = "properties.vendorProvisioningState", access = JsonProperty.Access.WRITE_ONLY) + private VendorProvisioningState vendorProvisioningState; + + /* + * The resource URI of the managed application. + */ + @JsonProperty(value = "properties.managedApplication", access = JsonProperty.Access.WRITE_ONLY) + private SubResource managedApplication; + + /* + * The parameters for the managed application. + */ + @JsonProperty(value = "properties.managedApplicationParameters") + private Object managedApplicationParameters; + + /* + * The network function container configurations from the user. + */ + @JsonProperty(value = "properties.networkFunctionContainerConfigurations") + private Object networkFunctionContainerConfigurations; + + /* + * The network function configurations from the user. + */ + @JsonProperty(value = "properties.networkFunctionUserConfigurations") + private List networkFunctionUserConfigurations; + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set. + * @return the NetworkFunctionInner object itself. + */ + public NetworkFunctionInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the provisioningState property: The provisioning state of the network function resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the device property: The reference to the device resource. Once set, it cannot be updated. + * + * @return the device value. + */ + public SubResource device() { + return this.device; + } + + /** + * Set the device property: The reference to the device resource. Once set, it cannot be updated. + * + * @param device the device value to set. + * @return the NetworkFunctionInner object itself. + */ + public NetworkFunctionInner withDevice(SubResource device) { + this.device = device; + return this; + } + + /** + * Get the skuName property: The sku name for the network function. Once set, it cannot be updated. + * + * @return the skuName value. + */ + public String skuName() { + return this.skuName; + } + + /** + * Set the skuName property: The sku name for the network function. Once set, it cannot be updated. + * + * @param skuName the skuName value to set. + * @return the NetworkFunctionInner object itself. + */ + public NetworkFunctionInner withSkuName(String skuName) { + this.skuName = skuName; + return this; + } + + /** + * Get the skuType property: The sku type for the network function. + * + * @return the skuType value. + */ + public SkuType skuType() { + return this.skuType; + } + + /** + * Get the vendorName property: The vendor name for the network function. Once set, it cannot be updated. + * + * @return the vendorName value. + */ + public String vendorName() { + return this.vendorName; + } + + /** + * Set the vendorName property: The vendor name for the network function. Once set, it cannot be updated. + * + * @param vendorName the vendorName value to set. + * @return the NetworkFunctionInner object itself. + */ + public NetworkFunctionInner withVendorName(String vendorName) { + this.vendorName = vendorName; + return this; + } + + /** + * Get the serviceKey property: The service key for the network function resource. + * + * @return the serviceKey value. + */ + public String serviceKey() { + return this.serviceKey; + } + + /** + * Get the vendorProvisioningState property: The vendor provisioning state for the network function resource. + * + * @return the vendorProvisioningState value. + */ + public VendorProvisioningState vendorProvisioningState() { + return this.vendorProvisioningState; + } + + /** + * Get the managedApplication property: The resource URI of the managed application. + * + * @return the managedApplication value. + */ + public SubResource managedApplication() { + return this.managedApplication; + } + + /** + * Get the managedApplicationParameters property: The parameters for the managed application. + * + * @return the managedApplicationParameters value. + */ + public Object managedApplicationParameters() { + return this.managedApplicationParameters; + } + + /** + * Set the managedApplicationParameters property: The parameters for the managed application. + * + * @param managedApplicationParameters the managedApplicationParameters value to set. + * @return the NetworkFunctionInner object itself. + */ + public NetworkFunctionInner withManagedApplicationParameters(Object managedApplicationParameters) { + this.managedApplicationParameters = managedApplicationParameters; + return this; + } + + /** + * Get the networkFunctionContainerConfigurations property: The network function container configurations from the + * user. + * + * @return the networkFunctionContainerConfigurations value. + */ + public Object networkFunctionContainerConfigurations() { + return this.networkFunctionContainerConfigurations; + } + + /** + * Set the networkFunctionContainerConfigurations property: The network function container configurations from the + * user. + * + * @param networkFunctionContainerConfigurations the networkFunctionContainerConfigurations value to set. + * @return the NetworkFunctionInner object itself. + */ + public NetworkFunctionInner withNetworkFunctionContainerConfigurations( + Object networkFunctionContainerConfigurations) { + this.networkFunctionContainerConfigurations = networkFunctionContainerConfigurations; + return this; + } + + /** + * Get the networkFunctionUserConfigurations property: The network function configurations from the user. + * + * @return the networkFunctionUserConfigurations value. + */ + public List networkFunctionUserConfigurations() { + return this.networkFunctionUserConfigurations; + } + + /** + * Set the networkFunctionUserConfigurations property: The network function configurations from the user. + * + * @param networkFunctionUserConfigurations the networkFunctionUserConfigurations value to set. + * @return the NetworkFunctionInner object itself. + */ + public NetworkFunctionInner withNetworkFunctionUserConfigurations( + List networkFunctionUserConfigurations) { + this.networkFunctionUserConfigurations = networkFunctionUserConfigurations; + return this; + } + + /** {@inheritDoc} */ + @Override + public NetworkFunctionInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public NetworkFunctionInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (networkFunctionUserConfigurations() != null) { + networkFunctionUserConfigurations().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/NetworkFunctionSkuRoleDetailsInner.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/NetworkFunctionSkuRoleDetailsInner.java new file mode 100644 index 000000000000..d01c4fa53faa --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/NetworkFunctionSkuRoleDetailsInner.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybridnetwork.models.NetworkInterface; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The network function user configuration. */ +@Fluent +public final class NetworkFunctionSkuRoleDetailsInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkFunctionSkuRoleDetailsInner.class); + + /* + * The name of the network function role. + */ + @JsonProperty(value = "roleName") + private String roleName; + + /* + * The user data template for customers. + */ + @JsonProperty(value = "userDataTemplate") + private Object userDataTemplate; + + /* + * The user parameters for customers. + */ + @JsonProperty(value = "userDataParameters") + private Object userDataParameters; + + /* + * The network interface configuration. + */ + @JsonProperty(value = "networkInterfaces") + private List networkInterfaces; + + /** + * Get the roleName property: The name of the network function role. + * + * @return the roleName value. + */ + public String roleName() { + return this.roleName; + } + + /** + * Set the roleName property: The name of the network function role. + * + * @param roleName the roleName value to set. + * @return the NetworkFunctionSkuRoleDetailsInner object itself. + */ + public NetworkFunctionSkuRoleDetailsInner withRoleName(String roleName) { + this.roleName = roleName; + return this; + } + + /** + * Get the userDataTemplate property: The user data template for customers. + * + * @return the userDataTemplate value. + */ + public Object userDataTemplate() { + return this.userDataTemplate; + } + + /** + * Set the userDataTemplate property: The user data template for customers. + * + * @param userDataTemplate the userDataTemplate value to set. + * @return the NetworkFunctionSkuRoleDetailsInner object itself. + */ + public NetworkFunctionSkuRoleDetailsInner withUserDataTemplate(Object userDataTemplate) { + this.userDataTemplate = userDataTemplate; + return this; + } + + /** + * Get the userDataParameters property: The user parameters for customers. + * + * @return the userDataParameters value. + */ + public Object userDataParameters() { + return this.userDataParameters; + } + + /** + * Set the userDataParameters property: The user parameters for customers. + * + * @param userDataParameters the userDataParameters value to set. + * @return the NetworkFunctionSkuRoleDetailsInner object itself. + */ + public NetworkFunctionSkuRoleDetailsInner withUserDataParameters(Object userDataParameters) { + this.userDataParameters = userDataParameters; + return this; + } + + /** + * Get the networkInterfaces property: The network interface configuration. + * + * @return the networkInterfaces value. + */ + public List networkInterfaces() { + return this.networkInterfaces; + } + + /** + * Set the networkInterfaces property: The network interface configuration. + * + * @param networkInterfaces the networkInterfaces value to set. + * @return the NetworkFunctionSkuRoleDetailsInner object itself. + */ + public NetworkFunctionSkuRoleDetailsInner withNetworkInterfaces(List networkInterfaces) { + this.networkInterfaces = networkInterfaces; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (networkInterfaces() != null) { + networkInterfaces().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/NetworkFunctionVendorInner.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/NetworkFunctionVendorInner.java new file mode 100644 index 000000000000..456dae307c6b --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/NetworkFunctionVendorInner.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.hybridnetwork.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The network function vendor. */ +@JsonFlatten +@Fluent +public class NetworkFunctionVendorInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkFunctionVendorInner.class); + + /* + * The network function vendor name. + */ + @JsonProperty(value = "properties.vendorName") + private String vendorName; + + /* + * The network function sku list. + */ + @JsonProperty(value = "properties.skuList") + private List skuList; + + /** + * Get the vendorName property: The network function vendor name. + * + * @return the vendorName value. + */ + public String vendorName() { + return this.vendorName; + } + + /** + * Set the vendorName property: The network function vendor name. + * + * @param vendorName the vendorName value to set. + * @return the NetworkFunctionVendorInner object itself. + */ + public NetworkFunctionVendorInner withVendorName(String vendorName) { + this.vendorName = vendorName; + return this; + } + + /** + * Get the skuList property: The network function sku list. + * + * @return the skuList value. + */ + public List skuList() { + return this.skuList; + } + + /** + * Set the skuList property: The network function sku list. + * + * @param skuList the skuList value to set. + * @return the NetworkFunctionVendorInner object itself. + */ + public NetworkFunctionVendorInner withSkuList(List skuList) { + this.skuList = skuList; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (skuList() != null) { + skuList().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/OperationInner.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/OperationInner.java new file mode 100644 index 000000000000..6b9d203790c9 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/OperationInner.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.hybridnetwork.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybridnetwork.models.OperationDisplay; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Object that describes a single Microsoft.HybridNetwork operation. */ +@Immutable +public final class OperationInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationInner.class); + + /* + * Operation name: {provider}/{resource}/{operation}. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The object that represents the operation. + */ + @JsonProperty(value = "display", access = JsonProperty.Access.WRITE_ONLY) + private OperationDisplay display; + + /** + * Get the name property: Operation name: {provider}/{resource}/{operation}. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the display property: The object that represents the operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/PreviewSubscriptionInner.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/PreviewSubscriptionInner.java new file mode 100644 index 000000000000..197ea8e05f94 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/PreviewSubscriptionInner.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.hybridnetwork.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybridnetwork.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Customer subscription which can use a sku. */ +@JsonFlatten +@Immutable +public class PreviewSubscriptionInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PreviewSubscriptionInner.class); + + /* + * The system meta data relating to this resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * The provisioning state of the PreviewSubscription resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the provisioningState property: The provisioning state of the PreviewSubscription resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/RoleInstanceInner.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/RoleInstanceInner.java new file mode 100644 index 000000000000..896575ba6b69 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/RoleInstanceInner.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybridnetwork.models.OperationalState; +import com.azure.resourcemanager.hybridnetwork.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The role instance sub resource. */ +@JsonFlatten +@Fluent +public class RoleInstanceInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RoleInstanceInner.class); + + /* + * The role instance name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The ARM ID of the resource. + */ + @JsonProperty(value = "id") + private String id; + + /* + * The type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /* + * The system meta data relating to this resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * The provisioning state of the RoleInstance resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The operational state of the role instance. + */ + @JsonProperty(value = "properties.operationalState") + private OperationalState operationalState; + + /** + * Get the name property: The role instance name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The role instance name. + * + * @param name the name value to set. + * @return the RoleInstanceInner object itself. + */ + public RoleInstanceInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the id property: The ARM ID of the resource. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The ARM ID of the resource. + * + * @param id the id value to set. + * @return the RoleInstanceInner object itself. + */ + public RoleInstanceInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The type of the resource. + * + * @param type the type value to set. + * @return the RoleInstanceInner object itself. + */ + public RoleInstanceInner withType(String type) { + this.type = type; + return this; + } + + /** + * Get the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the provisioningState property: The provisioning state of the RoleInstance resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the operationalState property: The operational state of the role instance. + * + * @return the operationalState value. + */ + public OperationalState operationalState() { + return this.operationalState; + } + + /** + * Set the operationalState property: The operational state of the role instance. + * + * @param operationalState the operationalState value to set. + * @return the RoleInstanceInner object itself. + */ + public RoleInstanceInner withOperationalState(OperationalState operationalState) { + this.operationalState = operationalState; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/SkuOverviewInner.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/SkuOverviewInner.java new file mode 100644 index 000000000000..f26c81779ee0 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/SkuOverviewInner.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.hybridnetwork.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybridnetwork.models.SkuType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The network function sku overview. */ +@Fluent +public final class SkuOverviewInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SkuOverviewInner.class); + + /* + * The vendor sku name. + */ + @JsonProperty(value = "skuName") + private String skuName; + + /* + * The vendor sku type. + */ + @JsonProperty(value = "skuType") + private SkuType skuType; + + /** + * Get the skuName property: The vendor sku name. + * + * @return the skuName value. + */ + public String skuName() { + return this.skuName; + } + + /** + * Set the skuName property: The vendor sku name. + * + * @param skuName the skuName value to set. + * @return the SkuOverviewInner object itself. + */ + public SkuOverviewInner withSkuName(String skuName) { + this.skuName = skuName; + return this; + } + + /** + * Get the skuType property: The vendor sku type. + * + * @return the skuType value. + */ + public SkuType skuType() { + return this.skuType; + } + + /** + * Set the skuType property: The vendor sku type. + * + * @param skuType the skuType value to set. + * @return the SkuOverviewInner object itself. + */ + public SkuOverviewInner withSkuType(SkuType skuType) { + this.skuType = skuType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/VendorInner.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/VendorInner.java new file mode 100644 index 000000000000..81062291108c --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/VendorInner.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.hybridnetwork.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SubResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybridnetwork.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Vendor resource. */ +@JsonFlatten +@Immutable +public class VendorInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VendorInner.class); + + /* + * The system meta data relating to this resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * The provisioning state of the vendor resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * A list of IDs of the vendor skus offered by the vendor. + */ + @JsonProperty(value = "properties.skus", access = JsonProperty.Access.WRITE_ONLY) + private List skus; + + /** + * Get the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the provisioningState property: The provisioning state of the vendor resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the skus property: A list of IDs of the vendor skus offered by the vendor. + * + * @return the skus value. + */ + public List skus() { + return this.skus; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/VendorNetworkFunctionInner.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/VendorNetworkFunctionInner.java new file mode 100644 index 000000000000..c5573a2e473f --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/VendorNetworkFunctionInner.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.hybridnetwork.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionVendorConfiguration; +import com.azure.resourcemanager.hybridnetwork.models.ProvisioningState; +import com.azure.resourcemanager.hybridnetwork.models.SkuType; +import com.azure.resourcemanager.hybridnetwork.models.VendorProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Vendor network function sub resource. */ +@JsonFlatten +@Fluent +public class VendorNetworkFunctionInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VendorNetworkFunctionInner.class); + + /* + * The system meta data relating to this resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * The provisioning state of the vendor network function sub resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The vendor controlled provisioning state of the vendor network function. + */ + @JsonProperty(value = "properties.vendorProvisioningState") + private VendorProvisioningState vendorProvisioningState; + + /* + * The name of the sku. Once set, it cannot be updated. + */ + @JsonProperty(value = "properties.skuName", access = JsonProperty.Access.WRITE_ONLY) + private String skuName; + + /* + * The sku type. + */ + @JsonProperty(value = "properties.skuType", access = JsonProperty.Access.WRITE_ONLY) + private SkuType skuType; + + /* + * An array of network function vendor configurations. + */ + @JsonProperty(value = "properties.networkFunctionVendorConfigurations") + private List networkFunctionVendorConfigurations; + + /** + * Get the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the provisioningState property: The provisioning state of the vendor network function sub resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the vendorProvisioningState property: The vendor controlled provisioning state of the vendor network + * function. + * + * @return the vendorProvisioningState value. + */ + public VendorProvisioningState vendorProvisioningState() { + return this.vendorProvisioningState; + } + + /** + * Set the vendorProvisioningState property: The vendor controlled provisioning state of the vendor network + * function. + * + * @param vendorProvisioningState the vendorProvisioningState value to set. + * @return the VendorNetworkFunctionInner object itself. + */ + public VendorNetworkFunctionInner withVendorProvisioningState(VendorProvisioningState vendorProvisioningState) { + this.vendorProvisioningState = vendorProvisioningState; + return this; + } + + /** + * Get the skuName property: The name of the sku. Once set, it cannot be updated. + * + * @return the skuName value. + */ + public String skuName() { + return this.skuName; + } + + /** + * Get the skuType property: The sku type. + * + * @return the skuType value. + */ + public SkuType skuType() { + return this.skuType; + } + + /** + * Get the networkFunctionVendorConfigurations property: An array of network function vendor configurations. + * + * @return the networkFunctionVendorConfigurations value. + */ + public List networkFunctionVendorConfigurations() { + return this.networkFunctionVendorConfigurations; + } + + /** + * Set the networkFunctionVendorConfigurations property: An array of network function vendor configurations. + * + * @param networkFunctionVendorConfigurations the networkFunctionVendorConfigurations value to set. + * @return the VendorNetworkFunctionInner object itself. + */ + public VendorNetworkFunctionInner withNetworkFunctionVendorConfigurations( + List networkFunctionVendorConfigurations) { + this.networkFunctionVendorConfigurations = networkFunctionVendorConfigurations; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (networkFunctionVendorConfigurations() != null) { + networkFunctionVendorConfigurations().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/VendorSkuInner.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/VendorSkuInner.java new file mode 100644 index 000000000000..241325317db6 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/VendorSkuInner.java @@ -0,0 +1,250 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionTemplate; +import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionType; +import com.azure.resourcemanager.hybridnetwork.models.ProvisioningState; +import com.azure.resourcemanager.hybridnetwork.models.SkuDeploymentMode; +import com.azure.resourcemanager.hybridnetwork.models.SkuType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Sku sub resource. */ +@JsonFlatten +@Fluent +public class VendorSkuInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VendorSkuInner.class); + + /* + * The system meta data relating to this resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * The provisioning state of the vendor sku sub resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The sku type. + */ + @JsonProperty(value = "properties.skuType") + private SkuType skuType; + + /* + * The sku deployment mode. + */ + @JsonProperty(value = "properties.deploymentMode") + private SkuDeploymentMode deploymentMode; + + /* + * The network function type. + */ + @JsonProperty(value = "properties.networkFunctionType") + private NetworkFunctionType networkFunctionType; + + /* + * Indicates if the vendor sku is in preview mode. + */ + @JsonProperty(value = "properties.preview") + private Boolean preview; + + /* + * The parameters for the managed application to be supplied by the vendor. + */ + @JsonProperty(value = "properties.managedApplicationParameters") + private Object managedApplicationParameters; + + /* + * The template for the managed application deployment. + */ + @JsonProperty(value = "properties.managedApplicationTemplate") + private Object managedApplicationTemplate; + + /* + * The template definition of the network function. + */ + @JsonProperty(value = "properties.networkFunctionTemplate") + private NetworkFunctionTemplate networkFunctionTemplate; + + /** + * Get the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the provisioningState property: The provisioning state of the vendor sku sub resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the skuType property: The sku type. + * + * @return the skuType value. + */ + public SkuType skuType() { + return this.skuType; + } + + /** + * Set the skuType property: The sku type. + * + * @param skuType the skuType value to set. + * @return the VendorSkuInner object itself. + */ + public VendorSkuInner withSkuType(SkuType skuType) { + this.skuType = skuType; + return this; + } + + /** + * Get the deploymentMode property: The sku deployment mode. + * + * @return the deploymentMode value. + */ + public SkuDeploymentMode deploymentMode() { + return this.deploymentMode; + } + + /** + * Set the deploymentMode property: The sku deployment mode. + * + * @param deploymentMode the deploymentMode value to set. + * @return the VendorSkuInner object itself. + */ + public VendorSkuInner withDeploymentMode(SkuDeploymentMode deploymentMode) { + this.deploymentMode = deploymentMode; + return this; + } + + /** + * Get the networkFunctionType property: The network function type. + * + * @return the networkFunctionType value. + */ + public NetworkFunctionType networkFunctionType() { + return this.networkFunctionType; + } + + /** + * Set the networkFunctionType property: The network function type. + * + * @param networkFunctionType the networkFunctionType value to set. + * @return the VendorSkuInner object itself. + */ + public VendorSkuInner withNetworkFunctionType(NetworkFunctionType networkFunctionType) { + this.networkFunctionType = networkFunctionType; + return this; + } + + /** + * Get the preview property: Indicates if the vendor sku is in preview mode. + * + * @return the preview value. + */ + public Boolean preview() { + return this.preview; + } + + /** + * Set the preview property: Indicates if the vendor sku is in preview mode. + * + * @param preview the preview value to set. + * @return the VendorSkuInner object itself. + */ + public VendorSkuInner withPreview(Boolean preview) { + this.preview = preview; + return this; + } + + /** + * Get the managedApplicationParameters property: The parameters for the managed application to be supplied by the + * vendor. + * + * @return the managedApplicationParameters value. + */ + public Object managedApplicationParameters() { + return this.managedApplicationParameters; + } + + /** + * Set the managedApplicationParameters property: The parameters for the managed application to be supplied by the + * vendor. + * + * @param managedApplicationParameters the managedApplicationParameters value to set. + * @return the VendorSkuInner object itself. + */ + public VendorSkuInner withManagedApplicationParameters(Object managedApplicationParameters) { + this.managedApplicationParameters = managedApplicationParameters; + return this; + } + + /** + * Get the managedApplicationTemplate property: The template for the managed application deployment. + * + * @return the managedApplicationTemplate value. + */ + public Object managedApplicationTemplate() { + return this.managedApplicationTemplate; + } + + /** + * Set the managedApplicationTemplate property: The template for the managed application deployment. + * + * @param managedApplicationTemplate the managedApplicationTemplate value to set. + * @return the VendorSkuInner object itself. + */ + public VendorSkuInner withManagedApplicationTemplate(Object managedApplicationTemplate) { + this.managedApplicationTemplate = managedApplicationTemplate; + return this; + } + + /** + * Get the networkFunctionTemplate property: The template definition of the network function. + * + * @return the networkFunctionTemplate value. + */ + public NetworkFunctionTemplate networkFunctionTemplate() { + return this.networkFunctionTemplate; + } + + /** + * Set the networkFunctionTemplate property: The template definition of the network function. + * + * @param networkFunctionTemplate the networkFunctionTemplate value to set. + * @return the VendorSkuInner object itself. + */ + public VendorSkuInner withNetworkFunctionTemplate(NetworkFunctionTemplate networkFunctionTemplate) { + this.networkFunctionTemplate = networkFunctionTemplate; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (networkFunctionTemplate() != null) { + networkFunctionTemplate().validate(); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/package-info.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/package-info.java new file mode 100644 index 000000000000..fb9edc9455d3 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the inner data models for HybridNetworkManagementClient. The definitions in this swagger + * specification will be used to manage the Hybrid Network resources. + */ +package com.azure.resourcemanager.hybridnetwork.fluent.models; diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/package-info.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/package-info.java new file mode 100644 index 000000000000..3ed3babcb945 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the service clients for HybridNetworkManagementClient. The definitions in this swagger + * specification will be used to manage the Hybrid Network resources. + */ +package com.azure.resourcemanager.hybridnetwork.fluent; diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/DeviceImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/DeviceImpl.java new file mode 100644 index 000000000000..c6405efd41c7 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/DeviceImpl.java @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridnetwork.fluent.models.DeviceInner; +import com.azure.resourcemanager.hybridnetwork.models.Device; +import com.azure.resourcemanager.hybridnetwork.models.DeviceRegistrationKey; +import com.azure.resourcemanager.hybridnetwork.models.ProvisioningState; +import com.azure.resourcemanager.hybridnetwork.models.Status; +import com.azure.resourcemanager.hybridnetwork.models.TagsObject; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class DeviceImpl implements Device, Device.Definition, Device.Update { + private DeviceInner innerObject; + + private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Status status() { + return this.innerModel().status(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public SubResource azureStackEdge() { + return this.innerModel().azureStackEdge(); + } + + public List networkFunctions() { + List inner = this.innerModel().networkFunctions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public DeviceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String deviceName; + + private TagsObject updateParameters; + + public DeviceImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Device create() { + this.innerObject = + serviceManager + .serviceClient() + .getDevices() + .createOrUpdate(resourceGroupName, deviceName, this.innerModel(), Context.NONE); + return this; + } + + public Device create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDevices() + .createOrUpdate(resourceGroupName, deviceName, this.innerModel(), context); + return this; + } + + DeviceImpl(String name, com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerObject = new DeviceInner(); + this.serviceManager = serviceManager; + this.deviceName = name; + } + + public DeviceImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public Device apply() { + this.innerObject = + serviceManager + .serviceClient() + .getDevices() + .updateTagsWithResponse(resourceGroupName, deviceName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public Device apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDevices() + .updateTagsWithResponse(resourceGroupName, deviceName, updateParameters, context) + .getValue(); + return this; + } + + DeviceImpl(DeviceInner innerObject, com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.deviceName = Utils.getValueFromIdByName(innerObject.id(), "devices"); + } + + public Device refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getDevices() + .getByResourceGroupWithResponse(resourceGroupName, deviceName, Context.NONE) + .getValue(); + return this; + } + + public Device refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDevices() + .getByResourceGroupWithResponse(resourceGroupName, deviceName, context) + .getValue(); + return this; + } + + public DeviceRegistrationKey listRegistrationKey() { + return serviceManager.devices().listRegistrationKey(resourceGroupName, deviceName); + } + + public Response listRegistrationKeyWithResponse(Context context) { + return serviceManager.devices().listRegistrationKeyWithResponse(resourceGroupName, deviceName, context); + } + + public DeviceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public DeviceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public DeviceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public DeviceImpl withAzureStackEdge(SubResource azureStackEdge) { + this.innerModel().withAzureStackEdge(azureStackEdge); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/DeviceRegistrationKeyImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/DeviceRegistrationKeyImpl.java new file mode 100644 index 000000000000..38444eae51e5 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/DeviceRegistrationKeyImpl.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.hybridnetwork.implementation; + +import com.azure.resourcemanager.hybridnetwork.fluent.models.DeviceRegistrationKeyInner; +import com.azure.resourcemanager.hybridnetwork.models.DeviceRegistrationKey; + +public final class DeviceRegistrationKeyImpl implements DeviceRegistrationKey { + private DeviceRegistrationKeyInner innerObject; + + private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager; + + DeviceRegistrationKeyImpl( + DeviceRegistrationKeyInner innerObject, + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String registrationKey() { + return this.innerModel().registrationKey(); + } + + public DeviceRegistrationKeyInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/DevicesClientImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/DevicesClientImpl.java new file mode 100644 index 000000000000..f6e3c19f1d77 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/DevicesClientImpl.java @@ -0,0 +1,1594 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.hybridnetwork.fluent.DevicesClient; +import com.azure.resourcemanager.hybridnetwork.fluent.models.DeviceInner; +import com.azure.resourcemanager.hybridnetwork.fluent.models.DeviceRegistrationKeyInner; +import com.azure.resourcemanager.hybridnetwork.models.DeviceListResult; +import com.azure.resourcemanager.hybridnetwork.models.TagsObject; +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 DevicesClient. */ +public final class DevicesClientImpl implements DevicesClient { + private final ClientLogger logger = new ClientLogger(DevicesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final DevicesService service; + + /** The service client containing this operation class. */ + private final HybridNetworkManagementClientImpl client; + + /** + * Initializes an instance of DevicesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DevicesClientImpl(HybridNetworkManagementClientImpl client) { + this.service = RestProxy.create(DevicesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HybridNetworkManagementClientDevices to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HybridNetworkManagem") + private interface DevicesService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork" + + "/devices/{deviceName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("deviceName") String deviceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork" + + "/devices/{deviceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("deviceName") String deviceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork" + + "/devices/{deviceName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("deviceName") String deviceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") DeviceInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork" + + "/devices/{deviceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("deviceName") String deviceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/devices") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork" + + "/devices") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork" + + "/devices/{deviceName}/listRegistrationKey") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listRegistrationKey( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("deviceName") String deviceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The name of the device resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String deviceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + deviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The name of the device resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String deviceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + deviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The name of the device resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String deviceName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, deviceName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The name of the device resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String deviceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, deviceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The name of the device resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete(String resourceGroupName, String deviceName) { + return beginDeleteAsync(resourceGroupName, deviceName).getSyncPoller(); + } + + /** + * Deletes the specified device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The name of the device resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String deviceName, Context context) { + return beginDeleteAsync(resourceGroupName, deviceName, context).getSyncPoller(); + } + + /** + * Deletes the specified device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The name of the device resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String deviceName) { + return beginDeleteAsync(resourceGroupName, deviceName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The name of the device resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String deviceName, Context context) { + return beginDeleteAsync(resourceGroupName, deviceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The name of the device resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String deviceName) { + deleteAsync(resourceGroupName, deviceName).block(); + } + + /** + * Deletes the specified device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The name of the device resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String deviceName, Context context) { + deleteAsync(resourceGroupName, deviceName, context).block(); + } + + /** + * Gets information about the specified device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The name of the device resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String deviceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required 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 + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + deviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets information about the specified device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The name of the device resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String deviceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required 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 + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + deviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets information about the specified device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The name of the device resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String deviceName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, deviceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets information about the specified device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The name of the device resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeviceInner getByResourceGroup(String resourceGroupName, String deviceName) { + return getByResourceGroupAsync(resourceGroupName, deviceName).block(); + } + + /** + * Gets information about the specified device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The name of the device resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String deviceName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, deviceName, context).block(); + } + + /** + * Creates or updates a device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName Resource name for the device resource. + * @param parameters Parameters supplied to the create or update device operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return device resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String deviceName, DeviceInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + deviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName Resource name for the device resource. + * @param parameters Parameters supplied to the create or update device 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 device resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String deviceName, DeviceInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + deviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates a device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName Resource name for the device resource. + * @param parameters Parameters supplied to the create or update device operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return device resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DeviceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String deviceName, DeviceInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, deviceName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), DeviceInner.class, DeviceInner.class, Context.NONE); + } + + /** + * Creates or updates a device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName Resource name for the device resource. + * @param parameters Parameters supplied to the create or update device 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 device resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DeviceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String deviceName, DeviceInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, deviceName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), DeviceInner.class, DeviceInner.class, context); + } + + /** + * Creates or updates a device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName Resource name for the device resource. + * @param parameters Parameters supplied to the create or update device operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return device resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DeviceInner> beginCreateOrUpdate( + String resourceGroupName, String deviceName, DeviceInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, deviceName, parameters).getSyncPoller(); + } + + /** + * Creates or updates a device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName Resource name for the device resource. + * @param parameters Parameters supplied to the create or update device 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 device resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DeviceInner> beginCreateOrUpdate( + String resourceGroupName, String deviceName, DeviceInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, deviceName, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates a device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName Resource name for the device resource. + * @param parameters Parameters supplied to the create or update device operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return device resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String deviceName, DeviceInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, deviceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName Resource name for the device resource. + * @param parameters Parameters supplied to the create or update device 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 device resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String deviceName, DeviceInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, deviceName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName Resource name for the device resource. + * @param parameters Parameters supplied to the create or update device operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return device resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeviceInner createOrUpdate(String resourceGroupName, String deviceName, DeviceInner parameters) { + return createOrUpdateAsync(resourceGroupName, deviceName, parameters).block(); + } + + /** + * Creates or updates a device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName Resource name for the device resource. + * @param parameters Parameters supplied to the create or update device 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 device resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeviceInner createOrUpdate( + String resourceGroupName, String deviceName, DeviceInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, deviceName, parameters, context).block(); + } + + /** + * Updates device tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The name of the device resource. + * @param parameters Parameters supplied to the update device tags operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return device resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String deviceName, TagsObject parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + deviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates device tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The name of the device resource. + * @param parameters Parameters supplied to the update device tags 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 device resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String deviceName, TagsObject parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + deviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates device tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The name of the device resource. + * @param parameters Parameters supplied to the update device tags operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return device resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync(String resourceGroupName, String deviceName, TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, deviceName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates device tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The name of the device resource. + * @param parameters Parameters supplied to the update device tags operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return device resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeviceInner updateTags(String resourceGroupName, String deviceName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, deviceName, parameters).block(); + } + + /** + * Updates device tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The name of the device resource. + * @param parameters Parameters supplied to the update device tags 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 device resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse( + String resourceGroupName, String deviceName, TagsObject parameters, Context context) { + return updateTagsWithResponseAsync(resourceGroupName, deviceName, parameters, context).block(); + } + + /** + * Lists all the devices in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for devices API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the devices in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for devices API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the devices in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for devices API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the devices in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for devices API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the devices in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for devices API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all the devices in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for devices API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Lists all the device resource in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for devices API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the device resource in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for devices API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the device resource in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for devices API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the device resource in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for devices API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the device resource in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for devices API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all the device resource in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for devices API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * List the registration key for the device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The name of the device resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the device registration key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listRegistrationKeyWithResponseAsync( + String resourceGroupName, String deviceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required 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 + .listRegistrationKey( + this.client.getEndpoint(), + resourceGroupName, + deviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List the registration key for the device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The name of the device resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the device registration key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listRegistrationKeyWithResponseAsync( + String resourceGroupName, String deviceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required 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 + .listRegistrationKey( + this.client.getEndpoint(), + resourceGroupName, + deviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * List the registration key for the device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The name of the device resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the device registration key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listRegistrationKeyAsync(String resourceGroupName, String deviceName) { + return listRegistrationKeyWithResponseAsync(resourceGroupName, deviceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * List the registration key for the device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The name of the device resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the device registration key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeviceRegistrationKeyInner listRegistrationKey(String resourceGroupName, String deviceName) { + return listRegistrationKeyAsync(resourceGroupName, deviceName).block(); + } + + /** + * List the registration key for the device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The name of the device resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the device registration key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listRegistrationKeyWithResponse( + String resourceGroupName, String deviceName, Context context) { + return listRegistrationKeyWithResponseAsync(resourceGroupName, deviceName, 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 response for devices API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The 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 response for devices API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The 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 response for devices API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The 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 response for devices API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/DevicesImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/DevicesImpl.java new file mode 100644 index 000000000000..53ada1f4ca13 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/DevicesImpl.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.hybridnetwork.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.hybridnetwork.fluent.DevicesClient; +import com.azure.resourcemanager.hybridnetwork.fluent.models.DeviceInner; +import com.azure.resourcemanager.hybridnetwork.fluent.models.DeviceRegistrationKeyInner; +import com.azure.resourcemanager.hybridnetwork.models.Device; +import com.azure.resourcemanager.hybridnetwork.models.DeviceRegistrationKey; +import com.azure.resourcemanager.hybridnetwork.models.Devices; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class DevicesImpl implements Devices { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DevicesImpl.class); + + private final DevicesClient innerClient; + + private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager; + + public DevicesImpl( + DevicesClient innerClient, com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String deviceName) { + this.serviceClient().delete(resourceGroupName, deviceName); + } + + public void delete(String resourceGroupName, String deviceName, Context context) { + this.serviceClient().delete(resourceGroupName, deviceName, context); + } + + public Device getByResourceGroup(String resourceGroupName, String deviceName) { + DeviceInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, deviceName); + if (inner != null) { + return new DeviceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String deviceName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, deviceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DeviceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new DeviceImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new DeviceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new DeviceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new DeviceImpl(inner1, this.manager())); + } + + public DeviceRegistrationKey listRegistrationKey(String resourceGroupName, String deviceName) { + DeviceRegistrationKeyInner inner = this.serviceClient().listRegistrationKey(resourceGroupName, deviceName); + if (inner != null) { + return new DeviceRegistrationKeyImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listRegistrationKeyWithResponse( + String resourceGroupName, String deviceName, Context context) { + Response inner = + this.serviceClient().listRegistrationKeyWithResponse(resourceGroupName, deviceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DeviceRegistrationKeyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Device getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String deviceName = Utils.getValueFromIdByName(id, "devices"); + if (deviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'devices'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, deviceName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String deviceName = Utils.getValueFromIdByName(id, "devices"); + if (deviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'devices'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, deviceName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String deviceName = Utils.getValueFromIdByName(id, "devices"); + if (deviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'devices'.", id))); + } + this.delete(resourceGroupName, deviceName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String deviceName = Utils.getValueFromIdByName(id, "devices"); + if (deviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'devices'.", id))); + } + this.delete(resourceGroupName, deviceName, context); + } + + private DevicesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { + return this.serviceManager; + } + + public DeviceImpl define(String name) { + return new DeviceImpl(name, this.manager()); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/HybridNetworkManagementClientBuilder.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/HybridNetworkManagementClientBuilder.java new file mode 100644 index 000000000000..adda16cf7a2f --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/HybridNetworkManagementClientBuilder.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.hybridnetwork.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 HybridNetworkManagementClientImpl type. */ +@ServiceClientBuilder(serviceClients = {HybridNetworkManagementClientImpl.class}) +public final class HybridNetworkManagementClientBuilder { + /* + * The ID of the target subscription. + */ + private String subscriptionId; + + /** + * Sets The ID of the target subscription. + * + * @param subscriptionId the subscriptionId value. + * @return the HybridNetworkManagementClientBuilder. + */ + public HybridNetworkManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the HybridNetworkManagementClientBuilder. + */ + public HybridNetworkManagementClientBuilder 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 HybridNetworkManagementClientBuilder. + */ + public HybridNetworkManagementClientBuilder 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 HybridNetworkManagementClientBuilder. + */ + public HybridNetworkManagementClientBuilder 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 HybridNetworkManagementClientBuilder. + */ + public HybridNetworkManagementClientBuilder 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 HybridNetworkManagementClientBuilder. + */ + public HybridNetworkManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of HybridNetworkManagementClientImpl with the provided parameters. + * + * @return an instance of HybridNetworkManagementClientImpl. + */ + public HybridNetworkManagementClientImpl 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(); + } + HybridNetworkManagementClientImpl client = + new HybridNetworkManagementClientImpl( + pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + return client; + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/HybridNetworkManagementClientImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/HybridNetworkManagementClientImpl.java new file mode 100644 index 000000000000..68afd30656ae --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/HybridNetworkManagementClientImpl.java @@ -0,0 +1,419 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.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.hybridnetwork.fluent.DevicesClient; +import com.azure.resourcemanager.hybridnetwork.fluent.HybridNetworkManagementClient; +import com.azure.resourcemanager.hybridnetwork.fluent.NetworkFunctionVendorSkusClient; +import com.azure.resourcemanager.hybridnetwork.fluent.NetworkFunctionVendorsClient; +import com.azure.resourcemanager.hybridnetwork.fluent.NetworkFunctionsClient; +import com.azure.resourcemanager.hybridnetwork.fluent.OperationsClient; +import com.azure.resourcemanager.hybridnetwork.fluent.RoleInstancesClient; +import com.azure.resourcemanager.hybridnetwork.fluent.VendorNetworkFunctionsClient; +import com.azure.resourcemanager.hybridnetwork.fluent.VendorSkuPreviewsClient; +import com.azure.resourcemanager.hybridnetwork.fluent.VendorSkusClient; +import com.azure.resourcemanager.hybridnetwork.fluent.VendorsClient; +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 HybridNetworkManagementClientImpl type. */ +@ServiceClient(builder = HybridNetworkManagementClientBuilder.class) +public final class HybridNetworkManagementClientImpl implements HybridNetworkManagementClient { + private final ClientLogger logger = new ClientLogger(HybridNetworkManagementClientImpl.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 NetworkFunctionsClient object to access its operations. */ + private final NetworkFunctionsClient networkFunctions; + + /** + * Gets the NetworkFunctionsClient object to access its operations. + * + * @return the NetworkFunctionsClient object. + */ + public NetworkFunctionsClient getNetworkFunctions() { + return this.networkFunctions; + } + + /** The DevicesClient object to access its operations. */ + private final DevicesClient devices; + + /** + * Gets the DevicesClient object to access its operations. + * + * @return the DevicesClient object. + */ + public DevicesClient getDevices() { + return this.devices; + } + + /** 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 VendorsClient object to access its operations. */ + private final VendorsClient vendors; + + /** + * Gets the VendorsClient object to access its operations. + * + * @return the VendorsClient object. + */ + public VendorsClient getVendors() { + return this.vendors; + } + + /** The VendorSkusClient object to access its operations. */ + private final VendorSkusClient vendorSkus; + + /** + * Gets the VendorSkusClient object to access its operations. + * + * @return the VendorSkusClient object. + */ + public VendorSkusClient getVendorSkus() { + return this.vendorSkus; + } + + /** The VendorSkuPreviewsClient object to access its operations. */ + private final VendorSkuPreviewsClient vendorSkuPreviews; + + /** + * Gets the VendorSkuPreviewsClient object to access its operations. + * + * @return the VendorSkuPreviewsClient object. + */ + public VendorSkuPreviewsClient getVendorSkuPreviews() { + return this.vendorSkuPreviews; + } + + /** The NetworkFunctionVendorsClient object to access its operations. */ + private final NetworkFunctionVendorsClient networkFunctionVendors; + + /** + * Gets the NetworkFunctionVendorsClient object to access its operations. + * + * @return the NetworkFunctionVendorsClient object. + */ + public NetworkFunctionVendorsClient getNetworkFunctionVendors() { + return this.networkFunctionVendors; + } + + /** The NetworkFunctionVendorSkusClient object to access its operations. */ + private final NetworkFunctionVendorSkusClient networkFunctionVendorSkus; + + /** + * Gets the NetworkFunctionVendorSkusClient object to access its operations. + * + * @return the NetworkFunctionVendorSkusClient object. + */ + public NetworkFunctionVendorSkusClient getNetworkFunctionVendorSkus() { + return this.networkFunctionVendorSkus; + } + + /** The VendorNetworkFunctionsClient object to access its operations. */ + private final VendorNetworkFunctionsClient vendorNetworkFunctions; + + /** + * Gets the VendorNetworkFunctionsClient object to access its operations. + * + * @return the VendorNetworkFunctionsClient object. + */ + public VendorNetworkFunctionsClient getVendorNetworkFunctions() { + return this.vendorNetworkFunctions; + } + + /** The RoleInstancesClient object to access its operations. */ + private final RoleInstancesClient roleInstances; + + /** + * Gets the RoleInstancesClient object to access its operations. + * + * @return the RoleInstancesClient object. + */ + public RoleInstancesClient getRoleInstances() { + return this.roleInstances; + } + + /** + * Initializes an instance of HybridNetworkManagementClient 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. + */ + HybridNetworkManagementClientImpl( + 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 = "2021-05-01"; + this.networkFunctions = new NetworkFunctionsClientImpl(this); + this.devices = new DevicesClientImpl(this); + this.operations = new OperationsClientImpl(this); + this.vendors = new VendorsClientImpl(this); + this.vendorSkus = new VendorSkusClientImpl(this); + this.vendorSkuPreviews = new VendorSkuPreviewsClientImpl(this); + this.networkFunctionVendors = new NetworkFunctionVendorsClientImpl(this); + this.networkFunctionVendorSkus = new NetworkFunctionVendorSkusClientImpl(this); + this.vendorNetworkFunctions = new VendorNetworkFunctionsClientImpl(this); + this.roleInstances = new RoleInstancesClientImpl(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/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionImpl.java new file mode 100644 index 000000000000..bd2971d8753d --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionImpl.java @@ -0,0 +1,273 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionInner; +import com.azure.resourcemanager.hybridnetwork.models.NetworkFunction; +import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionUserConfiguration; +import com.azure.resourcemanager.hybridnetwork.models.ProvisioningState; +import com.azure.resourcemanager.hybridnetwork.models.SkuType; +import com.azure.resourcemanager.hybridnetwork.models.TagsObject; +import com.azure.resourcemanager.hybridnetwork.models.VendorProvisioningState; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class NetworkFunctionImpl implements NetworkFunction, NetworkFunction.Definition, NetworkFunction.Update { + private NetworkFunctionInner innerObject; + + private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String etag() { + return this.innerModel().etag(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public SubResource device() { + return this.innerModel().device(); + } + + public String skuName() { + return this.innerModel().skuName(); + } + + public SkuType skuType() { + return this.innerModel().skuType(); + } + + public String vendorName() { + return this.innerModel().vendorName(); + } + + public String serviceKey() { + return this.innerModel().serviceKey(); + } + + public VendorProvisioningState vendorProvisioningState() { + return this.innerModel().vendorProvisioningState(); + } + + public SubResource managedApplication() { + return this.innerModel().managedApplication(); + } + + public Object managedApplicationParameters() { + return this.innerModel().managedApplicationParameters(); + } + + public Object networkFunctionContainerConfigurations() { + return this.innerModel().networkFunctionContainerConfigurations(); + } + + public List networkFunctionUserConfigurations() { + List inner = this.innerModel().networkFunctionUserConfigurations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public NetworkFunctionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String networkFunctionName; + + private TagsObject updateParameters; + + public NetworkFunctionImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public NetworkFunction create() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkFunctions() + .createOrUpdate(resourceGroupName, networkFunctionName, this.innerModel(), Context.NONE); + return this; + } + + public NetworkFunction create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkFunctions() + .createOrUpdate(resourceGroupName, networkFunctionName, this.innerModel(), context); + return this; + } + + NetworkFunctionImpl(String name, com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerObject = new NetworkFunctionInner(); + this.serviceManager = serviceManager; + this.networkFunctionName = name; + } + + public NetworkFunctionImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public NetworkFunction apply() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkFunctions() + .updateTagsWithResponse(resourceGroupName, networkFunctionName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public NetworkFunction apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkFunctions() + .updateTagsWithResponse(resourceGroupName, networkFunctionName, updateParameters, context) + .getValue(); + return this; + } + + NetworkFunctionImpl( + NetworkFunctionInner innerObject, com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkFunctionName = Utils.getValueFromIdByName(innerObject.id(), "networkFunctions"); + } + + public NetworkFunction refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkFunctions() + .getByResourceGroupWithResponse(resourceGroupName, networkFunctionName, Context.NONE) + .getValue(); + return this; + } + + public NetworkFunction refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkFunctions() + .getByResourceGroupWithResponse(resourceGroupName, networkFunctionName, context) + .getValue(); + return this; + } + + public NetworkFunctionImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public NetworkFunctionImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public NetworkFunctionImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public NetworkFunctionImpl withEtag(String etag) { + this.innerModel().withEtag(etag); + return this; + } + + public NetworkFunctionImpl withDevice(SubResource device) { + this.innerModel().withDevice(device); + return this; + } + + public NetworkFunctionImpl withSkuName(String skuName) { + this.innerModel().withSkuName(skuName); + return this; + } + + public NetworkFunctionImpl withVendorName(String vendorName) { + this.innerModel().withVendorName(vendorName); + return this; + } + + public NetworkFunctionImpl withManagedApplicationParameters(Object managedApplicationParameters) { + this.innerModel().withManagedApplicationParameters(managedApplicationParameters); + return this; + } + + public NetworkFunctionImpl withNetworkFunctionContainerConfigurations( + Object networkFunctionContainerConfigurations) { + this.innerModel().withNetworkFunctionContainerConfigurations(networkFunctionContainerConfigurations); + return this; + } + + public NetworkFunctionImpl withNetworkFunctionUserConfigurations( + List networkFunctionUserConfigurations) { + this.innerModel().withNetworkFunctionUserConfigurations(networkFunctionUserConfigurations); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionSkuRoleDetailsImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionSkuRoleDetailsImpl.java new file mode 100644 index 000000000000..0beed413e4f2 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionSkuRoleDetailsImpl.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.hybridnetwork.implementation; + +import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionSkuRoleDetailsInner; +import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionSkuRoleDetails; +import com.azure.resourcemanager.hybridnetwork.models.NetworkInterface; +import java.util.Collections; +import java.util.List; + +public final class NetworkFunctionSkuRoleDetailsImpl implements NetworkFunctionSkuRoleDetails { + private NetworkFunctionSkuRoleDetailsInner innerObject; + + private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager; + + NetworkFunctionSkuRoleDetailsImpl( + NetworkFunctionSkuRoleDetailsInner innerObject, + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String roleName() { + return this.innerModel().roleName(); + } + + public Object userDataTemplate() { + return this.innerModel().userDataTemplate(); + } + + public Object userDataParameters() { + return this.innerModel().userDataParameters(); + } + + public List networkInterfaces() { + List inner = this.innerModel().networkInterfaces(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public NetworkFunctionSkuRoleDetailsInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionVendorImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionVendorImpl.java new file mode 100644 index 000000000000..8514029a8cf3 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionVendorImpl.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.hybridnetwork.implementation; + +import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionVendorInner; +import com.azure.resourcemanager.hybridnetwork.fluent.models.SkuOverviewInner; +import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionVendor; +import com.azure.resourcemanager.hybridnetwork.models.SkuOverview; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class NetworkFunctionVendorImpl implements NetworkFunctionVendor { + private NetworkFunctionVendorInner innerObject; + + private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager; + + NetworkFunctionVendorImpl( + NetworkFunctionVendorInner innerObject, + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String vendorName() { + return this.innerModel().vendorName(); + } + + public List skuList() { + List inner = this.innerModel().skuList(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new SkuOverviewImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public NetworkFunctionVendorInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionVendorSkusClientImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionVendorSkusClientImpl.java new file mode 100644 index 000000000000..3d2a625f9e73 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionVendorSkusClientImpl.java @@ -0,0 +1,595 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybridnetwork.fluent.NetworkFunctionVendorSkusClient; +import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionSkuRoleDetailsInner; +import com.azure.resourcemanager.hybridnetwork.fluent.models.SkuOverviewInner; +import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionSkuDetails; +import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionSkuListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in NetworkFunctionVendorSkusClient. */ +public final class NetworkFunctionVendorSkusClientImpl implements NetworkFunctionVendorSkusClient { + private final ClientLogger logger = new ClientLogger(NetworkFunctionVendorSkusClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final NetworkFunctionVendorSkusService service; + + /** The service client containing this operation class. */ + private final HybridNetworkManagementClientImpl client; + + /** + * Initializes an instance of NetworkFunctionVendorSkusClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NetworkFunctionVendorSkusClientImpl(HybridNetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + NetworkFunctionVendorSkusService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HybridNetworkManagementClientNetworkFunctionVendorSkus to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HybridNetworkManagem") + private interface NetworkFunctionVendorSkusService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/networkFunctionVendors/{vendorName}" + + "/vendorSkus") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByVendor( + @HostParam("$host") String endpoint, + @PathParam("vendorName") String vendorName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/networkFunctionVendors/{vendorName}" + + "/vendorSkus/{vendorSkuName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySku( + @HostParam("$host") String endpoint, + @PathParam("vendorName") String vendorName, + @PathParam("vendorSkuName") String vendorSkuName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByVendorNext( + @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> listBySkuNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all network function vendor sku details in a vendor. + * + * @param vendorName The name of the network function vendor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of available network function skus. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByVendorSinglePageAsync(String vendorName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vendorName == null) { + return Mono.error(new IllegalArgumentException("Parameter vendorName is required 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 + .listByVendor( + this.client.getEndpoint(), + vendorName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all network function vendor sku details in a vendor. + * + * @param vendorName The name of the network function vendor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of available network function skus. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByVendorSinglePageAsync(String vendorName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vendorName == null) { + return Mono.error(new IllegalArgumentException("Parameter vendorName is required 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 + .listByVendor( + this.client.getEndpoint(), + vendorName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all network function vendor sku details in a vendor. + * + * @param vendorName The name of the network function vendor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of available network function skus. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByVendorAsync(String vendorName) { + return new PagedFlux<>( + () -> listByVendorSinglePageAsync(vendorName), nextLink -> listByVendorNextSinglePageAsync(nextLink)); + } + + /** + * Lists all network function vendor sku details in a vendor. + * + * @param vendorName The name of the network function vendor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of available network function skus. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByVendorAsync(String vendorName, Context context) { + return new PagedFlux<>( + () -> listByVendorSinglePageAsync(vendorName, context), + nextLink -> listByVendorNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all network function vendor sku details in a vendor. + * + * @param vendorName The name of the network function vendor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of available network function skus. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByVendor(String vendorName) { + return new PagedIterable<>(listByVendorAsync(vendorName)); + } + + /** + * Lists all network function vendor sku details in a vendor. + * + * @param vendorName The name of the network function vendor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of available network function skus. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByVendor(String vendorName, Context context) { + return new PagedIterable<>(listByVendorAsync(vendorName, context)); + } + + /** + * Lists information about network function vendor sku details. + * + * @param vendorName The name of the network function vendor. + * @param vendorSkuName The name of the network function 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 network function sku details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySkuSinglePageAsync( + String vendorName, String vendorSkuName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vendorName == null) { + return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); + } + if (vendorSkuName == null) { + return Mono.error(new IllegalArgumentException("Parameter vendorSkuName is required 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 + .listBySku( + this.client.getEndpoint(), + vendorName, + vendorSkuName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists information about network function vendor sku details. + * + * @param vendorName The name of the network function vendor. + * @param vendorSkuName The name of the network function 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 network function sku details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySkuSinglePageAsync( + String vendorName, String vendorSkuName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vendorName == null) { + return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); + } + if (vendorSkuName == null) { + return Mono.error(new IllegalArgumentException("Parameter vendorSkuName is required 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 + .listBySku( + this.client.getEndpoint(), + vendorName, + vendorSkuName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists information about network function vendor sku details. + * + * @param vendorName The name of the network function vendor. + * @param vendorSkuName The name of the network function 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 network function sku details. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBySkuAsync(String vendorName, String vendorSkuName) { + return new PagedFlux<>( + () -> listBySkuSinglePageAsync(vendorName, vendorSkuName), + nextLink -> listBySkuNextSinglePageAsync(nextLink)); + } + + /** + * Lists information about network function vendor sku details. + * + * @param vendorName The name of the network function vendor. + * @param vendorSkuName The name of the network function 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 network function sku details. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBySkuAsync( + String vendorName, String vendorSkuName, Context context) { + return new PagedFlux<>( + () -> listBySkuSinglePageAsync(vendorName, vendorSkuName, context), + nextLink -> listBySkuNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists information about network function vendor sku details. + * + * @param vendorName The name of the network function vendor. + * @param vendorSkuName The name of the network function 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 network function sku details. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBySku(String vendorName, String vendorSkuName) { + return new PagedIterable<>(listBySkuAsync(vendorName, vendorSkuName)); + } + + /** + * Lists information about network function vendor sku details. + * + * @param vendorName The name of the network function vendor. + * @param vendorSkuName The name of the network function 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 network function sku details. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBySku( + String vendorName, String vendorSkuName, Context context) { + return new PagedIterable<>(listBySkuAsync(vendorName, vendorSkuName, 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 a list of available network function skus. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByVendorNextSinglePageAsync(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.listByVendorNext(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 a list of available network function skus. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByVendorNextSinglePageAsync(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 + .listByVendorNext(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 network function sku details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySkuNextSinglePageAsync(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.listBySkuNext(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 network function sku details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySkuNextSinglePageAsync( + 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 + .listBySkuNext(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/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionVendorSkusImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionVendorSkusImpl.java new file mode 100644 index 000000000000..547e6a7debd1 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionVendorSkusImpl.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybridnetwork.fluent.NetworkFunctionVendorSkusClient; +import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionSkuRoleDetailsInner; +import com.azure.resourcemanager.hybridnetwork.fluent.models.SkuOverviewInner; +import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionSkuRoleDetails; +import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionVendorSkus; +import com.azure.resourcemanager.hybridnetwork.models.SkuOverview; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class NetworkFunctionVendorSkusImpl implements NetworkFunctionVendorSkus { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkFunctionVendorSkusImpl.class); + + private final NetworkFunctionVendorSkusClient innerClient; + + private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager; + + public NetworkFunctionVendorSkusImpl( + NetworkFunctionVendorSkusClient innerClient, + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByVendor(String vendorName) { + PagedIterable inner = this.serviceClient().listByVendor(vendorName); + return Utils.mapPage(inner, inner1 -> new SkuOverviewImpl(inner1, this.manager())); + } + + public PagedIterable listByVendor(String vendorName, Context context) { + PagedIterable inner = this.serviceClient().listByVendor(vendorName, context); + return Utils.mapPage(inner, inner1 -> new SkuOverviewImpl(inner1, this.manager())); + } + + public PagedIterable listBySku(String vendorName, String vendorSkuName) { + PagedIterable inner = + this.serviceClient().listBySku(vendorName, vendorSkuName); + return Utils.mapPage(inner, inner1 -> new NetworkFunctionSkuRoleDetailsImpl(inner1, this.manager())); + } + + public PagedIterable listBySku( + String vendorName, String vendorSkuName, Context context) { + PagedIterable inner = + this.serviceClient().listBySku(vendorName, vendorSkuName, context); + return Utils.mapPage(inner, inner1 -> new NetworkFunctionSkuRoleDetailsImpl(inner1, this.manager())); + } + + private NetworkFunctionVendorSkusClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionVendorsClientImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionVendorsClientImpl.java new file mode 100644 index 000000000000..a9256239b222 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionVendorsClientImpl.java @@ -0,0 +1,295 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybridnetwork.fluent.NetworkFunctionVendorsClient; +import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionVendorInner; +import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionVendorListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in NetworkFunctionVendorsClient. */ +public final class NetworkFunctionVendorsClientImpl implements NetworkFunctionVendorsClient { + private final ClientLogger logger = new ClientLogger(NetworkFunctionVendorsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final NetworkFunctionVendorsService service; + + /** The service client containing this operation class. */ + private final HybridNetworkManagementClientImpl client; + + /** + * Initializes an instance of NetworkFunctionVendorsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NetworkFunctionVendorsClientImpl(HybridNetworkManagementClientImpl client) { + this.service = + RestProxy + .create(NetworkFunctionVendorsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HybridNetworkManagementClientNetworkFunctionVendors to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HybridNetworkManagem") + private interface NetworkFunctionVendorsService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/networkFunctionVendors") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all the available vendor and sku information. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the network function vendor list result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the available vendor and sku information. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the network function vendor list result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the available vendor and sku information. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the network function vendor list result. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the available vendor and sku information. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the network function vendor list result. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the available vendor and sku information. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the network function vendor list result. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all the available vendor and sku information. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the network function vendor list result. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(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 network function vendor list result. + */ + @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 network function vendor list result. + */ + @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/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionVendorsImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionVendorsImpl.java new file mode 100644 index 000000000000..a956f80ab03b --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionVendorsImpl.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.hybridnetwork.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybridnetwork.fluent.NetworkFunctionVendorsClient; +import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionVendorInner; +import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionVendor; +import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionVendors; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class NetworkFunctionVendorsImpl implements NetworkFunctionVendors { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkFunctionVendorsImpl.class); + + private final NetworkFunctionVendorsClient innerClient; + + private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager; + + public NetworkFunctionVendorsImpl( + NetworkFunctionVendorsClient innerClient, + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new NetworkFunctionVendorImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new NetworkFunctionVendorImpl(inner1, this.manager())); + } + + private NetworkFunctionVendorsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionsClientImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionsClientImpl.java new file mode 100644 index 000000000000..10a76f91f392 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionsClientImpl.java @@ -0,0 +1,1471 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.hybridnetwork.fluent.NetworkFunctionsClient; +import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionInner; +import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionListResult; +import com.azure.resourcemanager.hybridnetwork.models.TagsObject; +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 NetworkFunctionsClient. */ +public final class NetworkFunctionsClientImpl implements NetworkFunctionsClient { + private final ClientLogger logger = new ClientLogger(NetworkFunctionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final NetworkFunctionsService service; + + /** The service client containing this operation class. */ + private final HybridNetworkManagementClientImpl client; + + /** + * Initializes an instance of NetworkFunctionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NetworkFunctionsClientImpl(HybridNetworkManagementClientImpl client) { + this.service = + RestProxy.create(NetworkFunctionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HybridNetworkManagementClientNetworkFunctions to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HybridNetworkManagem") + private interface NetworkFunctionsService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork" + + "/networkFunctions/{networkFunctionName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkFunctionName") String networkFunctionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork" + + "/networkFunctions/{networkFunctionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkFunctionName") String networkFunctionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork" + + "/networkFunctions/{networkFunctionName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkFunctionName") String networkFunctionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") NetworkFunctionInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork" + + "/networkFunctions/{networkFunctionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkFunctionName") String networkFunctionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/networkFunctions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork" + + "/networkFunctions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified network function resource. This operation can take up to 1 hour to complete. This is + * expected service behavior. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName The name of the network function. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resourceGroupName, String networkFunctionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkFunctionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkFunctionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + networkFunctionName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified network function resource. This operation can take up to 1 hour to complete. This is + * expected service behavior. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName The name of the network function. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resourceGroupName, String networkFunctionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkFunctionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkFunctionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + networkFunctionName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified network function resource. This operation can take up to 1 hour to complete. This is + * expected service behavior. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName The name of the network function. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String networkFunctionName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, networkFunctionName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified network function resource. This operation can take up to 1 hour to complete. This is + * expected service behavior. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName The name of the network function. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String networkFunctionName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, networkFunctionName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified network function resource. This operation can take up to 1 hour to complete. This is + * expected service behavior. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName The name of the network function. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + public SyncPoller, Void> beginDelete(String resourceGroupName, String networkFunctionName) { + return beginDeleteAsync(resourceGroupName, networkFunctionName).getSyncPoller(); + } + + /** + * Deletes the specified network function resource. This operation can take up to 1 hour to complete. This is + * expected service behavior. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName The name of the network function. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String networkFunctionName, Context context) { + return beginDeleteAsync(resourceGroupName, networkFunctionName, context).getSyncPoller(); + } + + /** + * Deletes the specified network function resource. This operation can take up to 1 hour to complete. This is + * expected service behavior. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName The name of the network function. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resourceGroupName, String networkFunctionName) { + return beginDeleteAsync(resourceGroupName, networkFunctionName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified network function resource. This operation can take up to 1 hour to complete. This is + * expected service behavior. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName The name of the network function. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resourceGroupName, String networkFunctionName, Context context) { + return beginDeleteAsync(resourceGroupName, networkFunctionName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified network function resource. This operation can take up to 1 hour to complete. This is + * expected service behavior. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName The name of the network function. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String networkFunctionName) { + deleteAsync(resourceGroupName, networkFunctionName).block(); + } + + /** + * Deletes the specified network function resource. This operation can take up to 1 hour to complete. This is + * expected service behavior. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName The name of the network function. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String networkFunctionName, Context context) { + deleteAsync(resourceGroupName, networkFunctionName, context).block(); + } + + /** + * Gets information about the specified network function resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName The name of the network function resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified network function resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String networkFunctionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkFunctionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkFunctionName is required 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 + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + networkFunctionName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets information about the specified network function resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName The name of the network function resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified network function resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String networkFunctionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkFunctionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkFunctionName is required 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 + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + networkFunctionName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets information about the specified network function resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName The name of the network function resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified network function resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String networkFunctionName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, networkFunctionName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets information about the specified network function resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName The name of the network function resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified network function resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkFunctionInner getByResourceGroup(String resourceGroupName, String networkFunctionName) { + return getByResourceGroupAsync(resourceGroupName, networkFunctionName).block(); + } + + /** + * Gets information about the specified network function resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName The name of the network function resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified network function resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String networkFunctionName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, networkFunctionName, context).block(); + } + + /** + * Creates or updates a network function resource. This operation can take up to 6 hours to complete. This is + * expected service behavior. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName Resource name for the network function resource. + * @param parameters Parameters supplied in the body to the create or update network function operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network function resource response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String networkFunctionName, NetworkFunctionInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkFunctionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkFunctionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + networkFunctionName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a network function resource. This operation can take up to 6 hours to complete. This is + * expected service behavior. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName Resource name for the network function resource. + * @param parameters Parameters supplied in the body to the create or update network function 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 network function resource response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String networkFunctionName, NetworkFunctionInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkFunctionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkFunctionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + networkFunctionName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates a network function resource. This operation can take up to 6 hours to complete. This is + * expected service behavior. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName Resource name for the network function resource. + * @param parameters Parameters supplied in the body to the create or update network function operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network function resource response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, NetworkFunctionInner> beginCreateOrUpdateAsync( + String resourceGroupName, String networkFunctionName, NetworkFunctionInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, networkFunctionName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + NetworkFunctionInner.class, + NetworkFunctionInner.class, + Context.NONE); + } + + /** + * Creates or updates a network function resource. This operation can take up to 6 hours to complete. This is + * expected service behavior. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName Resource name for the network function resource. + * @param parameters Parameters supplied in the body to the create or update network function 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 network function resource response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, NetworkFunctionInner> beginCreateOrUpdateAsync( + String resourceGroupName, String networkFunctionName, NetworkFunctionInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, networkFunctionName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), NetworkFunctionInner.class, NetworkFunctionInner.class, context); + } + + /** + * Creates or updates a network function resource. This operation can take up to 6 hours to complete. This is + * expected service behavior. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName Resource name for the network function resource. + * @param parameters Parameters supplied in the body to the create or update network function operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network function resource response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, NetworkFunctionInner> beginCreateOrUpdate( + String resourceGroupName, String networkFunctionName, NetworkFunctionInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, networkFunctionName, parameters).getSyncPoller(); + } + + /** + * Creates or updates a network function resource. This operation can take up to 6 hours to complete. This is + * expected service behavior. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName Resource name for the network function resource. + * @param parameters Parameters supplied in the body to the create or update network function 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 network function resource response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, NetworkFunctionInner> beginCreateOrUpdate( + String resourceGroupName, String networkFunctionName, NetworkFunctionInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, networkFunctionName, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates a network function resource. This operation can take up to 6 hours to complete. This is + * expected service behavior. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName Resource name for the network function resource. + * @param parameters Parameters supplied in the body to the create or update network function operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network function resource response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String networkFunctionName, NetworkFunctionInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, networkFunctionName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a network function resource. This operation can take up to 6 hours to complete. This is + * expected service behavior. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName Resource name for the network function resource. + * @param parameters Parameters supplied in the body to the create or update network function 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 network function resource response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String networkFunctionName, NetworkFunctionInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, networkFunctionName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a network function resource. This operation can take up to 6 hours to complete. This is + * expected service behavior. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName Resource name for the network function resource. + * @param parameters Parameters supplied in the body to the create or update network function operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network function resource response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkFunctionInner createOrUpdate( + String resourceGroupName, String networkFunctionName, NetworkFunctionInner parameters) { + return createOrUpdateAsync(resourceGroupName, networkFunctionName, parameters).block(); + } + + /** + * Creates or updates a network function resource. This operation can take up to 6 hours to complete. This is + * expected service behavior. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName Resource name for the network function resource. + * @param parameters Parameters supplied in the body to the create or update network function 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 network function resource response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkFunctionInner createOrUpdate( + String resourceGroupName, String networkFunctionName, NetworkFunctionInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, networkFunctionName, parameters, context).block(); + } + + /** + * Updates the tags for the network function resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName Resource name for the network function resource. + * @param parameters Parameters supplied to the update network function tags operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network function resource response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String networkFunctionName, TagsObject parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkFunctionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkFunctionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + networkFunctionName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates the tags for the network function resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName Resource name for the network function resource. + * @param parameters Parameters supplied to the update network function tags 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 network function resource response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String networkFunctionName, TagsObject parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkFunctionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkFunctionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + networkFunctionName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates the tags for the network function resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName Resource name for the network function resource. + * @param parameters Parameters supplied to the update network function tags operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network function resource response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String networkFunctionName, TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, networkFunctionName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates the tags for the network function resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName Resource name for the network function resource. + * @param parameters Parameters supplied to the update network function tags operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network function resource response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkFunctionInner updateTags( + String resourceGroupName, String networkFunctionName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, networkFunctionName, parameters).block(); + } + + /** + * Updates the tags for the network function resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName Resource name for the network function resource. + * @param parameters Parameters supplied to the update network function tags 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 network function resource response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse( + String resourceGroupName, String networkFunctionName, TagsObject parameters, Context context) { + return updateTagsWithResponseAsync(resourceGroupName, networkFunctionName, parameters, context).block(); + } + + /** + * Lists all the network functions in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for network function API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the network functions in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for network function API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the network functions in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for network function API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the network functions in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for network function API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the network functions in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for network function API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all the network functions in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for network function API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Lists all the network function resources in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for network function API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the network function resources in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for network function API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the network function resources in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for network function API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the network function resources in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for network function API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the network function resources in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for network function API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all the network function resources in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for network function API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The 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 response for network function API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The 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 response for network function API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The 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 response for network function API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The 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 response for network function API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionsImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionsImpl.java new file mode 100644 index 000000000000..831603a49300 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionsImpl.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.hybridnetwork.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.hybridnetwork.fluent.NetworkFunctionsClient; +import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionInner; +import com.azure.resourcemanager.hybridnetwork.models.NetworkFunction; +import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctions; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class NetworkFunctionsImpl implements NetworkFunctions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkFunctionsImpl.class); + + private final NetworkFunctionsClient innerClient; + + private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager; + + public NetworkFunctionsImpl( + NetworkFunctionsClient innerClient, + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String networkFunctionName) { + this.serviceClient().delete(resourceGroupName, networkFunctionName); + } + + public void delete(String resourceGroupName, String networkFunctionName, Context context) { + this.serviceClient().delete(resourceGroupName, networkFunctionName, context); + } + + public NetworkFunction getByResourceGroup(String resourceGroupName, String networkFunctionName) { + NetworkFunctionInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, networkFunctionName); + if (inner != null) { + return new NetworkFunctionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String networkFunctionName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, networkFunctionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NetworkFunctionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new NetworkFunctionImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new NetworkFunctionImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new NetworkFunctionImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new NetworkFunctionImpl(inner1, this.manager())); + } + + public NetworkFunction getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkFunctionName = Utils.getValueFromIdByName(id, "networkFunctions"); + if (networkFunctionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkFunctions'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, networkFunctionName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkFunctionName = Utils.getValueFromIdByName(id, "networkFunctions"); + if (networkFunctionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkFunctions'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, networkFunctionName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkFunctionName = Utils.getValueFromIdByName(id, "networkFunctions"); + if (networkFunctionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkFunctions'.", id))); + } + this.delete(resourceGroupName, networkFunctionName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkFunctionName = Utils.getValueFromIdByName(id, "networkFunctions"); + if (networkFunctionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkFunctions'.", id))); + } + this.delete(resourceGroupName, networkFunctionName, context); + } + + private NetworkFunctionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { + return this.serviceManager; + } + + public NetworkFunctionImpl define(String name) { + return new NetworkFunctionImpl(name, this.manager()); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/OperationImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/OperationImpl.java new file mode 100644 index 000000000000..83d4e87804f0 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/OperationImpl.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.hybridnetwork.implementation; + +import com.azure.resourcemanager.hybridnetwork.fluent.models.OperationInner; +import com.azure.resourcemanager.hybridnetwork.models.Operation; +import com.azure.resourcemanager.hybridnetwork.models.OperationDisplay; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager; + + OperationImpl( + OperationInner innerObject, com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public OperationDisplay display() { + return this.innerModel().display(); + } + + public OperationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/OperationsClientImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/OperationsClientImpl.java new file mode 100644 index 000000000000..6a5c0547c457 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/OperationsClientImpl.java @@ -0,0 +1,269 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybridnetwork.fluent.OperationsClient; +import com.azure.resourcemanager.hybridnetwork.fluent.models.OperationInner; +import com.azure.resourcemanager.hybridnetwork.models.OperationList; +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 HybridNetworkManagementClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(HybridNetworkManagementClientImpl client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HybridNetworkManagementClientOperations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HybridNetworkManagem") + private interface OperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.HybridNetwork/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets a list of the operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of the operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of the operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of the operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets a list of the operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of the operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of the operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of the operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list of the operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of the operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets a list of the operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of the operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(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 a list of the operations. + */ + @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 a list of the operations. + */ + @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/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/OperationsImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/OperationsImpl.java new file mode 100644 index 000000000000..6a6affc83cea --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/OperationsImpl.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.hybridnetwork.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybridnetwork.fluent.OperationsClient; +import com.azure.resourcemanager.hybridnetwork.fluent.models.OperationInner; +import com.azure.resourcemanager.hybridnetwork.models.Operation; +import com.azure.resourcemanager.hybridnetwork.models.Operations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class OperationsImpl implements Operations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager; + + public OperationsImpl( + OperationsClient innerClient, com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/PreviewSubscriptionImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/PreviewSubscriptionImpl.java new file mode 100644 index 000000000000..4f4fb352c11d --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/PreviewSubscriptionImpl.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.hybridnetwork.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridnetwork.fluent.models.PreviewSubscriptionInner; +import com.azure.resourcemanager.hybridnetwork.models.PreviewSubscription; +import com.azure.resourcemanager.hybridnetwork.models.ProvisioningState; + +public final class PreviewSubscriptionImpl + implements PreviewSubscription, PreviewSubscription.Definition, PreviewSubscription.Update { + private PreviewSubscriptionInner innerObject; + + private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public PreviewSubscriptionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { + return this.serviceManager; + } + + private String vendorName; + + private String skuName; + + private String previewSubscription; + + public PreviewSubscriptionImpl withExistingVendorSku(String vendorName, String skuName) { + this.vendorName = vendorName; + this.skuName = skuName; + return this; + } + + public PreviewSubscription create() { + this.innerObject = + serviceManager + .serviceClient() + .getVendorSkuPreviews() + .createOrUpdate(vendorName, skuName, previewSubscription, this.innerModel(), Context.NONE); + return this; + } + + public PreviewSubscription create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVendorSkuPreviews() + .createOrUpdate(vendorName, skuName, previewSubscription, this.innerModel(), context); + return this; + } + + PreviewSubscriptionImpl(String name, com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerObject = new PreviewSubscriptionInner(); + this.serviceManager = serviceManager; + this.previewSubscription = name; + } + + public PreviewSubscriptionImpl update() { + return this; + } + + public PreviewSubscription apply() { + this.innerObject = + serviceManager + .serviceClient() + .getVendorSkuPreviews() + .createOrUpdate(vendorName, skuName, previewSubscription, this.innerModel(), Context.NONE); + return this; + } + + public PreviewSubscription apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVendorSkuPreviews() + .createOrUpdate(vendorName, skuName, previewSubscription, this.innerModel(), context); + return this; + } + + PreviewSubscriptionImpl( + PreviewSubscriptionInner innerObject, + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.vendorName = Utils.getValueFromIdByName(innerObject.id(), "vendors"); + this.skuName = Utils.getValueFromIdByName(innerObject.id(), "vendorSkus"); + this.previewSubscription = Utils.getValueFromIdByName(innerObject.id(), "previewSubscriptions"); + } + + public PreviewSubscription refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getVendorSkuPreviews() + .getWithResponse(vendorName, skuName, previewSubscription, Context.NONE) + .getValue(); + return this; + } + + public PreviewSubscription refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVendorSkuPreviews() + .getWithResponse(vendorName, skuName, previewSubscription, context) + .getValue(); + return this; + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/RoleInstanceImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/RoleInstanceImpl.java new file mode 100644 index 000000000000..73740c62f82b --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/RoleInstanceImpl.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.hybridnetwork.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.hybridnetwork.fluent.models.RoleInstanceInner; +import com.azure.resourcemanager.hybridnetwork.models.OperationalState; +import com.azure.resourcemanager.hybridnetwork.models.ProvisioningState; +import com.azure.resourcemanager.hybridnetwork.models.RoleInstance; + +public final class RoleInstanceImpl implements RoleInstance { + private RoleInstanceInner innerObject; + + private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager; + + RoleInstanceImpl( + RoleInstanceInner innerObject, com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public String id() { + return this.innerModel().id(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public OperationalState operationalState() { + return this.innerModel().operationalState(); + } + + public RoleInstanceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/RoleInstancesClientImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/RoleInstancesClientImpl.java new file mode 100644 index 000000000000..f9dfe0b2d895 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/RoleInstancesClientImpl.java @@ -0,0 +1,1415 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.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.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.hybridnetwork.fluent.RoleInstancesClient; +import com.azure.resourcemanager.hybridnetwork.fluent.models.RoleInstanceInner; +import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionRoleInstanceListResult; +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 RoleInstancesClient. */ +public final class RoleInstancesClientImpl implements RoleInstancesClient { + private final ClientLogger logger = new ClientLogger(RoleInstancesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final RoleInstancesService service; + + /** The service client containing this operation class. */ + private final HybridNetworkManagementClientImpl client; + + /** + * Initializes an instance of RoleInstancesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RoleInstancesClientImpl(HybridNetworkManagementClientImpl client) { + this.service = + RestProxy.create(RoleInstancesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HybridNetworkManagementClientRoleInstances to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HybridNetworkManagem") + private interface RoleInstancesService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/locations/{locationName}/vendors" + + "/{vendorName}/networkFunctions/{serviceKey}/roleInstances/{roleInstanceName}/start") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> start( + @HostParam("$host") String endpoint, + @PathParam("locationName") String locationName, + @PathParam("vendorName") String vendorName, + @PathParam("serviceKey") String serviceKey, + @PathParam("roleInstanceName") String roleInstanceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/locations/{locationName}/vendors" + + "/{vendorName}/networkFunctions/{serviceKey}/roleInstances/{roleInstanceName}/stop") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> stop( + @HostParam("$host") String endpoint, + @PathParam("locationName") String locationName, + @PathParam("vendorName") String vendorName, + @PathParam("serviceKey") String serviceKey, + @PathParam("roleInstanceName") String roleInstanceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/locations/{locationName}/vendors" + + "/{vendorName}/networkFunctions/{serviceKey}/roleInstances/{roleInstanceName}/restart") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> restart( + @HostParam("$host") String endpoint, + @PathParam("locationName") String locationName, + @PathParam("vendorName") String vendorName, + @PathParam("serviceKey") String serviceKey, + @PathParam("roleInstanceName") String roleInstanceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/locations/{locationName}/vendors" + + "/{vendorName}/networkFunctions/{serviceKey}/roleInstances/{roleInstanceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("locationName") String locationName, + @PathParam("vendorName") String vendorName, + @PathParam("serviceKey") String serviceKey, + @PathParam("roleInstanceName") String roleInstanceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/locations/{locationName}/vendors" + + "/{vendorName}/networkFunctions/{serviceKey}/roleInstances") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("locationName") String locationName, + @PathParam("vendorName") String vendorName, + @PathParam("serviceKey") String serviceKey, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Starts a role instance of a vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param roleInstanceName The name of the role instance of the vendor network function. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> startWithResponseAsync( + String locationName, String vendorName, String serviceKey, String roleInstanceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (locationName == null) { + return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); + } + if (vendorName == null) { + return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); + } + if (serviceKey == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceKey is required and cannot be null.")); + } + if (roleInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleInstanceName is required 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 + .start( + this.client.getEndpoint(), + locationName, + vendorName, + serviceKey, + roleInstanceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Starts a role instance of a vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param roleInstanceName The name of the role instance of the vendor network function. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> startWithResponseAsync( + String locationName, String vendorName, String serviceKey, String roleInstanceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (locationName == null) { + return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); + } + if (vendorName == null) { + return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); + } + if (serviceKey == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceKey is required and cannot be null.")); + } + if (roleInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleInstanceName is required 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 + .start( + this.client.getEndpoint(), + locationName, + vendorName, + serviceKey, + roleInstanceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Starts a role instance of a vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param roleInstanceName The name of the role instance of the vendor network function. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 PollerFlux, Void> beginStartAsync( + String locationName, String vendorName, String serviceKey, String roleInstanceName) { + Mono>> mono = + startWithResponseAsync(locationName, vendorName, serviceKey, roleInstanceName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Starts a role instance of a vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param roleInstanceName The name of the role instance of the vendor network function. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 PollerFlux, Void> beginStartAsync( + String locationName, String vendorName, String serviceKey, String roleInstanceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + startWithResponseAsync(locationName, vendorName, serviceKey, roleInstanceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Starts a role instance of a vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param roleInstanceName The name of the role instance of the vendor network function. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + public SyncPoller, Void> beginStart( + String locationName, String vendorName, String serviceKey, String roleInstanceName) { + return beginStartAsync(locationName, vendorName, serviceKey, roleInstanceName).getSyncPoller(); + } + + /** + * Starts a role instance of a vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param roleInstanceName The name of the role instance of the vendor network function. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + public SyncPoller, Void> beginStart( + String locationName, String vendorName, String serviceKey, String roleInstanceName, Context context) { + return beginStartAsync(locationName, vendorName, serviceKey, roleInstanceName, context).getSyncPoller(); + } + + /** + * Starts a role instance of a vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param roleInstanceName The name of the role instance of the vendor network function. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 startAsync(String locationName, String vendorName, String serviceKey, String roleInstanceName) { + return beginStartAsync(locationName, vendorName, serviceKey, roleInstanceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts a role instance of a vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param roleInstanceName The name of the role instance of the vendor network function. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 startAsync( + String locationName, String vendorName, String serviceKey, String roleInstanceName, Context context) { + return beginStartAsync(locationName, vendorName, serviceKey, roleInstanceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts a role instance of a vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param roleInstanceName The name of the role instance of the vendor network function. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void start(String locationName, String vendorName, String serviceKey, String roleInstanceName) { + startAsync(locationName, vendorName, serviceKey, roleInstanceName).block(); + } + + /** + * Starts a role instance of a vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param roleInstanceName The name of the role instance of the vendor network function. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void start( + String locationName, String vendorName, String serviceKey, String roleInstanceName, Context context) { + startAsync(locationName, vendorName, serviceKey, roleInstanceName, context).block(); + } + + /** + * Powers off (stop) a role instance of a vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param roleInstanceName The name of the role instance of the vendor network function. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 locationName, String vendorName, String serviceKey, String roleInstanceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (locationName == null) { + return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); + } + if (vendorName == null) { + return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); + } + if (serviceKey == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceKey is required and cannot be null.")); + } + if (roleInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleInstanceName is required 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 + .stop( + this.client.getEndpoint(), + locationName, + vendorName, + serviceKey, + roleInstanceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Powers off (stop) a role instance of a vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param roleInstanceName The name of the role instance of the vendor network function. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 locationName, String vendorName, String serviceKey, String roleInstanceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (locationName == null) { + return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); + } + if (vendorName == null) { + return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); + } + if (serviceKey == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceKey is required and cannot be null.")); + } + if (roleInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleInstanceName is required 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 + .stop( + this.client.getEndpoint(), + locationName, + vendorName, + serviceKey, + roleInstanceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Powers off (stop) a role instance of a vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param roleInstanceName The name of the role instance of the vendor network function. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 PollerFlux, Void> beginStopAsync( + String locationName, String vendorName, String serviceKey, String roleInstanceName) { + Mono>> mono = + stopWithResponseAsync(locationName, vendorName, serviceKey, roleInstanceName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Powers off (stop) a role instance of a vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param roleInstanceName The name of the role instance of the vendor network function. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 PollerFlux, Void> beginStopAsync( + String locationName, String vendorName, String serviceKey, String roleInstanceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + stopWithResponseAsync(locationName, vendorName, serviceKey, roleInstanceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Powers off (stop) a role instance of a vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param roleInstanceName The name of the role instance of the vendor network function. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + public SyncPoller, Void> beginStop( + String locationName, String vendorName, String serviceKey, String roleInstanceName) { + return beginStopAsync(locationName, vendorName, serviceKey, roleInstanceName).getSyncPoller(); + } + + /** + * Powers off (stop) a role instance of a vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param roleInstanceName The name of the role instance of the vendor network function. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + public SyncPoller, Void> beginStop( + String locationName, String vendorName, String serviceKey, String roleInstanceName, Context context) { + return beginStopAsync(locationName, vendorName, serviceKey, roleInstanceName, context).getSyncPoller(); + } + + /** + * Powers off (stop) a role instance of a vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param roleInstanceName The name of the role instance of the vendor network function. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 locationName, String vendorName, String serviceKey, String roleInstanceName) { + return beginStopAsync(locationName, vendorName, serviceKey, roleInstanceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Powers off (stop) a role instance of a vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param roleInstanceName The name of the role instance of the vendor network function. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 locationName, String vendorName, String serviceKey, String roleInstanceName, Context context) { + return beginStopAsync(locationName, vendorName, serviceKey, roleInstanceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Powers off (stop) a role instance of a vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param roleInstanceName The name of the role instance of the vendor network function. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 locationName, String vendorName, String serviceKey, String roleInstanceName) { + stopAsync(locationName, vendorName, serviceKey, roleInstanceName).block(); + } + + /** + * Powers off (stop) a role instance of a vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param roleInstanceName The name of the role instance of the vendor network function. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 locationName, String vendorName, String serviceKey, String roleInstanceName, Context context) { + stopAsync(locationName, vendorName, serviceKey, roleInstanceName, context).block(); + } + + /** + * Restarts a role instance of a vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param roleInstanceName The name of the role instance of the vendor network function. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> restartWithResponseAsync( + String locationName, String vendorName, String serviceKey, String roleInstanceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (locationName == null) { + return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); + } + if (vendorName == null) { + return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); + } + if (serviceKey == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceKey is required and cannot be null.")); + } + if (roleInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleInstanceName is required 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 + .restart( + this.client.getEndpoint(), + locationName, + vendorName, + serviceKey, + roleInstanceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Restarts a role instance of a vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param roleInstanceName The name of the role instance of the vendor network function. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> restartWithResponseAsync( + String locationName, String vendorName, String serviceKey, String roleInstanceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (locationName == null) { + return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); + } + if (vendorName == null) { + return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); + } + if (serviceKey == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceKey is required and cannot be null.")); + } + if (roleInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleInstanceName is required 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 + .restart( + this.client.getEndpoint(), + locationName, + vendorName, + serviceKey, + roleInstanceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Restarts a role instance of a vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param roleInstanceName The name of the role instance of the vendor network function. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 PollerFlux, Void> beginRestartAsync( + String locationName, String vendorName, String serviceKey, String roleInstanceName) { + Mono>> mono = + restartWithResponseAsync(locationName, vendorName, serviceKey, roleInstanceName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Restarts a role instance of a vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param roleInstanceName The name of the role instance of the vendor network function. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 PollerFlux, Void> beginRestartAsync( + String locationName, String vendorName, String serviceKey, String roleInstanceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + restartWithResponseAsync(locationName, vendorName, serviceKey, roleInstanceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Restarts a role instance of a vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param roleInstanceName The name of the role instance of the vendor network function. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + public SyncPoller, Void> beginRestart( + String locationName, String vendorName, String serviceKey, String roleInstanceName) { + return beginRestartAsync(locationName, vendorName, serviceKey, roleInstanceName).getSyncPoller(); + } + + /** + * Restarts a role instance of a vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param roleInstanceName The name of the role instance of the vendor network function. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + public SyncPoller, Void> beginRestart( + String locationName, String vendorName, String serviceKey, String roleInstanceName, Context context) { + return beginRestartAsync(locationName, vendorName, serviceKey, roleInstanceName, context).getSyncPoller(); + } + + /** + * Restarts a role instance of a vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param roleInstanceName The name of the role instance of the vendor network function. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 restartAsync( + String locationName, String vendorName, String serviceKey, String roleInstanceName) { + return beginRestartAsync(locationName, vendorName, serviceKey, roleInstanceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restarts a role instance of a vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param roleInstanceName The name of the role instance of the vendor network function. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 restartAsync( + String locationName, String vendorName, String serviceKey, String roleInstanceName, Context context) { + return beginRestartAsync(locationName, vendorName, serviceKey, roleInstanceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restarts a role instance of a vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param roleInstanceName The name of the role instance of the vendor network function. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void restart(String locationName, String vendorName, String serviceKey, String roleInstanceName) { + restartAsync(locationName, vendorName, serviceKey, roleInstanceName).block(); + } + + /** + * Restarts a role instance of a vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param roleInstanceName The name of the role instance of the vendor network function. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void restart( + String locationName, String vendorName, String serviceKey, String roleInstanceName, Context context) { + restartAsync(locationName, vendorName, serviceKey, roleInstanceName, context).block(); + } + + /** + * Gets the information of role instance of vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param roleInstanceName The name of the role instance of the vendor network function. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the information of role instance of vendor network function. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String locationName, String vendorName, String serviceKey, String roleInstanceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (locationName == null) { + return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); + } + if (vendorName == null) { + return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); + } + if (serviceKey == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceKey is required and cannot be null.")); + } + if (roleInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleInstanceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + locationName, + vendorName, + serviceKey, + roleInstanceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the information of role instance of vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param roleInstanceName The name of the role instance of the vendor network function. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the information of role instance of vendor network function. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String locationName, String vendorName, String serviceKey, String roleInstanceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (locationName == null) { + return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); + } + if (vendorName == null) { + return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); + } + if (serviceKey == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceKey is required and cannot be null.")); + } + if (roleInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleInstanceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + locationName, + vendorName, + serviceKey, + roleInstanceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the information of role instance of vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param roleInstanceName The name of the role instance of the vendor network function. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the information of role instance of vendor network function. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String locationName, String vendorName, String serviceKey, String roleInstanceName) { + return getWithResponseAsync(locationName, vendorName, serviceKey, roleInstanceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the information of role instance of vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param roleInstanceName The name of the role instance of the vendor network function. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the information of role instance of vendor network function. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RoleInstanceInner get(String locationName, String vendorName, String serviceKey, String roleInstanceName) { + return getAsync(locationName, vendorName, serviceKey, roleInstanceName).block(); + } + + /** + * Gets the information of role instance of vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param roleInstanceName The name of the role instance of the vendor network function. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the information of role instance of vendor network function. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String locationName, String vendorName, String serviceKey, String roleInstanceName, Context context) { + return getWithResponseAsync(locationName, vendorName, serviceKey, roleInstanceName, context).block(); + } + + /** + * Lists the information of role instances of vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of role instances of vendor network function. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String locationName, String vendorName, String serviceKey) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (locationName == null) { + return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); + } + if (vendorName == null) { + return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); + } + if (serviceKey == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceKey is required 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(), + locationName, + vendorName, + serviceKey, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the information of role instances of vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of role instances of vendor network function. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String locationName, String vendorName, String serviceKey, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (locationName == null) { + return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); + } + if (vendorName == null) { + return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); + } + if (serviceKey == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceKey is required 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(), + locationName, + vendorName, + serviceKey, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the information of role instances of vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of role instances of vendor network function. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String locationName, String vendorName, String serviceKey) { + return new PagedFlux<>( + () -> listSinglePageAsync(locationName, vendorName, serviceKey), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the information of role instances of vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of role instances of vendor network function. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String locationName, String vendorName, String serviceKey, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(locationName, vendorName, serviceKey, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the information of role instances of vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of role instances of vendor network function. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String locationName, String vendorName, String serviceKey) { + return new PagedIterable<>(listAsync(locationName, vendorName, serviceKey)); + } + + /** + * Lists the information of role instances of vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of role instances of vendor network function. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String locationName, String vendorName, String serviceKey, Context context) { + return new PagedIterable<>(listAsync(locationName, vendorName, serviceKey, 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 list of role instances of vendor network function. + */ + @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 list of role instances of vendor network function. + */ + @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/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/RoleInstancesImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/RoleInstancesImpl.java new file mode 100644 index 000000000000..bd6ed07695cb --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/RoleInstancesImpl.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.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.hybridnetwork.fluent.RoleInstancesClient; +import com.azure.resourcemanager.hybridnetwork.fluent.models.RoleInstanceInner; +import com.azure.resourcemanager.hybridnetwork.models.RoleInstance; +import com.azure.resourcemanager.hybridnetwork.models.RoleInstances; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class RoleInstancesImpl implements RoleInstances { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RoleInstancesImpl.class); + + private final RoleInstancesClient innerClient; + + private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager; + + public RoleInstancesImpl( + RoleInstancesClient innerClient, com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void start(String locationName, String vendorName, String serviceKey, String roleInstanceName) { + this.serviceClient().start(locationName, vendorName, serviceKey, roleInstanceName); + } + + public void start( + String locationName, String vendorName, String serviceKey, String roleInstanceName, Context context) { + this.serviceClient().start(locationName, vendorName, serviceKey, roleInstanceName, context); + } + + public void stop(String locationName, String vendorName, String serviceKey, String roleInstanceName) { + this.serviceClient().stop(locationName, vendorName, serviceKey, roleInstanceName); + } + + public void stop( + String locationName, String vendorName, String serviceKey, String roleInstanceName, Context context) { + this.serviceClient().stop(locationName, vendorName, serviceKey, roleInstanceName, context); + } + + public void restart(String locationName, String vendorName, String serviceKey, String roleInstanceName) { + this.serviceClient().restart(locationName, vendorName, serviceKey, roleInstanceName); + } + + public void restart( + String locationName, String vendorName, String serviceKey, String roleInstanceName, Context context) { + this.serviceClient().restart(locationName, vendorName, serviceKey, roleInstanceName, context); + } + + public RoleInstance get(String locationName, String vendorName, String serviceKey, String roleInstanceName) { + RoleInstanceInner inner = this.serviceClient().get(locationName, vendorName, serviceKey, roleInstanceName); + if (inner != null) { + return new RoleInstanceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String locationName, String vendorName, String serviceKey, String roleInstanceName, Context context) { + Response inner = + this.serviceClient().getWithResponse(locationName, vendorName, serviceKey, roleInstanceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RoleInstanceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list(String locationName, String vendorName, String serviceKey) { + PagedIterable inner = this.serviceClient().list(locationName, vendorName, serviceKey); + return Utils.mapPage(inner, inner1 -> new RoleInstanceImpl(inner1, this.manager())); + } + + public PagedIterable list( + String locationName, String vendorName, String serviceKey, Context context) { + PagedIterable inner = + this.serviceClient().list(locationName, vendorName, serviceKey, context); + return Utils.mapPage(inner, inner1 -> new RoleInstanceImpl(inner1, this.manager())); + } + + private RoleInstancesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/SkuOverviewImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/SkuOverviewImpl.java new file mode 100644 index 000000000000..1fa058763ad5 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/SkuOverviewImpl.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.hybridnetwork.implementation; + +import com.azure.resourcemanager.hybridnetwork.fluent.models.SkuOverviewInner; +import com.azure.resourcemanager.hybridnetwork.models.SkuOverview; +import com.azure.resourcemanager.hybridnetwork.models.SkuType; + +public final class SkuOverviewImpl implements SkuOverview { + private SkuOverviewInner innerObject; + + private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager; + + SkuOverviewImpl( + SkuOverviewInner innerObject, com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String skuName() { + return this.innerModel().skuName(); + } + + public SkuType skuType() { + return this.innerModel().skuType(); + } + + public SkuOverviewInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/Utils.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/Utils.java new file mode 100644 index 000000000000..8068264e47d9 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/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.hybridnetwork.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/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorImpl.java new file mode 100644 index 000000000000..13edfdfcbce0 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorImpl.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.implementation; + +import com.azure.core.management.SubResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridnetwork.fluent.models.VendorInner; +import com.azure.resourcemanager.hybridnetwork.models.ProvisioningState; +import com.azure.resourcemanager.hybridnetwork.models.Vendor; +import java.util.Collections; +import java.util.List; + +public final class VendorImpl implements Vendor, Vendor.Definition, Vendor.Update { + private VendorInner innerObject; + + private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public List skus() { + List inner = this.innerModel().skus(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public VendorInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { + return this.serviceManager; + } + + private String vendorName; + + public Vendor create() { + this.innerObject = + serviceManager.serviceClient().getVendors().createOrUpdate(vendorName, this.innerModel(), Context.NONE); + return this; + } + + public Vendor create(Context context) { + this.innerObject = + serviceManager.serviceClient().getVendors().createOrUpdate(vendorName, this.innerModel(), context); + return this; + } + + VendorImpl(String name, com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerObject = new VendorInner(); + this.serviceManager = serviceManager; + this.vendorName = name; + } + + public VendorImpl update() { + return this; + } + + public Vendor apply() { + this.innerObject = + serviceManager.serviceClient().getVendors().createOrUpdate(vendorName, this.innerModel(), Context.NONE); + return this; + } + + public Vendor apply(Context context) { + this.innerObject = + serviceManager.serviceClient().getVendors().createOrUpdate(vendorName, this.innerModel(), context); + return this; + } + + VendorImpl(VendorInner innerObject, com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.vendorName = Utils.getValueFromIdByName(innerObject.id(), "vendors"); + } + + public Vendor refresh() { + this.innerObject = + serviceManager.serviceClient().getVendors().getWithResponse(vendorName, Context.NONE).getValue(); + return this; + } + + public Vendor refresh(Context context) { + this.innerObject = serviceManager.serviceClient().getVendors().getWithResponse(vendorName, context).getValue(); + return this; + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorNetworkFunctionImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorNetworkFunctionImpl.java new file mode 100644 index 000000000000..6193c1e7e374 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorNetworkFunctionImpl.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.hybridnetwork.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridnetwork.fluent.models.VendorNetworkFunctionInner; +import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionVendorConfiguration; +import com.azure.resourcemanager.hybridnetwork.models.ProvisioningState; +import com.azure.resourcemanager.hybridnetwork.models.SkuType; +import com.azure.resourcemanager.hybridnetwork.models.VendorNetworkFunction; +import com.azure.resourcemanager.hybridnetwork.models.VendorProvisioningState; +import java.util.Collections; +import java.util.List; + +public final class VendorNetworkFunctionImpl + implements VendorNetworkFunction, VendorNetworkFunction.Definition, VendorNetworkFunction.Update { + private VendorNetworkFunctionInner innerObject; + + private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public VendorProvisioningState vendorProvisioningState() { + return this.innerModel().vendorProvisioningState(); + } + + public String skuName() { + return this.innerModel().skuName(); + } + + public SkuType skuType() { + return this.innerModel().skuType(); + } + + public List networkFunctionVendorConfigurations() { + List inner = this.innerModel().networkFunctionVendorConfigurations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public VendorNetworkFunctionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { + return this.serviceManager; + } + + private String locationName; + + private String vendorName; + + private String serviceKey; + + public VendorNetworkFunctionImpl withExistingVendor(String locationName, String vendorName) { + this.locationName = locationName; + this.vendorName = vendorName; + return this; + } + + public VendorNetworkFunction create() { + this.innerObject = + serviceManager + .serviceClient() + .getVendorNetworkFunctions() + .createOrUpdate(locationName, vendorName, serviceKey, this.innerModel(), Context.NONE); + return this; + } + + public VendorNetworkFunction create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVendorNetworkFunctions() + .createOrUpdate(locationName, vendorName, serviceKey, this.innerModel(), context); + return this; + } + + VendorNetworkFunctionImpl( + String name, com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerObject = new VendorNetworkFunctionInner(); + this.serviceManager = serviceManager; + this.serviceKey = name; + } + + public VendorNetworkFunctionImpl update() { + return this; + } + + public VendorNetworkFunction apply() { + this.innerObject = + serviceManager + .serviceClient() + .getVendorNetworkFunctions() + .createOrUpdate(locationName, vendorName, serviceKey, this.innerModel(), Context.NONE); + return this; + } + + public VendorNetworkFunction apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVendorNetworkFunctions() + .createOrUpdate(locationName, vendorName, serviceKey, this.innerModel(), context); + return this; + } + + VendorNetworkFunctionImpl( + VendorNetworkFunctionInner innerObject, + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.locationName = Utils.getValueFromIdByName(innerObject.id(), "locations"); + this.vendorName = Utils.getValueFromIdByName(innerObject.id(), "vendors"); + this.serviceKey = Utils.getValueFromIdByName(innerObject.id(), "networkFunctions"); + } + + public VendorNetworkFunction refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getVendorNetworkFunctions() + .getWithResponse(locationName, vendorName, serviceKey, Context.NONE) + .getValue(); + return this; + } + + public VendorNetworkFunction refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVendorNetworkFunctions() + .getWithResponse(locationName, vendorName, serviceKey, context) + .getValue(); + return this; + } + + public VendorNetworkFunctionImpl withVendorProvisioningState(VendorProvisioningState vendorProvisioningState) { + this.innerModel().withVendorProvisioningState(vendorProvisioningState); + return this; + } + + public VendorNetworkFunctionImpl withNetworkFunctionVendorConfigurations( + List networkFunctionVendorConfigurations) { + this.innerModel().withNetworkFunctionVendorConfigurations(networkFunctionVendorConfigurations); + return this; + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorNetworkFunctionsClientImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorNetworkFunctionsClientImpl.java new file mode 100644 index 000000000000..f46222fa8b71 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorNetworkFunctionsClientImpl.java @@ -0,0 +1,891 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.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.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.hybridnetwork.fluent.VendorNetworkFunctionsClient; +import com.azure.resourcemanager.hybridnetwork.fluent.models.VendorNetworkFunctionInner; +import com.azure.resourcemanager.hybridnetwork.models.VendorNetworkFunctionListResult; +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 VendorNetworkFunctionsClient. */ +public final class VendorNetworkFunctionsClientImpl implements VendorNetworkFunctionsClient { + private final ClientLogger logger = new ClientLogger(VendorNetworkFunctionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VendorNetworkFunctionsService service; + + /** The service client containing this operation class. */ + private final HybridNetworkManagementClientImpl client; + + /** + * Initializes an instance of VendorNetworkFunctionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VendorNetworkFunctionsClientImpl(HybridNetworkManagementClientImpl client) { + this.service = + RestProxy + .create(VendorNetworkFunctionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HybridNetworkManagementClientVendorNetworkFunctions to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HybridNetworkManagem") + private interface VendorNetworkFunctionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/locations/{locationName}/vendors" + + "/{vendorName}/networkFunctions/{serviceKey}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("locationName") String locationName, + @PathParam("vendorName") String vendorName, + @PathParam("serviceKey") String serviceKey, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/locations/{locationName}/vendors" + + "/{vendorName}/networkFunctions/{serviceKey}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("locationName") String locationName, + @PathParam("vendorName") String vendorName, + @PathParam("serviceKey") String serviceKey, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VendorNetworkFunctionInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/locations/{locationName}/vendors" + + "/{vendorName}/networkFunctions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("locationName") String locationName, + @PathParam("vendorName") String vendorName, + @QueryParam("$filter") String filter, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets information about the specified vendor network function. + * + * @param locationName The Azure region where the network function resource was created by the customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified vendor network function. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String locationName, String vendorName, String serviceKey) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (locationName == null) { + return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); + } + if (vendorName == null) { + return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); + } + if (serviceKey == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceKey is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + locationName, + vendorName, + serviceKey, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets information about the specified vendor network function. + * + * @param locationName The Azure region where the network function resource was created by the customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified vendor network function. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String locationName, String vendorName, String serviceKey, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (locationName == null) { + return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); + } + if (vendorName == null) { + return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); + } + if (serviceKey == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceKey is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + locationName, + vendorName, + serviceKey, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets information about the specified vendor network function. + * + * @param locationName The Azure region where the network function resource was created by the customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified vendor network function. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String locationName, String vendorName, String serviceKey) { + return getWithResponseAsync(locationName, vendorName, serviceKey) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets information about the specified vendor network function. + * + * @param locationName The Azure region where the network function resource was created by the customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified vendor network function. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VendorNetworkFunctionInner get(String locationName, String vendorName, String serviceKey) { + return getAsync(locationName, vendorName, serviceKey).block(); + } + + /** + * Gets information about the specified vendor network function. + * + * @param locationName The Azure region where the network function resource was created by the customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified vendor network function. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String locationName, String vendorName, String serviceKey, Context context) { + return getWithResponseAsync(locationName, vendorName, serviceKey, context).block(); + } + + /** + * Creates or updates a vendor network function. This operation can take up to 6 hours to complete. This is expected + * service behavior. + * + * @param locationName The Azure region where the network function resource was created by the customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param parameters Parameters supplied to the create or update vendor network function operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vendor network function sub resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String locationName, String vendorName, String serviceKey, VendorNetworkFunctionInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (locationName == null) { + return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); + } + if (vendorName == null) { + return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); + } + if (serviceKey == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceKey is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + locationName, + vendorName, + serviceKey, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a vendor network function. This operation can take up to 6 hours to complete. This is expected + * service behavior. + * + * @param locationName The Azure region where the network function resource was created by the customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param parameters Parameters supplied to the create or update vendor network function 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 vendor network function sub resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String locationName, + String vendorName, + String serviceKey, + VendorNetworkFunctionInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (locationName == null) { + return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); + } + if (vendorName == null) { + return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); + } + if (serviceKey == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceKey is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + locationName, + vendorName, + serviceKey, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates a vendor network function. This operation can take up to 6 hours to complete. This is expected + * service behavior. + * + * @param locationName The Azure region where the network function resource was created by the customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param parameters Parameters supplied to the create or update vendor network function operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vendor network function sub resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VendorNetworkFunctionInner> beginCreateOrUpdateAsync( + String locationName, String vendorName, String serviceKey, VendorNetworkFunctionInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(locationName, vendorName, serviceKey, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VendorNetworkFunctionInner.class, + VendorNetworkFunctionInner.class, + Context.NONE); + } + + /** + * Creates or updates a vendor network function. This operation can take up to 6 hours to complete. This is expected + * service behavior. + * + * @param locationName The Azure region where the network function resource was created by the customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param parameters Parameters supplied to the create or update vendor network function 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 vendor network function sub resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VendorNetworkFunctionInner> beginCreateOrUpdateAsync( + String locationName, + String vendorName, + String serviceKey, + VendorNetworkFunctionInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(locationName, vendorName, serviceKey, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VendorNetworkFunctionInner.class, + VendorNetworkFunctionInner.class, + context); + } + + /** + * Creates or updates a vendor network function. This operation can take up to 6 hours to complete. This is expected + * service behavior. + * + * @param locationName The Azure region where the network function resource was created by the customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param parameters Parameters supplied to the create or update vendor network function operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vendor network function sub resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VendorNetworkFunctionInner> beginCreateOrUpdate( + String locationName, String vendorName, String serviceKey, VendorNetworkFunctionInner parameters) { + return beginCreateOrUpdateAsync(locationName, vendorName, serviceKey, parameters).getSyncPoller(); + } + + /** + * Creates or updates a vendor network function. This operation can take up to 6 hours to complete. This is expected + * service behavior. + * + * @param locationName The Azure region where the network function resource was created by the customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param parameters Parameters supplied to the create or update vendor network function 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 vendor network function sub resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VendorNetworkFunctionInner> beginCreateOrUpdate( + String locationName, + String vendorName, + String serviceKey, + VendorNetworkFunctionInner parameters, + Context context) { + return beginCreateOrUpdateAsync(locationName, vendorName, serviceKey, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates a vendor network function. This operation can take up to 6 hours to complete. This is expected + * service behavior. + * + * @param locationName The Azure region where the network function resource was created by the customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param parameters Parameters supplied to the create or update vendor network function operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vendor network function sub resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String locationName, String vendorName, String serviceKey, VendorNetworkFunctionInner parameters) { + return beginCreateOrUpdateAsync(locationName, vendorName, serviceKey, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a vendor network function. This operation can take up to 6 hours to complete. This is expected + * service behavior. + * + * @param locationName The Azure region where the network function resource was created by the customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param parameters Parameters supplied to the create or update vendor network function 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 vendor network function sub resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String locationName, + String vendorName, + String serviceKey, + VendorNetworkFunctionInner parameters, + Context context) { + return beginCreateOrUpdateAsync(locationName, vendorName, serviceKey, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a vendor network function. This operation can take up to 6 hours to complete. This is expected + * service behavior. + * + * @param locationName The Azure region where the network function resource was created by the customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param parameters Parameters supplied to the create or update vendor network function operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vendor network function sub resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VendorNetworkFunctionInner createOrUpdate( + String locationName, String vendorName, String serviceKey, VendorNetworkFunctionInner parameters) { + return createOrUpdateAsync(locationName, vendorName, serviceKey, parameters).block(); + } + + /** + * Creates or updates a vendor network function. This operation can take up to 6 hours to complete. This is expected + * service behavior. + * + * @param locationName The Azure region where the network function resource was created by the customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param parameters Parameters supplied to the create or update vendor network function 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 vendor network function sub resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VendorNetworkFunctionInner createOrUpdate( + String locationName, + String vendorName, + String serviceKey, + VendorNetworkFunctionInner parameters, + Context context) { + return createOrUpdateAsync(locationName, vendorName, serviceKey, parameters, context).block(); + } + + /** + * Lists all the vendor network function sub resources in an Azure region, filtered by skuType, skuName, + * vendorProvisioningState. + * + * @param locationName The Azure region where the network function resource was created by the customer. + * @param vendorName The name of the vendor. + * @param filter The filter to apply on the operation. The properties you can use for eq (equals) are: skuType, + * skuName and vendorProvisioningState. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for vendors API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String locationName, String vendorName, String filter) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (locationName == null) { + return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); + } + if (vendorName == null) { + return Mono.error(new IllegalArgumentException("Parameter vendorName is required 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(), + locationName, + vendorName, + filter, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the vendor network function sub resources in an Azure region, filtered by skuType, skuName, + * vendorProvisioningState. + * + * @param locationName The Azure region where the network function resource was created by the customer. + * @param vendorName The name of the vendor. + * @param filter The filter to apply on the operation. The properties you can use for eq (equals) are: skuType, + * skuName and vendorProvisioningState. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for vendors API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String locationName, String vendorName, String filter, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (locationName == null) { + return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); + } + if (vendorName == null) { + return Mono.error(new IllegalArgumentException("Parameter vendorName is required 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(), + locationName, + vendorName, + filter, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the vendor network function sub resources in an Azure region, filtered by skuType, skuName, + * vendorProvisioningState. + * + * @param locationName The Azure region where the network function resource was created by the customer. + * @param vendorName The name of the vendor. + * @param filter The filter to apply on the operation. The properties you can use for eq (equals) are: skuType, + * skuName and vendorProvisioningState. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for vendors API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String locationName, String vendorName, String filter) { + return new PagedFlux<>( + () -> listSinglePageAsync(locationName, vendorName, filter), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the vendor network function sub resources in an Azure region, filtered by skuType, skuName, + * vendorProvisioningState. + * + * @param locationName The Azure region where the network function resource was created by the customer. + * @param vendorName The name of the vendor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for vendors API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String locationName, String vendorName) { + final String filter = null; + return new PagedFlux<>( + () -> listSinglePageAsync(locationName, vendorName, filter), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the vendor network function sub resources in an Azure region, filtered by skuType, skuName, + * vendorProvisioningState. + * + * @param locationName The Azure region where the network function resource was created by the customer. + * @param vendorName The name of the vendor. + * @param filter The filter to apply on the operation. The properties you can use for eq (equals) are: skuType, + * skuName and vendorProvisioningState. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for vendors API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String locationName, String vendorName, String filter, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(locationName, vendorName, filter, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the vendor network function sub resources in an Azure region, filtered by skuType, skuName, + * vendorProvisioningState. + * + * @param locationName The Azure region where the network function resource was created by the customer. + * @param vendorName The name of the vendor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for vendors API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String locationName, String vendorName) { + final String filter = null; + return new PagedIterable<>(listAsync(locationName, vendorName, filter)); + } + + /** + * Lists all the vendor network function sub resources in an Azure region, filtered by skuType, skuName, + * vendorProvisioningState. + * + * @param locationName The Azure region where the network function resource was created by the customer. + * @param vendorName The name of the vendor. + * @param filter The filter to apply on the operation. The properties you can use for eq (equals) are: skuType, + * skuName and vendorProvisioningState. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for vendors API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String locationName, String vendorName, String filter, Context context) { + return new PagedIterable<>(listAsync(locationName, vendorName, filter, 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 response for vendors API service call. + */ + @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 response for vendors API service call. + */ + @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/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorNetworkFunctionsImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorNetworkFunctionsImpl.java new file mode 100644 index 000000000000..4e6b0a5cbc08 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorNetworkFunctionsImpl.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.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.hybridnetwork.fluent.VendorNetworkFunctionsClient; +import com.azure.resourcemanager.hybridnetwork.fluent.models.VendorNetworkFunctionInner; +import com.azure.resourcemanager.hybridnetwork.models.VendorNetworkFunction; +import com.azure.resourcemanager.hybridnetwork.models.VendorNetworkFunctions; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VendorNetworkFunctionsImpl implements VendorNetworkFunctions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VendorNetworkFunctionsImpl.class); + + private final VendorNetworkFunctionsClient innerClient; + + private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager; + + public VendorNetworkFunctionsImpl( + VendorNetworkFunctionsClient innerClient, + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public VendorNetworkFunction get(String locationName, String vendorName, String serviceKey) { + VendorNetworkFunctionInner inner = this.serviceClient().get(locationName, vendorName, serviceKey); + if (inner != null) { + return new VendorNetworkFunctionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String locationName, String vendorName, String serviceKey, Context context) { + Response inner = + this.serviceClient().getWithResponse(locationName, vendorName, serviceKey, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VendorNetworkFunctionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list(String locationName, String vendorName) { + PagedIterable inner = this.serviceClient().list(locationName, vendorName); + return Utils.mapPage(inner, inner1 -> new VendorNetworkFunctionImpl(inner1, this.manager())); + } + + public PagedIterable list( + String locationName, String vendorName, String filter, Context context) { + PagedIterable inner = + this.serviceClient().list(locationName, vendorName, filter, context); + return Utils.mapPage(inner, inner1 -> new VendorNetworkFunctionImpl(inner1, this.manager())); + } + + public VendorNetworkFunction getById(String id) { + String locationName = Utils.getValueFromIdByName(id, "locations"); + if (locationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'locations'.", id))); + } + String vendorName = Utils.getValueFromIdByName(id, "vendors"); + if (vendorName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vendors'.", id))); + } + String serviceKey = Utils.getValueFromIdByName(id, "networkFunctions"); + if (serviceKey == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkFunctions'.", id))); + } + return this.getWithResponse(locationName, vendorName, serviceKey, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String locationName = Utils.getValueFromIdByName(id, "locations"); + if (locationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'locations'.", id))); + } + String vendorName = Utils.getValueFromIdByName(id, "vendors"); + if (vendorName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vendors'.", id))); + } + String serviceKey = Utils.getValueFromIdByName(id, "networkFunctions"); + if (serviceKey == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkFunctions'.", id))); + } + return this.getWithResponse(locationName, vendorName, serviceKey, context); + } + + private VendorNetworkFunctionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { + return this.serviceManager; + } + + public VendorNetworkFunctionImpl define(String name) { + return new VendorNetworkFunctionImpl(name, this.manager()); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorSkuImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorSkuImpl.java new file mode 100644 index 000000000000..4fbe813d45da --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorSkuImpl.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridnetwork.fluent.models.VendorSkuInner; +import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionTemplate; +import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionType; +import com.azure.resourcemanager.hybridnetwork.models.ProvisioningState; +import com.azure.resourcemanager.hybridnetwork.models.SkuDeploymentMode; +import com.azure.resourcemanager.hybridnetwork.models.SkuType; +import com.azure.resourcemanager.hybridnetwork.models.VendorSku; + +public final class VendorSkuImpl implements VendorSku, VendorSku.Definition, VendorSku.Update { + private VendorSkuInner innerObject; + + private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public SkuType skuType() { + return this.innerModel().skuType(); + } + + public SkuDeploymentMode deploymentMode() { + return this.innerModel().deploymentMode(); + } + + public NetworkFunctionType networkFunctionType() { + return this.innerModel().networkFunctionType(); + } + + public Boolean preview() { + return this.innerModel().preview(); + } + + public Object managedApplicationParameters() { + return this.innerModel().managedApplicationParameters(); + } + + public Object managedApplicationTemplate() { + return this.innerModel().managedApplicationTemplate(); + } + + public NetworkFunctionTemplate networkFunctionTemplate() { + return this.innerModel().networkFunctionTemplate(); + } + + public VendorSkuInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { + return this.serviceManager; + } + + private String vendorName; + + private String skuName; + + public VendorSkuImpl withExistingVendor(String vendorName) { + this.vendorName = vendorName; + return this; + } + + public VendorSku create() { + this.innerObject = + serviceManager + .serviceClient() + .getVendorSkus() + .createOrUpdate(vendorName, skuName, this.innerModel(), Context.NONE); + return this; + } + + public VendorSku create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVendorSkus() + .createOrUpdate(vendorName, skuName, this.innerModel(), context); + return this; + } + + VendorSkuImpl(String name, com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerObject = new VendorSkuInner(); + this.serviceManager = serviceManager; + this.skuName = name; + } + + public VendorSkuImpl update() { + return this; + } + + public VendorSku apply() { + this.innerObject = + serviceManager + .serviceClient() + .getVendorSkus() + .createOrUpdate(vendorName, skuName, this.innerModel(), Context.NONE); + return this; + } + + public VendorSku apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVendorSkus() + .createOrUpdate(vendorName, skuName, this.innerModel(), context); + return this; + } + + VendorSkuImpl( + VendorSkuInner innerObject, com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.vendorName = Utils.getValueFromIdByName(innerObject.id(), "vendors"); + this.skuName = Utils.getValueFromIdByName(innerObject.id(), "vendorSkus"); + } + + public VendorSku refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getVendorSkus() + .getWithResponse(vendorName, skuName, Context.NONE) + .getValue(); + return this; + } + + public VendorSku refresh(Context context) { + this.innerObject = + serviceManager.serviceClient().getVendorSkus().getWithResponse(vendorName, skuName, context).getValue(); + return this; + } + + public VendorSkuImpl withSkuType(SkuType skuType) { + this.innerModel().withSkuType(skuType); + return this; + } + + public VendorSkuImpl withDeploymentMode(SkuDeploymentMode deploymentMode) { + this.innerModel().withDeploymentMode(deploymentMode); + return this; + } + + public VendorSkuImpl withNetworkFunctionType(NetworkFunctionType networkFunctionType) { + this.innerModel().withNetworkFunctionType(networkFunctionType); + return this; + } + + public VendorSkuImpl withPreview(Boolean preview) { + this.innerModel().withPreview(preview); + return this; + } + + public VendorSkuImpl withManagedApplicationParameters(Object managedApplicationParameters) { + this.innerModel().withManagedApplicationParameters(managedApplicationParameters); + return this; + } + + public VendorSkuImpl withManagedApplicationTemplate(Object managedApplicationTemplate) { + this.innerModel().withManagedApplicationTemplate(managedApplicationTemplate); + return this; + } + + public VendorSkuImpl withNetworkFunctionTemplate(NetworkFunctionTemplate networkFunctionTemplate) { + this.innerModel().withNetworkFunctionTemplate(networkFunctionTemplate); + return this; + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorSkuPreviewsClientImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorSkuPreviewsClientImpl.java new file mode 100644 index 000000000000..886a8f38a1a6 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorSkuPreviewsClientImpl.java @@ -0,0 +1,1110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.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.hybridnetwork.fluent.VendorSkuPreviewsClient; +import com.azure.resourcemanager.hybridnetwork.fluent.models.PreviewSubscriptionInner; +import com.azure.resourcemanager.hybridnetwork.models.PreviewSubscriptionsList; +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 VendorSkuPreviewsClient. */ +public final class VendorSkuPreviewsClientImpl implements VendorSkuPreviewsClient { + private final ClientLogger logger = new ClientLogger(VendorSkuPreviewsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VendorSkuPreviewsService service; + + /** The service client containing this operation class. */ + private final HybridNetworkManagementClientImpl client; + + /** + * Initializes an instance of VendorSkuPreviewsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VendorSkuPreviewsClientImpl(HybridNetworkManagementClientImpl client) { + this.service = + RestProxy.create(VendorSkuPreviewsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HybridNetworkManagementClientVendorSkuPreviews to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HybridNetworkManagem") + private interface VendorSkuPreviewsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/vendors/{vendorName}/vendorSkus" + + "/{skuName}/previewSubscriptions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("vendorName") String vendorName, + @PathParam("skuName") String skuName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/vendors/{vendorName}/vendorSkus" + + "/{skuName}/previewSubscriptions/{previewSubscription}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("vendorName") String vendorName, + @PathParam("skuName") String skuName, + @PathParam("previewSubscription") String previewSubscription, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") PreviewSubscriptionInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/vendors/{vendorName}/vendorSkus" + + "/{skuName}/previewSubscriptions/{previewSubscription}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("vendorName") String vendorName, + @PathParam("skuName") String skuName, + @PathParam("previewSubscription") String previewSubscription, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/vendors/{vendorName}/vendorSkus" + + "/{skuName}/previewSubscriptions/{previewSubscription}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("vendorName") String vendorName, + @PathParam("skuName") String skuName, + @PathParam("previewSubscription") String previewSubscription, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all the preview information of a vendor sku. + * + * @param vendorName The name of the vendor. + * @param skuName The name of 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 a list of customer subscriptions which can use a sku. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String vendorName, String skuName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vendorName == null) { + return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); + } + if (skuName == null) { + return Mono.error(new IllegalArgumentException("Parameter skuName is required 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(), + vendorName, + skuName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the preview information of a vendor sku. + * + * @param vendorName The name of the vendor. + * @param skuName The name of 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 a list of customer subscriptions which can use a sku. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String vendorName, String skuName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vendorName == null) { + return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); + } + if (skuName == null) { + return Mono.error(new IllegalArgumentException("Parameter skuName is required 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(), + vendorName, + skuName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the preview information of a vendor sku. + * + * @param vendorName The name of the vendor. + * @param skuName The name of 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 a list of customer subscriptions which can use a sku. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String vendorName, String skuName) { + return new PagedFlux<>( + () -> listSinglePageAsync(vendorName, skuName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the preview information of a vendor sku. + * + * @param vendorName The name of the vendor. + * @param skuName The name of 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 a list of customer subscriptions which can use a sku. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String vendorName, String skuName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(vendorName, skuName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the preview information of a vendor sku. + * + * @param vendorName The name of the vendor. + * @param skuName The name of 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 a list of customer subscriptions which can use a sku. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String vendorName, String skuName) { + return new PagedIterable<>(listAsync(vendorName, skuName)); + } + + /** + * Lists all the preview information of a vendor sku. + * + * @param vendorName The name of the vendor. + * @param skuName The name of 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 a list of customer subscriptions which can use a sku. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String vendorName, String skuName, Context context) { + return new PagedIterable<>(listAsync(vendorName, skuName, context)); + } + + /** + * Creates or updates preview information of a vendor sku. + * + * @param vendorName The name of the vendor. + * @param skuName The name of the vendor sku. + * @param previewSubscription Preview subscription ID. + * @param parameters Parameters supplied to the create or update vendor preview subscription operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customer subscription which can use a sku. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String vendorName, String skuName, String previewSubscription, PreviewSubscriptionInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vendorName == null) { + return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); + } + if (skuName == null) { + return Mono.error(new IllegalArgumentException("Parameter skuName is required and cannot be null.")); + } + if (previewSubscription == null) { + return Mono + .error(new IllegalArgumentException("Parameter previewSubscription is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + vendorName, + skuName, + previewSubscription, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates preview information of a vendor sku. + * + * @param vendorName The name of the vendor. + * @param skuName The name of the vendor sku. + * @param previewSubscription Preview subscription ID. + * @param parameters Parameters supplied to the create or update vendor preview subscription 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 customer subscription which can use a sku. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String vendorName, + String skuName, + String previewSubscription, + PreviewSubscriptionInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vendorName == null) { + return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); + } + if (skuName == null) { + return Mono.error(new IllegalArgumentException("Parameter skuName is required and cannot be null.")); + } + if (previewSubscription == null) { + return Mono + .error(new IllegalArgumentException("Parameter previewSubscription is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + vendorName, + skuName, + previewSubscription, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates preview information of a vendor sku. + * + * @param vendorName The name of the vendor. + * @param skuName The name of the vendor sku. + * @param previewSubscription Preview subscription ID. + * @param parameters Parameters supplied to the create or update vendor preview subscription operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customer subscription which can use a sku. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, PreviewSubscriptionInner> beginCreateOrUpdateAsync( + String vendorName, String skuName, String previewSubscription, PreviewSubscriptionInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(vendorName, skuName, previewSubscription, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PreviewSubscriptionInner.class, + PreviewSubscriptionInner.class, + Context.NONE); + } + + /** + * Creates or updates preview information of a vendor sku. + * + * @param vendorName The name of the vendor. + * @param skuName The name of the vendor sku. + * @param previewSubscription Preview subscription ID. + * @param parameters Parameters supplied to the create or update vendor preview subscription 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 customer subscription which can use a sku. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, PreviewSubscriptionInner> beginCreateOrUpdateAsync( + String vendorName, + String skuName, + String previewSubscription, + PreviewSubscriptionInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(vendorName, skuName, previewSubscription, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PreviewSubscriptionInner.class, + PreviewSubscriptionInner.class, + context); + } + + /** + * Creates or updates preview information of a vendor sku. + * + * @param vendorName The name of the vendor. + * @param skuName The name of the vendor sku. + * @param previewSubscription Preview subscription ID. + * @param parameters Parameters supplied to the create or update vendor preview subscription operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customer subscription which can use a sku. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, PreviewSubscriptionInner> beginCreateOrUpdate( + String vendorName, String skuName, String previewSubscription, PreviewSubscriptionInner parameters) { + return beginCreateOrUpdateAsync(vendorName, skuName, previewSubscription, parameters).getSyncPoller(); + } + + /** + * Creates or updates preview information of a vendor sku. + * + * @param vendorName The name of the vendor. + * @param skuName The name of the vendor sku. + * @param previewSubscription Preview subscription ID. + * @param parameters Parameters supplied to the create or update vendor preview subscription 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 customer subscription which can use a sku. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, PreviewSubscriptionInner> beginCreateOrUpdate( + String vendorName, + String skuName, + String previewSubscription, + PreviewSubscriptionInner parameters, + Context context) { + return beginCreateOrUpdateAsync(vendorName, skuName, previewSubscription, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates preview information of a vendor sku. + * + * @param vendorName The name of the vendor. + * @param skuName The name of the vendor sku. + * @param previewSubscription Preview subscription ID. + * @param parameters Parameters supplied to the create or update vendor preview subscription operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customer subscription which can use a sku. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String vendorName, String skuName, String previewSubscription, PreviewSubscriptionInner parameters) { + return beginCreateOrUpdateAsync(vendorName, skuName, previewSubscription, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates preview information of a vendor sku. + * + * @param vendorName The name of the vendor. + * @param skuName The name of the vendor sku. + * @param previewSubscription Preview subscription ID. + * @param parameters Parameters supplied to the create or update vendor preview subscription 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 customer subscription which can use a sku. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String vendorName, + String skuName, + String previewSubscription, + PreviewSubscriptionInner parameters, + Context context) { + return beginCreateOrUpdateAsync(vendorName, skuName, previewSubscription, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates preview information of a vendor sku. + * + * @param vendorName The name of the vendor. + * @param skuName The name of the vendor sku. + * @param previewSubscription Preview subscription ID. + * @param parameters Parameters supplied to the create or update vendor preview subscription operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customer subscription which can use a sku. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PreviewSubscriptionInner createOrUpdate( + String vendorName, String skuName, String previewSubscription, PreviewSubscriptionInner parameters) { + return createOrUpdateAsync(vendorName, skuName, previewSubscription, parameters).block(); + } + + /** + * Creates or updates preview information of a vendor sku. + * + * @param vendorName The name of the vendor. + * @param skuName The name of the vendor sku. + * @param previewSubscription Preview subscription ID. + * @param parameters Parameters supplied to the create or update vendor preview subscription 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 customer subscription which can use a sku. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PreviewSubscriptionInner createOrUpdate( + String vendorName, + String skuName, + String previewSubscription, + PreviewSubscriptionInner parameters, + Context context) { + return createOrUpdateAsync(vendorName, skuName, previewSubscription, parameters, context).block(); + } + + /** + * Gets the preview information of a vendor sku. + * + * @param vendorName The name of the vendor. + * @param skuName The name of the vendor sku. + * @param previewSubscription Preview subscription ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the preview information of a vendor sku. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String vendorName, String skuName, String previewSubscription) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vendorName == null) { + return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); + } + if (skuName == null) { + return Mono.error(new IllegalArgumentException("Parameter skuName is required and cannot be null.")); + } + if (previewSubscription == null) { + return Mono + .error(new IllegalArgumentException("Parameter previewSubscription is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + vendorName, + skuName, + previewSubscription, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the preview information of a vendor sku. + * + * @param vendorName The name of the vendor. + * @param skuName The name of the vendor sku. + * @param previewSubscription Preview subscription ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the preview information of a vendor sku. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String vendorName, String skuName, String previewSubscription, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vendorName == null) { + return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); + } + if (skuName == null) { + return Mono.error(new IllegalArgumentException("Parameter skuName is required and cannot be null.")); + } + if (previewSubscription == null) { + return Mono + .error(new IllegalArgumentException("Parameter previewSubscription is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + vendorName, + skuName, + previewSubscription, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the preview information of a vendor sku. + * + * @param vendorName The name of the vendor. + * @param skuName The name of the vendor sku. + * @param previewSubscription Preview subscription ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the preview information of a vendor sku. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String vendorName, String skuName, String previewSubscription) { + return getWithResponseAsync(vendorName, skuName, previewSubscription) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the preview information of a vendor sku. + * + * @param vendorName The name of the vendor. + * @param skuName The name of the vendor sku. + * @param previewSubscription Preview subscription ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the preview information of a vendor sku. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PreviewSubscriptionInner get(String vendorName, String skuName, String previewSubscription) { + return getAsync(vendorName, skuName, previewSubscription).block(); + } + + /** + * Gets the preview information of a vendor sku. + * + * @param vendorName The name of the vendor. + * @param skuName The name of the vendor sku. + * @param previewSubscription Preview subscription ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the preview information of a vendor sku. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String vendorName, String skuName, String previewSubscription, Context context) { + return getWithResponseAsync(vendorName, skuName, previewSubscription, context).block(); + } + + /** + * Deletes the preview information of a vendor sku. + * + * @param vendorName The name of the vendor. + * @param skuName The name of the vendor sku. + * @param previewSubscription Preview subscription ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 vendorName, String skuName, String previewSubscription) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vendorName == null) { + return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); + } + if (skuName == null) { + return Mono.error(new IllegalArgumentException("Parameter skuName is required and cannot be null.")); + } + if (previewSubscription == null) { + return Mono + .error(new IllegalArgumentException("Parameter previewSubscription is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + vendorName, + skuName, + previewSubscription, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the preview information of a vendor sku. + * + * @param vendorName The name of the vendor. + * @param skuName The name of the vendor sku. + * @param previewSubscription Preview subscription ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 vendorName, String skuName, String previewSubscription, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vendorName == null) { + return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); + } + if (skuName == null) { + return Mono.error(new IllegalArgumentException("Parameter skuName is required and cannot be null.")); + } + if (previewSubscription == null) { + return Mono + .error(new IllegalArgumentException("Parameter previewSubscription is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + vendorName, + skuName, + previewSubscription, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the preview information of a vendor sku. + * + * @param vendorName The name of the vendor. + * @param skuName The name of the vendor sku. + * @param previewSubscription Preview subscription ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 PollerFlux, Void> beginDeleteAsync( + String vendorName, String skuName, String previewSubscription) { + Mono>> mono = deleteWithResponseAsync(vendorName, skuName, previewSubscription); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the preview information of a vendor sku. + * + * @param vendorName The name of the vendor. + * @param skuName The name of the vendor sku. + * @param previewSubscription Preview subscription ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 PollerFlux, Void> beginDeleteAsync( + String vendorName, String skuName, String previewSubscription, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(vendorName, skuName, previewSubscription, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the preview information of a vendor sku. + * + * @param vendorName The name of the vendor. + * @param skuName The name of the vendor sku. + * @param previewSubscription Preview subscription ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + public SyncPoller, Void> beginDelete( + String vendorName, String skuName, String previewSubscription) { + return beginDeleteAsync(vendorName, skuName, previewSubscription).getSyncPoller(); + } + + /** + * Deletes the preview information of a vendor sku. + * + * @param vendorName The name of the vendor. + * @param skuName The name of the vendor sku. + * @param previewSubscription Preview subscription ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + public SyncPoller, Void> beginDelete( + String vendorName, String skuName, String previewSubscription, Context context) { + return beginDeleteAsync(vendorName, skuName, previewSubscription, context).getSyncPoller(); + } + + /** + * Deletes the preview information of a vendor sku. + * + * @param vendorName The name of the vendor. + * @param skuName The name of the vendor sku. + * @param previewSubscription Preview subscription ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 vendorName, String skuName, String previewSubscription) { + return beginDeleteAsync(vendorName, skuName, previewSubscription) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the preview information of a vendor sku. + * + * @param vendorName The name of the vendor. + * @param skuName The name of the vendor sku. + * @param previewSubscription Preview subscription ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 vendorName, String skuName, String previewSubscription, Context context) { + return beginDeleteAsync(vendorName, skuName, previewSubscription, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the preview information of a vendor sku. + * + * @param vendorName The name of the vendor. + * @param skuName The name of the vendor sku. + * @param previewSubscription Preview subscription ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 vendorName, String skuName, String previewSubscription) { + deleteAsync(vendorName, skuName, previewSubscription).block(); + } + + /** + * Deletes the preview information of a vendor sku. + * + * @param vendorName The name of the vendor. + * @param skuName The name of the vendor sku. + * @param previewSubscription Preview subscription ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 vendorName, String skuName, String previewSubscription, Context context) { + deleteAsync(vendorName, skuName, previewSubscription, 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 a list of customer subscriptions which can use a sku. + */ + @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 a list of customer subscriptions which can use a sku. + */ + @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/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorSkuPreviewsImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorSkuPreviewsImpl.java new file mode 100644 index 000000000000..942895fafa34 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorSkuPreviewsImpl.java @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.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.hybridnetwork.fluent.VendorSkuPreviewsClient; +import com.azure.resourcemanager.hybridnetwork.fluent.models.PreviewSubscriptionInner; +import com.azure.resourcemanager.hybridnetwork.models.PreviewSubscription; +import com.azure.resourcemanager.hybridnetwork.models.VendorSkuPreviews; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VendorSkuPreviewsImpl implements VendorSkuPreviews { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VendorSkuPreviewsImpl.class); + + private final VendorSkuPreviewsClient innerClient; + + private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager; + + public VendorSkuPreviewsImpl( + VendorSkuPreviewsClient innerClient, + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String vendorName, String skuName) { + PagedIterable inner = this.serviceClient().list(vendorName, skuName); + return Utils.mapPage(inner, inner1 -> new PreviewSubscriptionImpl(inner1, this.manager())); + } + + public PagedIterable list(String vendorName, String skuName, Context context) { + PagedIterable inner = this.serviceClient().list(vendorName, skuName, context); + return Utils.mapPage(inner, inner1 -> new PreviewSubscriptionImpl(inner1, this.manager())); + } + + public PreviewSubscription get(String vendorName, String skuName, String previewSubscription) { + PreviewSubscriptionInner inner = this.serviceClient().get(vendorName, skuName, previewSubscription); + if (inner != null) { + return new PreviewSubscriptionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String vendorName, String skuName, String previewSubscription, Context context) { + Response inner = + this.serviceClient().getWithResponse(vendorName, skuName, previewSubscription, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PreviewSubscriptionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String vendorName, String skuName, String previewSubscription) { + this.serviceClient().delete(vendorName, skuName, previewSubscription); + } + + public void delete(String vendorName, String skuName, String previewSubscription, Context context) { + this.serviceClient().delete(vendorName, skuName, previewSubscription, context); + } + + public PreviewSubscription getById(String id) { + String vendorName = Utils.getValueFromIdByName(id, "vendors"); + if (vendorName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vendors'.", id))); + } + String skuName = Utils.getValueFromIdByName(id, "vendorSkus"); + if (skuName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vendorSkus'.", id))); + } + String previewSubscription = Utils.getValueFromIdByName(id, "previewSubscriptions"); + if (previewSubscription == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'previewSubscriptions'.", + id))); + } + return this.getWithResponse(vendorName, skuName, previewSubscription, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String vendorName = Utils.getValueFromIdByName(id, "vendors"); + if (vendorName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vendors'.", id))); + } + String skuName = Utils.getValueFromIdByName(id, "vendorSkus"); + if (skuName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vendorSkus'.", id))); + } + String previewSubscription = Utils.getValueFromIdByName(id, "previewSubscriptions"); + if (previewSubscription == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'previewSubscriptions'.", + id))); + } + return this.getWithResponse(vendorName, skuName, previewSubscription, context); + } + + public void deleteById(String id) { + String vendorName = Utils.getValueFromIdByName(id, "vendors"); + if (vendorName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vendors'.", id))); + } + String skuName = Utils.getValueFromIdByName(id, "vendorSkus"); + if (skuName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vendorSkus'.", id))); + } + String previewSubscription = Utils.getValueFromIdByName(id, "previewSubscriptions"); + if (previewSubscription == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'previewSubscriptions'.", + id))); + } + this.delete(vendorName, skuName, previewSubscription, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String vendorName = Utils.getValueFromIdByName(id, "vendors"); + if (vendorName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vendors'.", id))); + } + String skuName = Utils.getValueFromIdByName(id, "vendorSkus"); + if (skuName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vendorSkus'.", id))); + } + String previewSubscription = Utils.getValueFromIdByName(id, "previewSubscriptions"); + if (previewSubscription == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'previewSubscriptions'.", + id))); + } + this.delete(vendorName, skuName, previewSubscription, context); + } + + private VendorSkuPreviewsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { + return this.serviceManager; + } + + public PreviewSubscriptionImpl define(String name) { + return new PreviewSubscriptionImpl(name, this.manager()); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorSkusClientImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorSkusClientImpl.java new file mode 100644 index 000000000000..b10d368cce9a --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorSkusClientImpl.java @@ -0,0 +1,988 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.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.hybridnetwork.fluent.VendorSkusClient; +import com.azure.resourcemanager.hybridnetwork.fluent.models.VendorSkuInner; +import com.azure.resourcemanager.hybridnetwork.models.VendorSkuListResult; +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 VendorSkusClient. */ +public final class VendorSkusClientImpl implements VendorSkusClient { + private final ClientLogger logger = new ClientLogger(VendorSkusClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VendorSkusService service; + + /** The service client containing this operation class. */ + private final HybridNetworkManagementClientImpl client; + + /** + * Initializes an instance of VendorSkusClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VendorSkusClientImpl(HybridNetworkManagementClientImpl client) { + this.service = + RestProxy.create(VendorSkusService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HybridNetworkManagementClientVendorSkus to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HybridNetworkManagem") + private interface VendorSkusService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/vendors/{vendorName}/vendorSkus" + + "/{skuName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("vendorName") String vendorName, + @PathParam("skuName") String skuName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/vendors/{vendorName}/vendorSkus" + + "/{skuName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("vendorName") String vendorName, + @PathParam("skuName") String skuName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/vendors/{vendorName}/vendorSkus" + + "/{skuName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("vendorName") String vendorName, + @PathParam("skuName") String skuName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VendorSkuInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/vendors/{vendorName}/vendorSkus") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("vendorName") String vendorName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified sku. This operation can take up to 2 hours to complete. This is expected service behavior. + * + * @param vendorName The name of the vendor. + * @param skuName The name of 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 vendorName, String skuName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vendorName == null) { + return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); + } + if (skuName == null) { + return Mono.error(new IllegalArgumentException("Parameter skuName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + vendorName, + skuName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified sku. This operation can take up to 2 hours to complete. This is expected service behavior. + * + * @param vendorName The name of the vendor. + * @param skuName The name of 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 vendorName, String skuName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vendorName == null) { + return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); + } + if (skuName == null) { + return Mono.error(new IllegalArgumentException("Parameter skuName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + vendorName, + skuName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified sku. This operation can take up to 2 hours to complete. This is expected service behavior. + * + * @param vendorName The name of the vendor. + * @param skuName The name of 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 PollerFlux, Void> beginDeleteAsync(String vendorName, String skuName) { + Mono>> mono = deleteWithResponseAsync(vendorName, skuName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified sku. This operation can take up to 2 hours to complete. This is expected service behavior. + * + * @param vendorName The name of the vendor. + * @param skuName The name of 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 PollerFlux, Void> beginDeleteAsync(String vendorName, String skuName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(vendorName, skuName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified sku. This operation can take up to 2 hours to complete. This is expected service behavior. + * + * @param vendorName The name of the vendor. + * @param skuName The name of 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) + public SyncPoller, Void> beginDelete(String vendorName, String skuName) { + return beginDeleteAsync(vendorName, skuName).getSyncPoller(); + } + + /** + * Deletes the specified sku. This operation can take up to 2 hours to complete. This is expected service behavior. + * + * @param vendorName The name of the vendor. + * @param skuName The name of 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) + public SyncPoller, Void> beginDelete(String vendorName, String skuName, Context context) { + return beginDeleteAsync(vendorName, skuName, context).getSyncPoller(); + } + + /** + * Deletes the specified sku. This operation can take up to 2 hours to complete. This is expected service behavior. + * + * @param vendorName The name of the vendor. + * @param skuName The name of 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 vendorName, String skuName) { + return beginDeleteAsync(vendorName, skuName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified sku. This operation can take up to 2 hours to complete. This is expected service behavior. + * + * @param vendorName The name of the vendor. + * @param skuName The name of 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 deleteAsync(String vendorName, String skuName, Context context) { + return beginDeleteAsync(vendorName, skuName, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified sku. This operation can take up to 2 hours to complete. This is expected service behavior. + * + * @param vendorName The name of the vendor. + * @param skuName The name of 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 vendorName, String skuName) { + deleteAsync(vendorName, skuName).block(); + } + + /** + * Deletes the specified sku. This operation can take up to 2 hours to complete. This is expected service behavior. + * + * @param vendorName The name of the vendor. + * @param skuName The name of 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String vendorName, String skuName, Context context) { + deleteAsync(vendorName, skuName, context).block(); + } + + /** + * Gets information about the specified sku. + * + * @param vendorName The name of the vendor. + * @param skuName The name of 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 information about the specified sku. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String vendorName, String skuName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vendorName == null) { + return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); + } + if (skuName == null) { + return Mono.error(new IllegalArgumentException("Parameter skuName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + vendorName, + skuName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets information about the specified sku. + * + * @param vendorName The name of the vendor. + * @param skuName The name of 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 information about the specified sku. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String vendorName, String skuName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vendorName == null) { + return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); + } + if (skuName == null) { + return Mono.error(new IllegalArgumentException("Parameter skuName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + vendorName, + skuName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets information about the specified sku. + * + * @param vendorName The name of the vendor. + * @param skuName The name of 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 information about the specified sku. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String vendorName, String skuName) { + return getWithResponseAsync(vendorName, skuName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets information about the specified sku. + * + * @param vendorName The name of the vendor. + * @param skuName The name of 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 information about the specified sku. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VendorSkuInner get(String vendorName, String skuName) { + return getAsync(vendorName, skuName).block(); + } + + /** + * Gets information about the specified sku. + * + * @param vendorName The name of the vendor. + * @param skuName The name of 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 information about the specified sku. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String vendorName, String skuName, Context context) { + return getWithResponseAsync(vendorName, skuName, context).block(); + } + + /** + * Creates or updates a sku. This operation can take up to 2 hours to complete. This is expected service behavior. + * + * @param vendorName The name of the vendor. + * @param skuName The name of the sku. + * @param parameters Parameters supplied to the create or update 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 sku sub resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String vendorName, String skuName, VendorSkuInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vendorName == null) { + return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); + } + if (skuName == null) { + return Mono.error(new IllegalArgumentException("Parameter skuName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + vendorName, + skuName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a sku. This operation can take up to 2 hours to complete. This is expected service behavior. + * + * @param vendorName The name of the vendor. + * @param skuName The name of the sku. + * @param parameters Parameters supplied to the create or update 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 sku sub resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String vendorName, String skuName, VendorSkuInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vendorName == null) { + return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); + } + if (skuName == null) { + return Mono.error(new IllegalArgumentException("Parameter skuName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + vendorName, + skuName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates a sku. This operation can take up to 2 hours to complete. This is expected service behavior. + * + * @param vendorName The name of the vendor. + * @param skuName The name of the sku. + * @param parameters Parameters supplied to the create or update 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 sku sub resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VendorSkuInner> beginCreateOrUpdateAsync( + String vendorName, String skuName, VendorSkuInner parameters) { + Mono>> mono = createOrUpdateWithResponseAsync(vendorName, skuName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), VendorSkuInner.class, VendorSkuInner.class, Context.NONE); + } + + /** + * Creates or updates a sku. This operation can take up to 2 hours to complete. This is expected service behavior. + * + * @param vendorName The name of the vendor. + * @param skuName The name of the sku. + * @param parameters Parameters supplied to the create or update 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 sku sub resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VendorSkuInner> beginCreateOrUpdateAsync( + String vendorName, String skuName, VendorSkuInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(vendorName, skuName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), VendorSkuInner.class, VendorSkuInner.class, context); + } + + /** + * Creates or updates a sku. This operation can take up to 2 hours to complete. This is expected service behavior. + * + * @param vendorName The name of the vendor. + * @param skuName The name of the sku. + * @param parameters Parameters supplied to the create or update 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 sku sub resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VendorSkuInner> beginCreateOrUpdate( + String vendorName, String skuName, VendorSkuInner parameters) { + return beginCreateOrUpdateAsync(vendorName, skuName, parameters).getSyncPoller(); + } + + /** + * Creates or updates a sku. This operation can take up to 2 hours to complete. This is expected service behavior. + * + * @param vendorName The name of the vendor. + * @param skuName The name of the sku. + * @param parameters Parameters supplied to the create or update 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 sku sub resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VendorSkuInner> beginCreateOrUpdate( + String vendorName, String skuName, VendorSkuInner parameters, Context context) { + return beginCreateOrUpdateAsync(vendorName, skuName, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates a sku. This operation can take up to 2 hours to complete. This is expected service behavior. + * + * @param vendorName The name of the vendor. + * @param skuName The name of the sku. + * @param parameters Parameters supplied to the create or update 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 sku sub resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String vendorName, String skuName, VendorSkuInner parameters) { + return beginCreateOrUpdateAsync(vendorName, skuName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a sku. This operation can take up to 2 hours to complete. This is expected service behavior. + * + * @param vendorName The name of the vendor. + * @param skuName The name of the sku. + * @param parameters Parameters supplied to the create or update 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 sku sub resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String vendorName, String skuName, VendorSkuInner parameters, Context context) { + return beginCreateOrUpdateAsync(vendorName, skuName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a sku. This operation can take up to 2 hours to complete. This is expected service behavior. + * + * @param vendorName The name of the vendor. + * @param skuName The name of the sku. + * @param parameters Parameters supplied to the create or update 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 sku sub resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VendorSkuInner createOrUpdate(String vendorName, String skuName, VendorSkuInner parameters) { + return createOrUpdateAsync(vendorName, skuName, parameters).block(); + } + + /** + * Creates or updates a sku. This operation can take up to 2 hours to complete. This is expected service behavior. + * + * @param vendorName The name of the vendor. + * @param skuName The name of the sku. + * @param parameters Parameters supplied to the create or update 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 sku sub resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VendorSkuInner createOrUpdate( + String vendorName, String skuName, VendorSkuInner parameters, Context context) { + return createOrUpdateAsync(vendorName, skuName, parameters, context).block(); + } + + /** + * Lists all the skus of a vendor. + * + * @param vendorName The name of the vendor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list vendor sku API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String vendorName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vendorName == null) { + return Mono.error(new IllegalArgumentException("Parameter vendorName is required 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(), + vendorName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the skus of a vendor. + * + * @param vendorName The name of the vendor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list vendor sku API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String vendorName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vendorName == null) { + return Mono.error(new IllegalArgumentException("Parameter vendorName is required 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(), + vendorName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the skus of a vendor. + * + * @param vendorName The name of the vendor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list vendor sku API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String vendorName) { + return new PagedFlux<>(() -> listSinglePageAsync(vendorName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the skus of a vendor. + * + * @param vendorName The name of the vendor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list vendor sku API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String vendorName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(vendorName, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the skus of a vendor. + * + * @param vendorName The name of the vendor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list vendor sku API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String vendorName) { + return new PagedIterable<>(listAsync(vendorName)); + } + + /** + * Lists all the skus of a vendor. + * + * @param vendorName The name of the vendor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list vendor sku API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String vendorName, Context context) { + return new PagedIterable<>(listAsync(vendorName, 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 response for list vendor sku API service call. + */ + @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 response for list vendor sku API service call. + */ + @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/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorSkusImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorSkusImpl.java new file mode 100644 index 000000000000..f6b2330a99e4 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorSkusImpl.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.hybridnetwork.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.hybridnetwork.fluent.VendorSkusClient; +import com.azure.resourcemanager.hybridnetwork.fluent.models.VendorSkuInner; +import com.azure.resourcemanager.hybridnetwork.models.VendorSku; +import com.azure.resourcemanager.hybridnetwork.models.VendorSkus; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VendorSkusImpl implements VendorSkus { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VendorSkusImpl.class); + + private final VendorSkusClient innerClient; + + private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager; + + public VendorSkusImpl( + VendorSkusClient innerClient, com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String vendorName, String skuName) { + this.serviceClient().delete(vendorName, skuName); + } + + public void delete(String vendorName, String skuName, Context context) { + this.serviceClient().delete(vendorName, skuName, context); + } + + public VendorSku get(String vendorName, String skuName) { + VendorSkuInner inner = this.serviceClient().get(vendorName, skuName); + if (inner != null) { + return new VendorSkuImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse(String vendorName, String skuName, Context context) { + Response inner = this.serviceClient().getWithResponse(vendorName, skuName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VendorSkuImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list(String vendorName) { + PagedIterable inner = this.serviceClient().list(vendorName); + return Utils.mapPage(inner, inner1 -> new VendorSkuImpl(inner1, this.manager())); + } + + public PagedIterable list(String vendorName, Context context) { + PagedIterable inner = this.serviceClient().list(vendorName, context); + return Utils.mapPage(inner, inner1 -> new VendorSkuImpl(inner1, this.manager())); + } + + public VendorSku getById(String id) { + String vendorName = Utils.getValueFromIdByName(id, "vendors"); + if (vendorName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vendors'.", id))); + } + String skuName = Utils.getValueFromIdByName(id, "vendorSkus"); + if (skuName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vendorSkus'.", id))); + } + return this.getWithResponse(vendorName, skuName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String vendorName = Utils.getValueFromIdByName(id, "vendors"); + if (vendorName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vendors'.", id))); + } + String skuName = Utils.getValueFromIdByName(id, "vendorSkus"); + if (skuName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vendorSkus'.", id))); + } + return this.getWithResponse(vendorName, skuName, context); + } + + public void deleteById(String id) { + String vendorName = Utils.getValueFromIdByName(id, "vendors"); + if (vendorName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vendors'.", id))); + } + String skuName = Utils.getValueFromIdByName(id, "vendorSkus"); + if (skuName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vendorSkus'.", id))); + } + this.delete(vendorName, skuName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String vendorName = Utils.getValueFromIdByName(id, "vendors"); + if (vendorName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vendors'.", id))); + } + String skuName = Utils.getValueFromIdByName(id, "vendorSkus"); + if (skuName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vendorSkus'.", id))); + } + this.delete(vendorName, skuName, context); + } + + private VendorSkusClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { + return this.serviceManager; + } + + public VendorSkuImpl define(String name) { + return new VendorSkuImpl(name, this.manager()); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorsClientImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorsClientImpl.java new file mode 100644 index 000000000000..a79e1a85bf70 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorsClientImpl.java @@ -0,0 +1,933 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.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.hybridnetwork.fluent.VendorsClient; +import com.azure.resourcemanager.hybridnetwork.fluent.models.VendorInner; +import com.azure.resourcemanager.hybridnetwork.models.VendorListResult; +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 VendorsClient. */ +public final class VendorsClientImpl implements VendorsClient { + private final ClientLogger logger = new ClientLogger(VendorsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VendorsService service; + + /** The service client containing this operation class. */ + private final HybridNetworkManagementClientImpl client; + + /** + * Initializes an instance of VendorsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VendorsClientImpl(HybridNetworkManagementClientImpl client) { + this.service = RestProxy.create(VendorsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HybridNetworkManagementClientVendors to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HybridNetworkManagem") + private interface VendorsService { + @Headers({"Content-Type: application/json"}) + @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/vendors/{vendorName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("vendorName") String vendorName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/vendors/{vendorName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("vendorName") String vendorName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put("/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/vendors/{vendorName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("vendorName") String vendorName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VendorInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/vendors") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified vendor. + * + * @param vendorName The name of the vendor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 vendorName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vendorName == null) { + return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + vendorName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified vendor. + * + * @param vendorName The name of the vendor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 vendorName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vendorName == null) { + return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + vendorName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified vendor. + * + * @param vendorName The name of the vendor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 PollerFlux, Void> beginDeleteAsync(String vendorName) { + Mono>> mono = deleteWithResponseAsync(vendorName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified vendor. + * + * @param vendorName The name of the vendor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 PollerFlux, Void> beginDeleteAsync(String vendorName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(vendorName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified vendor. + * + * @param vendorName The name of the vendor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + public SyncPoller, Void> beginDelete(String vendorName) { + return beginDeleteAsync(vendorName).getSyncPoller(); + } + + /** + * Deletes the specified vendor. + * + * @param vendorName The name of the vendor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + public SyncPoller, Void> beginDelete(String vendorName, Context context) { + return beginDeleteAsync(vendorName, context).getSyncPoller(); + } + + /** + * Deletes the specified vendor. + * + * @param vendorName The name of the vendor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 vendorName) { + return beginDeleteAsync(vendorName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified vendor. + * + * @param vendorName The name of the vendor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 vendorName, Context context) { + return beginDeleteAsync(vendorName, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified vendor. + * + * @param vendorName The name of the vendor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 vendorName) { + deleteAsync(vendorName).block(); + } + + /** + * Deletes the specified vendor. + * + * @param vendorName The name of the vendor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 vendorName, Context context) { + deleteAsync(vendorName, context).block(); + } + + /** + * Gets information about the specified vendor. + * + * @param vendorName The name of the vendor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified vendor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String vendorName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vendorName == null) { + return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + vendorName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets information about the specified vendor. + * + * @param vendorName The name of the vendor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified vendor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String vendorName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vendorName == null) { + return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + vendorName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets information about the specified vendor. + * + * @param vendorName The name of the vendor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified vendor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String vendorName) { + return getWithResponseAsync(vendorName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets information about the specified vendor. + * + * @param vendorName The name of the vendor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified vendor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VendorInner get(String vendorName) { + return getAsync(vendorName).block(); + } + + /** + * Gets information about the specified vendor. + * + * @param vendorName The name of the vendor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified vendor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String vendorName, Context context) { + return getWithResponseAsync(vendorName, context).block(); + } + + /** + * Creates or updates a vendor. + * + * @param vendorName The name of the vendor. + * @param parameters Parameters supplied to the create vendor operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vendor resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String vendorName, VendorInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vendorName == null) { + return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + vendorName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a vendor. + * + * @param vendorName The name of the vendor. + * @param parameters Parameters supplied to the create vendor 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 vendor resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String vendorName, VendorInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vendorName == null) { + return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + vendorName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates a vendor. + * + * @param vendorName The name of the vendor. + * @param parameters Parameters supplied to the create vendor operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vendor resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VendorInner> beginCreateOrUpdateAsync( + String vendorName, VendorInner parameters) { + Mono>> mono = createOrUpdateWithResponseAsync(vendorName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), VendorInner.class, VendorInner.class, Context.NONE); + } + + /** + * Creates or updates a vendor. + * + * @param vendorName The name of the vendor. + * @param parameters Parameters supplied to the create vendor 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 vendor resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VendorInner> beginCreateOrUpdateAsync( + String vendorName, VendorInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = createOrUpdateWithResponseAsync(vendorName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), VendorInner.class, VendorInner.class, context); + } + + /** + * Creates or updates a vendor. + * + * @param vendorName The name of the vendor. + * @param parameters Parameters supplied to the create vendor operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vendor resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VendorInner> beginCreateOrUpdate( + String vendorName, VendorInner parameters) { + return beginCreateOrUpdateAsync(vendorName, parameters).getSyncPoller(); + } + + /** + * Creates or updates a vendor. + * + * @param vendorName The name of the vendor. + * @param parameters Parameters supplied to the create vendor 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 vendor resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VendorInner> beginCreateOrUpdate( + String vendorName, VendorInner parameters, Context context) { + return beginCreateOrUpdateAsync(vendorName, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates a vendor. + * + * @param vendorName The name of the vendor. + * @param parameters Parameters supplied to the create vendor operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vendor resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String vendorName, VendorInner parameters) { + return beginCreateOrUpdateAsync(vendorName, parameters).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a vendor. + * + * @param vendorName The name of the vendor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vendor resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String vendorName) { + final VendorInner parameters = null; + return beginCreateOrUpdateAsync(vendorName, parameters).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a vendor. + * + * @param vendorName The name of the vendor. + * @param parameters Parameters supplied to the create vendor 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 vendor resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String vendorName, VendorInner parameters, Context context) { + return beginCreateOrUpdateAsync(vendorName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a vendor. + * + * @param vendorName The name of the vendor. + * @param parameters Parameters supplied to the create vendor operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vendor resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VendorInner createOrUpdate(String vendorName, VendorInner parameters) { + return createOrUpdateAsync(vendorName, parameters).block(); + } + + /** + * Creates or updates a vendor. + * + * @param vendorName The name of the vendor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vendor resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VendorInner createOrUpdate(String vendorName) { + final VendorInner parameters = null; + return createOrUpdateAsync(vendorName, parameters).block(); + } + + /** + * Creates or updates a vendor. + * + * @param vendorName The name of the vendor. + * @param parameters Parameters supplied to the create vendor 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 vendor resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VendorInner createOrUpdate(String vendorName, VendorInner parameters, Context context) { + return createOrUpdateAsync(vendorName, parameters, context).block(); + } + + /** + * Lists all the vendors in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for vendors API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the vendors in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for vendors API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the vendors in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for vendors API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the vendors in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for vendors API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the vendors in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for vendors API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all the vendors in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for vendors API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(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 response for vendors API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The 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 response for vendors API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorsImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorsImpl.java new file mode 100644 index 000000000000..89ac17c52e23 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorsImpl.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.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.hybridnetwork.fluent.VendorsClient; +import com.azure.resourcemanager.hybridnetwork.fluent.models.VendorInner; +import com.azure.resourcemanager.hybridnetwork.models.Vendor; +import com.azure.resourcemanager.hybridnetwork.models.Vendors; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VendorsImpl implements Vendors { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VendorsImpl.class); + + private final VendorsClient innerClient; + + private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager; + + public VendorsImpl( + VendorsClient innerClient, com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete(String vendorName) { + this.serviceClient().delete(vendorName); + } + + public void delete(String vendorName, Context context) { + this.serviceClient().delete(vendorName, context); + } + + public Vendor get(String vendorName) { + VendorInner inner = this.serviceClient().get(vendorName); + if (inner != null) { + return new VendorImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse(String vendorName, Context context) { + Response inner = this.serviceClient().getWithResponse(vendorName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VendorImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new VendorImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new VendorImpl(inner1, this.manager())); + } + + public Vendor getById(String id) { + String vendorName = Utils.getValueFromIdByName(id, "vendors"); + if (vendorName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vendors'.", id))); + } + return this.getWithResponse(vendorName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String vendorName = Utils.getValueFromIdByName(id, "vendors"); + if (vendorName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vendors'.", id))); + } + return this.getWithResponse(vendorName, context); + } + + public void deleteById(String id) { + String vendorName = Utils.getValueFromIdByName(id, "vendors"); + if (vendorName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vendors'.", id))); + } + this.delete(vendorName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String vendorName = Utils.getValueFromIdByName(id, "vendors"); + if (vendorName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vendors'.", id))); + } + this.delete(vendorName, context); + } + + private VendorsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { + return this.serviceManager; + } + + public VendorImpl define(String name) { + return new VendorImpl(name, this.manager()); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/package-info.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/package-info.java new file mode 100644 index 000000000000..05b52e0577a4 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the implementations for HybridNetworkManagementClient. The definitions in this swagger + * specification will be used to manage the Hybrid Network resources. + */ +package com.azure.resourcemanager.hybridnetwork.implementation; diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/CustomProfile.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/CustomProfile.java new file mode 100644 index 000000000000..b294cb5f83ae --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/CustomProfile.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.hybridnetwork.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; + +/** Specifies the custom settings for the virtual machine. */ +@Fluent +public final class CustomProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomProfile.class); + + /* + * Path for metadata configuration. + */ + @JsonProperty(value = "metadataConfigurationPath") + private String metadataConfigurationPath; + + /** + * Get the metadataConfigurationPath property: Path for metadata configuration. + * + * @return the metadataConfigurationPath value. + */ + public String metadataConfigurationPath() { + return this.metadataConfigurationPath; + } + + /** + * Set the metadataConfigurationPath property: Path for metadata configuration. + * + * @param metadataConfigurationPath the metadataConfigurationPath value to set. + * @return the CustomProfile object itself. + */ + public CustomProfile withMetadataConfigurationPath(String metadataConfigurationPath) { + this.metadataConfigurationPath = metadataConfigurationPath; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/DataDisk.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/DataDisk.java new file mode 100644 index 000000000000..58df45d9cd61 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/DataDisk.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.hybridnetwork.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; + +/** + * Specifies information about the operating system disk used by the virtual machine. <br><br> For more + * information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + */ +@Fluent +public final class DataDisk { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataDisk.class); + + /* + * Specifies how the virtual machine should be created. + */ + @JsonProperty(value = "createOption") + private DiskCreateOptionTypes createOption; + + /* + * The name of data disk. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Specifies the size of an empty disk in gigabytes. This element can be + * used to overwrite the size of the disk in a virtual machine image. + */ + @JsonProperty(value = "diskSizeGB") + private Integer diskSizeGB; + + /** + * Get the createOption property: Specifies how the virtual machine should be created. + * + * @return the createOption value. + */ + public DiskCreateOptionTypes createOption() { + return this.createOption; + } + + /** + * Set the createOption property: Specifies how the virtual machine should be created. + * + * @param createOption the createOption value to set. + * @return the DataDisk object itself. + */ + public DataDisk withCreateOption(DiskCreateOptionTypes createOption) { + this.createOption = createOption; + return this; + } + + /** + * Get the name property: The name of data disk. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of data disk. + * + * @param name the name value to set. + * @return the DataDisk object itself. + */ + public DataDisk withName(String name) { + this.name = name; + return this; + } + + /** + * Get the diskSizeGB property: Specifies the size of an empty disk in gigabytes. This element can be used to + * overwrite the size of the disk in a virtual machine image. + * + * @return the diskSizeGB value. + */ + public Integer diskSizeGB() { + return this.diskSizeGB; + } + + /** + * Set the diskSizeGB property: Specifies the size of an empty disk in gigabytes. This element can be used to + * overwrite the size of the disk in a virtual machine image. + * + * @param diskSizeGB the diskSizeGB value to set. + * @return the DataDisk object itself. + */ + public DataDisk withDiskSizeGB(Integer diskSizeGB) { + this.diskSizeGB = diskSizeGB; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Device.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Device.java new file mode 100644 index 000000000000..f84a781e15e0 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Device.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.hybridnetwork.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridnetwork.fluent.models.DeviceInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of Device. */ +public interface Device { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the status property: The current device status. + * + * @return the status value. + */ + Status status(); + + /** + * Gets the provisioningState property: The provisioning state of the device resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the azureStackEdge property: The reference to the Azure stack edge device. Once set, it cannot be updated. + * + * @return the azureStackEdge value. + */ + SubResource azureStackEdge(); + + /** + * Gets the networkFunctions property: The list of network functions deployed on the device. + * + * @return the networkFunctions value. + */ + List networkFunctions(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.hybridnetwork.fluent.models.DeviceInner object. + * + * @return the inner object. + */ + DeviceInner innerModel(); + + /** The entirety of the Device definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The Device definition stages. */ + interface DefinitionStages { + /** The first stage of the Device definition. */ + interface Blank extends WithLocation { + } + /** The stage of the Device definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the Device definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the Device definition which contains all the minimum required properties for the resource to be + * created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithAzureStackEdge { + /** + * Executes the create request. + * + * @return the created resource. + */ + Device create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Device create(Context context); + } + /** The stage of the Device definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the Device definition allowing to specify azureStackEdge. */ + interface WithAzureStackEdge { + /** + * Specifies the azureStackEdge property: The reference to the Azure stack edge device. Once set, it cannot + * be updated.. + * + * @param azureStackEdge The reference to the Azure stack edge device. Once set, it cannot be updated. + * @return the next definition stage. + */ + WithCreate withAzureStackEdge(SubResource azureStackEdge); + } + } + /** + * Begins update for the Device resource. + * + * @return the stage of resource update. + */ + Device.Update update(); + + /** The template for Device update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Device apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Device apply(Context context); + } + /** The Device update stages. */ + interface UpdateStages { + /** The stage of the Device update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Device refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Device refresh(Context context); + + /** + * List the registration key for the device. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the device registration key. + */ + DeviceRegistrationKey listRegistrationKey(); + + /** + * List the registration key for the device. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the device registration key. + */ + Response listRegistrationKeyWithResponse(Context context); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/DeviceListResult.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/DeviceListResult.java new file mode 100644 index 000000000000..53ea47a9b362 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/DeviceListResult.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.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybridnetwork.fluent.models.DeviceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for devices API service call. */ +@Fluent +public final class DeviceListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DeviceListResult.class); + + /* + * A list of devices. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of devices. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of devices. + * + * @param value the value value to set. + * @return the DeviceListResult object itself. + */ + public DeviceListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/DeviceRegistrationKey.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/DeviceRegistrationKey.java new file mode 100644 index 000000000000..383675fb129a --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/DeviceRegistrationKey.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.resourcemanager.hybridnetwork.fluent.models.DeviceRegistrationKeyInner; + +/** An immutable client-side representation of DeviceRegistrationKey. */ +public interface DeviceRegistrationKey { + /** + * Gets the registrationKey property: The registration key for the device. + * + * @return the registrationKey value. + */ + String registrationKey(); + + /** + * Gets the inner com.azure.resourcemanager.hybridnetwork.fluent.models.DeviceRegistrationKeyInner object. + * + * @return the inner object. + */ + DeviceRegistrationKeyInner innerModel(); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/DeviceType.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/DeviceType.java new file mode 100644 index 000000000000..41adc9834475 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/DeviceType.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.hybridnetwork.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DeviceType. */ +public final class DeviceType extends ExpandableStringEnum { + /** Static value Unknown for DeviceType. */ + public static final DeviceType UNKNOWN = fromString("Unknown"); + + /** Static value AzureStackEdge for DeviceType. */ + public static final DeviceType AZURE_STACK_EDGE = fromString("AzureStackEdge"); + + /** + * Creates or finds a DeviceType from its string representation. + * + * @param name a name to look for. + * @return the corresponding DeviceType. + */ + @JsonCreator + public static DeviceType fromString(String name) { + return fromString(name, DeviceType.class); + } + + /** @return known DeviceType values. */ + public static Collection values() { + return values(DeviceType.class); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Devices.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Devices.java new file mode 100644 index 000000000000..9d6204626425 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Devices.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.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 Devices. */ +public interface Devices { + /** + * Deletes the specified device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The name of the device resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String deviceName); + + /** + * Deletes the specified device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The name of the device resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String deviceName, Context context); + + /** + * Gets information about the specified device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The name of the device resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified device. + */ + Device getByResourceGroup(String resourceGroupName, String deviceName); + + /** + * Gets information about the specified device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The name of the device resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified device. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String deviceName, Context context); + + /** + * Lists all the devices in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for devices API service call. + */ + PagedIterable list(); + + /** + * Lists all the devices in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for devices API service call. + */ + PagedIterable list(Context context); + + /** + * Lists all the device resource in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for devices API service call. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all the device resource in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for devices API service call. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * List the registration key for the device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The name of the device resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the device registration key. + */ + DeviceRegistrationKey listRegistrationKey(String resourceGroupName, String deviceName); + + /** + * List the registration key for the device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The name of the device resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the device registration key. + */ + Response listRegistrationKeyWithResponse( + String resourceGroupName, String deviceName, Context context); + + /** + * Gets information about the specified device. + * + * @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 information about the specified device. + */ + Device getById(String id); + + /** + * Gets information about the specified device. + * + * @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 information about the specified device. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified device. + * + * @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 specified device. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Device resource. + * + * @param name resource name. + * @return the first stage of the new Device definition. + */ + Device.DefinitionStages.Blank define(String name); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/DiskCreateOptionTypes.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/DiskCreateOptionTypes.java new file mode 100644 index 000000000000..b359790d43eb --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/DiskCreateOptionTypes.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.hybridnetwork.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DiskCreateOptionTypes. */ +public final class DiskCreateOptionTypes extends ExpandableStringEnum { + /** Static value Unknown for DiskCreateOptionTypes. */ + public static final DiskCreateOptionTypes UNKNOWN = fromString("Unknown"); + + /** Static value Empty for DiskCreateOptionTypes. */ + public static final DiskCreateOptionTypes EMPTY = fromString("Empty"); + + /** + * Creates or finds a DiskCreateOptionTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding DiskCreateOptionTypes. + */ + @JsonCreator + public static DiskCreateOptionTypes fromString(String name) { + return fromString(name, DiskCreateOptionTypes.class); + } + + /** @return known DiskCreateOptionTypes values. */ + public static Collection values() { + return values(DiskCreateOptionTypes.class); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ImageReference.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ImageReference.java new file mode 100644 index 000000000000..72611b656f34 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ImageReference.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.hybridnetwork.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 image reference properties. */ +@Fluent +public final class ImageReference { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ImageReference.class); + + /* + * The image publisher. + */ + @JsonProperty(value = "publisher") + private String publisher; + + /* + * Specifies the offer of the image used to create the virtual machine. + */ + @JsonProperty(value = "offer") + private String offer; + + /* + * The image SKU. + */ + @JsonProperty(value = "sku") + private String sku; + + /* + * Specifies the version of the image used to create the virtual machine. + * The allowed formats are Major.Minor.Build or 'latest'. Major, Minor, and + * Build are decimal numbers. Specify 'latest' to use the latest version of + * an image available at deploy time. Even if you use 'latest', the VM + * image will not automatically update after deploy time even if a new + * version becomes available. + */ + @JsonProperty(value = "version") + private String version; + + /* + * Specifies in decimal numbers, the exact version of image used to create + * the virtual machine. + */ + @JsonProperty(value = "exactVersion") + private String exactVersion; + + /** + * Get the publisher property: The image publisher. + * + * @return the publisher value. + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the publisher property: The image publisher. + * + * @param publisher the publisher value to set. + * @return the ImageReference object itself. + */ + public ImageReference withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get the offer property: Specifies the offer of the image used to create the virtual machine. + * + * @return the offer value. + */ + public String offer() { + return this.offer; + } + + /** + * Set the offer property: Specifies the offer of the image used to create the virtual machine. + * + * @param offer the offer value to set. + * @return the ImageReference object itself. + */ + public ImageReference withOffer(String offer) { + this.offer = offer; + return this; + } + + /** + * Get the sku property: The image SKU. + * + * @return the sku value. + */ + public String sku() { + return this.sku; + } + + /** + * Set the sku property: The image SKU. + * + * @param sku the sku value to set. + * @return the ImageReference object itself. + */ + public ImageReference withSku(String sku) { + this.sku = sku; + return this; + } + + /** + * Get the version property: Specifies the version of the image used to create the virtual machine. The allowed + * formats are Major.Minor.Build or 'latest'. Major, Minor, and Build are decimal numbers. Specify 'latest' to use + * the latest version of an image available at deploy time. Even if you use 'latest', the VM image will not + * automatically update after deploy time even if a new version becomes available. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: Specifies the version of the image used to create the virtual machine. The allowed + * formats are Major.Minor.Build or 'latest'. Major, Minor, and Build are decimal numbers. Specify 'latest' to use + * the latest version of an image available at deploy time. Even if you use 'latest', the VM image will not + * automatically update after deploy time even if a new version becomes available. + * + * @param version the version value to set. + * @return the ImageReference object itself. + */ + public ImageReference withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get the exactVersion property: Specifies in decimal numbers, the exact version of image used to create the + * virtual machine. + * + * @return the exactVersion value. + */ + public String exactVersion() { + return this.exactVersion; + } + + /** + * Set the exactVersion property: Specifies in decimal numbers, the exact version of image used to create the + * virtual machine. + * + * @param exactVersion the exactVersion value to set. + * @return the ImageReference object itself. + */ + public ImageReference withExactVersion(String exactVersion) { + this.exactVersion = exactVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/IpAllocationMethod.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/IpAllocationMethod.java new file mode 100644 index 000000000000..a616db19e24d --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/IpAllocationMethod.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.hybridnetwork.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for IpAllocationMethod. */ +public final class IpAllocationMethod extends ExpandableStringEnum { + /** Static value Unknown for IpAllocationMethod. */ + public static final IpAllocationMethod UNKNOWN = fromString("Unknown"); + + /** Static value Static for IpAllocationMethod. */ + public static final IpAllocationMethod STATIC = fromString("Static"); + + /** Static value Dynamic for IpAllocationMethod. */ + public static final IpAllocationMethod DYNAMIC = fromString("Dynamic"); + + /** + * Creates or finds a IpAllocationMethod from its string representation. + * + * @param name a name to look for. + * @return the corresponding IpAllocationMethod. + */ + @JsonCreator + public static IpAllocationMethod fromString(String name) { + return fromString(name, IpAllocationMethod.class); + } + + /** @return known IpAllocationMethod values. */ + public static Collection values() { + return values(IpAllocationMethod.class); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/IpVersion.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/IpVersion.java new file mode 100644 index 000000000000..d6ebd6f6f647 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/IpVersion.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.hybridnetwork.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for IpVersion. */ +public final class IpVersion extends ExpandableStringEnum { + /** Static value Unknown for IpVersion. */ + public static final IpVersion UNKNOWN = fromString("Unknown"); + + /** Static value IPv4 for IpVersion. */ + public static final IpVersion IPV4 = fromString("IPv4"); + + /** + * Creates or finds a IpVersion from its string representation. + * + * @param name a name to look for. + * @return the corresponding IpVersion. + */ + @JsonCreator + public static IpVersion fromString(String name) { + return fromString(name, IpVersion.class); + } + + /** @return known IpVersion values. */ + public static Collection values() { + return values(IpVersion.class); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/LinuxConfiguration.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/LinuxConfiguration.java new file mode 100644 index 000000000000..3bba870d6777 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/LinuxConfiguration.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.hybridnetwork.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; + +/** Specifies the Linux operating system settings on the virtual machine. */ +@Fluent +public final class LinuxConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LinuxConfiguration.class); + + /* + * Specifies the ssh key configuration for a Linux OS. + */ + @JsonProperty(value = "ssh") + private SshConfiguration ssh; + + /** + * Get the ssh property: Specifies the ssh key configuration for a Linux OS. + * + * @return the ssh value. + */ + public SshConfiguration ssh() { + return this.ssh; + } + + /** + * Set the ssh property: Specifies the ssh key configuration for a Linux OS. + * + * @param ssh the ssh value to set. + * @return the LinuxConfiguration object itself. + */ + public LinuxConfiguration withSsh(SshConfiguration ssh) { + this.ssh = ssh; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ssh() != null) { + ssh().validate(); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunction.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunction.java new file mode 100644 index 000000000000..11b3f29428d8 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunction.java @@ -0,0 +1,370 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of NetworkFunction. */ +public interface NetworkFunction { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: The provisioning state of the network function resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the device property: The reference to the device resource. Once set, it cannot be updated. + * + * @return the device value. + */ + SubResource device(); + + /** + * Gets the skuName property: The sku name for the network function. Once set, it cannot be updated. + * + * @return the skuName value. + */ + String skuName(); + + /** + * Gets the skuType property: The sku type for the network function. + * + * @return the skuType value. + */ + SkuType skuType(); + + /** + * Gets the vendorName property: The vendor name for the network function. Once set, it cannot be updated. + * + * @return the vendorName value. + */ + String vendorName(); + + /** + * Gets the serviceKey property: The service key for the network function resource. + * + * @return the serviceKey value. + */ + String serviceKey(); + + /** + * Gets the vendorProvisioningState property: The vendor provisioning state for the network function resource. + * + * @return the vendorProvisioningState value. + */ + VendorProvisioningState vendorProvisioningState(); + + /** + * Gets the managedApplication property: The resource URI of the managed application. + * + * @return the managedApplication value. + */ + SubResource managedApplication(); + + /** + * Gets the managedApplicationParameters property: The parameters for the managed application. + * + * @return the managedApplicationParameters value. + */ + Object managedApplicationParameters(); + + /** + * Gets the networkFunctionContainerConfigurations property: The network function container configurations from the + * user. + * + * @return the networkFunctionContainerConfigurations value. + */ + Object networkFunctionContainerConfigurations(); + + /** + * Gets the networkFunctionUserConfigurations property: The network function configurations from the user. + * + * @return the networkFunctionUserConfigurations value. + */ + List networkFunctionUserConfigurations(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionInner object. + * + * @return the inner object. + */ + NetworkFunctionInner innerModel(); + + /** The entirety of the NetworkFunction definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The NetworkFunction definition stages. */ + interface DefinitionStages { + /** The first stage of the NetworkFunction definition. */ + interface Blank extends WithLocation { + } + /** The stage of the NetworkFunction definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the NetworkFunction definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the NetworkFunction definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithEtag, + DefinitionStages.WithDevice, + DefinitionStages.WithSkuName, + DefinitionStages.WithVendorName, + DefinitionStages.WithManagedApplicationParameters, + DefinitionStages.WithNetworkFunctionContainerConfigurations, + DefinitionStages.WithNetworkFunctionUserConfigurations { + /** + * Executes the create request. + * + * @return the created resource. + */ + NetworkFunction create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + NetworkFunction create(Context context); + } + /** The stage of the NetworkFunction definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the NetworkFunction definition allowing to specify etag. */ + interface WithEtag { + /** + * Specifies the etag property: A unique read-only string that changes whenever the resource is updated.. + * + * @param etag A unique read-only string that changes whenever the resource is updated. + * @return the next definition stage. + */ + WithCreate withEtag(String etag); + } + /** The stage of the NetworkFunction definition allowing to specify device. */ + interface WithDevice { + /** + * Specifies the device property: The reference to the device resource. Once set, it cannot be updated.. + * + * @param device The reference to the device resource. Once set, it cannot be updated. + * @return the next definition stage. + */ + WithCreate withDevice(SubResource device); + } + /** The stage of the NetworkFunction definition allowing to specify skuName. */ + interface WithSkuName { + /** + * Specifies the skuName property: The sku name for the network function. Once set, it cannot be updated.. + * + * @param skuName The sku name for the network function. Once set, it cannot be updated. + * @return the next definition stage. + */ + WithCreate withSkuName(String skuName); + } + /** The stage of the NetworkFunction definition allowing to specify vendorName. */ + interface WithVendorName { + /** + * Specifies the vendorName property: The vendor name for the network function. Once set, it cannot be + * updated.. + * + * @param vendorName The vendor name for the network function. Once set, it cannot be updated. + * @return the next definition stage. + */ + WithCreate withVendorName(String vendorName); + } + /** The stage of the NetworkFunction definition allowing to specify managedApplicationParameters. */ + interface WithManagedApplicationParameters { + /** + * Specifies the managedApplicationParameters property: The parameters for the managed application.. + * + * @param managedApplicationParameters The parameters for the managed application. + * @return the next definition stage. + */ + WithCreate withManagedApplicationParameters(Object managedApplicationParameters); + } + /** The stage of the NetworkFunction definition allowing to specify networkFunctionContainerConfigurations. */ + interface WithNetworkFunctionContainerConfigurations { + /** + * Specifies the networkFunctionContainerConfigurations property: The network function container + * configurations from the user.. + * + * @param networkFunctionContainerConfigurations The network function container configurations from the + * user. + * @return the next definition stage. + */ + WithCreate withNetworkFunctionContainerConfigurations(Object networkFunctionContainerConfigurations); + } + /** The stage of the NetworkFunction definition allowing to specify networkFunctionUserConfigurations. */ + interface WithNetworkFunctionUserConfigurations { + /** + * Specifies the networkFunctionUserConfigurations property: The network function configurations from the + * user.. + * + * @param networkFunctionUserConfigurations The network function configurations from the user. + * @return the next definition stage. + */ + WithCreate withNetworkFunctionUserConfigurations( + List networkFunctionUserConfigurations); + } + } + /** + * Begins update for the NetworkFunction resource. + * + * @return the stage of resource update. + */ + NetworkFunction.Update update(); + + /** The template for NetworkFunction update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + NetworkFunction apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + NetworkFunction apply(Context context); + } + /** The NetworkFunction update stages. */ + interface UpdateStages { + /** The stage of the NetworkFunction update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + NetworkFunction refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + NetworkFunction refresh(Context context); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionListResult.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionListResult.java new file mode 100644 index 000000000000..6f8fdfa74188 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionListResult.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for network function API service call. */ +@Fluent +public final class NetworkFunctionListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkFunctionListResult.class); + + /* + * A list of network function resources in a subscription or resource + * group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of network function resources in a subscription or resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of network function resources in a subscription or resource group. + * + * @param value the value value to set. + * @return the NetworkFunctionListResult object itself. + */ + public NetworkFunctionListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionRoleConfiguration.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionRoleConfiguration.java new file mode 100644 index 000000000000..6e4a7df6012f --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionRoleConfiguration.java @@ -0,0 +1,280 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.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; + +/** Network function role configuration. */ +@Fluent +public final class NetworkFunctionRoleConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkFunctionRoleConfiguration.class); + + /* + * The name of the network function role. + */ + @JsonProperty(value = "roleName") + private String roleName; + + /* + * Role type. + */ + @JsonProperty(value = "roleType") + private NetworkFunctionRoleConfigurationType roleType; + + /* + * The size of the virtual machine. + */ + @JsonProperty(value = "virtualMachineSize") + private VirtualMachineSizeTypes virtualMachineSize; + + /* + * Specifies the operating system settings for the role instance. This + * value can be updated during the deployment of network function. + */ + @JsonProperty(value = "osProfile") + private OsProfile osProfile; + + /* + * The user data template for customers. This is a json schema template + * describing the format and data type of user data parameters. + */ + @JsonProperty(value = "userDataTemplate") + private Object userDataTemplate; + + /* + * The user parameters for customers. The format of user data parameters + * has to be matched with the provided user data template. + */ + @JsonProperty(value = "userDataParameters") + private Object userDataParameters; + + /* + * The network interface configurations. + */ + @JsonProperty(value = "networkInterfaces") + private List networkInterfaces; + + /* + * Specifies the storage settings for the virtual machine disks. + */ + @JsonProperty(value = "storageProfile") + private StorageProfile storageProfile; + + /* + * Specifies the custom settings for the virtual machine. + */ + @JsonProperty(value = "customProfile") + private CustomProfile customProfile; + + /** + * Get the roleName property: The name of the network function role. + * + * @return the roleName value. + */ + public String roleName() { + return this.roleName; + } + + /** + * Set the roleName property: The name of the network function role. + * + * @param roleName the roleName value to set. + * @return the NetworkFunctionRoleConfiguration object itself. + */ + public NetworkFunctionRoleConfiguration withRoleName(String roleName) { + this.roleName = roleName; + return this; + } + + /** + * Get the roleType property: Role type. + * + * @return the roleType value. + */ + public NetworkFunctionRoleConfigurationType roleType() { + return this.roleType; + } + + /** + * Set the roleType property: Role type. + * + * @param roleType the roleType value to set. + * @return the NetworkFunctionRoleConfiguration object itself. + */ + public NetworkFunctionRoleConfiguration withRoleType(NetworkFunctionRoleConfigurationType roleType) { + this.roleType = roleType; + return this; + } + + /** + * Get the virtualMachineSize property: The size of the virtual machine. + * + * @return the virtualMachineSize value. + */ + public VirtualMachineSizeTypes virtualMachineSize() { + return this.virtualMachineSize; + } + + /** + * Set the virtualMachineSize property: The size of the virtual machine. + * + * @param virtualMachineSize the virtualMachineSize value to set. + * @return the NetworkFunctionRoleConfiguration object itself. + */ + public NetworkFunctionRoleConfiguration withVirtualMachineSize(VirtualMachineSizeTypes virtualMachineSize) { + this.virtualMachineSize = virtualMachineSize; + return this; + } + + /** + * Get the osProfile property: Specifies the operating system settings for the role instance. This value can be + * updated during the deployment of network function. + * + * @return the osProfile value. + */ + public OsProfile osProfile() { + return this.osProfile; + } + + /** + * Set the osProfile property: Specifies the operating system settings for the role instance. This value can be + * updated during the deployment of network function. + * + * @param osProfile the osProfile value to set. + * @return the NetworkFunctionRoleConfiguration object itself. + */ + public NetworkFunctionRoleConfiguration withOsProfile(OsProfile osProfile) { + this.osProfile = osProfile; + return this; + } + + /** + * Get the userDataTemplate property: The user data template for customers. This is a json schema template + * describing the format and data type of user data parameters. + * + * @return the userDataTemplate value. + */ + public Object userDataTemplate() { + return this.userDataTemplate; + } + + /** + * Set the userDataTemplate property: The user data template for customers. This is a json schema template + * describing the format and data type of user data parameters. + * + * @param userDataTemplate the userDataTemplate value to set. + * @return the NetworkFunctionRoleConfiguration object itself. + */ + public NetworkFunctionRoleConfiguration withUserDataTemplate(Object userDataTemplate) { + this.userDataTemplate = userDataTemplate; + return this; + } + + /** + * Get the userDataParameters property: The user parameters for customers. The format of user data parameters has to + * be matched with the provided user data template. + * + * @return the userDataParameters value. + */ + public Object userDataParameters() { + return this.userDataParameters; + } + + /** + * Set the userDataParameters property: The user parameters for customers. The format of user data parameters has to + * be matched with the provided user data template. + * + * @param userDataParameters the userDataParameters value to set. + * @return the NetworkFunctionRoleConfiguration object itself. + */ + public NetworkFunctionRoleConfiguration withUserDataParameters(Object userDataParameters) { + this.userDataParameters = userDataParameters; + return this; + } + + /** + * Get the networkInterfaces property: The network interface configurations. + * + * @return the networkInterfaces value. + */ + public List networkInterfaces() { + return this.networkInterfaces; + } + + /** + * Set the networkInterfaces property: The network interface configurations. + * + * @param networkInterfaces the networkInterfaces value to set. + * @return the NetworkFunctionRoleConfiguration object itself. + */ + public NetworkFunctionRoleConfiguration withNetworkInterfaces(List networkInterfaces) { + this.networkInterfaces = networkInterfaces; + return this; + } + + /** + * Get the storageProfile property: Specifies the storage settings for the virtual machine disks. + * + * @return the storageProfile value. + */ + public StorageProfile storageProfile() { + return this.storageProfile; + } + + /** + * Set the storageProfile property: Specifies the storage settings for the virtual machine disks. + * + * @param storageProfile the storageProfile value to set. + * @return the NetworkFunctionRoleConfiguration object itself. + */ + public NetworkFunctionRoleConfiguration withStorageProfile(StorageProfile storageProfile) { + this.storageProfile = storageProfile; + return this; + } + + /** + * Get the customProfile property: Specifies the custom settings for the virtual machine. + * + * @return the customProfile value. + */ + public CustomProfile customProfile() { + return this.customProfile; + } + + /** + * Set the customProfile property: Specifies the custom settings for the virtual machine. + * + * @param customProfile the customProfile value to set. + * @return the NetworkFunctionRoleConfiguration object itself. + */ + public NetworkFunctionRoleConfiguration withCustomProfile(CustomProfile customProfile) { + this.customProfile = customProfile; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (osProfile() != null) { + osProfile().validate(); + } + if (networkInterfaces() != null) { + networkInterfaces().forEach(e -> e.validate()); + } + if (storageProfile() != null) { + storageProfile().validate(); + } + if (customProfile() != null) { + customProfile().validate(); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionRoleConfigurationType.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionRoleConfigurationType.java new file mode 100644 index 000000000000..d3c8b8f0a9e9 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionRoleConfigurationType.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for NetworkFunctionRoleConfigurationType. */ +public final class NetworkFunctionRoleConfigurationType + extends ExpandableStringEnum { + /** Static value Unknown for NetworkFunctionRoleConfigurationType. */ + public static final NetworkFunctionRoleConfigurationType UNKNOWN = fromString("Unknown"); + + /** Static value VirtualMachine for NetworkFunctionRoleConfigurationType. */ + public static final NetworkFunctionRoleConfigurationType VIRTUAL_MACHINE = fromString("VirtualMachine"); + + /** + * Creates or finds a NetworkFunctionRoleConfigurationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding NetworkFunctionRoleConfigurationType. + */ + @JsonCreator + public static NetworkFunctionRoleConfigurationType fromString(String name) { + return fromString(name, NetworkFunctionRoleConfigurationType.class); + } + + /** @return known NetworkFunctionRoleConfigurationType values. */ + public static Collection values() { + return values(NetworkFunctionRoleConfigurationType.class); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionRoleInstanceListResult.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionRoleInstanceListResult.java new file mode 100644 index 000000000000..dacbccab5a9b --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionRoleInstanceListResult.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.hybridnetwork.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybridnetwork.fluent.models.RoleInstanceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of role instances of vendor network function. */ +@Immutable +public final class NetworkFunctionRoleInstanceListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkFunctionRoleInstanceListResult.class); + + /* + * A list of role instances. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of role instances. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionSkuDetails.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionSkuDetails.java new file mode 100644 index 000000000000..03021d7b64be --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionSkuDetails.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionSkuRoleDetailsInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The network function sku details. */ +@Fluent +public final class NetworkFunctionSkuDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkFunctionSkuDetails.class); + + /* + * The network function sku type. + */ + @JsonProperty(value = "skuType") + private SkuType skuType; + + /* + * The network function sku role details. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the skuType property: The network function sku type. + * + * @return the skuType value. + */ + public SkuType skuType() { + return this.skuType; + } + + /** + * Set the skuType property: The network function sku type. + * + * @param skuType the skuType value to set. + * @return the NetworkFunctionSkuDetails object itself. + */ + public NetworkFunctionSkuDetails withSkuType(SkuType skuType) { + this.skuType = skuType; + return this; + } + + /** + * Get the value property: The network function sku role details. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The network function sku role details. + * + * @param value the value value to set. + * @return the NetworkFunctionSkuDetails object itself. + */ + public NetworkFunctionSkuDetails withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionSkuListResult.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionSkuListResult.java new file mode 100644 index 000000000000..3018427552c7 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionSkuListResult.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.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybridnetwork.fluent.models.SkuOverviewInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of available network function skus. */ +@Fluent +public final class NetworkFunctionSkuListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkFunctionSkuListResult.class); + + /* + * The network function vendor sku overview properties. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The network function vendor sku overview properties. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The network function vendor sku overview properties. + * + * @param value the value value to set. + * @return the NetworkFunctionSkuListResult object itself. + */ + public NetworkFunctionSkuListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionSkuRoleDetails.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionSkuRoleDetails.java new file mode 100644 index 000000000000..a7cf2fa73365 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionSkuRoleDetails.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.hybridnetwork.models; + +import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionSkuRoleDetailsInner; +import java.util.List; + +/** An immutable client-side representation of NetworkFunctionSkuRoleDetails. */ +public interface NetworkFunctionSkuRoleDetails { + /** + * Gets the roleName property: The name of the network function role. + * + * @return the roleName value. + */ + String roleName(); + + /** + * Gets the userDataTemplate property: The user data template for customers. + * + * @return the userDataTemplate value. + */ + Object userDataTemplate(); + + /** + * Gets the userDataParameters property: The user parameters for customers. + * + * @return the userDataParameters value. + */ + Object userDataParameters(); + + /** + * Gets the networkInterfaces property: The network interface configuration. + * + * @return the networkInterfaces value. + */ + List networkInterfaces(); + + /** + * Gets the inner com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionSkuRoleDetailsInner object. + * + * @return the inner object. + */ + NetworkFunctionSkuRoleDetailsInner innerModel(); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionTemplate.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionTemplate.java new file mode 100644 index 000000000000..afad904d795c --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionTemplate.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.hybridnetwork.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 network function template. */ +@Fluent +public final class NetworkFunctionTemplate { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkFunctionTemplate.class); + + /* + * An array of network function role definitions. + */ + @JsonProperty(value = "networkFunctionRoleConfigurations") + private List networkFunctionRoleConfigurations; + + /** + * Get the networkFunctionRoleConfigurations property: An array of network function role definitions. + * + * @return the networkFunctionRoleConfigurations value. + */ + public List networkFunctionRoleConfigurations() { + return this.networkFunctionRoleConfigurations; + } + + /** + * Set the networkFunctionRoleConfigurations property: An array of network function role definitions. + * + * @param networkFunctionRoleConfigurations the networkFunctionRoleConfigurations value to set. + * @return the NetworkFunctionTemplate object itself. + */ + public NetworkFunctionTemplate withNetworkFunctionRoleConfigurations( + List networkFunctionRoleConfigurations) { + this.networkFunctionRoleConfigurations = networkFunctionRoleConfigurations; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (networkFunctionRoleConfigurations() != null) { + networkFunctionRoleConfigurations().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionType.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionType.java new file mode 100644 index 000000000000..180ce4eb0140 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionType.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.hybridnetwork.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for NetworkFunctionType. */ +public final class NetworkFunctionType extends ExpandableStringEnum { + /** Static value Unknown for NetworkFunctionType. */ + public static final NetworkFunctionType UNKNOWN = fromString("Unknown"); + + /** Static value VirtualNetworkFunction for NetworkFunctionType. */ + public static final NetworkFunctionType VIRTUAL_NETWORK_FUNCTION = fromString("VirtualNetworkFunction"); + + /** Static value ContainerizedNetworkFunction for NetworkFunctionType. */ + public static final NetworkFunctionType CONTAINERIZED_NETWORK_FUNCTION = fromString("ContainerizedNetworkFunction"); + + /** + * Creates or finds a NetworkFunctionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding NetworkFunctionType. + */ + @JsonCreator + public static NetworkFunctionType fromString(String name) { + return fromString(name, NetworkFunctionType.class); + } + + /** @return known NetworkFunctionType values. */ + public static Collection values() { + return values(NetworkFunctionType.class); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionUserConfiguration.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionUserConfiguration.java new file mode 100644 index 000000000000..96f6be144835 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionUserConfiguration.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.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 network function user configuration. */ +@Fluent +public final class NetworkFunctionUserConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkFunctionUserConfiguration.class); + + /* + * The name of the network function role. + */ + @JsonProperty(value = "roleName") + private String roleName; + + /* + * The user data parameters from the customer. + */ + @JsonProperty(value = "userDataParameters") + private Object userDataParameters; + + /* + * The network interface configuration. + */ + @JsonProperty(value = "networkInterfaces") + private List networkInterfaces; + + /* + * Specifies the operating system settings for the role instance. + */ + @JsonProperty(value = "osProfile") + private NetworkFunctionUserConfigurationOsProfile osProfile; + + /** + * Get the roleName property: The name of the network function role. + * + * @return the roleName value. + */ + public String roleName() { + return this.roleName; + } + + /** + * Set the roleName property: The name of the network function role. + * + * @param roleName the roleName value to set. + * @return the NetworkFunctionUserConfiguration object itself. + */ + public NetworkFunctionUserConfiguration withRoleName(String roleName) { + this.roleName = roleName; + return this; + } + + /** + * Get the userDataParameters property: The user data parameters from the customer. + * + * @return the userDataParameters value. + */ + public Object userDataParameters() { + return this.userDataParameters; + } + + /** + * Set the userDataParameters property: The user data parameters from the customer. + * + * @param userDataParameters the userDataParameters value to set. + * @return the NetworkFunctionUserConfiguration object itself. + */ + public NetworkFunctionUserConfiguration withUserDataParameters(Object userDataParameters) { + this.userDataParameters = userDataParameters; + return this; + } + + /** + * Get the networkInterfaces property: The network interface configuration. + * + * @return the networkInterfaces value. + */ + public List networkInterfaces() { + return this.networkInterfaces; + } + + /** + * Set the networkInterfaces property: The network interface configuration. + * + * @param networkInterfaces the networkInterfaces value to set. + * @return the NetworkFunctionUserConfiguration object itself. + */ + public NetworkFunctionUserConfiguration withNetworkInterfaces(List networkInterfaces) { + this.networkInterfaces = networkInterfaces; + return this; + } + + /** + * Get the osProfile property: Specifies the operating system settings for the role instance. + * + * @return the osProfile value. + */ + public NetworkFunctionUserConfigurationOsProfile osProfile() { + return this.osProfile; + } + + /** + * Set the osProfile property: Specifies the operating system settings for the role instance. + * + * @param osProfile the osProfile value to set. + * @return the NetworkFunctionUserConfiguration object itself. + */ + public NetworkFunctionUserConfiguration withOsProfile(NetworkFunctionUserConfigurationOsProfile osProfile) { + this.osProfile = osProfile; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (networkInterfaces() != null) { + networkInterfaces().forEach(e -> e.validate()); + } + if (osProfile() != null) { + osProfile().validate(); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionUserConfigurationOsProfile.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionUserConfigurationOsProfile.java new file mode 100644 index 000000000000..ec32e754dc02 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionUserConfigurationOsProfile.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.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; + +/** Specifies the operating system settings for the role instance. */ +@Fluent +public final class NetworkFunctionUserConfigurationOsProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkFunctionUserConfigurationOsProfile.class); + + /* + * Specifies a base-64 encoded string of custom data. The base-64 encoded + * string is decoded to a binary array that is saved as a file on the + * virtual machine. The maximum length of the binary array is 65535 bytes. + *

**Note: Do not pass any secrets or passwords in customData + * property**

This property cannot be updated after the VM is + * created.

customData is passed to the VM to be saved as a file. + * For more information see [Custom Data on Azure + * VMs](https://azure.microsoft.com/en-us/blog/custom-data-and-cloud-init-on-windows-azure/) + *

For using cloud-init for your Linux VM, see [Using cloud-init + * to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + */ + @JsonProperty(value = "customData") + private String customData; + + /** + * Get the customData property: Specifies a base-64 encoded string of custom data. The base-64 encoded string is + * decoded to a binary array that is saved as a file on the virtual machine. The maximum length of the binary array + * is 65535 bytes. <br><br> **Note: Do not pass any secrets or passwords in customData property** + * <br><br> This property cannot be updated after the VM is created. <br><br> customData is + * passed to the VM to be saved as a file. For more information see [Custom Data on Azure + * VMs](https://azure.microsoft.com/en-us/blog/custom-data-and-cloud-init-on-windows-azure/) <br><br> + * For using cloud-init for your Linux VM, see [Using cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @return the customData value. + */ + public String customData() { + return this.customData; + } + + /** + * Set the customData property: Specifies a base-64 encoded string of custom data. The base-64 encoded string is + * decoded to a binary array that is saved as a file on the virtual machine. The maximum length of the binary array + * is 65535 bytes. <br><br> **Note: Do not pass any secrets or passwords in customData property** + * <br><br> This property cannot be updated after the VM is created. <br><br> customData is + * passed to the VM to be saved as a file. For more information see [Custom Data on Azure + * VMs](https://azure.microsoft.com/en-us/blog/custom-data-and-cloud-init-on-windows-azure/) <br><br> + * For using cloud-init for your Linux VM, see [Using cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @param customData the customData value to set. + * @return the NetworkFunctionUserConfigurationOsProfile object itself. + */ + public NetworkFunctionUserConfigurationOsProfile withCustomData(String customData) { + this.customData = customData; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionVendor.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionVendor.java new file mode 100644 index 000000000000..85fd4a8cb75d --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionVendor.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.hybridnetwork.models; + +import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionVendorInner; +import java.util.List; + +/** An immutable client-side representation of NetworkFunctionVendor. */ +public interface NetworkFunctionVendor { + /** + * Gets the vendorName property: The network function vendor name. + * + * @return the vendorName value. + */ + String vendorName(); + + /** + * Gets the skuList property: The network function sku list. + * + * @return the skuList value. + */ + List skuList(); + + /** + * Gets the inner com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionVendorInner object. + * + * @return the inner object. + */ + NetworkFunctionVendorInner innerModel(); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionVendorConfiguration.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionVendorConfiguration.java new file mode 100644 index 000000000000..22d5ef9676fe --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionVendorConfiguration.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.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; + +/** Network function vendor configuration. */ +@Fluent +public final class NetworkFunctionVendorConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkFunctionVendorConfiguration.class); + + /* + * The name of the vendor network function role. + */ + @JsonProperty(value = "roleName") + private String roleName; + + /* + * Specifies the operating system settings for the role instance. + */ + @JsonProperty(value = "osProfile") + private OsProfile osProfile; + + /* + * The user parameters from the customer. + */ + @JsonProperty(value = "userDataParameters", access = JsonProperty.Access.WRITE_ONLY) + private Object userDataParameters; + + /* + * The network interface configurations. + */ + @JsonProperty(value = "networkInterfaces") + private List networkInterfaces; + + /** + * Get the roleName property: The name of the vendor network function role. + * + * @return the roleName value. + */ + public String roleName() { + return this.roleName; + } + + /** + * Set the roleName property: The name of the vendor network function role. + * + * @param roleName the roleName value to set. + * @return the NetworkFunctionVendorConfiguration object itself. + */ + public NetworkFunctionVendorConfiguration withRoleName(String roleName) { + this.roleName = roleName; + return this; + } + + /** + * Get the osProfile property: Specifies the operating system settings for the role instance. + * + * @return the osProfile value. + */ + public OsProfile osProfile() { + return this.osProfile; + } + + /** + * Set the osProfile property: Specifies the operating system settings for the role instance. + * + * @param osProfile the osProfile value to set. + * @return the NetworkFunctionVendorConfiguration object itself. + */ + public NetworkFunctionVendorConfiguration withOsProfile(OsProfile osProfile) { + this.osProfile = osProfile; + return this; + } + + /** + * Get the userDataParameters property: The user parameters from the customer. + * + * @return the userDataParameters value. + */ + public Object userDataParameters() { + return this.userDataParameters; + } + + /** + * Get the networkInterfaces property: The network interface configurations. + * + * @return the networkInterfaces value. + */ + public List networkInterfaces() { + return this.networkInterfaces; + } + + /** + * Set the networkInterfaces property: The network interface configurations. + * + * @param networkInterfaces the networkInterfaces value to set. + * @return the NetworkFunctionVendorConfiguration object itself. + */ + public NetworkFunctionVendorConfiguration withNetworkInterfaces(List networkInterfaces) { + this.networkInterfaces = networkInterfaces; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (osProfile() != null) { + osProfile().validate(); + } + if (networkInterfaces() != null) { + networkInterfaces().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionVendorListResult.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionVendorListResult.java new file mode 100644 index 000000000000..8d558391f7f0 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionVendorListResult.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.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionVendorInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The network function vendor list result. */ +@Fluent +public final class NetworkFunctionVendorListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkFunctionVendorListResult.class); + + /* + * A list of available network function vendors and skus. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of available network function vendors and skus. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of available network function vendors and skus. + * + * @param value the value value to set. + * @return the NetworkFunctionVendorListResult object itself. + */ + public NetworkFunctionVendorListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionVendorSkus.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionVendorSkus.java new file mode 100644 index 000000000000..17ace6054c56 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionVendorSkus.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.hybridnetwork.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of NetworkFunctionVendorSkus. */ +public interface NetworkFunctionVendorSkus { + /** + * Lists all network function vendor sku details in a vendor. + * + * @param vendorName The name of the network function vendor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of available network function skus. + */ + PagedIterable listByVendor(String vendorName); + + /** + * Lists all network function vendor sku details in a vendor. + * + * @param vendorName The name of the network function vendor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of available network function skus. + */ + PagedIterable listByVendor(String vendorName, Context context); + + /** + * Lists information about network function vendor sku details. + * + * @param vendorName The name of the network function vendor. + * @param vendorSkuName The name of the network function 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 network function sku details. + */ + PagedIterable listBySku(String vendorName, String vendorSkuName); + + /** + * Lists information about network function vendor sku details. + * + * @param vendorName The name of the network function vendor. + * @param vendorSkuName The name of the network function 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 network function sku details. + */ + PagedIterable listBySku(String vendorName, String vendorSkuName, Context context); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionVendors.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionVendors.java new file mode 100644 index 000000000000..2f0db3f91f85 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionVendors.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of NetworkFunctionVendors. */ +public interface NetworkFunctionVendors { + /** + * Lists all the available vendor and sku information. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the network function vendor list result. + */ + PagedIterable list(); + + /** + * Lists all the available vendor and sku information. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the network function vendor list result. + */ + PagedIterable list(Context context); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctions.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctions.java new file mode 100644 index 000000000000..1f3387419b52 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctions.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.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 NetworkFunctions. */ +public interface NetworkFunctions { + /** + * Deletes the specified network function resource. This operation can take up to 1 hour to complete. This is + * expected service behavior. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName The name of the network function. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String networkFunctionName); + + /** + * Deletes the specified network function resource. This operation can take up to 1 hour to complete. This is + * expected service behavior. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName The name of the network function. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String networkFunctionName, Context context); + + /** + * Gets information about the specified network function resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName The name of the network function resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified network function resource. + */ + NetworkFunction getByResourceGroup(String resourceGroupName, String networkFunctionName); + + /** + * Gets information about the specified network function resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName The name of the network function resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified network function resource. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String networkFunctionName, Context context); + + /** + * Lists all the network functions in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for network function API service call. + */ + PagedIterable list(); + + /** + * Lists all the network functions in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for network function API service call. + */ + PagedIterable list(Context context); + + /** + * Lists all the network function resources in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for network function API service call. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all the network function resources in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for network function API service call. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets information about the specified network function resource. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified network function resource. + */ + NetworkFunction getById(String id); + + /** + * Gets information about the specified network function resource. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified network function resource. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified network function resource. This operation can take up to 1 hour to complete. This is + * expected service behavior. + * + * @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 specified network function resource. This operation can take up to 1 hour to complete. This is + * expected service behavior. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new NetworkFunction resource. + * + * @param name resource name. + * @return the first stage of the new NetworkFunction definition. + */ + NetworkFunction.DefinitionStages.Blank define(String name); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkInterface.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkInterface.java new file mode 100644 index 000000000000..8be48f9cc381 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkInterface.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.hybridnetwork.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; + +/** Network interface properties. */ +@Fluent +public final class NetworkInterface { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkInterface.class); + + /* + * The name of the network interface. + */ + @JsonProperty(value = "networkInterfaceName") + private String networkInterfaceName; + + /* + * The MAC address of the network interface. + */ + @JsonProperty(value = "macAddress") + private String macAddress; + + /* + * A list of IP configurations of the network interface. + */ + @JsonProperty(value = "ipConfigurations") + private List ipConfigurations; + + /* + * The type of the VM switch. + */ + @JsonProperty(value = "vmSwitchType") + private VMSwitchType vmSwitchType; + + /** + * Get the networkInterfaceName property: The name of the network interface. + * + * @return the networkInterfaceName value. + */ + public String networkInterfaceName() { + return this.networkInterfaceName; + } + + /** + * Set the networkInterfaceName property: The name of the network interface. + * + * @param networkInterfaceName the networkInterfaceName value to set. + * @return the NetworkInterface object itself. + */ + public NetworkInterface withNetworkInterfaceName(String networkInterfaceName) { + this.networkInterfaceName = networkInterfaceName; + return this; + } + + /** + * Get the macAddress property: The MAC address of the network interface. + * + * @return the macAddress value. + */ + public String macAddress() { + return this.macAddress; + } + + /** + * Set the macAddress property: The MAC address of the network interface. + * + * @param macAddress the macAddress value to set. + * @return the NetworkInterface object itself. + */ + public NetworkInterface withMacAddress(String macAddress) { + this.macAddress = macAddress; + return this; + } + + /** + * Get the ipConfigurations property: A list of IP configurations of the network interface. + * + * @return the ipConfigurations value. + */ + public List ipConfigurations() { + return this.ipConfigurations; + } + + /** + * Set the ipConfigurations property: A list of IP configurations of the network interface. + * + * @param ipConfigurations the ipConfigurations value to set. + * @return the NetworkInterface object itself. + */ + public NetworkInterface withIpConfigurations(List ipConfigurations) { + this.ipConfigurations = ipConfigurations; + return this; + } + + /** + * Get the vmSwitchType property: The type of the VM switch. + * + * @return the vmSwitchType value. + */ + public VMSwitchType vmSwitchType() { + return this.vmSwitchType; + } + + /** + * Set the vmSwitchType property: The type of the VM switch. + * + * @param vmSwitchType the vmSwitchType value to set. + * @return the NetworkInterface object itself. + */ + public NetworkInterface withVmSwitchType(VMSwitchType vmSwitchType) { + this.vmSwitchType = vmSwitchType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ipConfigurations() != null) { + ipConfigurations().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkInterfaceIpConfiguration.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkInterfaceIpConfiguration.java new file mode 100644 index 000000000000..926234bbea03 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkInterfaceIpConfiguration.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.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; + +/** Network interface IP configuration properties. */ +@Fluent +public final class NetworkInterfaceIpConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkInterfaceIpConfiguration.class); + + /* + * IP address allocation method. + */ + @JsonProperty(value = "ipAllocationMethod") + private IpAllocationMethod ipAllocationMethod; + + /* + * The value of the IP address. + */ + @JsonProperty(value = "ipAddress") + private String ipAddress; + + /* + * The value of the subnet. + */ + @JsonProperty(value = "subnet") + private String subnet; + + /* + * The value of the gateway. + */ + @JsonProperty(value = "gateway") + private String gateway; + + /* + * IP address version. + */ + @JsonProperty(value = "ipVersion") + private IpVersion ipVersion; + + /* + * The list of DNS servers IP addresses. + */ + @JsonProperty(value = "dnsServers") + private List dnsServers; + + /** + * Get the ipAllocationMethod property: IP address allocation method. + * + * @return the ipAllocationMethod value. + */ + public IpAllocationMethod ipAllocationMethod() { + return this.ipAllocationMethod; + } + + /** + * Set the ipAllocationMethod property: IP address allocation method. + * + * @param ipAllocationMethod the ipAllocationMethod value to set. + * @return the NetworkInterfaceIpConfiguration object itself. + */ + public NetworkInterfaceIpConfiguration withIpAllocationMethod(IpAllocationMethod ipAllocationMethod) { + this.ipAllocationMethod = ipAllocationMethod; + return this; + } + + /** + * Get the ipAddress property: The value of the IP address. + * + * @return the ipAddress value. + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Set the ipAddress property: The value of the IP address. + * + * @param ipAddress the ipAddress value to set. + * @return the NetworkInterfaceIpConfiguration object itself. + */ + public NetworkInterfaceIpConfiguration withIpAddress(String ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + * Get the subnet property: The value of the subnet. + * + * @return the subnet value. + */ + public String subnet() { + return this.subnet; + } + + /** + * Set the subnet property: The value of the subnet. + * + * @param subnet the subnet value to set. + * @return the NetworkInterfaceIpConfiguration object itself. + */ + public NetworkInterfaceIpConfiguration withSubnet(String subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get the gateway property: The value of the gateway. + * + * @return the gateway value. + */ + public String gateway() { + return this.gateway; + } + + /** + * Set the gateway property: The value of the gateway. + * + * @param gateway the gateway value to set. + * @return the NetworkInterfaceIpConfiguration object itself. + */ + public NetworkInterfaceIpConfiguration withGateway(String gateway) { + this.gateway = gateway; + return this; + } + + /** + * Get the ipVersion property: IP address version. + * + * @return the ipVersion value. + */ + public IpVersion ipVersion() { + return this.ipVersion; + } + + /** + * Set the ipVersion property: IP address version. + * + * @param ipVersion the ipVersion value to set. + * @return the NetworkInterfaceIpConfiguration object itself. + */ + public NetworkInterfaceIpConfiguration withIpVersion(IpVersion ipVersion) { + this.ipVersion = ipVersion; + return this; + } + + /** + * Get the dnsServers property: The list of DNS servers IP addresses. + * + * @return the dnsServers value. + */ + public List dnsServers() { + return this.dnsServers; + } + + /** + * Set the dnsServers property: The list of DNS servers IP addresses. + * + * @param dnsServers the dnsServers value to set. + * @return the NetworkInterfaceIpConfiguration object itself. + */ + public NetworkInterfaceIpConfiguration withDnsServers(List dnsServers) { + this.dnsServers = dnsServers; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/OperatingSystemTypes.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/OperatingSystemTypes.java new file mode 100644 index 000000000000..e7dd52023a65 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/OperatingSystemTypes.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.hybridnetwork.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for OperatingSystemTypes. */ +public final class OperatingSystemTypes extends ExpandableStringEnum { + /** Static value Unknown for OperatingSystemTypes. */ + public static final OperatingSystemTypes UNKNOWN = fromString("Unknown"); + + /** Static value Windows for OperatingSystemTypes. */ + public static final OperatingSystemTypes WINDOWS = fromString("Windows"); + + /** Static value Linux for OperatingSystemTypes. */ + public static final OperatingSystemTypes LINUX = fromString("Linux"); + + /** + * Creates or finds a OperatingSystemTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding OperatingSystemTypes. + */ + @JsonCreator + public static OperatingSystemTypes fromString(String name) { + return fromString(name, OperatingSystemTypes.class); + } + + /** @return known OperatingSystemTypes values. */ + public static Collection values() { + return values(OperatingSystemTypes.class); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Operation.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Operation.java new file mode 100644 index 000000000000..11c12247af23 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Operation.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.resourcemanager.hybridnetwork.fluent.models.OperationInner; + +/** An immutable client-side representation of Operation. */ +public interface Operation { + /** + * Gets the name property: Operation name: {provider}/{resource}/{operation}. + * + * @return the name value. + */ + String name(); + + /** + * Gets the display property: The object that represents the operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the inner com.azure.resourcemanager.hybridnetwork.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/OperationDisplay.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/OperationDisplay.java new file mode 100644 index 000000000000..fadf9a655277 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/OperationDisplay.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.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 object that represents the operation. */ +@Fluent +public final class OperationDisplay { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDisplay.class); + + /* + * Service provider: Microsoft.HybridNetwork. + */ + @JsonProperty(value = "provider") + private String provider; + + /* + * Resource on which the operation is performed: Registration definition, + * registration assignment, etc. + */ + @JsonProperty(value = "resource") + private String resource; + + /* + * Operation type: Read, write, delete, etc. + */ + @JsonProperty(value = "operation") + private String operation; + + /* + * Description of the operation. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the provider property: Service provider: Microsoft.HybridNetwork. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider property: Service provider: Microsoft.HybridNetwork. + * + * @param provider the provider value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the resource property: Resource on which the operation is performed: Registration definition, registration + * assignment, etc. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource property: Resource on which the operation is performed: Registration definition, registration + * assignment, etc. + * + * @param resource the resource value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the operation property: Operation type: Read, write, delete, etc. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation property: Operation type: Read, write, delete, etc. + * + * @param operation the operation value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the description property: Description of the operation. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of the operation. + * + * @param description the description value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/OperationList.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/OperationList.java new file mode 100644 index 000000000000..cfb7b2405def --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/OperationList.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.hybridnetwork.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybridnetwork.fluent.models.OperationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of the operations. */ +@Immutable +public final class OperationList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationList.class); + + /* + * A list of Microsoft.HybridNetwork operations. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of Microsoft.HybridNetwork operations. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/OperationalState.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/OperationalState.java new file mode 100644 index 000000000000..eb6c9643b83d --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/OperationalState.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.hybridnetwork.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for OperationalState. */ +public final class OperationalState extends ExpandableStringEnum { + /** Static value Unknown for OperationalState. */ + public static final OperationalState UNKNOWN = fromString("Unknown"); + + /** Static value Stopped for OperationalState. */ + public static final OperationalState STOPPED = fromString("Stopped"); + + /** Static value Running for OperationalState. */ + public static final OperationalState RUNNING = fromString("Running"); + + /** Static value Stopping for OperationalState. */ + public static final OperationalState STOPPING = fromString("Stopping"); + + /** Static value Starting for OperationalState. */ + public static final OperationalState STARTING = fromString("Starting"); + + /** + * Creates or finds a OperationalState from its string representation. + * + * @param name a name to look for. + * @return the corresponding OperationalState. + */ + @JsonCreator + public static OperationalState fromString(String name) { + return fromString(name, OperationalState.class); + } + + /** @return known OperationalState values. */ + public static Collection values() { + return values(OperationalState.class); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Operations.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Operations.java new file mode 100644 index 000000000000..b5fe8a18c6bc --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Operations.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Operations. */ +public interface Operations { + /** + * Gets a list of the operations. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of the operations. + */ + PagedIterable list(); + + /** + * Gets a list of the operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of the operations. + */ + PagedIterable list(Context context); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/OsDisk.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/OsDisk.java new file mode 100644 index 000000000000..6d6c29af92fa --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/OsDisk.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.hybridnetwork.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; + +/** + * Specifies information about the operating system disk used by the virtual machine. <br><br> For more + * information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + */ +@Fluent +public final class OsDisk { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OsDisk.class); + + /* + * The OS type. + */ + @JsonProperty(value = "osType") + private OperatingSystemTypes osType; + + /* + * The VHD name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The virtual hard disk. + */ + @JsonProperty(value = "vhd") + private VirtualHardDisk vhd; + + /* + * Specifies the size of os disk in gigabytes. This is the fully expanded + * disk size needed of the VHD image on the ASE. This disk size should be + * greater than the size of the VHD provided in vhdUri. + */ + @JsonProperty(value = "diskSizeGB") + private Integer diskSizeGB; + + /** + * Get the osType property: The OS type. + * + * @return the osType value. + */ + public OperatingSystemTypes osType() { + return this.osType; + } + + /** + * Set the osType property: The OS type. + * + * @param osType the osType value to set. + * @return the OsDisk object itself. + */ + public OsDisk withOsType(OperatingSystemTypes osType) { + this.osType = osType; + return this; + } + + /** + * Get the name property: The VHD name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The VHD name. + * + * @param name the name value to set. + * @return the OsDisk object itself. + */ + public OsDisk withName(String name) { + this.name = name; + return this; + } + + /** + * Get the vhd property: The virtual hard disk. + * + * @return the vhd value. + */ + public VirtualHardDisk vhd() { + return this.vhd; + } + + /** + * Set the vhd property: The virtual hard disk. + * + * @param vhd the vhd value to set. + * @return the OsDisk object itself. + */ + public OsDisk withVhd(VirtualHardDisk vhd) { + this.vhd = vhd; + return this; + } + + /** + * Get the diskSizeGB property: Specifies the size of os disk in gigabytes. This is the fully expanded disk size + * needed of the VHD image on the ASE. This disk size should be greater than the size of the VHD provided in vhdUri. + * + * @return the diskSizeGB value. + */ + public Integer diskSizeGB() { + return this.diskSizeGB; + } + + /** + * Set the diskSizeGB property: Specifies the size of os disk in gigabytes. This is the fully expanded disk size + * needed of the VHD image on the ASE. This disk size should be greater than the size of the VHD provided in vhdUri. + * + * @param diskSizeGB the diskSizeGB value to set. + * @return the OsDisk object itself. + */ + public OsDisk withDiskSizeGB(Integer diskSizeGB) { + this.diskSizeGB = diskSizeGB; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (vhd() != null) { + vhd().validate(); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/OsProfile.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/OsProfile.java new file mode 100644 index 000000000000..25fbd46fad48 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/OsProfile.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.hybridnetwork.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; + +/** Specifies the operating system settings for the role instance. */ +@Fluent +public final class OsProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OsProfile.class); + + /* + * Specifies the name of the administrator account.

**Windows-only + * restriction:** Cannot end in "."

**Disallowed values:** + * "administrator", "admin", "user", "user1", "test", "user2", "test1", + * "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", + * "aspnet", "backup", "console", "david", "guest", "john", "owner", + * "root", "server", "sql", "support", "support_388945a0", "sys", "test2", + * "test3", "user4", "user5".

**Minimum-length (Linux):** 1 + * character

**Max-length (Linux):** 64 characters

+ * **Max-length (Windows):** 20 characters

  • For root access to + * the Linux VM, see [Using root privileges on Linux virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + * For a list of built-in system users on Linux that should not be used in + * this field, see [Selecting User Names for Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + */ + @JsonProperty(value = "adminUsername") + private String adminUsername; + + /* + * Specifies the Linux operating system settings on the virtual machine. + *

    For a list of supported Linux distributions, see [Linux on + * Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + */ + @JsonProperty(value = "linuxConfiguration") + private LinuxConfiguration linuxConfiguration; + + /* + * Specifies a base-64 encoded string of custom data. The base-64 encoded + * string is decoded to a binary array that is saved as a file on the + * virtual machine. The maximum length of the binary array is 65535 bytes. + *

    **Note: Do not pass any secrets or passwords in customData + * property**

    This property cannot be updated after the VM is + * created.

    customData is passed to the VM to be saved as a file. + * For more information see [Custom Data on Azure + * VMs](https://azure.microsoft.com/en-us/blog/custom-data-and-cloud-init-on-windows-azure/) + *

    For using cloud-init for your Linux VM, see [Using cloud-init + * to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + */ + @JsonProperty(value = "customData") + private String customData; + + /* + * Indicates if custom data is required to deploy this role. + */ + @JsonProperty(value = "customDataRequired") + private Boolean customDataRequired; + + /** + * Get the adminUsername property: Specifies the name of the administrator account. <br><br> + * **Windows-only restriction:** Cannot end in "." <br><br> **Disallowed values:** "administrator", + * "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", + * "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", + * "support_388945a0", "sys", "test2", "test3", "user4", "user5". <br><br> **Minimum-length (Linux):** 1 + * character <br><br> **Max-length (Linux):** 64 characters <br><br> **Max-length + * (Windows):** 20 characters <br><br><li> For root access to the Linux VM, see [Using root + * privileges on Linux virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)<br><li> + * For a list of built-in system users on Linux that should not be used in this field, see [Selecting User Names for + * Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @return the adminUsername value. + */ + public String adminUsername() { + return this.adminUsername; + } + + /** + * Set the adminUsername property: Specifies the name of the administrator account. <br><br> + * **Windows-only restriction:** Cannot end in "." <br><br> **Disallowed values:** "administrator", + * "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", + * "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", + * "support_388945a0", "sys", "test2", "test3", "user4", "user5". <br><br> **Minimum-length (Linux):** 1 + * character <br><br> **Max-length (Linux):** 64 characters <br><br> **Max-length + * (Windows):** 20 characters <br><br><li> For root access to the Linux VM, see [Using root + * privileges on Linux virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)<br><li> + * For a list of built-in system users on Linux that should not be used in this field, see [Selecting User Names for + * Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @param adminUsername the adminUsername value to set. + * @return the OsProfile object itself. + */ + public OsProfile withAdminUsername(String adminUsername) { + this.adminUsername = adminUsername; + return this; + } + + /** + * Get the linuxConfiguration property: Specifies the Linux operating system settings on the virtual machine. + * <br><br>For a list of supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * <br><br> For running non-endorsed distributions, see [Information for Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @return the linuxConfiguration value. + */ + public LinuxConfiguration linuxConfiguration() { + return this.linuxConfiguration; + } + + /** + * Set the linuxConfiguration property: Specifies the Linux operating system settings on the virtual machine. + * <br><br>For a list of supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * <br><br> For running non-endorsed distributions, see [Information for Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @param linuxConfiguration the linuxConfiguration value to set. + * @return the OsProfile object itself. + */ + public OsProfile withLinuxConfiguration(LinuxConfiguration linuxConfiguration) { + this.linuxConfiguration = linuxConfiguration; + return this; + } + + /** + * Get the customData property: Specifies a base-64 encoded string of custom data. The base-64 encoded string is + * decoded to a binary array that is saved as a file on the virtual machine. The maximum length of the binary array + * is 65535 bytes. <br><br> **Note: Do not pass any secrets or passwords in customData property** + * <br><br> This property cannot be updated after the VM is created. <br><br> customData is + * passed to the VM to be saved as a file. For more information see [Custom Data on Azure + * VMs](https://azure.microsoft.com/en-us/blog/custom-data-and-cloud-init-on-windows-azure/) <br><br> + * For using cloud-init for your Linux VM, see [Using cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @return the customData value. + */ + public String customData() { + return this.customData; + } + + /** + * Set the customData property: Specifies a base-64 encoded string of custom data. The base-64 encoded string is + * decoded to a binary array that is saved as a file on the virtual machine. The maximum length of the binary array + * is 65535 bytes. <br><br> **Note: Do not pass any secrets or passwords in customData property** + * <br><br> This property cannot be updated after the VM is created. <br><br> customData is + * passed to the VM to be saved as a file. For more information see [Custom Data on Azure + * VMs](https://azure.microsoft.com/en-us/blog/custom-data-and-cloud-init-on-windows-azure/) <br><br> + * For using cloud-init for your Linux VM, see [Using cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @param customData the customData value to set. + * @return the OsProfile object itself. + */ + public OsProfile withCustomData(String customData) { + this.customData = customData; + return this; + } + + /** + * Get the customDataRequired property: Indicates if custom data is required to deploy this role. + * + * @return the customDataRequired value. + */ + public Boolean customDataRequired() { + return this.customDataRequired; + } + + /** + * Set the customDataRequired property: Indicates if custom data is required to deploy this role. + * + * @param customDataRequired the customDataRequired value to set. + * @return the OsProfile object itself. + */ + public OsProfile withCustomDataRequired(Boolean customDataRequired) { + this.customDataRequired = customDataRequired; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (linuxConfiguration() != null) { + linuxConfiguration().validate(); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/PreviewSubscription.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/PreviewSubscription.java new file mode 100644 index 000000000000..bf3268bc200a --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/PreviewSubscription.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.hybridnetwork.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridnetwork.fluent.models.PreviewSubscriptionInner; + +/** An immutable client-side representation of PreviewSubscription. */ +public interface PreviewSubscription { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: The provisioning state of the PreviewSubscription resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.hybridnetwork.fluent.models.PreviewSubscriptionInner object. + * + * @return the inner object. + */ + PreviewSubscriptionInner innerModel(); + + /** The entirety of the PreviewSubscription definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The PreviewSubscription definition stages. */ + interface DefinitionStages { + /** The first stage of the PreviewSubscription definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the PreviewSubscription definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies vendorName, skuName. + * + * @param vendorName The name of the vendor. + * @param skuName The name of the vendor sku. + * @return the next definition stage. + */ + WithCreate withExistingVendorSku(String vendorName, String skuName); + } + /** + * The stage of the PreviewSubscription 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. + */ + PreviewSubscription create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + PreviewSubscription create(Context context); + } + } + /** + * Begins update for the PreviewSubscription resource. + * + * @return the stage of resource update. + */ + PreviewSubscription.Update update(); + + /** The template for PreviewSubscription update. */ + interface Update { + /** + * Executes the update request. + * + * @return the updated resource. + */ + PreviewSubscription apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + PreviewSubscription apply(Context context); + } + /** The PreviewSubscription update stages. */ + interface UpdateStages { + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + PreviewSubscription refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + PreviewSubscription refresh(Context context); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/PreviewSubscriptionsList.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/PreviewSubscriptionsList.java new file mode 100644 index 000000000000..2f6d0e04a90c --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/PreviewSubscriptionsList.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.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybridnetwork.fluent.models.PreviewSubscriptionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of customer subscriptions which can use a sku. */ +@Fluent +public final class PreviewSubscriptionsList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PreviewSubscriptionsList.class); + + /* + * A list of preview subscriptions. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of preview subscriptions. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of preview subscriptions. + * + * @param value the value value to set. + * @return the PreviewSubscriptionsList object itself. + */ + public PreviewSubscriptionsList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ProvisioningState.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ProvisioningState.java new file mode 100644 index 000000000000..dc8c15999bc7 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ProvisioningState.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.hybridnetwork.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 Unknown for ProvisioningState. */ + public static final ProvisioningState UNKNOWN = fromString("Unknown"); + + /** Static value Succeeded for ProvisioningState. */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Accepted for ProvisioningState. */ + public static final ProvisioningState ACCEPTED = fromString("Accepted"); + + /** Static value Deleting for ProvisioningState. */ + public static final ProvisioningState DELETING = fromString("Deleting"); + + /** Static value Failed for ProvisioningState. */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** Static value Canceled for ProvisioningState. */ + public static final ProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Deleted for ProvisioningState. */ + public static final ProvisioningState DELETED = fromString("Deleted"); + + /** + * Creates 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/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/RoleInstance.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/RoleInstance.java new file mode 100644 index 000000000000..b65cec0bd6e1 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/RoleInstance.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.hybridnetwork.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.hybridnetwork.fluent.models.RoleInstanceInner; + +/** An immutable client-side representation of RoleInstance. */ +public interface RoleInstance { + /** + * Gets the name property: The role instance name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the id property: The ARM ID of the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: The provisioning state of the RoleInstance resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the operationalState property: The operational state of the role instance. + * + * @return the operationalState value. + */ + OperationalState operationalState(); + + /** + * Gets the inner com.azure.resourcemanager.hybridnetwork.fluent.models.RoleInstanceInner object. + * + * @return the inner object. + */ + RoleInstanceInner innerModel(); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/RoleInstances.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/RoleInstances.java new file mode 100644 index 000000000000..0ea31792cf98 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/RoleInstances.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.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 RoleInstances. */ +public interface RoleInstances { + /** + * Starts a role instance of a vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param roleInstanceName The name of the role instance of the vendor network function. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(String locationName, String vendorName, String serviceKey, String roleInstanceName); + + /** + * Starts a role instance of a vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param roleInstanceName The name of the role instance of the vendor network function. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(String locationName, String vendorName, String serviceKey, String roleInstanceName, Context context); + + /** + * Powers off (stop) a role instance of a vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param roleInstanceName The name of the role instance of the vendor network function. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 locationName, String vendorName, String serviceKey, String roleInstanceName); + + /** + * Powers off (stop) a role instance of a vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param roleInstanceName The name of the role instance of the vendor network function. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 locationName, String vendorName, String serviceKey, String roleInstanceName, Context context); + + /** + * Restarts a role instance of a vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param roleInstanceName The name of the role instance of the vendor network function. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void restart(String locationName, String vendorName, String serviceKey, String roleInstanceName); + + /** + * Restarts a role instance of a vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param roleInstanceName The name of the role instance of the vendor network function. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void restart(String locationName, String vendorName, String serviceKey, String roleInstanceName, Context context); + + /** + * Gets the information of role instance of vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param roleInstanceName The name of the role instance of the vendor network function. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the information of role instance of vendor network function. + */ + RoleInstance get(String locationName, String vendorName, String serviceKey, String roleInstanceName); + + /** + * Gets the information of role instance of vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param roleInstanceName The name of the role instance of the vendor network function. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the information of role instance of vendor network function. + */ + Response getWithResponse( + String locationName, String vendorName, String serviceKey, String roleInstanceName, Context context); + + /** + * Lists the information of role instances of vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of role instances of vendor network function. + */ + PagedIterable list(String locationName, String vendorName, String serviceKey); + + /** + * Lists the information of role instances of vendor network function. + * + * @param locationName The Azure region where the network function resource was created by customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of role instances of vendor network function. + */ + PagedIterable list(String locationName, String vendorName, String serviceKey, Context context); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/SkuDeploymentMode.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/SkuDeploymentMode.java new file mode 100644 index 000000000000..3642dbe1a79f --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/SkuDeploymentMode.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.hybridnetwork.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SkuDeploymentMode. */ +public final class SkuDeploymentMode extends ExpandableStringEnum { + /** Static value Unknown for SkuDeploymentMode. */ + public static final SkuDeploymentMode UNKNOWN = fromString("Unknown"); + + /** Static value Azure for SkuDeploymentMode. */ + public static final SkuDeploymentMode AZURE = fromString("Azure"); + + /** Static value PrivateEdgeZone for SkuDeploymentMode. */ + public static final SkuDeploymentMode PRIVATE_EDGE_ZONE = fromString("PrivateEdgeZone"); + + /** + * Creates or finds a SkuDeploymentMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding SkuDeploymentMode. + */ + @JsonCreator + public static SkuDeploymentMode fromString(String name) { + return fromString(name, SkuDeploymentMode.class); + } + + /** @return known SkuDeploymentMode values. */ + public static Collection values() { + return values(SkuDeploymentMode.class); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/SkuOverview.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/SkuOverview.java new file mode 100644 index 000000000000..4955f450f49f --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/SkuOverview.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.resourcemanager.hybridnetwork.fluent.models.SkuOverviewInner; + +/** An immutable client-side representation of SkuOverview. */ +public interface SkuOverview { + /** + * Gets the skuName property: The vendor sku name. + * + * @return the skuName value. + */ + String skuName(); + + /** + * Gets the skuType property: The vendor sku type. + * + * @return the skuType value. + */ + SkuType skuType(); + + /** + * Gets the inner com.azure.resourcemanager.hybridnetwork.fluent.models.SkuOverviewInner object. + * + * @return the inner object. + */ + SkuOverviewInner innerModel(); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/SkuType.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/SkuType.java new file mode 100644 index 000000000000..32da76ec3432 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/SkuType.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.hybridnetwork.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SkuType. */ +public final class SkuType extends ExpandableStringEnum { + /** Static value Unknown for SkuType. */ + public static final SkuType UNKNOWN = fromString("Unknown"); + + /** Static value EvolvedPacketCore for SkuType. */ + public static final SkuType EVOLVED_PACKET_CORE = fromString("EvolvedPacketCore"); + + /** Static value SDWAN for SkuType. */ + public static final SkuType SDWAN = fromString("SDWAN"); + + /** Static value Firewall for SkuType. */ + public static final SkuType FIREWALL = fromString("Firewall"); + + /** + * Creates or finds a SkuType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SkuType. + */ + @JsonCreator + public static SkuType fromString(String name) { + return fromString(name, SkuType.class); + } + + /** @return known SkuType values. */ + public static Collection values() { + return values(SkuType.class); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/SshConfiguration.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/SshConfiguration.java new file mode 100644 index 000000000000..5e4303b66cec --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/SshConfiguration.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.hybridnetwork.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; + +/** SSH configuration for Linux based VMs running on Azure. */ +@Fluent +public final class SshConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SshConfiguration.class); + + /* + * The list of SSH public keys used to authenticate with linux based VMs. + */ + @JsonProperty(value = "publicKeys") + private List publicKeys; + + /** + * Get the publicKeys property: The list of SSH public keys used to authenticate with linux based VMs. + * + * @return the publicKeys value. + */ + public List publicKeys() { + return this.publicKeys; + } + + /** + * Set the publicKeys property: The list of SSH public keys used to authenticate with linux based VMs. + * + * @param publicKeys the publicKeys value to set. + * @return the SshConfiguration object itself. + */ + public SshConfiguration withPublicKeys(List publicKeys) { + this.publicKeys = publicKeys; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (publicKeys() != null) { + publicKeys().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/SshPublicKey.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/SshPublicKey.java new file mode 100644 index 000000000000..79809d13d684 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/SshPublicKey.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.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; + +/** + * Contains information about SSH certificate public key and the path on the Linux VM where the public key is placed. + */ +@Fluent +public final class SshPublicKey { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SshPublicKey.class); + + /* + * Specifies the full path on the created VM where ssh public key is + * stored. If the file already exists, the specified key is appended to the + * file. Example: /home/user/.ssh/authorized_keys + */ + @JsonProperty(value = "path") + private String path; + + /* + * SSH public key certificate used to authenticate with the VM through ssh. + * The key needs to be at least 2048-bit and in ssh-rsa format.

    + * For creating ssh keys, see [Create SSH keys on Linux and Mac for Linux + * VMs in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-mac-create-ssh-keys?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + */ + @JsonProperty(value = "keyData") + private String keyData; + + /** + * Get the path property: Specifies the full path on the created VM where ssh public key is stored. If the file + * already exists, the specified key is appended to the file. Example: /home/user/.ssh/authorized_keys. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: Specifies the full path on the created VM where ssh public key is stored. If the file + * already exists, the specified key is appended to the file. Example: /home/user/.ssh/authorized_keys. + * + * @param path the path value to set. + * @return the SshPublicKey object itself. + */ + public SshPublicKey withPath(String path) { + this.path = path; + return this; + } + + /** + * Get the keyData property: SSH public key certificate used to authenticate with the VM through ssh. The key needs + * to be at least 2048-bit and in ssh-rsa format. <br><br> For creating ssh keys, see [Create SSH keys + * on Linux and Mac for Linux VMs in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-mac-create-ssh-keys?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @return the keyData value. + */ + public String keyData() { + return this.keyData; + } + + /** + * Set the keyData property: SSH public key certificate used to authenticate with the VM through ssh. The key needs + * to be at least 2048-bit and in ssh-rsa format. <br><br> For creating ssh keys, see [Create SSH keys + * on Linux and Mac for Linux VMs in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-mac-create-ssh-keys?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @param keyData the keyData value to set. + * @return the SshPublicKey object itself. + */ + public SshPublicKey withKeyData(String keyData) { + this.keyData = keyData; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Status.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Status.java new file mode 100644 index 000000000000..4de76f09d4df --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Status.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.hybridnetwork.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Status. */ +public final class Status extends ExpandableStringEnum { + /** Static value Unknown for Status. */ + public static final Status UNKNOWN = fromString("Unknown"); + + /** Static value NotRegistered for Status. */ + public static final Status NOT_REGISTERED = fromString("NotRegistered"); + + /** Static value Registered for Status. */ + public static final Status REGISTERED = fromString("Registered"); + + /** Static value Deleted for Status. */ + public static final Status DELETED = fromString("Deleted"); + + /** + * Creates or finds a Status from its string representation. + * + * @param name a name to look for. + * @return the corresponding Status. + */ + @JsonCreator + public static Status fromString(String name) { + return fromString(name, Status.class); + } + + /** @return known Status values. */ + public static Collection values() { + return values(Status.class); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/StorageProfile.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/StorageProfile.java new file mode 100644 index 000000000000..05f1eb00a4f7 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/StorageProfile.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.hybridnetwork.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; + +/** Specifies the storage settings for the virtual machine disks. */ +@Fluent +public final class StorageProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageProfile.class); + + /* + * The image reference properties. + */ + @JsonProperty(value = "imageReference") + private ImageReference imageReference; + + /* + * Specifies information about the operating system disk used by the + * virtual machine. + */ + @JsonProperty(value = "osDisk") + private OsDisk osDisk; + + /* + * Specifies the parameters that are used to add a data disk to a virtual + * machine. + */ + @JsonProperty(value = "dataDisks") + private List dataDisks; + + /** + * Get the imageReference property: The image reference properties. + * + * @return the imageReference value. + */ + public ImageReference imageReference() { + return this.imageReference; + } + + /** + * Set the imageReference property: The image reference properties. + * + * @param imageReference the imageReference value to set. + * @return the StorageProfile object itself. + */ + public StorageProfile withImageReference(ImageReference imageReference) { + this.imageReference = imageReference; + return this; + } + + /** + * Get the osDisk property: Specifies information about the operating system disk used by the virtual machine. + * + * @return the osDisk value. + */ + public OsDisk osDisk() { + return this.osDisk; + } + + /** + * Set the osDisk property: Specifies information about the operating system disk used by the virtual machine. + * + * @param osDisk the osDisk value to set. + * @return the StorageProfile object itself. + */ + public StorageProfile withOsDisk(OsDisk osDisk) { + this.osDisk = osDisk; + return this; + } + + /** + * Get the dataDisks property: Specifies the parameters that are used to add a data disk to a virtual machine. + * + * @return the dataDisks value. + */ + public List dataDisks() { + return this.dataDisks; + } + + /** + * Set the dataDisks property: Specifies the parameters that are used to add a data disk to a virtual machine. + * + * @param dataDisks the dataDisks value to set. + * @return the StorageProfile object itself. + */ + public StorageProfile withDataDisks(List dataDisks) { + this.dataDisks = dataDisks; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (imageReference() != null) { + imageReference().validate(); + } + if (osDisk() != null) { + osDisk().validate(); + } + if (dataDisks() != null) { + dataDisks().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/TagsObject.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/TagsObject.java new file mode 100644 index 000000000000..9498e5d84ec5 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/TagsObject.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.hybridnetwork.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.Map; + +/** Tags object for patch operations. */ +@Fluent +public final class TagsObject { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TagsObject.class); + + /* + * Resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the TagsObject object itself. + */ + public TagsObject withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VMSwitchType.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VMSwitchType.java new file mode 100644 index 000000000000..9bfe6493774f --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VMSwitchType.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.hybridnetwork.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VMSwitchType. */ +public final class VMSwitchType extends ExpandableStringEnum { + /** Static value Unknown for VMSwitchType. */ + public static final VMSwitchType UNKNOWN = fromString("Unknown"); + + /** Static value Management for VMSwitchType. */ + public static final VMSwitchType MANAGEMENT = fromString("Management"); + + /** Static value Wan for VMSwitchType. */ + public static final VMSwitchType WAN = fromString("Wan"); + + /** Static value Lan for VMSwitchType. */ + public static final VMSwitchType LAN = fromString("Lan"); + + /** + * Creates or finds a VMSwitchType from its string representation. + * + * @param name a name to look for. + * @return the corresponding VMSwitchType. + */ + @JsonCreator + public static VMSwitchType fromString(String name) { + return fromString(name, VMSwitchType.class); + } + + /** @return known VMSwitchType values. */ + public static Collection values() { + return values(VMSwitchType.class); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Vendor.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Vendor.java new file mode 100644 index 000000000000..a6c33e6eb998 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Vendor.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.hybridnetwork.models; + +import com.azure.core.management.SubResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridnetwork.fluent.models.VendorInner; +import java.util.List; + +/** An immutable client-side representation of Vendor. */ +public interface Vendor { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: The provisioning state of the vendor resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the skus property: A list of IDs of the vendor skus offered by the vendor. + * + * @return the skus value. + */ + List skus(); + + /** + * Gets the inner com.azure.resourcemanager.hybridnetwork.fluent.models.VendorInner object. + * + * @return the inner object. + */ + VendorInner innerModel(); + + /** The entirety of the Vendor definition. */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithCreate { + } + /** The Vendor definition stages. */ + interface DefinitionStages { + /** The first stage of the Vendor definition. */ + interface Blank extends WithCreate { + } + /** + * The stage of the Vendor 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. + */ + Vendor create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Vendor create(Context context); + } + } + /** + * Begins update for the Vendor resource. + * + * @return the stage of resource update. + */ + Vendor.Update update(); + + /** The template for Vendor update. */ + interface Update { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Vendor apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Vendor apply(Context context); + } + /** The Vendor update stages. */ + interface UpdateStages { + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Vendor refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Vendor refresh(Context context); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VendorListResult.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VendorListResult.java new file mode 100644 index 000000000000..55e74879207a --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VendorListResult.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.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybridnetwork.fluent.models.VendorInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for vendors API service call. */ +@Fluent +public final class VendorListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VendorListResult.class); + + /* + * A list of vendors. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of vendors. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of vendors. + * + * @param value the value value to set. + * @return the VendorListResult object itself. + */ + public VendorListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VendorNetworkFunction.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VendorNetworkFunction.java new file mode 100644 index 000000000000..73e04d5e8324 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VendorNetworkFunction.java @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridnetwork.fluent.models.VendorNetworkFunctionInner; +import java.util.List; + +/** An immutable client-side representation of VendorNetworkFunction. */ +public interface VendorNetworkFunction { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: The provisioning state of the vendor network function sub resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the vendorProvisioningState property: The vendor controlled provisioning state of the vendor network + * function. + * + * @return the vendorProvisioningState value. + */ + VendorProvisioningState vendorProvisioningState(); + + /** + * Gets the skuName property: The name of the sku. Once set, it cannot be updated. + * + * @return the skuName value. + */ + String skuName(); + + /** + * Gets the skuType property: The sku type. + * + * @return the skuType value. + */ + SkuType skuType(); + + /** + * Gets the networkFunctionVendorConfigurations property: An array of network function vendor configurations. + * + * @return the networkFunctionVendorConfigurations value. + */ + List networkFunctionVendorConfigurations(); + + /** + * Gets the inner com.azure.resourcemanager.hybridnetwork.fluent.models.VendorNetworkFunctionInner object. + * + * @return the inner object. + */ + VendorNetworkFunctionInner innerModel(); + + /** The entirety of the VendorNetworkFunction definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The VendorNetworkFunction definition stages. */ + interface DefinitionStages { + /** The first stage of the VendorNetworkFunction definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the VendorNetworkFunction definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies locationName, vendorName. + * + * @param locationName The Azure region where the network function resource was created by the customer. + * @param vendorName The name of the vendor. + * @return the next definition stage. + */ + WithCreate withExistingVendor(String locationName, String vendorName); + } + /** + * The stage of the VendorNetworkFunction 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.WithVendorProvisioningState, + DefinitionStages.WithNetworkFunctionVendorConfigurations { + /** + * Executes the create request. + * + * @return the created resource. + */ + VendorNetworkFunction create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + VendorNetworkFunction create(Context context); + } + /** The stage of the VendorNetworkFunction definition allowing to specify vendorProvisioningState. */ + interface WithVendorProvisioningState { + /** + * Specifies the vendorProvisioningState property: The vendor controlled provisioning state of the vendor + * network function.. + * + * @param vendorProvisioningState The vendor controlled provisioning state of the vendor network function. + * @return the next definition stage. + */ + WithCreate withVendorProvisioningState(VendorProvisioningState vendorProvisioningState); + } + /** + * The stage of the VendorNetworkFunction definition allowing to specify networkFunctionVendorConfigurations. + */ + interface WithNetworkFunctionVendorConfigurations { + /** + * Specifies the networkFunctionVendorConfigurations property: An array of network function vendor + * configurations.. + * + * @param networkFunctionVendorConfigurations An array of network function vendor configurations. + * @return the next definition stage. + */ + WithCreate withNetworkFunctionVendorConfigurations( + List networkFunctionVendorConfigurations); + } + } + /** + * Begins update for the VendorNetworkFunction resource. + * + * @return the stage of resource update. + */ + VendorNetworkFunction.Update update(); + + /** The template for VendorNetworkFunction update. */ + interface Update + extends UpdateStages.WithVendorProvisioningState, UpdateStages.WithNetworkFunctionVendorConfigurations { + /** + * Executes the update request. + * + * @return the updated resource. + */ + VendorNetworkFunction apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + VendorNetworkFunction apply(Context context); + } + /** The VendorNetworkFunction update stages. */ + interface UpdateStages { + /** The stage of the VendorNetworkFunction update allowing to specify vendorProvisioningState. */ + interface WithVendorProvisioningState { + /** + * Specifies the vendorProvisioningState property: The vendor controlled provisioning state of the vendor + * network function.. + * + * @param vendorProvisioningState The vendor controlled provisioning state of the vendor network function. + * @return the next definition stage. + */ + Update withVendorProvisioningState(VendorProvisioningState vendorProvisioningState); + } + /** The stage of the VendorNetworkFunction update allowing to specify networkFunctionVendorConfigurations. */ + interface WithNetworkFunctionVendorConfigurations { + /** + * Specifies the networkFunctionVendorConfigurations property: An array of network function vendor + * configurations.. + * + * @param networkFunctionVendorConfigurations An array of network function vendor configurations. + * @return the next definition stage. + */ + Update withNetworkFunctionVendorConfigurations( + List networkFunctionVendorConfigurations); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + VendorNetworkFunction refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + VendorNetworkFunction refresh(Context context); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VendorNetworkFunctionListResult.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VendorNetworkFunctionListResult.java new file mode 100644 index 000000000000..66411e04115e --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VendorNetworkFunctionListResult.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.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybridnetwork.fluent.models.VendorNetworkFunctionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for vendors API service call. */ +@Fluent +public final class VendorNetworkFunctionListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VendorNetworkFunctionListResult.class); + + /* + * A list of vendor network functions. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of vendor network functions. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of vendor network functions. + * + * @param value the value value to set. + * @return the VendorNetworkFunctionListResult object itself. + */ + public VendorNetworkFunctionListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VendorNetworkFunctions.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VendorNetworkFunctions.java new file mode 100644 index 000000000000..4856aef9efaf --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VendorNetworkFunctions.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.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 VendorNetworkFunctions. */ +public interface VendorNetworkFunctions { + /** + * Gets information about the specified vendor network function. + * + * @param locationName The Azure region where the network function resource was created by the customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified vendor network function. + */ + VendorNetworkFunction get(String locationName, String vendorName, String serviceKey); + + /** + * Gets information about the specified vendor network function. + * + * @param locationName The Azure region where the network function resource was created by the customer. + * @param vendorName The name of the vendor. + * @param serviceKey The GUID for the vendor network function. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified vendor network function. + */ + Response getWithResponse( + String locationName, String vendorName, String serviceKey, Context context); + + /** + * Lists all the vendor network function sub resources in an Azure region, filtered by skuType, skuName, + * vendorProvisioningState. + * + * @param locationName The Azure region where the network function resource was created by the customer. + * @param vendorName The name of the vendor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for vendors API service call. + */ + PagedIterable list(String locationName, String vendorName); + + /** + * Lists all the vendor network function sub resources in an Azure region, filtered by skuType, skuName, + * vendorProvisioningState. + * + * @param locationName The Azure region where the network function resource was created by the customer. + * @param vendorName The name of the vendor. + * @param filter The filter to apply on the operation. The properties you can use for eq (equals) are: skuType, + * skuName and vendorProvisioningState. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for vendors API service call. + */ + PagedIterable list(String locationName, String vendorName, String filter, Context context); + + /** + * Gets information about the specified vendor network function. + * + * @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 information about the specified vendor network function. + */ + VendorNetworkFunction getById(String id); + + /** + * Gets information about the specified vendor network function. + * + * @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 information about the specified vendor network function. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new VendorNetworkFunction resource. + * + * @param name resource name. + * @return the first stage of the new VendorNetworkFunction definition. + */ + VendorNetworkFunction.DefinitionStages.Blank define(String name); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VendorProvisioningState.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VendorProvisioningState.java new file mode 100644 index 000000000000..0fd87df8bf02 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VendorProvisioningState.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.hybridnetwork.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VendorProvisioningState. */ +public final class VendorProvisioningState extends ExpandableStringEnum { + /** Static value Unknown for VendorProvisioningState. */ + public static final VendorProvisioningState UNKNOWN = fromString("Unknown"); + + /** Static value NotProvisioned for VendorProvisioningState. */ + public static final VendorProvisioningState NOT_PROVISIONED = fromString("NotProvisioned"); + + /** Static value Provisioning for VendorProvisioningState. */ + public static final VendorProvisioningState PROVISIONING = fromString("Provisioning"); + + /** Static value Provisioned for VendorProvisioningState. */ + public static final VendorProvisioningState PROVISIONED = fromString("Provisioned"); + + /** Static value Deprovisioned for VendorProvisioningState. */ + public static final VendorProvisioningState DEPROVISIONED = fromString("Deprovisioned"); + + /** Static value UserDataValidationFailed for VendorProvisioningState. */ + public static final VendorProvisioningState USER_DATA_VALIDATION_FAILED = fromString("UserDataValidationFailed"); + + /** + * Creates or finds a VendorProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding VendorProvisioningState. + */ + @JsonCreator + public static VendorProvisioningState fromString(String name) { + return fromString(name, VendorProvisioningState.class); + } + + /** @return known VendorProvisioningState values. */ + public static Collection values() { + return values(VendorProvisioningState.class); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VendorSku.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VendorSku.java new file mode 100644 index 000000000000..8d1291e1ef0c --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VendorSku.java @@ -0,0 +1,344 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridnetwork.fluent.models.VendorSkuInner; + +/** An immutable client-side representation of VendorSku. */ +public interface VendorSku { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: The provisioning state of the vendor sku sub resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the skuType property: The sku type. + * + * @return the skuType value. + */ + SkuType skuType(); + + /** + * Gets the deploymentMode property: The sku deployment mode. + * + * @return the deploymentMode value. + */ + SkuDeploymentMode deploymentMode(); + + /** + * Gets the networkFunctionType property: The network function type. + * + * @return the networkFunctionType value. + */ + NetworkFunctionType networkFunctionType(); + + /** + * Gets the preview property: Indicates if the vendor sku is in preview mode. + * + * @return the preview value. + */ + Boolean preview(); + + /** + * Gets the managedApplicationParameters property: The parameters for the managed application to be supplied by the + * vendor. + * + * @return the managedApplicationParameters value. + */ + Object managedApplicationParameters(); + + /** + * Gets the managedApplicationTemplate property: The template for the managed application deployment. + * + * @return the managedApplicationTemplate value. + */ + Object managedApplicationTemplate(); + + /** + * Gets the networkFunctionTemplate property: The template definition of the network function. + * + * @return the networkFunctionTemplate value. + */ + NetworkFunctionTemplate networkFunctionTemplate(); + + /** + * Gets the inner com.azure.resourcemanager.hybridnetwork.fluent.models.VendorSkuInner object. + * + * @return the inner object. + */ + VendorSkuInner innerModel(); + + /** The entirety of the VendorSku definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The VendorSku definition stages. */ + interface DefinitionStages { + /** The first stage of the VendorSku definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the VendorSku definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies vendorName. + * + * @param vendorName The name of the vendor. + * @return the next definition stage. + */ + WithCreate withExistingVendor(String vendorName); + } + /** + * The stage of the VendorSku 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.WithSkuType, + DefinitionStages.WithDeploymentMode, + DefinitionStages.WithNetworkFunctionType, + DefinitionStages.WithPreview, + DefinitionStages.WithManagedApplicationParameters, + DefinitionStages.WithManagedApplicationTemplate, + DefinitionStages.WithNetworkFunctionTemplate { + /** + * Executes the create request. + * + * @return the created resource. + */ + VendorSku create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + VendorSku create(Context context); + } + /** The stage of the VendorSku definition allowing to specify skuType. */ + interface WithSkuType { + /** + * Specifies the skuType property: The sku type.. + * + * @param skuType The sku type. + * @return the next definition stage. + */ + WithCreate withSkuType(SkuType skuType); + } + /** The stage of the VendorSku definition allowing to specify deploymentMode. */ + interface WithDeploymentMode { + /** + * Specifies the deploymentMode property: The sku deployment mode.. + * + * @param deploymentMode The sku deployment mode. + * @return the next definition stage. + */ + WithCreate withDeploymentMode(SkuDeploymentMode deploymentMode); + } + /** The stage of the VendorSku definition allowing to specify networkFunctionType. */ + interface WithNetworkFunctionType { + /** + * Specifies the networkFunctionType property: The network function type.. + * + * @param networkFunctionType The network function type. + * @return the next definition stage. + */ + WithCreate withNetworkFunctionType(NetworkFunctionType networkFunctionType); + } + /** The stage of the VendorSku definition allowing to specify preview. */ + interface WithPreview { + /** + * Specifies the preview property: Indicates if the vendor sku is in preview mode.. + * + * @param preview Indicates if the vendor sku is in preview mode. + * @return the next definition stage. + */ + WithCreate withPreview(Boolean preview); + } + /** The stage of the VendorSku definition allowing to specify managedApplicationParameters. */ + interface WithManagedApplicationParameters { + /** + * Specifies the managedApplicationParameters property: The parameters for the managed application to be + * supplied by the vendor.. + * + * @param managedApplicationParameters The parameters for the managed application to be supplied by the + * vendor. + * @return the next definition stage. + */ + WithCreate withManagedApplicationParameters(Object managedApplicationParameters); + } + /** The stage of the VendorSku definition allowing to specify managedApplicationTemplate. */ + interface WithManagedApplicationTemplate { + /** + * Specifies the managedApplicationTemplate property: The template for the managed application deployment.. + * + * @param managedApplicationTemplate The template for the managed application deployment. + * @return the next definition stage. + */ + WithCreate withManagedApplicationTemplate(Object managedApplicationTemplate); + } + /** The stage of the VendorSku definition allowing to specify networkFunctionTemplate. */ + interface WithNetworkFunctionTemplate { + /** + * Specifies the networkFunctionTemplate property: The template definition of the network function.. + * + * @param networkFunctionTemplate The template definition of the network function. + * @return the next definition stage. + */ + WithCreate withNetworkFunctionTemplate(NetworkFunctionTemplate networkFunctionTemplate); + } + } + /** + * Begins update for the VendorSku resource. + * + * @return the stage of resource update. + */ + VendorSku.Update update(); + + /** The template for VendorSku update. */ + interface Update + extends UpdateStages.WithSkuType, + UpdateStages.WithDeploymentMode, + UpdateStages.WithNetworkFunctionType, + UpdateStages.WithPreview, + UpdateStages.WithManagedApplicationParameters, + UpdateStages.WithManagedApplicationTemplate, + UpdateStages.WithNetworkFunctionTemplate { + /** + * Executes the update request. + * + * @return the updated resource. + */ + VendorSku apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + VendorSku apply(Context context); + } + /** The VendorSku update stages. */ + interface UpdateStages { + /** The stage of the VendorSku update allowing to specify skuType. */ + interface WithSkuType { + /** + * Specifies the skuType property: The sku type.. + * + * @param skuType The sku type. + * @return the next definition stage. + */ + Update withSkuType(SkuType skuType); + } + /** The stage of the VendorSku update allowing to specify deploymentMode. */ + interface WithDeploymentMode { + /** + * Specifies the deploymentMode property: The sku deployment mode.. + * + * @param deploymentMode The sku deployment mode. + * @return the next definition stage. + */ + Update withDeploymentMode(SkuDeploymentMode deploymentMode); + } + /** The stage of the VendorSku update allowing to specify networkFunctionType. */ + interface WithNetworkFunctionType { + /** + * Specifies the networkFunctionType property: The network function type.. + * + * @param networkFunctionType The network function type. + * @return the next definition stage. + */ + Update withNetworkFunctionType(NetworkFunctionType networkFunctionType); + } + /** The stage of the VendorSku update allowing to specify preview. */ + interface WithPreview { + /** + * Specifies the preview property: Indicates if the vendor sku is in preview mode.. + * + * @param preview Indicates if the vendor sku is in preview mode. + * @return the next definition stage. + */ + Update withPreview(Boolean preview); + } + /** The stage of the VendorSku update allowing to specify managedApplicationParameters. */ + interface WithManagedApplicationParameters { + /** + * Specifies the managedApplicationParameters property: The parameters for the managed application to be + * supplied by the vendor.. + * + * @param managedApplicationParameters The parameters for the managed application to be supplied by the + * vendor. + * @return the next definition stage. + */ + Update withManagedApplicationParameters(Object managedApplicationParameters); + } + /** The stage of the VendorSku update allowing to specify managedApplicationTemplate. */ + interface WithManagedApplicationTemplate { + /** + * Specifies the managedApplicationTemplate property: The template for the managed application deployment.. + * + * @param managedApplicationTemplate The template for the managed application deployment. + * @return the next definition stage. + */ + Update withManagedApplicationTemplate(Object managedApplicationTemplate); + } + /** The stage of the VendorSku update allowing to specify networkFunctionTemplate. */ + interface WithNetworkFunctionTemplate { + /** + * Specifies the networkFunctionTemplate property: The template definition of the network function.. + * + * @param networkFunctionTemplate The template definition of the network function. + * @return the next definition stage. + */ + Update withNetworkFunctionTemplate(NetworkFunctionTemplate networkFunctionTemplate); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + VendorSku refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + VendorSku refresh(Context context); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VendorSkuListResult.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VendorSkuListResult.java new file mode 100644 index 000000000000..44c165d578c6 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VendorSkuListResult.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.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybridnetwork.fluent.models.VendorSkuInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for list vendor sku API service call. */ +@Fluent +public final class VendorSkuListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VendorSkuListResult.class); + + /* + * A list of vendor skus offered by the vendor. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URI to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of vendor skus offered by the vendor. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of vendor skus offered by the vendor. + * + * @param value the value value to set. + * @return the VendorSkuListResult object itself. + */ + public VendorSkuListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VendorSkuPreviews.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VendorSkuPreviews.java new file mode 100644 index 000000000000..7232da75bd2b --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VendorSkuPreviews.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.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 VendorSkuPreviews. */ +public interface VendorSkuPreviews { + /** + * Lists all the preview information of a vendor sku. + * + * @param vendorName The name of the vendor. + * @param skuName The name of 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 a list of customer subscriptions which can use a sku. + */ + PagedIterable list(String vendorName, String skuName); + + /** + * Lists all the preview information of a vendor sku. + * + * @param vendorName The name of the vendor. + * @param skuName The name of 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 a list of customer subscriptions which can use a sku. + */ + PagedIterable list(String vendorName, String skuName, Context context); + + /** + * Gets the preview information of a vendor sku. + * + * @param vendorName The name of the vendor. + * @param skuName The name of the vendor sku. + * @param previewSubscription Preview subscription 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 preview information of a vendor sku. + */ + PreviewSubscription get(String vendorName, String skuName, String previewSubscription); + + /** + * Gets the preview information of a vendor sku. + * + * @param vendorName The name of the vendor. + * @param skuName The name of the vendor sku. + * @param previewSubscription Preview subscription 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 preview information of a vendor sku. + */ + Response getWithResponse( + String vendorName, String skuName, String previewSubscription, Context context); + + /** + * Deletes the preview information of a vendor sku. + * + * @param vendorName The name of the vendor. + * @param skuName The name of the vendor sku. + * @param previewSubscription Preview subscription 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 delete(String vendorName, String skuName, String previewSubscription); + + /** + * Deletes the preview information of a vendor sku. + * + * @param vendorName The name of the vendor. + * @param skuName The name of the vendor sku. + * @param previewSubscription Preview subscription ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String vendorName, String skuName, String previewSubscription, Context context); + + /** + * Gets the preview information of a vendor 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. + * @return the preview information of a vendor sku. + */ + PreviewSubscription getById(String id); + + /** + * Gets the preview information of a vendor 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 preview information of a vendor sku. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the preview information of a vendor 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 the preview information of a vendor 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. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new PreviewSubscription resource. + * + * @param name resource name. + * @return the first stage of the new PreviewSubscription definition. + */ + PreviewSubscription.DefinitionStages.Blank define(String name); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VendorSkus.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VendorSkus.java new file mode 100644 index 000000000000..10414d5aab28 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VendorSkus.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.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 VendorSkus. */ +public interface VendorSkus { + /** + * Deletes the specified sku. This operation can take up to 2 hours to complete. This is expected service behavior. + * + * @param vendorName The name of the vendor. + * @param skuName The name of 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 deleteByResourceGroup(String vendorName, String skuName); + + /** + * Deletes the specified sku. This operation can take up to 2 hours to complete. This is expected service behavior. + * + * @param vendorName The name of the vendor. + * @param skuName The name of 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. + */ + void delete(String vendorName, String skuName, Context context); + + /** + * Gets information about the specified sku. + * + * @param vendorName The name of the vendor. + * @param skuName The name of 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 information about the specified sku. + */ + VendorSku get(String vendorName, String skuName); + + /** + * Gets information about the specified sku. + * + * @param vendorName The name of the vendor. + * @param skuName The name of 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 information about the specified sku. + */ + Response getWithResponse(String vendorName, String skuName, Context context); + + /** + * Lists all the skus of a vendor. + * + * @param vendorName The name of the vendor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list vendor sku API service call. + */ + PagedIterable list(String vendorName); + + /** + * Lists all the skus of a vendor. + * + * @param vendorName The name of the vendor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list vendor sku API service call. + */ + PagedIterable list(String vendorName, Context context); + + /** + * Gets information about the specified 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. + * @return information about the specified sku. + */ + VendorSku getById(String id); + + /** + * Gets information about the specified 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 information about the specified sku. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified sku. This operation can take up to 2 hours to complete. This is expected service behavior. + * + * @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 specified sku. This operation can take up to 2 hours to complete. This is expected service behavior. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new VendorSku resource. + * + * @param name resource name. + * @return the first stage of the new VendorSku definition. + */ + VendorSku.DefinitionStages.Blank define(String name); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Vendors.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Vendors.java new file mode 100644 index 000000000000..ebd01a1a9b5d --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Vendors.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.hybridnetwork.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 Vendors. */ +public interface Vendors { + /** + * Deletes the specified vendor. + * + * @param vendorName The name of the vendor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 vendorName); + + /** + * Deletes the specified vendor. + * + * @param vendorName The name of the vendor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 vendorName, Context context); + + /** + * Gets information about the specified vendor. + * + * @param vendorName The name of the vendor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified vendor. + */ + Vendor get(String vendorName); + + /** + * Gets information about the specified vendor. + * + * @param vendorName The name of the vendor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified vendor. + */ + Response getWithResponse(String vendorName, Context context); + + /** + * Lists all the vendors in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for vendors API service call. + */ + PagedIterable list(); + + /** + * Lists all the vendors in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for vendors API service call. + */ + PagedIterable list(Context context); + + /** + * Gets information about the specified vendor. + * + * @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 information about the specified vendor. + */ + Vendor getById(String id); + + /** + * Gets information about the specified vendor. + * + * @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 information about the specified vendor. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified vendor. + * + * @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 specified vendor. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Vendor resource. + * + * @param name resource name. + * @return the first stage of the new Vendor definition. + */ + Vendor.DefinitionStages.Blank define(String name); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VirtualHardDisk.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VirtualHardDisk.java new file mode 100644 index 000000000000..18207531da70 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VirtualHardDisk.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.hybridnetwork.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; + +/** Describes the uri of a disk. */ +@Fluent +public final class VirtualHardDisk { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualHardDisk.class); + + /* + * Specifies the virtual hard disk's uri. + */ + @JsonProperty(value = "uri") + private String uri; + + /** + * Get the uri property: Specifies the virtual hard disk's uri. + * + * @return the uri value. + */ + public String uri() { + return this.uri; + } + + /** + * Set the uri property: Specifies the virtual hard disk's uri. + * + * @param uri the uri value to set. + * @return the VirtualHardDisk object itself. + */ + public VirtualHardDisk withUri(String uri) { + this.uri = uri; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VirtualMachineSizeTypes.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VirtualMachineSizeTypes.java new file mode 100644 index 000000000000..2917dccf9570 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VirtualMachineSizeTypes.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.hybridnetwork.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VirtualMachineSizeTypes. */ +public final class VirtualMachineSizeTypes extends ExpandableStringEnum { + /** Static value Unknown for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes UNKNOWN = fromString("Unknown"); + + /** Static value Standard_D1_v2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_D1_V2 = fromString("Standard_D1_v2"); + + /** Static value Standard_D2_v2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_D2_V2 = fromString("Standard_D2_v2"); + + /** Static value Standard_D3_v2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_D3_V2 = fromString("Standard_D3_v2"); + + /** Static value Standard_D4_v2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_D4_V2 = fromString("Standard_D4_v2"); + + /** Static value Standard_D5_v2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_D5_V2 = fromString("Standard_D5_v2"); + + /** Static value Standard_D11_v2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_D11_V2 = fromString("Standard_D11_v2"); + + /** Static value Standard_D12_v2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_D12_V2 = fromString("Standard_D12_v2"); + + /** Static value Standard_D13_v2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_D13_V2 = fromString("Standard_D13_v2"); + + /** Static value Standard_DS1_v2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_DS1_V2 = fromString("Standard_DS1_v2"); + + /** Static value Standard_DS2_v2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_DS2_V2 = fromString("Standard_DS2_v2"); + + /** Static value Standard_DS3_v2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_DS3_V2 = fromString("Standard_DS3_v2"); + + /** Static value Standard_DS4_v2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_DS4_V2 = fromString("Standard_DS4_v2"); + + /** Static value Standard_DS5_v2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_DS5_V2 = fromString("Standard_DS5_v2"); + + /** Static value Standard_DS11_v2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_DS11_V2 = fromString("Standard_DS11_v2"); + + /** Static value Standard_DS12_v2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_DS12_V2 = fromString("Standard_DS12_v2"); + + /** Static value Standard_DS13_v2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_DS13_V2 = fromString("Standard_DS13_v2"); + + /** Static value Standard_F1 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_F1 = fromString("Standard_F1"); + + /** Static value Standard_F2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_F2 = fromString("Standard_F2"); + + /** Static value Standard_F4 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_F4 = fromString("Standard_F4"); + + /** Static value Standard_F8 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_F8 = fromString("Standard_F8"); + + /** Static value Standard_F16 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_F16 = fromString("Standard_F16"); + + /** Static value Standard_F1s for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_F1S = fromString("Standard_F1s"); + + /** Static value Standard_F2s for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_F2S = fromString("Standard_F2s"); + + /** Static value Standard_F4s for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_F4S = fromString("Standard_F4s"); + + /** Static value Standard_F8s for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_F8S = fromString("Standard_F8s"); + + /** Static value Standard_F16s for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_F16S = fromString("Standard_F16s"); + + /** + * Creates or finds a VirtualMachineSizeTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding VirtualMachineSizeTypes. + */ + @JsonCreator + public static VirtualMachineSizeTypes fromString(String name) { + return fromString(name, VirtualMachineSizeTypes.class); + } + + /** @return known VirtualMachineSizeTypes values. */ + public static Collection values() { + return values(VirtualMachineSizeTypes.class); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/package-info.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/package-info.java new file mode 100644 index 000000000000..2018033424a5 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the data models for HybridNetworkManagementClient. The definitions in this swagger specification + * will be used to manage the Hybrid Network resources. + */ +package com.azure.resourcemanager.hybridnetwork.models; diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/package-info.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/package-info.java new file mode 100644 index 000000000000..bbf24390ebdc --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the classes for HybridNetworkManagementClient. The definitions in this swagger specification will + * be used to manage the Hybrid Network resources. + */ +package com.azure.resourcemanager.hybridnetwork; diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/module-info.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/module-info.java new file mode 100644 index 000000000000..012fc695e649 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/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.hybridnetwork { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.hybridnetwork; + exports com.azure.resourcemanager.hybridnetwork.fluent; + exports com.azure.resourcemanager.hybridnetwork.fluent.models; + exports com.azure.resourcemanager.hybridnetwork.models; + + opens com.azure.resourcemanager.hybridnetwork.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.hybridnetwork.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/hybridnetwork/ci.yml b/sdk/hybridnetwork/ci.yml new file mode 100644 index 000000000000..f143abd62705 --- /dev/null +++ b/sdk/hybridnetwork/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/hybridnetwork/ + +pr: + branches: + include: + - master + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hybridnetwork/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: hybridnetwork + Artifacts: + - name: azure-resourcemanager-hybridnetwork + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerhybridnetwork diff --git a/sdk/hybridnetwork/pom.xml b/sdk/hybridnetwork/pom.xml new file mode 100644 index 000000000000..60f3a584d57c --- /dev/null +++ b/sdk/hybridnetwork/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + com.azure + azure-hybridnetwork-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-hybridnetwork + + + +