diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 50bc88e1acee..af7aa147db24 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -399,6 +399,7 @@ com.azure.resourcemanager:azure-resourcemanager-reservations;1.0.0-beta.1;1.0.0- com.azure.resourcemanager:azure-resourcemanager-storagemover;1.0.0;1.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-containerservicefleet;1.0.0-beta.1;1.0.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-voiceservices;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-servicefabricmesh;1.0.0-beta.1;1.0.0-beta.1 com.azure.tools:azure-sdk-archetype;1.0.0;1.2.0-beta.1 com.azure.tools:azure-sdk-build-tool;1.0.0-beta.1;1.0.0-beta.2 diff --git a/pom.xml b/pom.xml index 2c7336bffde9..9e804df5aedd 100644 --- a/pom.xml +++ b/pom.xml @@ -156,6 +156,7 @@ sdk/securityinsights sdk/servicebus sdk/servicefabric + sdk/servicefabricmesh sdk/servicelinker sdk/servicenetworking sdk/signalr diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/CHANGELOG.md b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/CHANGELOG.md new file mode 100644 index 000000000000..7e3b567b44c5 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2023-03-14) + +- Azure Resource Manager ServiceFabricMesh client library for Java. This package contains Microsoft Azure SDK for ServiceFabricMesh Management SDK. Service Fabric Mesh Management Client. Package tag package-2018-09-01-preview. 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/servicefabricmesh/azure-resourcemanager-servicefabricmesh/README.md b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/README.md new file mode 100644 index 000000000000..28c29bee8742 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/README.md @@ -0,0 +1,105 @@ +# Azure Resource Manager ServiceFabricMesh client library for Java + +Azure Resource Manager ServiceFabricMesh client library for Java. + +This package contains Microsoft Azure SDK for ServiceFabricMesh Management SDK. Service Fabric Mesh Management Client. Package tag package-2018-09-01-preview. 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-servicefabricmesh;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-servicefabricmesh + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Include the recommended packages + +Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. + +[Azure Identity][azure_identity] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation. + +### Authentication + +By default, Azure Active Directory token authentication depends on correct configuration of the following environment variables. + +- `AZURE_CLIENT_ID` for Azure client ID. +- `AZURE_TENANT_ID` for Azure tenant ID. +- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. + +In addition, Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. + +With above configuration, `azure` client can be authenticated using the following code: + +```java +AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +ServiceFabricMeshManager manager = ServiceFabricMeshManager + .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 + +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/SAMPLE.md) + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide][cg]. + +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact with any additional questions or comments. + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://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 +[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/SAMPLE.md b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/SAMPLE.md new file mode 100644 index 000000000000..baa3508acde4 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/SAMPLE.md @@ -0,0 +1,1029 @@ +# Code snippets and samples + + +## Application + +- [Create](#application_create) +- [Delete](#application_delete) +- [GetByResourceGroup](#application_getbyresourcegroup) +- [List](#application_list) +- [ListByResourceGroup](#application_listbyresourcegroup) + +## CodePackage + +- [GetContainerLogs](#codepackage_getcontainerlogs) + +## Gateway + +- [Create](#gateway_create) +- [Delete](#gateway_delete) +- [GetByResourceGroup](#gateway_getbyresourcegroup) +- [List](#gateway_list) +- [ListByResourceGroup](#gateway_listbyresourcegroup) + +## Network + +- [Create](#network_create) +- [Delete](#network_delete) +- [GetByResourceGroup](#network_getbyresourcegroup) +- [List](#network_list) +- [ListByResourceGroup](#network_listbyresourcegroup) + +## Operations + +- [List](#operations_list) + +## Secret + +- [Create](#secret_create) +- [Delete](#secret_delete) +- [GetByResourceGroup](#secret_getbyresourcegroup) +- [List](#secret_list) +- [ListByResourceGroup](#secret_listbyresourcegroup) + +## SecretValue + +- [Create](#secretvalue_create) +- [Delete](#secretvalue_delete) +- [Get](#secretvalue_get) +- [List](#secretvalue_list) +- [ListValue](#secretvalue_listvalue) + +## Service + +- [Get](#service_get) +- [List](#service_list) + +## ServiceReplica + +- [Get](#servicereplica_get) +- [List](#servicereplica_list) + +## Volume + +- [Create](#volume_create) +- [Delete](#volume_delete) +- [GetByResourceGroup](#volume_getbyresourcegroup) +- [List](#volume_list) +- [ListByResourceGroup](#volume_listbyresourcegroup) +### Application_Create + +```java +import com.azure.resourcemanager.servicefabricmesh.fluent.models.ServiceResourceDescriptionInner; +import com.azure.resourcemanager.servicefabricmesh.models.ContainerCodePackageProperties; +import com.azure.resourcemanager.servicefabricmesh.models.EndpointProperties; +import com.azure.resourcemanager.servicefabricmesh.models.EndpointRef; +import com.azure.resourcemanager.servicefabricmesh.models.NetworkRef; +import com.azure.resourcemanager.servicefabricmesh.models.OperatingSystemType; +import com.azure.resourcemanager.servicefabricmesh.models.ResourceRequests; +import com.azure.resourcemanager.servicefabricmesh.models.ResourceRequirements; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Application Create. */ +public final class ApplicationCreateSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/applications/create_update.json + */ + /** + * Sample code: CreateOrUpdateApplication. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void createOrUpdateApplication( + com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager + .applications() + .define("sampleApplication") + .withRegion("EastUS") + .withExistingResourceGroup("sbz_demo") + .withTags(mapOf()) + .withDescription("Service Fabric Mesh sample application.") + .withServices( + Arrays + .asList( + new ServiceResourceDescriptionInner() + .withName("helloWorldService") + .withOsType(OperatingSystemType.LINUX) + .withCodePackages( + Arrays + .asList( + new ContainerCodePackageProperties() + .withName("helloWorldCode") + .withImage("seabreeze/sbz-helloworld:1.0-alpine") + .withEndpoints( + Arrays + .asList( + new EndpointProperties() + .withName("helloWorldListener") + .withPort(80))) + .withResources( + new ResourceRequirements() + .withRequests( + new ResourceRequests().withMemoryInGB(1.0).withCpu(1.0))))) + .withNetworkRefs( + Arrays + .asList( + new NetworkRef() + .withName( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/sbz_demo/providers/Microsoft.ServiceFabricMesh/networks/sampleNetwork") + .withEndpointRefs( + Arrays.asList(new EndpointRef().withName("helloWorldListener"))))) + .withDescription("SeaBreeze Hello World Service.") + .withReplicaCount(1))) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Application_Delete + +```java +/** Samples for Application Delete. */ +public final class ApplicationDeleteSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/applications/delete.json + */ + /** + * Sample code: DeleteApplication. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void deleteApplication(com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager + .applications() + .deleteByResourceGroupWithResponse("sbz_demo", "sampleApplication", com.azure.core.util.Context.NONE); + } +} +``` + +### Application_GetByResourceGroup + +```java +/** Samples for Application GetByResourceGroup. */ +public final class ApplicationGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/applications/get.json + */ + /** + * Sample code: GetApplication. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void getApplication(com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager + .applications() + .getByResourceGroupWithResponse("sbz_demo", "sampleApplication", com.azure.core.util.Context.NONE); + } +} +``` + +### Application_List + +```java +/** Samples for Application List. */ +public final class ApplicationListSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/applications/list_bySubscriptionId.json + */ + /** + * Sample code: ListApplicationsBySubscriptionId. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void listApplicationsBySubscriptionId( + com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager.applications().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Application_ListByResourceGroup + +```java +/** Samples for Application ListByResourceGroup. */ +public final class ApplicationListByResourceGroupSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/applications/list_byResourceGroup.json + */ + /** + * Sample code: ListApplicationsByResourceGroup. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void listApplicationsByResourceGroup( + com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager.applications().listByResourceGroup("sbz_demo", com.azure.core.util.Context.NONE); + } +} +``` + +### CodePackage_GetContainerLogs + +```java +/** Samples for CodePackage GetContainerLogs. */ +public final class CodePackageGetContainerLogsSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/applications/services/replicas/codepackages/get_logs.json + */ + /** + * Sample code: GetContainerLogs. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void getContainerLogs(com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager + .codePackages() + .getContainerLogsWithResponse( + "sbz_demo", "sbzDocApp", "sbzDocService", "0", "sbzDocCode", null, com.azure.core.util.Context.NONE); + } +} +``` + +### Gateway_Create + +```java +import com.azure.resourcemanager.servicefabricmesh.models.GatewayDestination; +import com.azure.resourcemanager.servicefabricmesh.models.HeaderMatchType; +import com.azure.resourcemanager.servicefabricmesh.models.HttpConfig; +import com.azure.resourcemanager.servicefabricmesh.models.HttpHostConfig; +import com.azure.resourcemanager.servicefabricmesh.models.HttpRouteConfig; +import com.azure.resourcemanager.servicefabricmesh.models.HttpRouteMatchHeader; +import com.azure.resourcemanager.servicefabricmesh.models.HttpRouteMatchPath; +import com.azure.resourcemanager.servicefabricmesh.models.HttpRouteMatchRule; +import com.azure.resourcemanager.servicefabricmesh.models.NetworkRef; +import com.azure.resourcemanager.servicefabricmesh.models.PathMatchType; +import com.azure.resourcemanager.servicefabricmesh.models.TcpConfig; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Gateway Create. */ +public final class GatewayCreateSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/gateways/create_update.json + */ + /** + * Sample code: CreateOrUpdateGateway. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void createOrUpdateGateway( + com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager + .gateways() + .define("sampleGateway") + .withRegion("EastUS") + .withExistingResourceGroup("sbz_demo") + .withSourceNetwork(new NetworkRef().withName("Open")) + .withDestinationNetwork(new NetworkRef().withName("helloWorldNetwork")) + .withTags(mapOf()) + .withDescription("Service Fabric Mesh sample gateway.") + .withTcp( + Arrays + .asList( + new TcpConfig() + .withName("web") + .withPort(80) + .withDestination( + new GatewayDestination() + .withApplicationName("helloWorldApp") + .withServiceName("helloWorldService") + .withEndpointName("helloWorldListener")))) + .withHttp( + Arrays + .asList( + new HttpConfig() + .withName("contosoWebsite") + .withPort(8081) + .withHosts( + Arrays + .asList( + new HttpHostConfig() + .withName("contoso.com") + .withRoutes( + Arrays + .asList( + new HttpRouteConfig() + .withName("index") + .withMatch( + new HttpRouteMatchRule() + .withPath( + new HttpRouteMatchPath() + .withValue("/index") + .withRewrite("/") + .withType(PathMatchType.PREFIX)) + .withHeaders( + Arrays + .asList( + new HttpRouteMatchHeader() + .withName("accept") + .withValue("application/json") + .withType(HeaderMatchType.EXACT)))) + .withDestination( + new GatewayDestination() + .withApplicationName("httpHelloWorldApp") + .withServiceName("indexService") + .withEndpointName("indexHttpEndpoint")))))))) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Gateway_Delete + +```java +/** Samples for Gateway Delete. */ +public final class GatewayDeleteSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/gateways/delete.json + */ + /** + * Sample code: DeleteGateway. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void deleteGateway(com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager + .gateways() + .deleteByResourceGroupWithResponse("sbz_demo", "sampleGateway", com.azure.core.util.Context.NONE); + } +} +``` + +### Gateway_GetByResourceGroup + +```java +/** Samples for Gateway GetByResourceGroup. */ +public final class GatewayGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/gateways/get.json + */ + /** + * Sample code: GetGateway. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void getGateway(com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager + .gateways() + .getByResourceGroupWithResponse("sbz_demo", "sampleGateway", com.azure.core.util.Context.NONE); + } +} +``` + +### Gateway_List + +```java +/** Samples for Gateway List. */ +public final class GatewayListSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/gateways/list_bySubscriptionId.json + */ + /** + * Sample code: ListGatewaysBySubscriptionId. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void listGatewaysBySubscriptionId( + com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager.gateways().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Gateway_ListByResourceGroup + +```java +/** Samples for Gateway ListByResourceGroup. */ +public final class GatewayListByResourceGroupSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/gateways/list_byResourceGroup.json + */ + /** + * Sample code: ListGatewaysByResourceGroup. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void listGatewaysByResourceGroup( + com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager.gateways().listByResourceGroup("sbz_demo", com.azure.core.util.Context.NONE); + } +} +``` + +### Network_Create + +```java +import com.azure.resourcemanager.servicefabricmesh.models.LocalNetworkResourceProperties; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Network Create. */ +public final class NetworkCreateSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/networks/create_update.json + */ + /** + * Sample code: CreateOrUpdateNetwork. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void createOrUpdateNetwork( + com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager + .networks() + .define("sampleNetwork") + .withRegion("EastUS") + .withExistingResourceGroup("sbz_demo") + .withProperties( + new LocalNetworkResourceProperties() + .withDescription("Service Fabric Mesh sample network.") + .withNetworkAddressPrefix("2.0.0.0/16")) + .withTags(mapOf()) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Network_Delete + +```java +/** Samples for Network Delete. */ +public final class NetworkDeleteSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/networks/delete.json + */ + /** + * Sample code: DeleteNetwork. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void deleteNetwork(com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager + .networks() + .deleteByResourceGroupWithResponse("sbz_demo", "sampleNetwork", com.azure.core.util.Context.NONE); + } +} +``` + +### Network_GetByResourceGroup + +```java +/** Samples for Network GetByResourceGroup. */ +public final class NetworkGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/networks/get.json + */ + /** + * Sample code: GetNetwork. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void getNetwork(com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager + .networks() + .getByResourceGroupWithResponse("sbz_demo", "sampleNetwork", com.azure.core.util.Context.NONE); + } +} +``` + +### Network_List + +```java +/** Samples for Network List. */ +public final class NetworkListSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/networks/list_bySubscriptionId.json + */ + /** + * Sample code: ListNetworksBySubscriptionId. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void listNetworksBySubscriptionId( + com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager.networks().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Network_ListByResourceGroup + +```java +/** Samples for Network ListByResourceGroup. */ +public final class NetworkListByResourceGroupSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/networks/list_byResourceGroup.json + */ + /** + * Sample code: ListNetworksByResourceGroup. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void listNetworksByResourceGroup( + com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager.networks().listByResourceGroup("sbz_demo", com.azure.core.util.Context.NONE); + } +} +``` + +### Operations_List + +```java +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/listAllOperations.json + */ + /** + * Sample code: ListAllOperations. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void listAllOperations(com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Secret_Create + +```java +import com.azure.resourcemanager.servicefabricmesh.models.InlinedValueSecretResourceProperties; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Secret Create. */ +public final class SecretCreateSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/secrets/create_update.json + */ + /** + * Sample code: CreateOrUpdateSecret. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void createOrUpdateSecret( + com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager + .secrets() + .define("dbConnectionString") + .withRegion("EastUS") + .withExistingResourceGroup("sbz_demo") + .withProperties( + new InlinedValueSecretResourceProperties() + .withDescription("Mongo DB connection string for backend database!") + .withContentType("text/plain")) + .withTags(mapOf()) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Secret_Delete + +```java +/** Samples for Secret Delete. */ +public final class SecretDeleteSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/secrets/delete.json + */ + /** + * Sample code: DeleteSecret. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void deleteSecret(com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager + .secrets() + .deleteByResourceGroupWithResponse("sbz_demo", "dbConnectionString", com.azure.core.util.Context.NONE); + } +} +``` + +### Secret_GetByResourceGroup + +```java +/** Samples for Secret GetByResourceGroup. */ +public final class SecretGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/secrets/get.json + */ + /** + * Sample code: GetSecret. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void getSecret(com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager + .secrets() + .getByResourceGroupWithResponse("sbz_demo", "dbConnectionString", com.azure.core.util.Context.NONE); + } +} +``` + +### Secret_List + +```java +/** Samples for Secret List. */ +public final class SecretListSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/secrets/list_bySubscriptionId.json + */ + /** + * Sample code: ListSecretsBySubscriptionId. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void listSecretsBySubscriptionId( + com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager.secrets().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Secret_ListByResourceGroup + +```java +/** Samples for Secret ListByResourceGroup. */ +public final class SecretListByResourceGroupSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/secrets/list_byResourceGroup.json + */ + /** + * Sample code: ListSecretsByResourceGroup. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void listSecretsByResourceGroup( + com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager.secrets().listByResourceGroup("sbz_demo", com.azure.core.util.Context.NONE); + } +} +``` + +### SecretValue_Create + +```java +/** Samples for SecretValue Create. */ +public final class SecretValueCreateSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/secrets/values/create.json + */ + /** + * Sample code: CreateSecretValue. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void createSecretValue(com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager + .secretValues() + .define("v1") + .withRegion("West US") + .withExistingSecret("sbz_demo", "dbConnectionString") + .withValue( + "mongodb://contoso123:0Fc3IolnL12312asdfawejunASDF@asdfYXX2t8a97kghVcUzcDv98hawelufhawefafnoQRGwNj2nMPL1Y9qsIr9Srdw==@contoso123.documents.azure.com:10255/mydatabase?ssl=true") + .create(); + } +} +``` + +### SecretValue_Delete + +```java +/** Samples for SecretValue Delete. */ +public final class SecretValueDeleteSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/secrets/values/delete.json + */ + /** + * Sample code: DeleteSecretValue. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void deleteSecretValue(com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager + .secretValues() + .deleteWithResponse("sbz_demo", "dbConnectionString", "v1", com.azure.core.util.Context.NONE); + } +} +``` + +### SecretValue_Get + +```java +/** Samples for SecretValue Get. */ +public final class SecretValueGetSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/secrets/values/get.json + */ + /** + * Sample code: GetSecretValue. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void getSecretValue(com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager + .secretValues() + .getWithResponse("sbz_demo", "dbConnectionString", "v1", com.azure.core.util.Context.NONE); + } +} +``` + +### SecretValue_List + +```java +/** Samples for SecretValue List. */ +public final class SecretValueListSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/secrets/values/list.json + */ + /** + * Sample code: ListSecretValues. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void listSecretValues(com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager.secretValues().list("sbz_demo", "dbConnectionString", com.azure.core.util.Context.NONE); + } +} +``` + +### SecretValue_ListValue + +```java +/** Samples for SecretValue ListValue. */ +public final class SecretValueListValueSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/secrets/values/list_value.json + */ + /** + * Sample code: ListSecretValue. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void listSecretValue(com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager + .secretValues() + .listValueWithResponse("sbz_demo", "dbConnectionString", "v1", com.azure.core.util.Context.NONE); + } +} +``` + +### Service_Get + +```java +/** Samples for Service Get. */ +public final class ServiceGetSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/applications/services/get.json + */ + /** + * Sample code: GetService. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void getService(com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager + .services() + .getWithResponse("sbz_demo", "sampleApplication", "helloWorldService", com.azure.core.util.Context.NONE); + } +} +``` + +### Service_List + +```java +/** Samples for Service List. */ +public final class ServiceListSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/applications/services/list.json + */ + /** + * Sample code: ListServices. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void listServices(com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager.services().list("sbz_demo", "sampleApplication", com.azure.core.util.Context.NONE); + } +} +``` + +### ServiceReplica_Get + +```java +/** Samples for ServiceReplica Get. */ +public final class ServiceReplicaGetSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/applications/services/replicas/get.json + */ + /** + * Sample code: ReplicaGet. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void replicaGet(com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager + .serviceReplicas() + .getWithResponse("sbz_demo", "helloWorldApp", "helloWorldService", "0", com.azure.core.util.Context.NONE); + } +} +``` + +### ServiceReplica_List + +```java +/** Samples for ServiceReplica List. */ +public final class ServiceReplicaListSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/applications/services/replicas/list.json + */ + /** + * Sample code: ReplicasGetAll. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void replicasGetAll(com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager + .serviceReplicas() + .list("sbz_demo", "sampleApplication", "helloWorldService", com.azure.core.util.Context.NONE); + } +} +``` + +### Volume_Create + +```java +import com.azure.resourcemanager.servicefabricmesh.models.VolumeProvider; +import com.azure.resourcemanager.servicefabricmesh.models.VolumeProviderParametersAzureFile; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Volume Create. */ +public final class VolumeCreateSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/volumes/create_update.json + */ + /** + * Sample code: CreateOrUpdateVolume. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void createOrUpdateVolume( + com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager + .volumes() + .define("sampleVolume") + .withRegion("EastUS") + .withExistingResourceGroup("sbz_demo") + .withProvider(VolumeProvider.SFAZURE_FILE) + .withTags(mapOf()) + .withDescription("Service Fabric Mesh sample volume.") + .withAzureFileParameters( + new VolumeProviderParametersAzureFile() + .withAccountName("sbzdemoaccount") + .withAccountKey("fakeTokenPlaceholder") + .withShareName("sharel")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Volume_Delete + +```java +/** Samples for Volume Delete. */ +public final class VolumeDeleteSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/volumes/delete.json + */ + /** + * Sample code: DeleteVolume. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void deleteVolume(com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager + .volumes() + .deleteByResourceGroupWithResponse("sbz_demo", "sampleVolume", com.azure.core.util.Context.NONE); + } +} +``` + +### Volume_GetByResourceGroup + +```java +/** Samples for Volume GetByResourceGroup. */ +public final class VolumeGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/volumes/get.json + */ + /** + * Sample code: GetVolume. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void getVolume(com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager.volumes().getByResourceGroupWithResponse("sbz_demo", "sampleVolume", com.azure.core.util.Context.NONE); + } +} +``` + +### Volume_List + +```java +/** Samples for Volume List. */ +public final class VolumeListSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/volumes/list_bySubscriptionId.json + */ + /** + * Sample code: ListVolumesBySubscriptionId. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void listVolumesBySubscriptionId( + com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager.volumes().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Volume_ListByResourceGroup + +```java +/** Samples for Volume ListByResourceGroup. */ +public final class VolumeListByResourceGroupSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/volumes/list_byResourceGroup.json + */ + /** + * Sample code: ListVolumesByResourceGroup. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void listVolumesByResourceGroup( + com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager.volumes().listByResourceGroup("sbz_demo", com.azure.core.util.Context.NONE); + } +} +``` + diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/pom.xml b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/pom.xml new file mode 100644 index 000000000000..6d430423df0b --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/pom.xml @@ -0,0 +1,61 @@ + + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-servicefabricmesh + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for ServiceFabricMesh Management + This package contains Microsoft Azure SDK for ServiceFabricMesh Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Service Fabric Mesh Management Client. Package tag package-2018-09-01-preview. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + 0 + 0 + + + + com.azure + azure-core + 1.37.0 + + + com.azure + azure-core-management + 1.10.2 + + + diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/ServiceFabricMeshManager.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/ServiceFabricMeshManager.java new file mode 100644 index 000000000000..21655d637f54 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/ServiceFabricMeshManager.java @@ -0,0 +1,426 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh; + +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.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.servicefabricmesh.fluent.ServiceFabricMeshManagementClient; +import com.azure.resourcemanager.servicefabricmesh.implementation.ApplicationsImpl; +import com.azure.resourcemanager.servicefabricmesh.implementation.CodePackagesImpl; +import com.azure.resourcemanager.servicefabricmesh.implementation.GatewaysImpl; +import com.azure.resourcemanager.servicefabricmesh.implementation.NetworksImpl; +import com.azure.resourcemanager.servicefabricmesh.implementation.OperationsImpl; +import com.azure.resourcemanager.servicefabricmesh.implementation.SecretValuesImpl; +import com.azure.resourcemanager.servicefabricmesh.implementation.SecretsImpl; +import com.azure.resourcemanager.servicefabricmesh.implementation.ServiceFabricMeshManagementClientBuilder; +import com.azure.resourcemanager.servicefabricmesh.implementation.ServiceReplicasImpl; +import com.azure.resourcemanager.servicefabricmesh.implementation.ServicesImpl; +import com.azure.resourcemanager.servicefabricmesh.implementation.VolumesImpl; +import com.azure.resourcemanager.servicefabricmesh.models.Applications; +import com.azure.resourcemanager.servicefabricmesh.models.CodePackages; +import com.azure.resourcemanager.servicefabricmesh.models.Gateways; +import com.azure.resourcemanager.servicefabricmesh.models.Networks; +import com.azure.resourcemanager.servicefabricmesh.models.Operations; +import com.azure.resourcemanager.servicefabricmesh.models.SecretValues; +import com.azure.resourcemanager.servicefabricmesh.models.Secrets; +import com.azure.resourcemanager.servicefabricmesh.models.ServiceReplicas; +import com.azure.resourcemanager.servicefabricmesh.models.Services; +import com.azure.resourcemanager.servicefabricmesh.models.Volumes; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + +/** Entry point to ServiceFabricMeshManager. Service Fabric Mesh Management Client. */ +public final class ServiceFabricMeshManager { + private Operations operations; + + private Secrets secrets; + + private SecretValues secretValues; + + private Volumes volumes; + + private Networks networks; + + private Gateways gateways; + + private Applications applications; + + private Services services; + + private ServiceReplicas serviceReplicas; + + private CodePackages codePackages; + + private final ServiceFabricMeshManagementClient clientObject; + + private ServiceFabricMeshManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new ServiceFabricMeshManagementClientBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of ServiceFabricMesh service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the ServiceFabricMesh service API instance. + */ + public static ServiceFabricMeshManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Creates an instance of ServiceFabricMesh service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the ServiceFabricMesh service API instance. + */ + public static ServiceFabricMeshManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new ServiceFabricMeshManager(httpPipeline, profile, null); + } + + /** + * Gets a Configurable instance that can be used to create ServiceFabricMeshManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new ServiceFabricMeshManager.Configurable(); + } + + /** The Configurable allowing configurations to be set. */ + public static final class Configurable { + private static 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 RetryOptions retryOptions; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the retry options for the HTTP pipeline retry policy. + * + *

This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + * + * @param retryOptions the retry options for the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryOptions(RetryOptions retryOptions) { + this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = + Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of ServiceFabricMesh service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the ServiceFabricMesh service API instance. + */ + public ServiceFabricMeshManager 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.servicefabricmesh") + .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) { + if (retryOptions != null) { + retryPolicy = new RetryPolicy(retryOptions); + } else { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new AddHeadersFromContextPolicy()); + policies.add(new RequestIdPolicy()); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new ServiceFabricMeshManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** + * Gets the resource collection API of Operations. + * + * @return Resource collection API of Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** + * Gets the resource collection API of Secrets. It manages SecretResourceDescription. + * + * @return Resource collection API of Secrets. + */ + public Secrets secrets() { + if (this.secrets == null) { + this.secrets = new SecretsImpl(clientObject.getSecrets(), this); + } + return secrets; + } + + /** + * Gets the resource collection API of SecretValues. It manages SecretValueResourceDescription. + * + * @return Resource collection API of SecretValues. + */ + public SecretValues secretValues() { + if (this.secretValues == null) { + this.secretValues = new SecretValuesImpl(clientObject.getSecretValues(), this); + } + return secretValues; + } + + /** + * Gets the resource collection API of Volumes. It manages VolumeResourceDescription. + * + * @return Resource collection API of Volumes. + */ + public Volumes volumes() { + if (this.volumes == null) { + this.volumes = new VolumesImpl(clientObject.getVolumes(), this); + } + return volumes; + } + + /** + * Gets the resource collection API of Networks. It manages NetworkResourceDescription. + * + * @return Resource collection API of Networks. + */ + public Networks networks() { + if (this.networks == null) { + this.networks = new NetworksImpl(clientObject.getNetworks(), this); + } + return networks; + } + + /** + * Gets the resource collection API of Gateways. It manages GatewayResourceDescription. + * + * @return Resource collection API of Gateways. + */ + public Gateways gateways() { + if (this.gateways == null) { + this.gateways = new GatewaysImpl(clientObject.getGateways(), this); + } + return gateways; + } + + /** + * Gets the resource collection API of Applications. It manages ApplicationResourceDescription. + * + * @return Resource collection API of Applications. + */ + public Applications applications() { + if (this.applications == null) { + this.applications = new ApplicationsImpl(clientObject.getApplications(), this); + } + return applications; + } + + /** + * Gets the resource collection API of Services. + * + * @return Resource collection API of Services. + */ + public Services services() { + if (this.services == null) { + this.services = new ServicesImpl(clientObject.getServices(), this); + } + return services; + } + + /** + * Gets the resource collection API of ServiceReplicas. + * + * @return Resource collection API of ServiceReplicas. + */ + public ServiceReplicas serviceReplicas() { + if (this.serviceReplicas == null) { + this.serviceReplicas = new ServiceReplicasImpl(clientObject.getServiceReplicas(), this); + } + return serviceReplicas; + } + + /** + * Gets the resource collection API of CodePackages. + * + * @return Resource collection API of CodePackages. + */ + public CodePackages codePackages() { + if (this.codePackages == null) { + this.codePackages = new CodePackagesImpl(clientObject.getCodePackages(), this); + } + return codePackages; + } + + /** + * @return Wrapped service client ServiceFabricMeshManagementClient providing direct access to the underlying + * auto-generated API implementation, based on Azure REST API. + */ + public ServiceFabricMeshManagementClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/ApplicationsClient.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/ApplicationsClient.java new file mode 100644 index 000000000000..99db17354ad0 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/ApplicationsClient.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicefabricmesh.fluent.models.ApplicationResourceDescriptionInner; + +/** An instance of this class provides access to all the operations defined in ApplicationsClient. */ +public interface ApplicationsClient { + /** + * Creates or updates an application resource. + * + *

Creates an application resource with the specified name, description and properties. If an application + * resource with the same name exists, then it is updated with the specified description and properties. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @param applicationResourceDescription Description for creating a Application resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return this type describes an application resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + String resourceGroupName, + String applicationResourceName, + ApplicationResourceDescriptionInner applicationResourceDescription, + Context context); + + /** + * Creates or updates an application resource. + * + *

Creates an application resource with the specified name, description and properties. If an application + * resource with the same name exists, then it is updated with the specified description and properties. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @param applicationResourceDescription Description for creating a Application resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return this type describes an application resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationResourceDescriptionInner create( + String resourceGroupName, + String applicationResourceName, + ApplicationResourceDescriptionInner applicationResourceDescription); + + /** + * Gets the application resource with the given name. + * + *

Gets the information about the application resource with the given name. The information include the + * description and other properties of the application. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about the application resource with the given name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String applicationResourceName, Context context); + + /** + * Gets the application resource with the given name. + * + *

Gets the information about the application resource with the given name. The information include the + * description and other properties of the application. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about the application resource with the given name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationResourceDescriptionInner getByResourceGroup(String resourceGroupName, String applicationResourceName); + + /** + * Deletes the application resource. + * + *

Deletes the application resource identified by the name. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String applicationResourceName, Context context); + + /** + * Deletes the application resource. + * + *

Deletes the application resource identified by the name. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 applicationResourceName); + + /** + * Gets all the application resources in a given resource group. + * + *

Gets the information about all application resources in a given resource group. The information include the + * description and other properties of the Application. + * + * @param resourceGroupName Azure resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about all application resources in a given resource group as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all the application resources in a given resource group. + * + *

Gets the information about all application resources in a given resource group. The information include the + * description and other properties of the Application. + * + * @param resourceGroupName Azure resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about all application resources in a given resource group as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all the application resources in a given subscription. + * + *

Gets the information about all application resources in a given resource group. The information include the + * description and other properties of the application. + * + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about all application resources in a given resource group as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all the application resources in a given subscription. + * + *

Gets the information about all application resources in a given resource group. The information include the + * description and other properties of the application. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about all application resources in a given resource group as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/CodePackagesClient.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/CodePackagesClient.java new file mode 100644 index 000000000000..aa0eb7cbc3b0 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/CodePackagesClient.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicefabricmesh.fluent.models.ContainerLogsInner; + +/** An instance of this class provides access to all the operations defined in CodePackagesClient. */ +public interface CodePackagesClient { + /** + * Gets the logs from the container. + * + *

Gets the logs for the container of the specified code package of the service replica. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @param serviceResourceName The identity of the service. + * @param replicaName Service Fabric replica name. + * @param codePackageName The name of code package of the service. + * @param tail Number of lines to show from the end of the logs. Default is 100. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the logs for the container of the specified code package of the service replica along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getContainerLogsWithResponse( + String resourceGroupName, + String applicationResourceName, + String serviceResourceName, + String replicaName, + String codePackageName, + Integer tail, + Context context); + + /** + * Gets the logs from the container. + * + *

Gets the logs for the container of the specified code package of the service replica. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @param serviceResourceName The identity of the service. + * @param replicaName Service Fabric replica name. + * @param codePackageName The name of code package of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the logs for the container of the specified code package of the service replica. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContainerLogsInner getContainerLogs( + String resourceGroupName, + String applicationResourceName, + String serviceResourceName, + String replicaName, + String codePackageName); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/GatewaysClient.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/GatewaysClient.java new file mode 100644 index 000000000000..9d83a4dc780e --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/GatewaysClient.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.servicefabricmesh.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicefabricmesh.fluent.models.GatewayResourceDescriptionInner; + +/** An instance of this class provides access to all the operations defined in GatewaysClient. */ +public interface GatewaysClient { + /** + * Creates or updates a gateway resource. + * + *

Creates a gateway resource with the specified name, description and properties. If a gateway resource with the + * same name exists, then it is updated with the specified description and properties. Use gateway resources to + * create a gateway for public connectivity for services within your application. + * + * @param resourceGroupName Azure resource group name. + * @param gatewayResourceName The identity of the gateway. + * @param gatewayResourceDescription Description for creating a Gateway resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return this type describes a gateway resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + String resourceGroupName, + String gatewayResourceName, + GatewayResourceDescriptionInner gatewayResourceDescription, + Context context); + + /** + * Creates or updates a gateway resource. + * + *

Creates a gateway resource with the specified name, description and properties. If a gateway resource with the + * same name exists, then it is updated with the specified description and properties. Use gateway resources to + * create a gateway for public connectivity for services within your application. + * + * @param resourceGroupName Azure resource group name. + * @param gatewayResourceName The identity of the gateway. + * @param gatewayResourceDescription Description for creating a Gateway resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return this type describes a gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GatewayResourceDescriptionInner create( + String resourceGroupName, + String gatewayResourceName, + GatewayResourceDescriptionInner gatewayResourceDescription); + + /** + * Gets the gateway resource with the given name. + * + *

Gets the information about the gateway resource with the given name. The information include the description + * and other properties of the gateway. + * + * @param resourceGroupName Azure resource group name. + * @param gatewayResourceName The identity of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about the gateway resource with the given name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String gatewayResourceName, Context context); + + /** + * Gets the gateway resource with the given name. + * + *

Gets the information about the gateway resource with the given name. The information include the description + * and other properties of the gateway. + * + * @param resourceGroupName Azure resource group name. + * @param gatewayResourceName The identity of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about the gateway resource with the given name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GatewayResourceDescriptionInner getByResourceGroup(String resourceGroupName, String gatewayResourceName); + + /** + * Deletes the gateway resource. + * + *

Deletes the gateway resource identified by the name. + * + * @param resourceGroupName Azure resource group name. + * @param gatewayResourceName The identity of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String gatewayResourceName, Context context); + + /** + * Deletes the gateway resource. + * + *

Deletes the gateway resource identified by the name. + * + * @param resourceGroupName Azure resource group name. + * @param gatewayResourceName The identity of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 gatewayResourceName); + + /** + * Gets all the gateway resources in a given resource group. + * + *

Gets the information about all gateway resources in a given resource group. The information include the + * description and other properties of the Gateway. + * + * @param resourceGroupName Azure resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about all gateway resources in a given resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all the gateway resources in a given resource group. + * + *

Gets the information about all gateway resources in a given resource group. The information include the + * description and other properties of the Gateway. + * + * @param resourceGroupName Azure resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about all gateway resources in a given resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all the gateway resources in a given subscription. + * + *

Gets the information about all gateway resources in a given resource group. The information include the + * description and other properties of the gateway. + * + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about all gateway resources in a given resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all the gateway resources in a given subscription. + * + *

Gets the information about all gateway resources in a given resource group. The information include the + * description and other properties of the gateway. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about all gateway resources in a given resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/NetworksClient.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/NetworksClient.java new file mode 100644 index 000000000000..eff82fb479a9 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/NetworksClient.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicefabricmesh.fluent.models.NetworkResourceDescriptionInner; + +/** An instance of this class provides access to all the operations defined in NetworksClient. */ +public interface NetworksClient { + /** + * Creates or updates a network resource. + * + *

Creates a network resource with the specified name, description and properties. If a network resource with the + * same name exists, then it is updated with the specified description and properties. + * + * @param resourceGroupName Azure resource group name. + * @param networkResourceName The identity of the network. + * @param networkResourceDescription Description for creating a Network resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return this type describes a network resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + String resourceGroupName, + String networkResourceName, + NetworkResourceDescriptionInner networkResourceDescription, + Context context); + + /** + * Creates or updates a network resource. + * + *

Creates a network resource with the specified name, description and properties. If a network resource with the + * same name exists, then it is updated with the specified description and properties. + * + * @param resourceGroupName Azure resource group name. + * @param networkResourceName The identity of the network. + * @param networkResourceDescription Description for creating a Network resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return this type describes a network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkResourceDescriptionInner create( + String resourceGroupName, + String networkResourceName, + NetworkResourceDescriptionInner networkResourceDescription); + + /** + * Gets the network resource with the given name. + * + *

Gets the information about the network resource with the given name. The information include the description + * and other properties of the network. + * + * @param resourceGroupName Azure resource group name. + * @param networkResourceName The identity of the network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about the network resource with the given name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String networkResourceName, Context context); + + /** + * Gets the network resource with the given name. + * + *

Gets the information about the network resource with the given name. The information include the description + * and other properties of the network. + * + * @param resourceGroupName Azure resource group name. + * @param networkResourceName The identity of the network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about the network resource with the given name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkResourceDescriptionInner getByResourceGroup(String resourceGroupName, String networkResourceName); + + /** + * Deletes the network resource. + * + *

Deletes the network resource identified by the name. + * + * @param resourceGroupName Azure resource group name. + * @param networkResourceName The identity of the network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String networkResourceName, Context context); + + /** + * Deletes the network resource. + * + *

Deletes the network resource identified by the name. + * + * @param resourceGroupName Azure resource group name. + * @param networkResourceName The identity of the network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 networkResourceName); + + /** + * Gets all the network resources in a given resource group. + * + *

Gets the information about all network resources in a given resource group. The information include the + * description and other properties of the Network. + * + * @param resourceGroupName Azure resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about all network resources in a given resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all the network resources in a given resource group. + * + *

Gets the information about all network resources in a given resource group. The information include the + * description and other properties of the Network. + * + * @param resourceGroupName Azure resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about all network resources in a given resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all the network resources in a given subscription. + * + *

Gets the information about all network resources in a given resource group. The information include the + * description and other properties of the network. + * + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about all network resources in a given resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all the network resources in a given subscription. + * + *

Gets the information about all network resources in a given resource group. The information include the + * description and other properties of the network. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about all network resources in a given resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/OperationsClient.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/OperationsClient.java new file mode 100644 index 000000000000..0b6a2f43e488 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/OperationsClient.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.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.servicefabricmesh.fluent.models.OperationResultInner; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public interface OperationsClient { + /** + * Lists all of the available operations. + * + *

Lists all the available operations provided by Service Fabric SeaBreeze resource provider. + * + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the result of the request to list Service Fabric operations as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all of the available operations. + * + *

Lists all the available operations provided by Service Fabric SeaBreeze resource provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the result of the request to list Service Fabric operations as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/SecretValuesClient.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/SecretValuesClient.java new file mode 100644 index 000000000000..4840cae00782 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/SecretValuesClient.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicefabricmesh.fluent.models.SecretValueInner; +import com.azure.resourcemanager.servicefabricmesh.fluent.models.SecretValueResourceDescriptionInner; + +/** An instance of this class provides access to all the operations defined in SecretValuesClient. */ +public interface SecretValuesClient { + /** + * Adds the specified value as a new version of the specified secret resource. + * + *

Creates a new value of the specified secret resource. The name of the value is typically the version + * identifier. Once created the value cannot be changed. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier + * for the value. + * @param secretValueResourceDescription Description for creating a value of a secret resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return this type describes a value of a secret resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + String resourceGroupName, + String secretResourceName, + String secretValueResourceName, + SecretValueResourceDescriptionInner secretValueResourceDescription, + Context context); + + /** + * Adds the specified value as a new version of the specified secret resource. + * + *

Creates a new value of the specified secret resource. The name of the value is typically the version + * identifier. Once created the value cannot be changed. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier + * for the value. + * @param secretValueResourceDescription Description for creating a value of a secret resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return this type describes a value of a secret resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecretValueResourceDescriptionInner create( + String resourceGroupName, + String secretResourceName, + String secretValueResourceName, + SecretValueResourceDescriptionInner secretValueResourceDescription); + + /** + * Gets the specified secret value resource. + * + *

Get the information about the specified named secret value resources. The information does not include the + * actual value of the secret. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier + * for the value. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about the specified named secret value resources along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String secretResourceName, String secretValueResourceName, Context context); + + /** + * Gets the specified secret value resource. + * + *

Get the information about the specified named secret value resources. The information does not include the + * actual value of the secret. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier + * for the value. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about the specified named secret value resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecretValueResourceDescriptionInner get( + String resourceGroupName, String secretResourceName, String secretValueResourceName); + + /** + * Deletes the specified value of the named secret resource. + * + *

Deletes the secret value resource identified by the name. The name of the resource is typically the version + * associated with that value. Deletion will fail if the specified value is in use. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier + * for the value. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String secretResourceName, String secretValueResourceName, Context context); + + /** + * Deletes the specified value of the named secret resource. + * + *

Deletes the secret value resource identified by the name. The name of the resource is typically the version + * associated with that value. Deletion will fail if the specified value is in use. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier + * for the value. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 secretResourceName, String secretValueResourceName); + + /** + * List names of all values of the specified secret resource. + * + *

Gets information about all secret value resources of the specified secret resource. The information includes + * the names of the secret value resources, but not the actual values. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 all secret value resources of the specified secret resource as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String secretResourceName); + + /** + * List names of all values of the specified secret resource. + * + *

Gets information about all secret value resources of the specified secret resource. The information includes + * the names of the secret value resources, but not the actual values. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 all secret value resources of the specified secret resource as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String secretResourceName, Context context); + + /** + * Lists the specified value of the secret resource. + * + *

Lists the decrypted value of the specified named value of the secret resource. This is a privileged operation. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier + * for the value. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return this type represents the unencrypted value of the secret along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listValueWithResponse( + String resourceGroupName, String secretResourceName, String secretValueResourceName, Context context); + + /** + * Lists the specified value of the secret resource. + * + *

Lists the decrypted value of the specified named value of the secret resource. This is a privileged operation. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier + * for the value. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return this type represents the unencrypted value of the secret. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecretValueInner listValue(String resourceGroupName, String secretResourceName, String secretValueResourceName); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/SecretsClient.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/SecretsClient.java new file mode 100644 index 000000000000..b3778b9b41de --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/SecretsClient.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicefabricmesh.fluent.models.SecretResourceDescriptionInner; + +/** An instance of this class provides access to all the operations defined in SecretsClient. */ +public interface SecretsClient { + /** + * Creates or updates a secret resource. + * + *

Creates a secret resource with the specified name, description and properties. If a secret resource with the + * same name exists, then it is updated with the specified description and properties. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @param secretResourceDescription Description for creating a secret resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return this type describes a secret resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + String resourceGroupName, + String secretResourceName, + SecretResourceDescriptionInner secretResourceDescription, + Context context); + + /** + * Creates or updates a secret resource. + * + *

Creates a secret resource with the specified name, description and properties. If a secret resource with the + * same name exists, then it is updated with the specified description and properties. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @param secretResourceDescription Description for creating a secret resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return this type describes a secret resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecretResourceDescriptionInner create( + String resourceGroupName, String secretResourceName, SecretResourceDescriptionInner secretResourceDescription); + + /** + * Gets the secret resource with the given name. + * + *

Gets the information about the secret resource with the given name. The information include the description + * and other properties of the secret. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about the secret resource with the given name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String secretResourceName, Context context); + + /** + * Gets the secret resource with the given name. + * + *

Gets the information about the secret resource with the given name. The information include the description + * and other properties of the secret. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about the secret resource with the given name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecretResourceDescriptionInner getByResourceGroup(String resourceGroupName, String secretResourceName); + + /** + * Deletes the secret resource. + * + *

Deletes the secret resource identified by the name. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String secretResourceName, Context context); + + /** + * Deletes the secret resource. + * + *

Deletes the secret resource identified by the name. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 secretResourceName); + + /** + * Gets all the secret resources in a given resource group. + * + *

Gets the information about all secret resources in a given resource group. The information include the + * description and other properties of the Secret. + * + * @param resourceGroupName Azure resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about all secret resources in a given resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all the secret resources in a given resource group. + * + *

Gets the information about all secret resources in a given resource group. The information include the + * description and other properties of the Secret. + * + * @param resourceGroupName Azure resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about all secret resources in a given resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all the secret resources in a given subscription. + * + *

Gets the information about all secret resources in a given resource group. The information include the + * description and other properties of the secret. + * + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about all secret resources in a given resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all the secret resources in a given subscription. + * + *

Gets the information about all secret resources in a given resource group. The information include the + * description and other properties of the secret. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about all secret resources in a given resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/ServiceFabricMeshManagementClient.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/ServiceFabricMeshManagementClient.java new file mode 100644 index 000000000000..9936bf4518c5 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/ServiceFabricMeshManagementClient.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.servicefabricmesh.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for ServiceFabricMeshManagementClient class. */ +public interface ServiceFabricMeshManagementClient { + /** + * Gets The customer subscription identifier. + * + * @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 OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the SecretsClient object to access its operations. + * + * @return the SecretsClient object. + */ + SecretsClient getSecrets(); + + /** + * Gets the SecretValuesClient object to access its operations. + * + * @return the SecretValuesClient object. + */ + SecretValuesClient getSecretValues(); + + /** + * Gets the VolumesClient object to access its operations. + * + * @return the VolumesClient object. + */ + VolumesClient getVolumes(); + + /** + * Gets the NetworksClient object to access its operations. + * + * @return the NetworksClient object. + */ + NetworksClient getNetworks(); + + /** + * Gets the GatewaysClient object to access its operations. + * + * @return the GatewaysClient object. + */ + GatewaysClient getGateways(); + + /** + * Gets the ApplicationsClient object to access its operations. + * + * @return the ApplicationsClient object. + */ + ApplicationsClient getApplications(); + + /** + * Gets the ServicesClient object to access its operations. + * + * @return the ServicesClient object. + */ + ServicesClient getServices(); + + /** + * Gets the ServiceReplicasClient object to access its operations. + * + * @return the ServiceReplicasClient object. + */ + ServiceReplicasClient getServiceReplicas(); + + /** + * Gets the CodePackagesClient object to access its operations. + * + * @return the CodePackagesClient object. + */ + CodePackagesClient getCodePackages(); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/ServiceReplicasClient.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/ServiceReplicasClient.java new file mode 100644 index 000000000000..bc7f3480a7f9 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/ServiceReplicasClient.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.servicefabricmesh.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicefabricmesh.fluent.models.ServiceReplicaDescriptionInner; + +/** An instance of this class provides access to all the operations defined in ServiceReplicasClient. */ +public interface ServiceReplicasClient { + /** + * Gets the given replica of the service of an application. + * + *

Gets the information about the service replica with the given name. The information include the description + * and other properties of the service replica. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @param serviceResourceName The identity of the service. + * @param replicaName Service Fabric replica name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about the service replica with the given name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String applicationResourceName, + String serviceResourceName, + String replicaName, + Context context); + + /** + * Gets the given replica of the service of an application. + * + *

Gets the information about the service replica with the given name. The information include the description + * and other properties of the service replica. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @param serviceResourceName The identity of the service. + * @param replicaName Service Fabric replica name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about the service replica with the given name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServiceReplicaDescriptionInner get( + String resourceGroupName, String applicationResourceName, String serviceResourceName, String replicaName); + + /** + * Gets replicas of a given service. + * + *

Gets the information about all replicas of a given service of an application. The information includes the + * runtime properties of the replica instance. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @param serviceResourceName The identity of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about all replicas of a given service of an application as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String applicationResourceName, String serviceResourceName); + + /** + * Gets replicas of a given service. + * + *

Gets the information about all replicas of a given service of an application. The information includes the + * runtime properties of the replica instance. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @param serviceResourceName The identity of the service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about all replicas of a given service of an application as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String applicationResourceName, String serviceResourceName, Context context); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/ServicesClient.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/ServicesClient.java new file mode 100644 index 000000000000..981a72b8f4d2 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/ServicesClient.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.servicefabricmesh.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicefabricmesh.fluent.models.ServiceResourceDescriptionInner; + +/** An instance of this class provides access to all the operations defined in ServicesClient. */ +public interface ServicesClient { + /** + * Gets the service resource with the given name. + * + *

Gets the information about the service resource with the given name. The information include the description + * and other properties of the service. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @param serviceResourceName The identity of the service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about the service resource with the given name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String applicationResourceName, String serviceResourceName, Context context); + + /** + * Gets the service resource with the given name. + * + *

Gets the information about the service resource with the given name. The information include the description + * and other properties of the service. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @param serviceResourceName The identity of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about the service resource with the given name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServiceResourceDescriptionInner get( + String resourceGroupName, String applicationResourceName, String serviceResourceName); + + /** + * Lists all the service resources. + * + *

Gets the information about all services of an application resource. The information include the description + * and other properties of the Service. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about all services of an application resource as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String applicationResourceName); + + /** + * Lists all the service resources. + * + *

Gets the information about all services of an application resource. The information include the description + * and other properties of the Service. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about all services of an application resource as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String applicationResourceName, Context context); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/VolumesClient.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/VolumesClient.java new file mode 100644 index 000000000000..78b889321101 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/VolumesClient.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicefabricmesh.fluent.models.VolumeResourceDescriptionInner; + +/** An instance of this class provides access to all the operations defined in VolumesClient. */ +public interface VolumesClient { + /** + * Creates or updates a volume resource. + * + *

Creates a volume resource with the specified name, description and properties. If a volume resource with the + * same name exists, then it is updated with the specified description and properties. + * + * @param resourceGroupName Azure resource group name. + * @param volumeResourceName The identity of the volume. + * @param volumeResourceDescription Description for creating a Volume resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return this type describes a volume resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + String resourceGroupName, + String volumeResourceName, + VolumeResourceDescriptionInner volumeResourceDescription, + Context context); + + /** + * Creates or updates a volume resource. + * + *

Creates a volume resource with the specified name, description and properties. If a volume resource with the + * same name exists, then it is updated with the specified description and properties. + * + * @param resourceGroupName Azure resource group name. + * @param volumeResourceName The identity of the volume. + * @param volumeResourceDescription Description for creating a Volume resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return this type describes a volume resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VolumeResourceDescriptionInner create( + String resourceGroupName, String volumeResourceName, VolumeResourceDescriptionInner volumeResourceDescription); + + /** + * Gets the volume resource with the given name. + * + *

Gets the information about the volume resource with the given name. The information include the description + * and other properties of the volume. + * + * @param resourceGroupName Azure resource group name. + * @param volumeResourceName The identity of the volume. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about the volume resource with the given name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String volumeResourceName, Context context); + + /** + * Gets the volume resource with the given name. + * + *

Gets the information about the volume resource with the given name. The information include the description + * and other properties of the volume. + * + * @param resourceGroupName Azure resource group name. + * @param volumeResourceName The identity of the volume. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about the volume resource with the given name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VolumeResourceDescriptionInner getByResourceGroup(String resourceGroupName, String volumeResourceName); + + /** + * Deletes the volume resource. + * + *

Deletes the volume resource identified by the name. + * + * @param resourceGroupName Azure resource group name. + * @param volumeResourceName The identity of the volume. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String volumeResourceName, Context context); + + /** + * Deletes the volume resource. + * + *

Deletes the volume resource identified by the name. + * + * @param resourceGroupName Azure resource group name. + * @param volumeResourceName The identity of the volume. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 volumeResourceName); + + /** + * Gets all the volume resources in a given resource group. + * + *

Gets the information about all volume resources in a given resource group. The information include the + * description and other properties of the Volume. + * + * @param resourceGroupName Azure resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about all volume resources in a given resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all the volume resources in a given resource group. + * + *

Gets the information about all volume resources in a given resource group. The information include the + * description and other properties of the Volume. + * + * @param resourceGroupName Azure resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about all volume resources in a given resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all the volume resources in a given subscription. + * + *

Gets the information about all volume resources in a given resource group. The information include the + * description and other properties of the volume. + * + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about all volume resources in a given resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all the volume resources in a given subscription. + * + *

Gets the information about all volume resources in a given resource group. The information include the + * description and other properties of the volume. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about all volume resources in a given resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/models/ApplicationResourceDescriptionInner.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/models/ApplicationResourceDescriptionInner.java new file mode 100644 index 000000000000..0a58c096d503 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/models/ApplicationResourceDescriptionInner.java @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicefabricmesh.models.DiagnosticsDescription; +import com.azure.resourcemanager.servicefabricmesh.models.HealthState; +import com.azure.resourcemanager.servicefabricmesh.models.ResourceStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** This type describes an application resource. */ +@Fluent +public final class ApplicationResourceDescriptionInner extends Resource { + /* + * This type describes properties of an application resource. + */ + @JsonProperty(value = "properties", required = true) + private ApplicationResourceProperties innerProperties = new ApplicationResourceProperties(); + + /** Creates an instance of ApplicationResourceDescriptionInner class. */ + public ApplicationResourceDescriptionInner() { + } + + /** + * Get the innerProperties property: This type describes properties of an application resource. + * + * @return the innerProperties value. + */ + private ApplicationResourceProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public ApplicationResourceDescriptionInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApplicationResourceDescriptionInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the description property: User readable description of the application. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: User readable description of the application. + * + * @param description the description value to set. + * @return the ApplicationResourceDescriptionInner object itself. + */ + public ApplicationResourceDescriptionInner withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationResourceProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the services property: Describes the services in the application. This property is used to create or modify + * services of the application. On get only the name of the service is returned. The service description can be + * obtained by querying for the service resource. + * + * @return the services value. + */ + public List services() { + return this.innerProperties() == null ? null : this.innerProperties().services(); + } + + /** + * Set the services property: Describes the services in the application. This property is used to create or modify + * services of the application. On get only the name of the service is returned. The service description can be + * obtained by querying for the service resource. + * + * @param services the services value to set. + * @return the ApplicationResourceDescriptionInner object itself. + */ + public ApplicationResourceDescriptionInner withServices(List services) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationResourceProperties(); + } + this.innerProperties().withServices(services); + return this; + } + + /** + * Get the diagnostics property: Describes the diagnostics definition and usage for an application resource. + * + * @return the diagnostics value. + */ + public DiagnosticsDescription diagnostics() { + return this.innerProperties() == null ? null : this.innerProperties().diagnostics(); + } + + /** + * Set the diagnostics property: Describes the diagnostics definition and usage for an application resource. + * + * @param diagnostics the diagnostics value to set. + * @return the ApplicationResourceDescriptionInner object itself. + */ + public ApplicationResourceDescriptionInner withDiagnostics(DiagnosticsDescription diagnostics) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationResourceProperties(); + } + this.innerProperties().withDiagnostics(diagnostics); + return this; + } + + /** + * Get the debugParams property: Internal - used by Visual Studio to setup the debugging session on the local + * development environment. + * + * @return the debugParams value. + */ + public String debugParams() { + return this.innerProperties() == null ? null : this.innerProperties().debugParams(); + } + + /** + * Set the debugParams property: Internal - used by Visual Studio to setup the debugging session on the local + * development environment. + * + * @param debugParams the debugParams value to set. + * @return the ApplicationResourceDescriptionInner object itself. + */ + public ApplicationResourceDescriptionInner withDebugParams(String debugParams) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationResourceProperties(); + } + this.innerProperties().withDebugParams(debugParams); + return this; + } + + /** + * Get the serviceNames property: Names of the services in the application. + * + * @return the serviceNames value. + */ + public List serviceNames() { + return this.innerProperties() == null ? null : this.innerProperties().serviceNames(); + } + + /** + * Get the status property: Status of the application. + * + * @return the status value. + */ + public ResourceStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Get the statusDetails property: Gives additional information about the current status of the application. + * + * @return the statusDetails value. + */ + public String statusDetails() { + return this.innerProperties() == null ? null : this.innerProperties().statusDetails(); + } + + /** + * Get the healthState property: Describes the health state of an application resource. + * + * @return the healthState value. + */ + public HealthState healthState() { + return this.innerProperties() == null ? null : this.innerProperties().healthState(); + } + + /** + * Get the unhealthyEvaluation property: When the application's health state is not 'Ok', this additional details + * from service fabric Health Manager for the user to know why the application is marked unhealthy. + * + * @return the unhealthyEvaluation value. + */ + public String unhealthyEvaluation() { + return this.innerProperties() == null ? null : this.innerProperties().unhealthyEvaluation(); + } + + /** + * Get the provisioningState property: State of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model ApplicationResourceDescriptionInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ApplicationResourceDescriptionInner.class); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/models/ApplicationResourceProperties.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/models/ApplicationResourceProperties.java new file mode 100644 index 000000000000..ea808857baae --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/models/ApplicationResourceProperties.java @@ -0,0 +1,226 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.servicefabricmesh.models.DiagnosticsDescription; +import com.azure.resourcemanager.servicefabricmesh.models.HealthState; +import com.azure.resourcemanager.servicefabricmesh.models.ProvisionedResourceProperties; +import com.azure.resourcemanager.servicefabricmesh.models.ResourceStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** This type describes properties of an application resource. */ +@Fluent +public final class ApplicationResourceProperties extends ProvisionedResourceProperties { + /* + * User readable description of the application. + */ + @JsonProperty(value = "description") + private String description; + + /* + * Describes the services in the application. This property is used to create or modify services of the + * application. On get only the name of the service is returned. The service description can be obtained by + * querying for the service resource. + */ + @JsonProperty(value = "services") + private List services; + + /* + * Describes the diagnostics definition and usage for an application resource. + */ + @JsonProperty(value = "diagnostics") + private DiagnosticsDescription diagnostics; + + /* + * Internal - used by Visual Studio to setup the debugging session on the local development environment. + */ + @JsonProperty(value = "debugParams") + private String debugParams; + + /* + * Names of the services in the application. + */ + @JsonProperty(value = "serviceNames", access = JsonProperty.Access.WRITE_ONLY) + private List serviceNames; + + /* + * Status of the application. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private ResourceStatus status; + + /* + * Gives additional information about the current status of the application. + */ + @JsonProperty(value = "statusDetails", access = JsonProperty.Access.WRITE_ONLY) + private String statusDetails; + + /* + * Describes the health state of an application resource. + */ + @JsonProperty(value = "healthState", access = JsonProperty.Access.WRITE_ONLY) + private HealthState healthState; + + /* + * When the application's health state is not 'Ok', this additional details from service fabric Health Manager for + * the user to know why the application is marked unhealthy. + */ + @JsonProperty(value = "unhealthyEvaluation", access = JsonProperty.Access.WRITE_ONLY) + private String unhealthyEvaluation; + + /** Creates an instance of ApplicationResourceProperties class. */ + public ApplicationResourceProperties() { + } + + /** + * Get the description property: User readable description of the application. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: User readable description of the application. + * + * @param description the description value to set. + * @return the ApplicationResourceProperties object itself. + */ + public ApplicationResourceProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the services property: Describes the services in the application. This property is used to create or modify + * services of the application. On get only the name of the service is returned. The service description can be + * obtained by querying for the service resource. + * + * @return the services value. + */ + public List services() { + return this.services; + } + + /** + * Set the services property: Describes the services in the application. This property is used to create or modify + * services of the application. On get only the name of the service is returned. The service description can be + * obtained by querying for the service resource. + * + * @param services the services value to set. + * @return the ApplicationResourceProperties object itself. + */ + public ApplicationResourceProperties withServices(List services) { + this.services = services; + return this; + } + + /** + * Get the diagnostics property: Describes the diagnostics definition and usage for an application resource. + * + * @return the diagnostics value. + */ + public DiagnosticsDescription diagnostics() { + return this.diagnostics; + } + + /** + * Set the diagnostics property: Describes the diagnostics definition and usage for an application resource. + * + * @param diagnostics the diagnostics value to set. + * @return the ApplicationResourceProperties object itself. + */ + public ApplicationResourceProperties withDiagnostics(DiagnosticsDescription diagnostics) { + this.diagnostics = diagnostics; + return this; + } + + /** + * Get the debugParams property: Internal - used by Visual Studio to setup the debugging session on the local + * development environment. + * + * @return the debugParams value. + */ + public String debugParams() { + return this.debugParams; + } + + /** + * Set the debugParams property: Internal - used by Visual Studio to setup the debugging session on the local + * development environment. + * + * @param debugParams the debugParams value to set. + * @return the ApplicationResourceProperties object itself. + */ + public ApplicationResourceProperties withDebugParams(String debugParams) { + this.debugParams = debugParams; + return this; + } + + /** + * Get the serviceNames property: Names of the services in the application. + * + * @return the serviceNames value. + */ + public List serviceNames() { + return this.serviceNames; + } + + /** + * Get the status property: Status of the application. + * + * @return the status value. + */ + public ResourceStatus status() { + return this.status; + } + + /** + * Get the statusDetails property: Gives additional information about the current status of the application. + * + * @return the statusDetails value. + */ + public String statusDetails() { + return this.statusDetails; + } + + /** + * Get the healthState property: Describes the health state of an application resource. + * + * @return the healthState value. + */ + public HealthState healthState() { + return this.healthState; + } + + /** + * Get the unhealthyEvaluation property: When the application's health state is not 'Ok', this additional details + * from service fabric Health Manager for the user to know why the application is marked unhealthy. + * + * @return the unhealthyEvaluation value. + */ + public String unhealthyEvaluation() { + return this.unhealthyEvaluation; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (services() != null) { + services().forEach(e -> e.validate()); + } + if (diagnostics() != null) { + diagnostics().validate(); + } + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/models/ContainerLogsInner.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/models/ContainerLogsInner.java new file mode 100644 index 000000000000..dfa11ad7b813 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/models/ContainerLogsInner.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.servicefabricmesh.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Container logs. */ +@Fluent +public final class ContainerLogsInner { + /* + * Container logs. + */ + @JsonProperty(value = "content") + private String content; + + /** Creates an instance of ContainerLogsInner class. */ + public ContainerLogsInner() { + } + + /** + * Get the content property: Container logs. + * + * @return the content value. + */ + public String content() { + return this.content; + } + + /** + * Set the content property: Container logs. + * + * @param content the content value to set. + * @return the ContainerLogsInner object itself. + */ + public ContainerLogsInner withContent(String content) { + this.content = content; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/models/GatewayResourceDescriptionInner.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/models/GatewayResourceDescriptionInner.java new file mode 100644 index 000000000000..0fb7d6e8349c --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/models/GatewayResourceDescriptionInner.java @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicefabricmesh.models.HttpConfig; +import com.azure.resourcemanager.servicefabricmesh.models.NetworkRef; +import com.azure.resourcemanager.servicefabricmesh.models.ResourceStatus; +import com.azure.resourcemanager.servicefabricmesh.models.TcpConfig; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** This type describes a gateway resource. */ +@Fluent +public final class GatewayResourceDescriptionInner extends Resource { + /* + * This type describes properties of a gateway resource. + */ + @JsonProperty(value = "properties", required = true) + private GatewayResourceProperties innerProperties = new GatewayResourceProperties(); + + /** Creates an instance of GatewayResourceDescriptionInner class. */ + public GatewayResourceDescriptionInner() { + } + + /** + * Get the innerProperties property: This type describes properties of a gateway resource. + * + * @return the innerProperties value. + */ + private GatewayResourceProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public GatewayResourceDescriptionInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public GatewayResourceDescriptionInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the description property: User readable description of the gateway. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: User readable description of the gateway. + * + * @param description the description value to set. + * @return the GatewayResourceDescriptionInner object itself. + */ + public GatewayResourceDescriptionInner withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new GatewayResourceProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the sourceNetwork property: Network the gateway should listen on for requests. + * + * @return the sourceNetwork value. + */ + public NetworkRef sourceNetwork() { + return this.innerProperties() == null ? null : this.innerProperties().sourceNetwork(); + } + + /** + * Set the sourceNetwork property: Network the gateway should listen on for requests. + * + * @param sourceNetwork the sourceNetwork value to set. + * @return the GatewayResourceDescriptionInner object itself. + */ + public GatewayResourceDescriptionInner withSourceNetwork(NetworkRef sourceNetwork) { + if (this.innerProperties() == null) { + this.innerProperties = new GatewayResourceProperties(); + } + this.innerProperties().withSourceNetwork(sourceNetwork); + return this; + } + + /** + * Get the destinationNetwork property: Network that the Application is using. + * + * @return the destinationNetwork value. + */ + public NetworkRef destinationNetwork() { + return this.innerProperties() == null ? null : this.innerProperties().destinationNetwork(); + } + + /** + * Set the destinationNetwork property: Network that the Application is using. + * + * @param destinationNetwork the destinationNetwork value to set. + * @return the GatewayResourceDescriptionInner object itself. + */ + public GatewayResourceDescriptionInner withDestinationNetwork(NetworkRef destinationNetwork) { + if (this.innerProperties() == null) { + this.innerProperties = new GatewayResourceProperties(); + } + this.innerProperties().withDestinationNetwork(destinationNetwork); + return this; + } + + /** + * Get the tcp property: Configuration for tcp connectivity for this gateway. + * + * @return the tcp value. + */ + public List tcp() { + return this.innerProperties() == null ? null : this.innerProperties().tcp(); + } + + /** + * Set the tcp property: Configuration for tcp connectivity for this gateway. + * + * @param tcp the tcp value to set. + * @return the GatewayResourceDescriptionInner object itself. + */ + public GatewayResourceDescriptionInner withTcp(List tcp) { + if (this.innerProperties() == null) { + this.innerProperties = new GatewayResourceProperties(); + } + this.innerProperties().withTcp(tcp); + return this; + } + + /** + * Get the http property: Configuration for http connectivity for this gateway. + * + * @return the http value. + */ + public List http() { + return this.innerProperties() == null ? null : this.innerProperties().http(); + } + + /** + * Set the http property: Configuration for http connectivity for this gateway. + * + * @param http the http value to set. + * @return the GatewayResourceDescriptionInner object itself. + */ + public GatewayResourceDescriptionInner withHttp(List http) { + if (this.innerProperties() == null) { + this.innerProperties = new GatewayResourceProperties(); + } + this.innerProperties().withHttp(http); + return this; + } + + /** + * Get the status property: Status of the resource. + * + * @return the status value. + */ + public ResourceStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Get the statusDetails property: Gives additional information about the current status of the gateway. + * + * @return the statusDetails value. + */ + public String statusDetails() { + return this.innerProperties() == null ? null : this.innerProperties().statusDetails(); + } + + /** + * Get the ipAddress property: IP address of the gateway. This is populated in the response and is ignored for + * incoming requests. + * + * @return the ipAddress value. + */ + public String ipAddress() { + return this.innerProperties() == null ? null : this.innerProperties().ipAddress(); + } + + /** + * Get the provisioningState property: State of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model GatewayResourceDescriptionInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GatewayResourceDescriptionInner.class); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/models/GatewayResourceProperties.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/models/GatewayResourceProperties.java new file mode 100644 index 000000000000..5c4c1e7ffe9d --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/models/GatewayResourceProperties.java @@ -0,0 +1,233 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicefabricmesh.models.HttpConfig; +import com.azure.resourcemanager.servicefabricmesh.models.NetworkRef; +import com.azure.resourcemanager.servicefabricmesh.models.ProvisionedResourceProperties; +import com.azure.resourcemanager.servicefabricmesh.models.ResourceStatus; +import com.azure.resourcemanager.servicefabricmesh.models.TcpConfig; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** This type describes properties of a gateway resource. */ +@Fluent +public final class GatewayResourceProperties extends ProvisionedResourceProperties { + /* + * User readable description of the gateway. + */ + @JsonProperty(value = "description") + private String description; + + /* + * Network the gateway should listen on for requests. + */ + @JsonProperty(value = "sourceNetwork", required = true) + private NetworkRef sourceNetwork; + + /* + * Network that the Application is using. + */ + @JsonProperty(value = "destinationNetwork", required = true) + private NetworkRef destinationNetwork; + + /* + * Configuration for tcp connectivity for this gateway. + */ + @JsonProperty(value = "tcp") + private List tcp; + + /* + * Configuration for http connectivity for this gateway. + */ + @JsonProperty(value = "http") + private List http; + + /* + * Status of the resource. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private ResourceStatus status; + + /* + * Gives additional information about the current status of the gateway. + */ + @JsonProperty(value = "statusDetails", access = JsonProperty.Access.WRITE_ONLY) + private String statusDetails; + + /* + * IP address of the gateway. This is populated in the response and is ignored for incoming requests. + */ + @JsonProperty(value = "ipAddress", access = JsonProperty.Access.WRITE_ONLY) + private String ipAddress; + + /** Creates an instance of GatewayResourceProperties class. */ + public GatewayResourceProperties() { + } + + /** + * Get the description property: User readable description of the gateway. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: User readable description of the gateway. + * + * @param description the description value to set. + * @return the GatewayResourceProperties object itself. + */ + public GatewayResourceProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the sourceNetwork property: Network the gateway should listen on for requests. + * + * @return the sourceNetwork value. + */ + public NetworkRef sourceNetwork() { + return this.sourceNetwork; + } + + /** + * Set the sourceNetwork property: Network the gateway should listen on for requests. + * + * @param sourceNetwork the sourceNetwork value to set. + * @return the GatewayResourceProperties object itself. + */ + public GatewayResourceProperties withSourceNetwork(NetworkRef sourceNetwork) { + this.sourceNetwork = sourceNetwork; + return this; + } + + /** + * Get the destinationNetwork property: Network that the Application is using. + * + * @return the destinationNetwork value. + */ + public NetworkRef destinationNetwork() { + return this.destinationNetwork; + } + + /** + * Set the destinationNetwork property: Network that the Application is using. + * + * @param destinationNetwork the destinationNetwork value to set. + * @return the GatewayResourceProperties object itself. + */ + public GatewayResourceProperties withDestinationNetwork(NetworkRef destinationNetwork) { + this.destinationNetwork = destinationNetwork; + return this; + } + + /** + * Get the tcp property: Configuration for tcp connectivity for this gateway. + * + * @return the tcp value. + */ + public List tcp() { + return this.tcp; + } + + /** + * Set the tcp property: Configuration for tcp connectivity for this gateway. + * + * @param tcp the tcp value to set. + * @return the GatewayResourceProperties object itself. + */ + public GatewayResourceProperties withTcp(List tcp) { + this.tcp = tcp; + return this; + } + + /** + * Get the http property: Configuration for http connectivity for this gateway. + * + * @return the http value. + */ + public List http() { + return this.http; + } + + /** + * Set the http property: Configuration for http connectivity for this gateway. + * + * @param http the http value to set. + * @return the GatewayResourceProperties object itself. + */ + public GatewayResourceProperties withHttp(List http) { + this.http = http; + return this; + } + + /** + * Get the status property: Status of the resource. + * + * @return the status value. + */ + public ResourceStatus status() { + return this.status; + } + + /** + * Get the statusDetails property: Gives additional information about the current status of the gateway. + * + * @return the statusDetails value. + */ + public String statusDetails() { + return this.statusDetails; + } + + /** + * Get the ipAddress property: IP address of the gateway. This is populated in the response and is ignored for + * incoming requests. + * + * @return the ipAddress value. + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (sourceNetwork() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sourceNetwork in model GatewayResourceProperties")); + } else { + sourceNetwork().validate(); + } + if (destinationNetwork() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property destinationNetwork in model GatewayResourceProperties")); + } else { + destinationNetwork().validate(); + } + if (tcp() != null) { + tcp().forEach(e -> e.validate()); + } + if (http() != null) { + http().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GatewayResourceProperties.class); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/models/NetworkResourceDescriptionInner.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/models/NetworkResourceDescriptionInner.java new file mode 100644 index 000000000000..46a4d252089c --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/models/NetworkResourceDescriptionInner.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicefabricmesh.models.NetworkResourceProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** This type describes a network resource. */ +@Fluent +public final class NetworkResourceDescriptionInner extends Resource { + /* + * Describes properties of a network resource. + */ + @JsonProperty(value = "properties", required = true) + private NetworkResourceProperties properties; + + /** Creates an instance of NetworkResourceDescriptionInner class. */ + public NetworkResourceDescriptionInner() { + } + + /** + * Get the properties property: Describes properties of a network resource. + * + * @return the properties value. + */ + public NetworkResourceProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Describes properties of a network resource. + * + * @param properties the properties value to set. + * @return the NetworkResourceDescriptionInner object itself. + */ + public NetworkResourceDescriptionInner withProperties(NetworkResourceProperties properties) { + this.properties = properties; + return this; + } + + /** {@inheritDoc} */ + @Override + public NetworkResourceDescriptionInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public NetworkResourceDescriptionInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property properties in model NetworkResourceDescriptionInner")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(NetworkResourceDescriptionInner.class); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/models/OperationResultInner.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/models/OperationResultInner.java new file mode 100644 index 000000000000..5b22d4cef8e4 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/models/OperationResultInner.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.servicefabricmesh.models.AvailableOperationDescriptionProperties; +import com.azure.resourcemanager.servicefabricmesh.models.AvailableOperationDisplay; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** List of operations available at the listed Azure resource provider. */ +@Fluent +public final class OperationResultInner { + /* + * The name of the operation. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The object that represents the operation. + */ + @JsonProperty(value = "display") + private AvailableOperationDisplay display; + + /* + * Origin result + */ + @JsonProperty(value = "origin") + private String origin; + + /* + * The URL to use for getting the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /* + * Properties of the operation + */ + @JsonProperty(value = "properties") + private AvailableOperationDescriptionProperties properties; + + /** Creates an instance of OperationResultInner class. */ + public OperationResultInner() { + } + + /** + * Get the name property: The name of the operation. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the operation. + * + * @param name the name value to set. + * @return the OperationResultInner object itself. + */ + public OperationResultInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the display property: The object that represents the operation. + * + * @return the display value. + */ + public AvailableOperationDisplay display() { + return this.display; + } + + /** + * Set the display property: The object that represents the operation. + * + * @param display the display value to set. + * @return the OperationResultInner object itself. + */ + public OperationResultInner withDisplay(AvailableOperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the origin property: Origin result. + * + * @return the origin value. + */ + public String origin() { + return this.origin; + } + + /** + * Set the origin property: Origin result. + * + * @param origin the origin value to set. + * @return the OperationResultInner object itself. + */ + public OperationResultInner withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Get the nextLink property: The URL to use for getting the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to use for getting the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the OperationResultInner object itself. + */ + public OperationResultInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the properties property: Properties of the operation. + * + * @return the properties value. + */ + public AvailableOperationDescriptionProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the operation. + * + * @param properties the properties value to set. + * @return the OperationResultInner object itself. + */ + public OperationResultInner withProperties(AvailableOperationDescriptionProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/models/SecretResourceDescriptionInner.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/models/SecretResourceDescriptionInner.java new file mode 100644 index 000000000000..5b784f40bba9 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/models/SecretResourceDescriptionInner.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicefabricmesh.models.SecretResourceProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** This type describes a secret resource. */ +@Fluent +public final class SecretResourceDescriptionInner extends Resource { + /* + * Describes the properties of a secret resource. + */ + @JsonProperty(value = "properties", required = true) + private SecretResourceProperties properties; + + /** Creates an instance of SecretResourceDescriptionInner class. */ + public SecretResourceDescriptionInner() { + } + + /** + * Get the properties property: Describes the properties of a secret resource. + * + * @return the properties value. + */ + public SecretResourceProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Describes the properties of a secret resource. + * + * @param properties the properties value to set. + * @return the SecretResourceDescriptionInner object itself. + */ + public SecretResourceDescriptionInner withProperties(SecretResourceProperties properties) { + this.properties = properties; + return this; + } + + /** {@inheritDoc} */ + @Override + public SecretResourceDescriptionInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public SecretResourceDescriptionInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property properties in model SecretResourceDescriptionInner")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SecretResourceDescriptionInner.class); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/models/SecretValueInner.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/models/SecretValueInner.java new file mode 100644 index 000000000000..35827fb309c0 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/models/SecretValueInner.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.servicefabricmesh.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** This type represents the unencrypted value of the secret. */ +@Fluent +public final class SecretValueInner { + /* + * The actual value of the secret. + */ + @JsonProperty(value = "value") + private String value; + + /** Creates an instance of SecretValueInner class. */ + public SecretValueInner() { + } + + /** + * Get the value property: The actual value of the secret. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The actual value of the secret. + * + * @param value the value value to set. + * @return the SecretValueInner object itself. + */ + public SecretValueInner withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/models/SecretValueResourceDescriptionInner.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/models/SecretValueResourceDescriptionInner.java new file mode 100644 index 000000000000..078877480de3 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/models/SecretValueResourceDescriptionInner.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.servicefabricmesh.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** + * This type describes a value of a secret resource. The name of this resource is the version identifier corresponding + * to this secret value. + */ +@Fluent +public final class SecretValueResourceDescriptionInner extends Resource { + /* + * This type describes properties of a secret value resource. + */ + @JsonProperty(value = "properties", required = true) + private SecretValueResourceProperties innerProperties = new SecretValueResourceProperties(); + + /** Creates an instance of SecretValueResourceDescriptionInner class. */ + public SecretValueResourceDescriptionInner() { + } + + /** + * Get the innerProperties property: This type describes properties of a secret value resource. + * + * @return the innerProperties value. + */ + private SecretValueResourceProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public SecretValueResourceDescriptionInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public SecretValueResourceDescriptionInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the value property: The actual value of the secret. + * + * @return the value value. + */ + public String value() { + return this.innerProperties() == null ? null : this.innerProperties().value(); + } + + /** + * Set the value property: The actual value of the secret. + * + * @param value the value value to set. + * @return the SecretValueResourceDescriptionInner object itself. + */ + public SecretValueResourceDescriptionInner withValue(String value) { + if (this.innerProperties() == null) { + this.innerProperties = new SecretValueResourceProperties(); + } + this.innerProperties().withValue(value); + return this; + } + + /** + * Get the provisioningState property: State of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model SecretValueResourceDescriptionInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SecretValueResourceDescriptionInner.class); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/models/SecretValueResourceProperties.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/models/SecretValueResourceProperties.java new file mode 100644 index 000000000000..dfb3a6feb4b6 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/models/SecretValueResourceProperties.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.servicefabricmesh.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.servicefabricmesh.models.ProvisionedResourceProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** This type describes properties of a secret value resource. */ +@Fluent +public final class SecretValueResourceProperties extends ProvisionedResourceProperties { + /* + * The actual value of the secret. + */ + @JsonProperty(value = "value") + private String value; + + /** Creates an instance of SecretValueResourceProperties class. */ + public SecretValueResourceProperties() { + } + + /** + * Get the value property: The actual value of the secret. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The actual value of the secret. + * + * @param value the value value to set. + * @return the SecretValueResourceProperties object itself. + */ + public SecretValueResourceProperties withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/models/ServiceReplicaDescriptionInner.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/models/ServiceReplicaDescriptionInner.java new file mode 100644 index 000000000000..54f0fea81aa0 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/models/ServiceReplicaDescriptionInner.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicefabricmesh.models.ContainerCodePackageProperties; +import com.azure.resourcemanager.servicefabricmesh.models.DiagnosticsRef; +import com.azure.resourcemanager.servicefabricmesh.models.NetworkRef; +import com.azure.resourcemanager.servicefabricmesh.models.OperatingSystemType; +import com.azure.resourcemanager.servicefabricmesh.models.ServiceReplicaProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a replica of a service resource. */ +@Fluent +public final class ServiceReplicaDescriptionInner extends ServiceReplicaProperties { + /* + * Name of the replica. + */ + @JsonProperty(value = "replicaName", required = true) + private String replicaName; + + /** Creates an instance of ServiceReplicaDescriptionInner class. */ + public ServiceReplicaDescriptionInner() { + } + + /** + * Get the replicaName property: Name of the replica. + * + * @return the replicaName value. + */ + public String replicaName() { + return this.replicaName; + } + + /** + * Set the replicaName property: Name of the replica. + * + * @param replicaName the replicaName value to set. + * @return the ServiceReplicaDescriptionInner object itself. + */ + public ServiceReplicaDescriptionInner withReplicaName(String replicaName) { + this.replicaName = replicaName; + return this; + } + + /** {@inheritDoc} */ + @Override + public ServiceReplicaDescriptionInner withOsType(OperatingSystemType osType) { + super.withOsType(osType); + return this; + } + + /** {@inheritDoc} */ + @Override + public ServiceReplicaDescriptionInner withCodePackages(List codePackages) { + super.withCodePackages(codePackages); + return this; + } + + /** {@inheritDoc} */ + @Override + public ServiceReplicaDescriptionInner withNetworkRefs(List networkRefs) { + super.withNetworkRefs(networkRefs); + return this; + } + + /** {@inheritDoc} */ + @Override + public ServiceReplicaDescriptionInner withDiagnostics(DiagnosticsRef diagnostics) { + super.withDiagnostics(diagnostics); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (replicaName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property replicaName in model ServiceReplicaDescriptionInner")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ServiceReplicaDescriptionInner.class); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/models/ServiceResourceDescriptionInner.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/models/ServiceResourceDescriptionInner.java new file mode 100644 index 000000000000..2cf7e58dcecd --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/models/ServiceResourceDescriptionInner.java @@ -0,0 +1,279 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicefabricmesh.models.AutoScalingPolicy; +import com.azure.resourcemanager.servicefabricmesh.models.ContainerCodePackageProperties; +import com.azure.resourcemanager.servicefabricmesh.models.DiagnosticsRef; +import com.azure.resourcemanager.servicefabricmesh.models.HealthState; +import com.azure.resourcemanager.servicefabricmesh.models.ManagedProxyResource; +import com.azure.resourcemanager.servicefabricmesh.models.NetworkRef; +import com.azure.resourcemanager.servicefabricmesh.models.OperatingSystemType; +import com.azure.resourcemanager.servicefabricmesh.models.ResourceStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** This type describes a service resource. */ +@Fluent +public final class ServiceResourceDescriptionInner extends ManagedProxyResource { + /* + * This type describes properties of a service resource. + */ + @JsonProperty(value = "properties", required = true) + private ServiceResourceProperties innerProperties = new ServiceResourceProperties(); + + /** Creates an instance of ServiceResourceDescriptionInner class. */ + public ServiceResourceDescriptionInner() { + } + + /** + * Get the innerProperties property: This type describes properties of a service resource. + * + * @return the innerProperties value. + */ + private ServiceResourceProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public ServiceResourceDescriptionInner withName(String name) { + super.withName(name); + return this; + } + + /** + * Get the osType property: The operation system required by the code in service. + * + * @return the osType value. + */ + public OperatingSystemType osType() { + return this.innerProperties() == null ? null : this.innerProperties().osType(); + } + + /** + * Set the osType property: The operation system required by the code in service. + * + * @param osType the osType value to set. + * @return the ServiceResourceDescriptionInner object itself. + */ + public ServiceResourceDescriptionInner withOsType(OperatingSystemType osType) { + if (this.innerProperties() == null) { + this.innerProperties = new ServiceResourceProperties(); + } + this.innerProperties().withOsType(osType); + return this; + } + + /** + * Get the codePackages property: Describes the set of code packages that forms the service. A code package + * describes the container and the properties for running it. All the code packages are started together on the same + * host and share the same context (network, process etc.). + * + * @return the codePackages value. + */ + public List codePackages() { + return this.innerProperties() == null ? null : this.innerProperties().codePackages(); + } + + /** + * Set the codePackages property: Describes the set of code packages that forms the service. A code package + * describes the container and the properties for running it. All the code packages are started together on the same + * host and share the same context (network, process etc.). + * + * @param codePackages the codePackages value to set. + * @return the ServiceResourceDescriptionInner object itself. + */ + public ServiceResourceDescriptionInner withCodePackages(List codePackages) { + if (this.innerProperties() == null) { + this.innerProperties = new ServiceResourceProperties(); + } + this.innerProperties().withCodePackages(codePackages); + return this; + } + + /** + * Get the networkRefs property: The names of the private networks that this service needs to be part of. + * + * @return the networkRefs value. + */ + public List networkRefs() { + return this.innerProperties() == null ? null : this.innerProperties().networkRefs(); + } + + /** + * Set the networkRefs property: The names of the private networks that this service needs to be part of. + * + * @param networkRefs the networkRefs value to set. + * @return the ServiceResourceDescriptionInner object itself. + */ + public ServiceResourceDescriptionInner withNetworkRefs(List networkRefs) { + if (this.innerProperties() == null) { + this.innerProperties = new ServiceResourceProperties(); + } + this.innerProperties().withNetworkRefs(networkRefs); + return this; + } + + /** + * Get the diagnostics property: Reference to sinks in DiagnosticsDescription. + * + * @return the diagnostics value. + */ + public DiagnosticsRef diagnostics() { + return this.innerProperties() == null ? null : this.innerProperties().diagnostics(); + } + + /** + * Set the diagnostics property: Reference to sinks in DiagnosticsDescription. + * + * @param diagnostics the diagnostics value to set. + * @return the ServiceResourceDescriptionInner object itself. + */ + public ServiceResourceDescriptionInner withDiagnostics(DiagnosticsRef diagnostics) { + if (this.innerProperties() == null) { + this.innerProperties = new ServiceResourceProperties(); + } + this.innerProperties().withDiagnostics(diagnostics); + return this; + } + + /** + * Get the description property: User readable description of the service. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: User readable description of the service. + * + * @param description the description value to set. + * @return the ServiceResourceDescriptionInner object itself. + */ + public ServiceResourceDescriptionInner withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new ServiceResourceProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the replicaCount property: The number of replicas of the service to create. Defaults to 1 if not specified. + * + * @return the replicaCount value. + */ + public Integer replicaCount() { + return this.innerProperties() == null ? null : this.innerProperties().replicaCount(); + } + + /** + * Set the replicaCount property: The number of replicas of the service to create. Defaults to 1 if not specified. + * + * @param replicaCount the replicaCount value to set. + * @return the ServiceResourceDescriptionInner object itself. + */ + public ServiceResourceDescriptionInner withReplicaCount(Integer replicaCount) { + if (this.innerProperties() == null) { + this.innerProperties = new ServiceResourceProperties(); + } + this.innerProperties().withReplicaCount(replicaCount); + return this; + } + + /** + * Get the autoScalingPolicies property: Auto scaling policies. + * + * @return the autoScalingPolicies value. + */ + public List autoScalingPolicies() { + return this.innerProperties() == null ? null : this.innerProperties().autoScalingPolicies(); + } + + /** + * Set the autoScalingPolicies property: Auto scaling policies. + * + * @param autoScalingPolicies the autoScalingPolicies value to set. + * @return the ServiceResourceDescriptionInner object itself. + */ + public ServiceResourceDescriptionInner withAutoScalingPolicies(List autoScalingPolicies) { + if (this.innerProperties() == null) { + this.innerProperties = new ServiceResourceProperties(); + } + this.innerProperties().withAutoScalingPolicies(autoScalingPolicies); + return this; + } + + /** + * Get the status property: Status of the service. + * + * @return the status value. + */ + public ResourceStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Get the statusDetails property: Gives additional information about the current status of the service. + * + * @return the statusDetails value. + */ + public String statusDetails() { + return this.innerProperties() == null ? null : this.innerProperties().statusDetails(); + } + + /** + * Get the healthState property: Describes the health state of an application resource. + * + * @return the healthState value. + */ + public HealthState healthState() { + return this.innerProperties() == null ? null : this.innerProperties().healthState(); + } + + /** + * Get the unhealthyEvaluation property: When the service's health state is not 'Ok', this additional details from + * service fabric Health Manager for the user to know why the service is marked unhealthy. + * + * @return the unhealthyEvaluation value. + */ + public String unhealthyEvaluation() { + return this.innerProperties() == null ? null : this.innerProperties().unhealthyEvaluation(); + } + + /** + * Get the provisioningState property: State of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model ServiceResourceDescriptionInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ServiceResourceDescriptionInner.class); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/models/ServiceResourceProperties.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/models/ServiceResourceProperties.java new file mode 100644 index 000000000000..16066201953d --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/models/ServiceResourceProperties.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicefabricmesh.models.AutoScalingPolicy; +import com.azure.resourcemanager.servicefabricmesh.models.ContainerCodePackageProperties; +import com.azure.resourcemanager.servicefabricmesh.models.DiagnosticsRef; +import com.azure.resourcemanager.servicefabricmesh.models.HealthState; +import com.azure.resourcemanager.servicefabricmesh.models.NetworkRef; +import com.azure.resourcemanager.servicefabricmesh.models.OperatingSystemType; +import com.azure.resourcemanager.servicefabricmesh.models.ProvisionedResourceProperties; +import com.azure.resourcemanager.servicefabricmesh.models.ResourceStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** This type describes properties of a service resource. */ +@Fluent +public final class ServiceResourceProperties extends ProvisionedResourceProperties { + /* + * The operation system required by the code in service. + */ + @JsonProperty(value = "osType", required = true) + private OperatingSystemType osType; + + /* + * Describes the set of code packages that forms the service. A code package describes the container and the + * properties for running it. All the code packages are started together on the same host and share the same + * context (network, process etc.). + */ + @JsonProperty(value = "codePackages", required = true) + private List codePackages; + + /* + * The names of the private networks that this service needs to be part of. + */ + @JsonProperty(value = "networkRefs") + private List networkRefs; + + /* + * Reference to sinks in DiagnosticsDescription. + */ + @JsonProperty(value = "diagnostics") + private DiagnosticsRef diagnostics; + + /* + * User readable description of the service. + */ + @JsonProperty(value = "description") + private String description; + + /* + * The number of replicas of the service to create. Defaults to 1 if not specified. + */ + @JsonProperty(value = "replicaCount") + private Integer replicaCount; + + /* + * Auto scaling policies + */ + @JsonProperty(value = "autoScalingPolicies") + private List autoScalingPolicies; + + /* + * Status of the service. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private ResourceStatus status; + + /* + * Gives additional information about the current status of the service. + */ + @JsonProperty(value = "statusDetails", access = JsonProperty.Access.WRITE_ONLY) + private String statusDetails; + + /* + * Describes the health state of an application resource. + */ + @JsonProperty(value = "healthState", access = JsonProperty.Access.WRITE_ONLY) + private HealthState healthState; + + /* + * When the service's health state is not 'Ok', this additional details from service fabric Health Manager for the + * user to know why the service is marked unhealthy. + */ + @JsonProperty(value = "unhealthyEvaluation", access = JsonProperty.Access.WRITE_ONLY) + private String unhealthyEvaluation; + + /** Creates an instance of ServiceResourceProperties class. */ + public ServiceResourceProperties() { + } + + /** + * Get the osType property: The operation system required by the code in service. + * + * @return the osType value. + */ + public OperatingSystemType osType() { + return this.osType; + } + + /** + * Set the osType property: The operation system required by the code in service. + * + * @param osType the osType value to set. + * @return the ServiceResourceProperties object itself. + */ + public ServiceResourceProperties withOsType(OperatingSystemType osType) { + this.osType = osType; + return this; + } + + /** + * Get the codePackages property: Describes the set of code packages that forms the service. A code package + * describes the container and the properties for running it. All the code packages are started together on the same + * host and share the same context (network, process etc.). + * + * @return the codePackages value. + */ + public List codePackages() { + return this.codePackages; + } + + /** + * Set the codePackages property: Describes the set of code packages that forms the service. A code package + * describes the container and the properties for running it. All the code packages are started together on the same + * host and share the same context (network, process etc.). + * + * @param codePackages the codePackages value to set. + * @return the ServiceResourceProperties object itself. + */ + public ServiceResourceProperties withCodePackages(List codePackages) { + this.codePackages = codePackages; + return this; + } + + /** + * Get the networkRefs property: The names of the private networks that this service needs to be part of. + * + * @return the networkRefs value. + */ + public List networkRefs() { + return this.networkRefs; + } + + /** + * Set the networkRefs property: The names of the private networks that this service needs to be part of. + * + * @param networkRefs the networkRefs value to set. + * @return the ServiceResourceProperties object itself. + */ + public ServiceResourceProperties withNetworkRefs(List networkRefs) { + this.networkRefs = networkRefs; + return this; + } + + /** + * Get the diagnostics property: Reference to sinks in DiagnosticsDescription. + * + * @return the diagnostics value. + */ + public DiagnosticsRef diagnostics() { + return this.diagnostics; + } + + /** + * Set the diagnostics property: Reference to sinks in DiagnosticsDescription. + * + * @param diagnostics the diagnostics value to set. + * @return the ServiceResourceProperties object itself. + */ + public ServiceResourceProperties withDiagnostics(DiagnosticsRef diagnostics) { + this.diagnostics = diagnostics; + return this; + } + + /** + * Get the description property: User readable description of the service. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: User readable description of the service. + * + * @param description the description value to set. + * @return the ServiceResourceProperties object itself. + */ + public ServiceResourceProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the replicaCount property: The number of replicas of the service to create. Defaults to 1 if not specified. + * + * @return the replicaCount value. + */ + public Integer replicaCount() { + return this.replicaCount; + } + + /** + * Set the replicaCount property: The number of replicas of the service to create. Defaults to 1 if not specified. + * + * @param replicaCount the replicaCount value to set. + * @return the ServiceResourceProperties object itself. + */ + public ServiceResourceProperties withReplicaCount(Integer replicaCount) { + this.replicaCount = replicaCount; + return this; + } + + /** + * Get the autoScalingPolicies property: Auto scaling policies. + * + * @return the autoScalingPolicies value. + */ + public List autoScalingPolicies() { + return this.autoScalingPolicies; + } + + /** + * Set the autoScalingPolicies property: Auto scaling policies. + * + * @param autoScalingPolicies the autoScalingPolicies value to set. + * @return the ServiceResourceProperties object itself. + */ + public ServiceResourceProperties withAutoScalingPolicies(List autoScalingPolicies) { + this.autoScalingPolicies = autoScalingPolicies; + return this; + } + + /** + * Get the status property: Status of the service. + * + * @return the status value. + */ + public ResourceStatus status() { + return this.status; + } + + /** + * Get the statusDetails property: Gives additional information about the current status of the service. + * + * @return the statusDetails value. + */ + public String statusDetails() { + return this.statusDetails; + } + + /** + * Get the healthState property: Describes the health state of an application resource. + * + * @return the healthState value. + */ + public HealthState healthState() { + return this.healthState; + } + + /** + * Get the unhealthyEvaluation property: When the service's health state is not 'Ok', this additional details from + * service fabric Health Manager for the user to know why the service is marked unhealthy. + * + * @return the unhealthyEvaluation value. + */ + public String unhealthyEvaluation() { + return this.unhealthyEvaluation; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (osType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property osType in model ServiceResourceProperties")); + } + if (codePackages() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property codePackages in model ServiceResourceProperties")); + } else { + codePackages().forEach(e -> e.validate()); + } + if (networkRefs() != null) { + networkRefs().forEach(e -> e.validate()); + } + if (diagnostics() != null) { + diagnostics().validate(); + } + if (autoScalingPolicies() != null) { + autoScalingPolicies().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ServiceResourceProperties.class); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/models/VolumeResourceDescriptionInner.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/models/VolumeResourceDescriptionInner.java new file mode 100644 index 000000000000..f42ff9913e57 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/models/VolumeResourceDescriptionInner.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicefabricmesh.models.ResourceStatus; +import com.azure.resourcemanager.servicefabricmesh.models.VolumeProvider; +import com.azure.resourcemanager.servicefabricmesh.models.VolumeProviderParametersAzureFile; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** This type describes a volume resource. */ +@Fluent +public final class VolumeResourceDescriptionInner extends Resource { + /* + * This type describes properties of a volume resource. + */ + @JsonProperty(value = "properties", required = true) + private VolumeResourceProperties innerProperties = new VolumeResourceProperties(); + + /** Creates an instance of VolumeResourceDescriptionInner class. */ + public VolumeResourceDescriptionInner() { + } + + /** + * Get the innerProperties property: This type describes properties of a volume resource. + * + * @return the innerProperties value. + */ + private VolumeResourceProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public VolumeResourceDescriptionInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public VolumeResourceDescriptionInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the description property: User readable description of the volume. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: User readable description of the volume. + * + * @param description the description value to set. + * @return the VolumeResourceDescriptionInner object itself. + */ + public VolumeResourceDescriptionInner withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new VolumeResourceProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the status property: Status of the volume. + * + * @return the status value. + */ + public ResourceStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Get the statusDetails property: Gives additional information about the current status of the volume. + * + * @return the statusDetails value. + */ + public String statusDetails() { + return this.innerProperties() == null ? null : this.innerProperties().statusDetails(); + } + + /** + * Get the provider property: Provider of the volume. + * + * @return the provider value. + */ + public VolumeProvider provider() { + return this.innerProperties() == null ? null : this.innerProperties().provider(); + } + + /** + * Set the provider property: Provider of the volume. + * + * @param provider the provider value to set. + * @return the VolumeResourceDescriptionInner object itself. + */ + public VolumeResourceDescriptionInner withProvider(VolumeProvider provider) { + if (this.innerProperties() == null) { + this.innerProperties = new VolumeResourceProperties(); + } + this.innerProperties().withProvider(provider); + return this; + } + + /** + * Get the azureFileParameters property: This type describes a volume provided by an Azure Files file share. + * + * @return the azureFileParameters value. + */ + public VolumeProviderParametersAzureFile azureFileParameters() { + return this.innerProperties() == null ? null : this.innerProperties().azureFileParameters(); + } + + /** + * Set the azureFileParameters property: This type describes a volume provided by an Azure Files file share. + * + * @param azureFileParameters the azureFileParameters value to set. + * @return the VolumeResourceDescriptionInner object itself. + */ + public VolumeResourceDescriptionInner withAzureFileParameters( + VolumeProviderParametersAzureFile azureFileParameters) { + if (this.innerProperties() == null) { + this.innerProperties = new VolumeResourceProperties(); + } + this.innerProperties().withAzureFileParameters(azureFileParameters); + return this; + } + + /** + * Get the provisioningState property: State of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model VolumeResourceDescriptionInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VolumeResourceDescriptionInner.class); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/models/VolumeResourceProperties.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/models/VolumeResourceProperties.java new file mode 100644 index 000000000000..79e300dca98d --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/models/VolumeResourceProperties.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.servicefabricmesh.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicefabricmesh.models.ProvisionedResourceProperties; +import com.azure.resourcemanager.servicefabricmesh.models.ResourceStatus; +import com.azure.resourcemanager.servicefabricmesh.models.VolumeProvider; +import com.azure.resourcemanager.servicefabricmesh.models.VolumeProviderParametersAzureFile; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** This type describes properties of a volume resource. */ +@Fluent +public final class VolumeResourceProperties extends ProvisionedResourceProperties { + /* + * User readable description of the volume. + */ + @JsonProperty(value = "description") + private String description; + + /* + * Status of the volume. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private ResourceStatus status; + + /* + * Gives additional information about the current status of the volume. + */ + @JsonProperty(value = "statusDetails", access = JsonProperty.Access.WRITE_ONLY) + private String statusDetails; + + /* + * Provider of the volume. + */ + @JsonProperty(value = "provider", required = true) + private VolumeProvider provider; + + /* + * This type describes a volume provided by an Azure Files file share. + */ + @JsonProperty(value = "azureFileParameters") + private VolumeProviderParametersAzureFile azureFileParameters; + + /** Creates an instance of VolumeResourceProperties class. */ + public VolumeResourceProperties() { + } + + /** + * Get the description property: User readable description of the volume. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: User readable description of the volume. + * + * @param description the description value to set. + * @return the VolumeResourceProperties object itself. + */ + public VolumeResourceProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the status property: Status of the volume. + * + * @return the status value. + */ + public ResourceStatus status() { + return this.status; + } + + /** + * Get the statusDetails property: Gives additional information about the current status of the volume. + * + * @return the statusDetails value. + */ + public String statusDetails() { + return this.statusDetails; + } + + /** + * Get the provider property: Provider of the volume. + * + * @return the provider value. + */ + public VolumeProvider provider() { + return this.provider; + } + + /** + * Set the provider property: Provider of the volume. + * + * @param provider the provider value to set. + * @return the VolumeResourceProperties object itself. + */ + public VolumeResourceProperties withProvider(VolumeProvider provider) { + this.provider = provider; + return this; + } + + /** + * Get the azureFileParameters property: This type describes a volume provided by an Azure Files file share. + * + * @return the azureFileParameters value. + */ + public VolumeProviderParametersAzureFile azureFileParameters() { + return this.azureFileParameters; + } + + /** + * Set the azureFileParameters property: This type describes a volume provided by an Azure Files file share. + * + * @param azureFileParameters the azureFileParameters value to set. + * @return the VolumeResourceProperties object itself. + */ + public VolumeResourceProperties withAzureFileParameters(VolumeProviderParametersAzureFile azureFileParameters) { + this.azureFileParameters = azureFileParameters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (provider() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property provider in model VolumeResourceProperties")); + } + if (azureFileParameters() != null) { + azureFileParameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VolumeResourceProperties.class); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/models/package-info.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/models/package-info.java new file mode 100644 index 000000000000..0e3fae3b20cf --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/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 ServiceFabricMeshManagementClient. Service Fabric Mesh Management + * Client. + */ +package com.azure.resourcemanager.servicefabricmesh.fluent.models; diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/package-info.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/package-info.java new file mode 100644 index 000000000000..dc6379016561 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/fluent/package-info.java @@ -0,0 +1,8 @@ +// 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 ServiceFabricMeshManagementClient. Service Fabric Mesh Management Client. + */ +package com.azure.resourcemanager.servicefabricmesh.fluent; diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/ApplicationResourceDescriptionImpl.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/ApplicationResourceDescriptionImpl.java new file mode 100644 index 000000000000..f85912cf9b5a --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/ApplicationResourceDescriptionImpl.java @@ -0,0 +1,220 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicefabricmesh.fluent.models.ApplicationResourceDescriptionInner; +import com.azure.resourcemanager.servicefabricmesh.fluent.models.ServiceResourceDescriptionInner; +import com.azure.resourcemanager.servicefabricmesh.models.ApplicationResourceDescription; +import com.azure.resourcemanager.servicefabricmesh.models.DiagnosticsDescription; +import com.azure.resourcemanager.servicefabricmesh.models.HealthState; +import com.azure.resourcemanager.servicefabricmesh.models.ResourceStatus; +import com.azure.resourcemanager.servicefabricmesh.models.ServiceResourceDescription; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public final class ApplicationResourceDescriptionImpl + implements ApplicationResourceDescription, ApplicationResourceDescription.Definition { + private ApplicationResourceDescriptionInner innerObject; + + private final com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager serviceManager; + + ApplicationResourceDescriptionImpl( + ApplicationResourceDescriptionInner innerObject, + com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String description() { + return this.innerModel().description(); + } + + public List services() { + List inner = this.innerModel().services(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new ServiceResourceDescriptionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public DiagnosticsDescription diagnostics() { + return this.innerModel().diagnostics(); + } + + public String debugParams() { + return this.innerModel().debugParams(); + } + + public List serviceNames() { + List inner = this.innerModel().serviceNames(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ResourceStatus status() { + return this.innerModel().status(); + } + + public String statusDetails() { + return this.innerModel().statusDetails(); + } + + public HealthState healthState() { + return this.innerModel().healthState(); + } + + public String unhealthyEvaluation() { + return this.innerModel().unhealthyEvaluation(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public ApplicationResourceDescriptionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String applicationResourceName; + + public ApplicationResourceDescriptionImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public ApplicationResourceDescription create() { + this.innerObject = + serviceManager + .serviceClient() + .getApplications() + .createWithResponse(resourceGroupName, applicationResourceName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public ApplicationResourceDescription create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApplications() + .createWithResponse(resourceGroupName, applicationResourceName, this.innerModel(), context) + .getValue(); + return this; + } + + ApplicationResourceDescriptionImpl( + String name, com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager serviceManager) { + this.innerObject = new ApplicationResourceDescriptionInner(); + this.serviceManager = serviceManager; + this.applicationResourceName = name; + } + + public ApplicationResourceDescription refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getApplications() + .getByResourceGroupWithResponse(resourceGroupName, applicationResourceName, Context.NONE) + .getValue(); + return this; + } + + public ApplicationResourceDescription refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApplications() + .getByResourceGroupWithResponse(resourceGroupName, applicationResourceName, context) + .getValue(); + return this; + } + + public ApplicationResourceDescriptionImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ApplicationResourceDescriptionImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ApplicationResourceDescriptionImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public ApplicationResourceDescriptionImpl withDescription(String description) { + this.innerModel().withDescription(description); + return this; + } + + public ApplicationResourceDescriptionImpl withServices(List services) { + this.innerModel().withServices(services); + return this; + } + + public ApplicationResourceDescriptionImpl withDiagnostics(DiagnosticsDescription diagnostics) { + this.innerModel().withDiagnostics(diagnostics); + return this; + } + + public ApplicationResourceDescriptionImpl withDebugParams(String debugParams) { + this.innerModel().withDebugParams(debugParams); + return this; + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/ApplicationsClientImpl.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/ApplicationsClientImpl.java new file mode 100644 index 000000000000..c7a1270d9071 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/ApplicationsClientImpl.java @@ -0,0 +1,1187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.servicefabricmesh.fluent.ApplicationsClient; +import com.azure.resourcemanager.servicefabricmesh.fluent.models.ApplicationResourceDescriptionInner; +import com.azure.resourcemanager.servicefabricmesh.models.ApplicationResourceDescriptionList; +import com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ApplicationsClient. */ +public final class ApplicationsClientImpl implements ApplicationsClient { + /** The proxy service used to perform REST calls. */ + private final ApplicationsService service; + + /** The service client containing this operation class. */ + private final ServiceFabricMeshManagementClientImpl client; + + /** + * Initializes an instance of ApplicationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ApplicationsClientImpl(ServiceFabricMeshManagementClientImpl client) { + this.service = + RestProxy.create(ApplicationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ServiceFabricMeshManagementClientApplications to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ServiceFabricMeshMan") + public interface ApplicationsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh" + + "/applications/{applicationResourceName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ErrorErrorModelException.class) + Mono> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam(value = "applicationResourceName", encoded = true) String applicationResourceName, + @BodyParam("application/json") ApplicationResourceDescriptionInner applicationResourceDescription, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh" + + "/applications/{applicationResourceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorErrorModelException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam(value = "applicationResourceName", encoded = true) String applicationResourceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh" + + "/applications/{applicationResourceName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ErrorErrorModelException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam(value = "applicationResourceName", encoded = true) String applicationResourceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh" + + "/applications") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorErrorModelException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabricMesh/applications") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorErrorModelException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorErrorModelException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorErrorModelException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Creates or updates an application resource. + * + *

Creates an application resource with the specified name, description and properties. If an application + * resource with the same name exists, then it is updated with the specified description and properties. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @param applicationResourceDescription Description for creating a Application resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return this type describes an application resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, + String applicationResourceName, + ApplicationResourceDescriptionInner applicationResourceDescription) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (applicationResourceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter applicationResourceName is required and cannot be null.")); + } + if (applicationResourceDescription == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter applicationResourceDescription is required and cannot be null.")); + } else { + applicationResourceDescription.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + applicationResourceName, + applicationResourceDescription, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates an application resource. + * + *

Creates an application resource with the specified name, description and properties. If an application + * resource with the same name exists, then it is updated with the specified description and properties. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @param applicationResourceDescription Description for creating a Application resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return this type describes an application resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, + String applicationResourceName, + ApplicationResourceDescriptionInner applicationResourceDescription, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (applicationResourceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter applicationResourceName is required and cannot be null.")); + } + if (applicationResourceDescription == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter applicationResourceDescription is required and cannot be null.")); + } else { + applicationResourceDescription.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + applicationResourceName, + applicationResourceDescription, + accept, + context); + } + + /** + * Creates or updates an application resource. + * + *

Creates an application resource with the specified name, description and properties. If an application + * resource with the same name exists, then it is updated with the specified description and properties. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @param applicationResourceDescription Description for creating a Application resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return this type describes an application resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String applicationResourceName, + ApplicationResourceDescriptionInner applicationResourceDescription) { + return createWithResponseAsync(resourceGroupName, applicationResourceName, applicationResourceDescription) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates or updates an application resource. + * + *

Creates an application resource with the specified name, description and properties. If an application + * resource with the same name exists, then it is updated with the specified description and properties. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @param applicationResourceDescription Description for creating a Application resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return this type describes an application resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse( + String resourceGroupName, + String applicationResourceName, + ApplicationResourceDescriptionInner applicationResourceDescription, + Context context) { + return createWithResponseAsync( + resourceGroupName, applicationResourceName, applicationResourceDescription, context) + .block(); + } + + /** + * Creates or updates an application resource. + * + *

Creates an application resource with the specified name, description and properties. If an application + * resource with the same name exists, then it is updated with the specified description and properties. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @param applicationResourceDescription Description for creating a Application resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return this type describes an application resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationResourceDescriptionInner create( + String resourceGroupName, + String applicationResourceName, + ApplicationResourceDescriptionInner applicationResourceDescription) { + return createWithResponse( + resourceGroupName, applicationResourceName, applicationResourceDescription, Context.NONE) + .getValue(); + } + + /** + * Gets the application resource with the given name. + * + *

Gets the information about the application resource with the given name. The information include the + * description and other properties of the application. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about the application resource with the given name along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String applicationResourceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (applicationResourceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter applicationResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + applicationResourceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the application resource with the given name. + * + *

Gets the information about the application resource with the given name. The information include the + * description and other properties of the application. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about the application resource with the given name along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String applicationResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (applicationResourceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter applicationResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + applicationResourceName, + accept, + context); + } + + /** + * Gets the application resource with the given name. + * + *

Gets the information about the application resource with the given name. The information include the + * description and other properties of the application. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about the application resource with the given name on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String applicationResourceName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, applicationResourceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the application resource with the given name. + * + *

Gets the information about the application resource with the given name. The information include the + * description and other properties of the application. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about the application resource with the given name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String applicationResourceName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, applicationResourceName, context).block(); + } + + /** + * Gets the application resource with the given name. + * + *

Gets the information about the application resource with the given name. The information include the + * description and other properties of the application. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about the application resource with the given name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationResourceDescriptionInner getByResourceGroup( + String resourceGroupName, String applicationResourceName) { + return getByResourceGroupWithResponse(resourceGroupName, applicationResourceName, Context.NONE).getValue(); + } + + /** + * Deletes the application resource. + * + *

Deletes the application resource identified by the name. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String applicationResourceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (applicationResourceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter applicationResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + applicationResourceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the application resource. + * + *

Deletes the application resource identified by the name. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String applicationResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (applicationResourceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter applicationResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + applicationResourceName, + accept, + context); + } + + /** + * Deletes the application resource. + * + *

Deletes the application resource identified by the name. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String applicationResourceName) { + return deleteWithResponseAsync(resourceGroupName, applicationResourceName).flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes the application resource. + * + *

Deletes the application resource identified by the name. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String applicationResourceName, Context context) { + return deleteWithResponseAsync(resourceGroupName, applicationResourceName, context).block(); + } + + /** + * Deletes the application resource. + * + *

Deletes the application resource identified by the name. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 applicationResourceName) { + deleteWithResponse(resourceGroupName, applicationResourceName, Context.NONE); + } + + /** + * Gets all the application resources in a given resource group. + * + *

Gets the information about all application resources in a given resource group. The information include the + * description and other properties of the Application. + * + * @param resourceGroupName Azure resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about all application resources in a given resource group along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all the application resources in a given resource group. + * + *

Gets the information about all application resources in a given resource group. The information include the + * description and other properties of the Application. + * + * @param resourceGroupName Azure resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about all application resources in a given resource group along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the application resources in a given resource group. + * + *

Gets the information about all application resources in a given resource group. The information include the + * description and other properties of the Application. + * + * @param resourceGroupName Azure resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about all application resources in a given resource group as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the application resources in a given resource group. + * + *

Gets the information about all application resources in a given resource group. The information include the + * description and other properties of the Application. + * + * @param resourceGroupName Azure resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about all application resources in a given resource group as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the application resources in a given resource group. + * + *

Gets the information about all application resources in a given resource group. The information include the + * description and other properties of the Application. + * + * @param resourceGroupName Azure resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about all application resources in a given resource group as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets all the application resources in a given resource group. + * + *

Gets the information about all application resources in a given resource group. The information include the + * description and other properties of the Application. + * + * @param resourceGroupName Azure resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about all application resources in a given resource group as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup( + String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets all the application resources in a given subscription. + * + *

Gets the information about all application resources in a given resource group. The information include the + * description and other properties of the application. + * + * @throws ErrorErrorModelException 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 about all application resources in a given resource group along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all the application resources in a given subscription. + * + *

Gets the information about all application resources in a given resource group. The information include the + * description and other properties of the application. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about all application resources in a given resource group along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the application resources in a given subscription. + * + *

Gets the information about all application resources in a given resource group. The information include the + * description and other properties of the application. + * + * @throws ErrorErrorModelException 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 about all application resources in a given resource group as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the application resources in a given subscription. + * + *

Gets the information about all application resources in a given resource group. The information include the + * description and other properties of the application. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about all application resources in a given resource group as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the application resources in a given subscription. + * + *

Gets the information about all application resources in a given resource group. The information include the + * description and other properties of the application. + * + * @throws ErrorErrorModelException 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 about all application resources in a given resource group as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all the application resources in a given subscription. + * + *

Gets the information about all application resources in a given resource group. The information include the + * description and other properties of the application. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about all application resources in a given resource group as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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

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

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a pageable list of application resources along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/ApplicationsImpl.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/ApplicationsImpl.java new file mode 100644 index 000000000000..c888e2f29d54 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/ApplicationsImpl.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.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.servicefabricmesh.fluent.ApplicationsClient; +import com.azure.resourcemanager.servicefabricmesh.fluent.models.ApplicationResourceDescriptionInner; +import com.azure.resourcemanager.servicefabricmesh.models.ApplicationResourceDescription; +import com.azure.resourcemanager.servicefabricmesh.models.Applications; + +public final class ApplicationsImpl implements Applications { + private static final ClientLogger LOGGER = new ClientLogger(ApplicationsImpl.class); + + private final ApplicationsClient innerClient; + + private final com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager serviceManager; + + public ApplicationsImpl( + ApplicationsClient innerClient, + com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String applicationResourceName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, applicationResourceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ApplicationResourceDescriptionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ApplicationResourceDescription getByResourceGroup(String resourceGroupName, String applicationResourceName) { + ApplicationResourceDescriptionInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, applicationResourceName); + if (inner != null) { + return new ApplicationResourceDescriptionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteByResourceGroupWithResponse( + String resourceGroupName, String applicationResourceName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, applicationResourceName, context); + } + + public void deleteByResourceGroup(String resourceGroupName, String applicationResourceName) { + this.serviceClient().delete(resourceGroupName, applicationResourceName); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new ApplicationResourceDescriptionImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup( + String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new ApplicationResourceDescriptionImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ApplicationResourceDescriptionImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ApplicationResourceDescriptionImpl(inner1, this.manager())); + } + + public ApplicationResourceDescription 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 applicationResourceName = Utils.getValueFromIdByName(id, "applications"); + if (applicationResourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, applicationResourceName, 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 applicationResourceName = Utils.getValueFromIdByName(id, "applications"); + if (applicationResourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, applicationResourceName, 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 applicationResourceName = Utils.getValueFromIdByName(id, "applications"); + if (applicationResourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); + } + this.deleteByResourceGroupWithResponse(resourceGroupName, applicationResourceName, Context.NONE); + } + + public Response 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 applicationResourceName = Utils.getValueFromIdByName(id, "applications"); + if (applicationResourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); + } + return this.deleteByResourceGroupWithResponse(resourceGroupName, applicationResourceName, context); + } + + private ApplicationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager() { + return this.serviceManager; + } + + public ApplicationResourceDescriptionImpl define(String name) { + return new ApplicationResourceDescriptionImpl(name, this.manager()); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/CodePackagesClientImpl.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/CodePackagesClientImpl.java new file mode 100644 index 000000000000..3ccf0348a309 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/CodePackagesClientImpl.java @@ -0,0 +1,328 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.servicefabricmesh.fluent.CodePackagesClient; +import com.azure.resourcemanager.servicefabricmesh.fluent.models.ContainerLogsInner; +import com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in CodePackagesClient. */ +public final class CodePackagesClientImpl implements CodePackagesClient { + /** The proxy service used to perform REST calls. */ + private final CodePackagesService service; + + /** The service client containing this operation class. */ + private final ServiceFabricMeshManagementClientImpl client; + + /** + * Initializes an instance of CodePackagesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CodePackagesClientImpl(ServiceFabricMeshManagementClientImpl client) { + this.service = + RestProxy.create(CodePackagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ServiceFabricMeshManagementClientCodePackages to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ServiceFabricMeshMan") + public interface CodePackagesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh" + + "/applications/{applicationResourceName}/services/{serviceResourceName}/replicas/{replicaName}" + + "/codePackages/{codePackageName}/logs") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorErrorModelException.class) + Mono> getContainerLogs( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam(value = "applicationResourceName", encoded = true) String applicationResourceName, + @PathParam(value = "serviceResourceName", encoded = true) String serviceResourceName, + @PathParam(value = "replicaName", encoded = true) String replicaName, + @PathParam("codePackageName") String codePackageName, + @QueryParam("tail") Integer tail, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the logs from the container. + * + *

Gets the logs for the container of the specified code package of the service replica. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @param serviceResourceName The identity of the service. + * @param replicaName Service Fabric replica name. + * @param codePackageName The name of code package of the service. + * @param tail Number of lines to show from the end of the logs. Default is 100. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the logs for the container of the specified code package of the service replica along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getContainerLogsWithResponseAsync( + String resourceGroupName, + String applicationResourceName, + String serviceResourceName, + String replicaName, + String codePackageName, + Integer tail) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (applicationResourceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter applicationResourceName is required and cannot be null.")); + } + if (serviceResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter serviceResourceName is required and cannot be null.")); + } + if (replicaName == null) { + return Mono.error(new IllegalArgumentException("Parameter replicaName is required and cannot be null.")); + } + if (codePackageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter codePackageName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getContainerLogs( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + applicationResourceName, + serviceResourceName, + replicaName, + codePackageName, + tail, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the logs from the container. + * + *

Gets the logs for the container of the specified code package of the service replica. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @param serviceResourceName The identity of the service. + * @param replicaName Service Fabric replica name. + * @param codePackageName The name of code package of the service. + * @param tail Number of lines to show from the end of the logs. Default is 100. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the logs for the container of the specified code package of the service replica along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getContainerLogsWithResponseAsync( + String resourceGroupName, + String applicationResourceName, + String serviceResourceName, + String replicaName, + String codePackageName, + Integer tail, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (applicationResourceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter applicationResourceName is required and cannot be null.")); + } + if (serviceResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter serviceResourceName is required and cannot be null.")); + } + if (replicaName == null) { + return Mono.error(new IllegalArgumentException("Parameter replicaName is required and cannot be null.")); + } + if (codePackageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter codePackageName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getContainerLogs( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + applicationResourceName, + serviceResourceName, + replicaName, + codePackageName, + tail, + accept, + context); + } + + /** + * Gets the logs from the container. + * + *

Gets the logs for the container of the specified code package of the service replica. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @param serviceResourceName The identity of the service. + * @param replicaName Service Fabric replica name. + * @param codePackageName The name of code package of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the logs for the container of the specified code package of the service replica on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getContainerLogsAsync( + String resourceGroupName, + String applicationResourceName, + String serviceResourceName, + String replicaName, + String codePackageName) { + final Integer tail = null; + return getContainerLogsWithResponseAsync( + resourceGroupName, applicationResourceName, serviceResourceName, replicaName, codePackageName, tail) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the logs from the container. + * + *

Gets the logs for the container of the specified code package of the service replica. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @param serviceResourceName The identity of the service. + * @param replicaName Service Fabric replica name. + * @param codePackageName The name of code package of the service. + * @param tail Number of lines to show from the end of the logs. Default is 100. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the logs for the container of the specified code package of the service replica along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getContainerLogsWithResponse( + String resourceGroupName, + String applicationResourceName, + String serviceResourceName, + String replicaName, + String codePackageName, + Integer tail, + Context context) { + return getContainerLogsWithResponseAsync( + resourceGroupName, + applicationResourceName, + serviceResourceName, + replicaName, + codePackageName, + tail, + context) + .block(); + } + + /** + * Gets the logs from the container. + * + *

Gets the logs for the container of the specified code package of the service replica. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @param serviceResourceName The identity of the service. + * @param replicaName Service Fabric replica name. + * @param codePackageName The name of code package of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the logs for the container of the specified code package of the service replica. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContainerLogsInner getContainerLogs( + String resourceGroupName, + String applicationResourceName, + String serviceResourceName, + String replicaName, + String codePackageName) { + final Integer tail = null; + return getContainerLogsWithResponse( + resourceGroupName, + applicationResourceName, + serviceResourceName, + replicaName, + codePackageName, + tail, + Context.NONE) + .getValue(); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/CodePackagesImpl.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/CodePackagesImpl.java new file mode 100644 index 000000000000..5513ad360fa1 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/CodePackagesImpl.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicefabricmesh.fluent.CodePackagesClient; +import com.azure.resourcemanager.servicefabricmesh.fluent.models.ContainerLogsInner; +import com.azure.resourcemanager.servicefabricmesh.models.CodePackages; +import com.azure.resourcemanager.servicefabricmesh.models.ContainerLogs; + +public final class CodePackagesImpl implements CodePackages { + private static final ClientLogger LOGGER = new ClientLogger(CodePackagesImpl.class); + + private final CodePackagesClient innerClient; + + private final com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager serviceManager; + + public CodePackagesImpl( + CodePackagesClient innerClient, + com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getContainerLogsWithResponse( + String resourceGroupName, + String applicationResourceName, + String serviceResourceName, + String replicaName, + String codePackageName, + Integer tail, + Context context) { + Response inner = + this + .serviceClient() + .getContainerLogsWithResponse( + resourceGroupName, + applicationResourceName, + serviceResourceName, + replicaName, + codePackageName, + tail, + context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ContainerLogsImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ContainerLogs getContainerLogs( + String resourceGroupName, + String applicationResourceName, + String serviceResourceName, + String replicaName, + String codePackageName) { + ContainerLogsInner inner = + this + .serviceClient() + .getContainerLogs( + resourceGroupName, applicationResourceName, serviceResourceName, replicaName, codePackageName); + if (inner != null) { + return new ContainerLogsImpl(inner, this.manager()); + } else { + return null; + } + } + + private CodePackagesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/ContainerLogsImpl.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/ContainerLogsImpl.java new file mode 100644 index 000000000000..9d47ebc2c068 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/ContainerLogsImpl.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.servicefabricmesh.implementation; + +import com.azure.resourcemanager.servicefabricmesh.fluent.models.ContainerLogsInner; +import com.azure.resourcemanager.servicefabricmesh.models.ContainerLogs; + +public final class ContainerLogsImpl implements ContainerLogs { + private ContainerLogsInner innerObject; + + private final com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager serviceManager; + + ContainerLogsImpl( + ContainerLogsInner innerObject, + com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String content() { + return this.innerModel().content(); + } + + public ContainerLogsInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/GatewayResourceDescriptionImpl.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/GatewayResourceDescriptionImpl.java new file mode 100644 index 000000000000..6d027d0b3df1 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/GatewayResourceDescriptionImpl.java @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicefabricmesh.fluent.models.GatewayResourceDescriptionInner; +import com.azure.resourcemanager.servicefabricmesh.models.GatewayResourceDescription; +import com.azure.resourcemanager.servicefabricmesh.models.HttpConfig; +import com.azure.resourcemanager.servicefabricmesh.models.NetworkRef; +import com.azure.resourcemanager.servicefabricmesh.models.ResourceStatus; +import com.azure.resourcemanager.servicefabricmesh.models.TcpConfig; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class GatewayResourceDescriptionImpl + implements GatewayResourceDescription, GatewayResourceDescription.Definition { + private GatewayResourceDescriptionInner innerObject; + + private final com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager serviceManager; + + GatewayResourceDescriptionImpl( + GatewayResourceDescriptionInner innerObject, + com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String description() { + return this.innerModel().description(); + } + + public NetworkRef sourceNetwork() { + return this.innerModel().sourceNetwork(); + } + + public NetworkRef destinationNetwork() { + return this.innerModel().destinationNetwork(); + } + + public List tcp() { + List inner = this.innerModel().tcp(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List http() { + List inner = this.innerModel().http(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ResourceStatus status() { + return this.innerModel().status(); + } + + public String statusDetails() { + return this.innerModel().statusDetails(); + } + + public String ipAddress() { + return this.innerModel().ipAddress(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public GatewayResourceDescriptionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String gatewayResourceName; + + public GatewayResourceDescriptionImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public GatewayResourceDescription create() { + this.innerObject = + serviceManager + .serviceClient() + .getGateways() + .createWithResponse(resourceGroupName, gatewayResourceName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public GatewayResourceDescription create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getGateways() + .createWithResponse(resourceGroupName, gatewayResourceName, this.innerModel(), context) + .getValue(); + return this; + } + + GatewayResourceDescriptionImpl( + String name, com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager serviceManager) { + this.innerObject = new GatewayResourceDescriptionInner(); + this.serviceManager = serviceManager; + this.gatewayResourceName = name; + } + + public GatewayResourceDescription refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getGateways() + .getByResourceGroupWithResponse(resourceGroupName, gatewayResourceName, Context.NONE) + .getValue(); + return this; + } + + public GatewayResourceDescription refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getGateways() + .getByResourceGroupWithResponse(resourceGroupName, gatewayResourceName, context) + .getValue(); + return this; + } + + public GatewayResourceDescriptionImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public GatewayResourceDescriptionImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public GatewayResourceDescriptionImpl withSourceNetwork(NetworkRef sourceNetwork) { + this.innerModel().withSourceNetwork(sourceNetwork); + return this; + } + + public GatewayResourceDescriptionImpl withDestinationNetwork(NetworkRef destinationNetwork) { + this.innerModel().withDestinationNetwork(destinationNetwork); + return this; + } + + public GatewayResourceDescriptionImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public GatewayResourceDescriptionImpl withDescription(String description) { + this.innerModel().withDescription(description); + return this; + } + + public GatewayResourceDescriptionImpl withTcp(List tcp) { + this.innerModel().withTcp(tcp); + return this; + } + + public GatewayResourceDescriptionImpl withHttp(List http) { + this.innerModel().withHttp(http); + return this; + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/GatewaysClientImpl.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/GatewaysClientImpl.java new file mode 100644 index 000000000000..be86e6003054 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/GatewaysClientImpl.java @@ -0,0 +1,1180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.servicefabricmesh.fluent.GatewaysClient; +import com.azure.resourcemanager.servicefabricmesh.fluent.models.GatewayResourceDescriptionInner; +import com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException; +import com.azure.resourcemanager.servicefabricmesh.models.GatewayResourceDescriptionList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in GatewaysClient. */ +public final class GatewaysClientImpl implements GatewaysClient { + /** The proxy service used to perform REST calls. */ + private final GatewaysService service; + + /** The service client containing this operation class. */ + private final ServiceFabricMeshManagementClientImpl client; + + /** + * Initializes an instance of GatewaysClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + GatewaysClientImpl(ServiceFabricMeshManagementClientImpl client) { + this.service = RestProxy.create(GatewaysService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ServiceFabricMeshManagementClientGateways to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ServiceFabricMeshMan") + public interface GatewaysService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh" + + "/gateways/{gatewayResourceName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ErrorErrorModelException.class) + Mono> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam(value = "gatewayResourceName", encoded = true) String gatewayResourceName, + @BodyParam("application/json") GatewayResourceDescriptionInner gatewayResourceDescription, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh" + + "/gateways/{gatewayResourceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorErrorModelException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam(value = "gatewayResourceName", encoded = true) String gatewayResourceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh" + + "/gateways/{gatewayResourceName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ErrorErrorModelException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam(value = "gatewayResourceName", encoded = true) String gatewayResourceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh" + + "/gateways") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorErrorModelException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabricMesh/gateways") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorErrorModelException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorErrorModelException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorErrorModelException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Creates or updates a gateway resource. + * + *

Creates a gateway resource with the specified name, description and properties. If a gateway resource with the + * same name exists, then it is updated with the specified description and properties. Use gateway resources to + * create a gateway for public connectivity for services within your application. + * + * @param resourceGroupName Azure resource group name. + * @param gatewayResourceName The identity of the gateway. + * @param gatewayResourceDescription Description for creating a Gateway resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return this type describes a gateway resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, + String gatewayResourceName, + GatewayResourceDescriptionInner gatewayResourceDescription) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (gatewayResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter gatewayResourceName is required and cannot be null.")); + } + if (gatewayResourceDescription == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter gatewayResourceDescription is required and cannot be null.")); + } else { + gatewayResourceDescription.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + gatewayResourceName, + gatewayResourceDescription, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a gateway resource. + * + *

Creates a gateway resource with the specified name, description and properties. If a gateway resource with the + * same name exists, then it is updated with the specified description and properties. Use gateway resources to + * create a gateway for public connectivity for services within your application. + * + * @param resourceGroupName Azure resource group name. + * @param gatewayResourceName The identity of the gateway. + * @param gatewayResourceDescription Description for creating a Gateway resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return this type describes a gateway resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, + String gatewayResourceName, + GatewayResourceDescriptionInner gatewayResourceDescription, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (gatewayResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter gatewayResourceName is required and cannot be null.")); + } + if (gatewayResourceDescription == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter gatewayResourceDescription is required and cannot be null.")); + } else { + gatewayResourceDescription.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + gatewayResourceName, + gatewayResourceDescription, + accept, + context); + } + + /** + * Creates or updates a gateway resource. + * + *

Creates a gateway resource with the specified name, description and properties. If a gateway resource with the + * same name exists, then it is updated with the specified description and properties. Use gateway resources to + * create a gateway for public connectivity for services within your application. + * + * @param resourceGroupName Azure resource group name. + * @param gatewayResourceName The identity of the gateway. + * @param gatewayResourceDescription Description for creating a Gateway resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return this type describes a gateway resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String gatewayResourceName, + GatewayResourceDescriptionInner gatewayResourceDescription) { + return createWithResponseAsync(resourceGroupName, gatewayResourceName, gatewayResourceDescription) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates or updates a gateway resource. + * + *

Creates a gateway resource with the specified name, description and properties. If a gateway resource with the + * same name exists, then it is updated with the specified description and properties. Use gateway resources to + * create a gateway for public connectivity for services within your application. + * + * @param resourceGroupName Azure resource group name. + * @param gatewayResourceName The identity of the gateway. + * @param gatewayResourceDescription Description for creating a Gateway resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return this type describes a gateway resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse( + String resourceGroupName, + String gatewayResourceName, + GatewayResourceDescriptionInner gatewayResourceDescription, + Context context) { + return createWithResponseAsync(resourceGroupName, gatewayResourceName, gatewayResourceDescription, context) + .block(); + } + + /** + * Creates or updates a gateway resource. + * + *

Creates a gateway resource with the specified name, description and properties. If a gateway resource with the + * same name exists, then it is updated with the specified description and properties. Use gateway resources to + * create a gateway for public connectivity for services within your application. + * + * @param resourceGroupName Azure resource group name. + * @param gatewayResourceName The identity of the gateway. + * @param gatewayResourceDescription Description for creating a Gateway resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return this type describes a gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GatewayResourceDescriptionInner create( + String resourceGroupName, + String gatewayResourceName, + GatewayResourceDescriptionInner gatewayResourceDescription) { + return createWithResponse(resourceGroupName, gatewayResourceName, gatewayResourceDescription, Context.NONE) + .getValue(); + } + + /** + * Gets the gateway resource with the given name. + * + *

Gets the information about the gateway resource with the given name. The information include the description + * and other properties of the gateway. + * + * @param resourceGroupName Azure resource group name. + * @param gatewayResourceName The identity of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about the gateway resource with the given name along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String gatewayResourceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (gatewayResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter gatewayResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + gatewayResourceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the gateway resource with the given name. + * + *

Gets the information about the gateway resource with the given name. The information include the description + * and other properties of the gateway. + * + * @param resourceGroupName Azure resource group name. + * @param gatewayResourceName The identity of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about the gateway resource with the given name along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String gatewayResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (gatewayResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter gatewayResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + gatewayResourceName, + accept, + context); + } + + /** + * Gets the gateway resource with the given name. + * + *

Gets the information about the gateway resource with the given name. The information include the description + * and other properties of the gateway. + * + * @param resourceGroupName Azure resource group name. + * @param gatewayResourceName The identity of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about the gateway resource with the given name on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String gatewayResourceName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, gatewayResourceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the gateway resource with the given name. + * + *

Gets the information about the gateway resource with the given name. The information include the description + * and other properties of the gateway. + * + * @param resourceGroupName Azure resource group name. + * @param gatewayResourceName The identity of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about the gateway resource with the given name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String gatewayResourceName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, gatewayResourceName, context).block(); + } + + /** + * Gets the gateway resource with the given name. + * + *

Gets the information about the gateway resource with the given name. The information include the description + * and other properties of the gateway. + * + * @param resourceGroupName Azure resource group name. + * @param gatewayResourceName The identity of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about the gateway resource with the given name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GatewayResourceDescriptionInner getByResourceGroup(String resourceGroupName, String gatewayResourceName) { + return getByResourceGroupWithResponse(resourceGroupName, gatewayResourceName, Context.NONE).getValue(); + } + + /** + * Deletes the gateway resource. + * + *

Deletes the gateway resource identified by the name. + * + * @param resourceGroupName Azure resource group name. + * @param gatewayResourceName The identity of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String gatewayResourceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (gatewayResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter gatewayResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + gatewayResourceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the gateway resource. + * + *

Deletes the gateway resource identified by the name. + * + * @param resourceGroupName Azure resource group name. + * @param gatewayResourceName The identity of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String gatewayResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (gatewayResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter gatewayResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + gatewayResourceName, + accept, + context); + } + + /** + * Deletes the gateway resource. + * + *

Deletes the gateway resource identified by the name. + * + * @param resourceGroupName Azure resource group name. + * @param gatewayResourceName The identity of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String gatewayResourceName) { + return deleteWithResponseAsync(resourceGroupName, gatewayResourceName).flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes the gateway resource. + * + *

Deletes the gateway resource identified by the name. + * + * @param resourceGroupName Azure resource group name. + * @param gatewayResourceName The identity of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String gatewayResourceName, Context context) { + return deleteWithResponseAsync(resourceGroupName, gatewayResourceName, context).block(); + } + + /** + * Deletes the gateway resource. + * + *

Deletes the gateway resource identified by the name. + * + * @param resourceGroupName Azure resource group name. + * @param gatewayResourceName The identity of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 gatewayResourceName) { + deleteWithResponse(resourceGroupName, gatewayResourceName, Context.NONE); + } + + /** + * Gets all the gateway resources in a given resource group. + * + *

Gets the information about all gateway resources in a given resource group. The information include the + * description and other properties of the Gateway. + * + * @param resourceGroupName Azure resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about all gateway resources in a given resource group along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all the gateway resources in a given resource group. + * + *

Gets the information about all gateway resources in a given resource group. The information include the + * description and other properties of the Gateway. + * + * @param resourceGroupName Azure resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about all gateway resources in a given resource group along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the gateway resources in a given resource group. + * + *

Gets the information about all gateway resources in a given resource group. The information include the + * description and other properties of the Gateway. + * + * @param resourceGroupName Azure resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about all gateway resources in a given resource group as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the gateway resources in a given resource group. + * + *

Gets the information about all gateway resources in a given resource group. The information include the + * description and other properties of the Gateway. + * + * @param resourceGroupName Azure resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about all gateway resources in a given resource group as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the gateway resources in a given resource group. + * + *

Gets the information about all gateway resources in a given resource group. The information include the + * description and other properties of the Gateway. + * + * @param resourceGroupName Azure resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about all gateway resources in a given resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets all the gateway resources in a given resource group. + * + *

Gets the information about all gateway resources in a given resource group. The information include the + * description and other properties of the Gateway. + * + * @param resourceGroupName Azure resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about all gateway resources in a given resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup( + String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets all the gateway resources in a given subscription. + * + *

Gets the information about all gateway resources in a given resource group. The information include the + * description and other properties of the gateway. + * + * @throws ErrorErrorModelException 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 about all gateway resources in a given resource group along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all the gateway resources in a given subscription. + * + *

Gets the information about all gateway resources in a given resource group. The information include the + * description and other properties of the gateway. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about all gateway resources in a given resource group along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the gateway resources in a given subscription. + * + *

Gets the information about all gateway resources in a given resource group. The information include the + * description and other properties of the gateway. + * + * @throws ErrorErrorModelException 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 about all gateway resources in a given resource group as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the gateway resources in a given subscription. + * + *

Gets the information about all gateway resources in a given resource group. The information include the + * description and other properties of the gateway. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about all gateway resources in a given resource group as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the gateway resources in a given subscription. + * + *

Gets the information about all gateway resources in a given resource group. The information include the + * description and other properties of the gateway. + * + * @throws ErrorErrorModelException 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 about all gateway resources in a given resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all the gateway resources in a given subscription. + * + *

Gets the information about all gateway resources in a given resource group. The information include the + * description and other properties of the gateway. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about all gateway resources in a given resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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

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

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a pageable list of gateway resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/GatewaysImpl.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/GatewaysImpl.java new file mode 100644 index 000000000000..8f8f1542e0f7 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/GatewaysImpl.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.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.servicefabricmesh.fluent.GatewaysClient; +import com.azure.resourcemanager.servicefabricmesh.fluent.models.GatewayResourceDescriptionInner; +import com.azure.resourcemanager.servicefabricmesh.models.GatewayResourceDescription; +import com.azure.resourcemanager.servicefabricmesh.models.Gateways; + +public final class GatewaysImpl implements Gateways { + private static final ClientLogger LOGGER = new ClientLogger(GatewaysImpl.class); + + private final GatewaysClient innerClient; + + private final com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager serviceManager; + + public GatewaysImpl( + GatewaysClient innerClient, + com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String gatewayResourceName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, gatewayResourceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new GatewayResourceDescriptionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public GatewayResourceDescription getByResourceGroup(String resourceGroupName, String gatewayResourceName) { + GatewayResourceDescriptionInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, gatewayResourceName); + if (inner != null) { + return new GatewayResourceDescriptionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteByResourceGroupWithResponse( + String resourceGroupName, String gatewayResourceName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, gatewayResourceName, context); + } + + public void deleteByResourceGroup(String resourceGroupName, String gatewayResourceName) { + this.serviceClient().delete(resourceGroupName, gatewayResourceName); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new GatewayResourceDescriptionImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new GatewayResourceDescriptionImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new GatewayResourceDescriptionImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new GatewayResourceDescriptionImpl(inner1, this.manager())); + } + + public GatewayResourceDescription 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 gatewayResourceName = Utils.getValueFromIdByName(id, "gateways"); + if (gatewayResourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'gateways'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, gatewayResourceName, 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 gatewayResourceName = Utils.getValueFromIdByName(id, "gateways"); + if (gatewayResourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'gateways'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, gatewayResourceName, 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 gatewayResourceName = Utils.getValueFromIdByName(id, "gateways"); + if (gatewayResourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'gateways'.", id))); + } + this.deleteByResourceGroupWithResponse(resourceGroupName, gatewayResourceName, Context.NONE); + } + + public Response 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 gatewayResourceName = Utils.getValueFromIdByName(id, "gateways"); + if (gatewayResourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'gateways'.", id))); + } + return this.deleteByResourceGroupWithResponse(resourceGroupName, gatewayResourceName, context); + } + + private GatewaysClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager() { + return this.serviceManager; + } + + public GatewayResourceDescriptionImpl define(String name) { + return new GatewayResourceDescriptionImpl(name, this.manager()); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/NetworkResourceDescriptionImpl.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/NetworkResourceDescriptionImpl.java new file mode 100644 index 000000000000..be67fbb19c81 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/NetworkResourceDescriptionImpl.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicefabricmesh.fluent.models.NetworkResourceDescriptionInner; +import com.azure.resourcemanager.servicefabricmesh.models.NetworkResourceDescription; +import com.azure.resourcemanager.servicefabricmesh.models.NetworkResourceProperties; +import java.util.Collections; +import java.util.Map; + +public final class NetworkResourceDescriptionImpl + implements NetworkResourceDescription, NetworkResourceDescription.Definition { + private NetworkResourceDescriptionInner innerObject; + + private final com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager serviceManager; + + NetworkResourceDescriptionImpl( + NetworkResourceDescriptionInner innerObject, + com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public NetworkResourceProperties properties() { + return this.innerModel().properties(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public NetworkResourceDescriptionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String networkResourceName; + + public NetworkResourceDescriptionImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public NetworkResourceDescription create() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworks() + .createWithResponse(resourceGroupName, networkResourceName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public NetworkResourceDescription create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworks() + .createWithResponse(resourceGroupName, networkResourceName, this.innerModel(), context) + .getValue(); + return this; + } + + NetworkResourceDescriptionImpl( + String name, com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager serviceManager) { + this.innerObject = new NetworkResourceDescriptionInner(); + this.serviceManager = serviceManager; + this.networkResourceName = name; + } + + public NetworkResourceDescription refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworks() + .getByResourceGroupWithResponse(resourceGroupName, networkResourceName, Context.NONE) + .getValue(); + return this; + } + + public NetworkResourceDescription refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworks() + .getByResourceGroupWithResponse(resourceGroupName, networkResourceName, context) + .getValue(); + return this; + } + + public NetworkResourceDescriptionImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public NetworkResourceDescriptionImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public NetworkResourceDescriptionImpl withProperties(NetworkResourceProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + public NetworkResourceDescriptionImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/NetworksClientImpl.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/NetworksClientImpl.java new file mode 100644 index 000000000000..29e088b512e3 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/NetworksClientImpl.java @@ -0,0 +1,1175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.servicefabricmesh.fluent.NetworksClient; +import com.azure.resourcemanager.servicefabricmesh.fluent.models.NetworkResourceDescriptionInner; +import com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException; +import com.azure.resourcemanager.servicefabricmesh.models.NetworkResourceDescriptionList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in NetworksClient. */ +public final class NetworksClientImpl implements NetworksClient { + /** The proxy service used to perform REST calls. */ + private final NetworksService service; + + /** The service client containing this operation class. */ + private final ServiceFabricMeshManagementClientImpl client; + + /** + * Initializes an instance of NetworksClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NetworksClientImpl(ServiceFabricMeshManagementClientImpl client) { + this.service = RestProxy.create(NetworksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ServiceFabricMeshManagementClientNetworks to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ServiceFabricMeshMan") + public interface NetworksService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh" + + "/networks/{networkResourceName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ErrorErrorModelException.class) + Mono> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam(value = "networkResourceName", encoded = true) String networkResourceName, + @BodyParam("application/json") NetworkResourceDescriptionInner networkResourceDescription, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh" + + "/networks/{networkResourceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorErrorModelException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam(value = "networkResourceName", encoded = true) String networkResourceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh" + + "/networks/{networkResourceName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ErrorErrorModelException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam(value = "networkResourceName", encoded = true) String networkResourceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh" + + "/networks") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorErrorModelException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabricMesh/networks") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorErrorModelException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorErrorModelException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorErrorModelException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Creates or updates a network resource. + * + *

Creates a network resource with the specified name, description and properties. If a network resource with the + * same name exists, then it is updated with the specified description and properties. + * + * @param resourceGroupName Azure resource group name. + * @param networkResourceName The identity of the network. + * @param networkResourceDescription Description for creating a Network resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return this type describes a network resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, + String networkResourceName, + NetworkResourceDescriptionInner networkResourceDescription) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkResourceName is required and cannot be null.")); + } + if (networkResourceDescription == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkResourceDescription is required and cannot be null.")); + } else { + networkResourceDescription.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + networkResourceName, + networkResourceDescription, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a network resource. + * + *

Creates a network resource with the specified name, description and properties. If a network resource with the + * same name exists, then it is updated with the specified description and properties. + * + * @param resourceGroupName Azure resource group name. + * @param networkResourceName The identity of the network. + * @param networkResourceDescription Description for creating a Network resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return this type describes a network resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, + String networkResourceName, + NetworkResourceDescriptionInner networkResourceDescription, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkResourceName is required and cannot be null.")); + } + if (networkResourceDescription == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkResourceDescription is required and cannot be null.")); + } else { + networkResourceDescription.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + networkResourceName, + networkResourceDescription, + accept, + context); + } + + /** + * Creates or updates a network resource. + * + *

Creates a network resource with the specified name, description and properties. If a network resource with the + * same name exists, then it is updated with the specified description and properties. + * + * @param resourceGroupName Azure resource group name. + * @param networkResourceName The identity of the network. + * @param networkResourceDescription Description for creating a Network resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return this type describes a network resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String networkResourceName, + NetworkResourceDescriptionInner networkResourceDescription) { + return createWithResponseAsync(resourceGroupName, networkResourceName, networkResourceDescription) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates or updates a network resource. + * + *

Creates a network resource with the specified name, description and properties. If a network resource with the + * same name exists, then it is updated with the specified description and properties. + * + * @param resourceGroupName Azure resource group name. + * @param networkResourceName The identity of the network. + * @param networkResourceDescription Description for creating a Network resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return this type describes a network resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse( + String resourceGroupName, + String networkResourceName, + NetworkResourceDescriptionInner networkResourceDescription, + Context context) { + return createWithResponseAsync(resourceGroupName, networkResourceName, networkResourceDescription, context) + .block(); + } + + /** + * Creates or updates a network resource. + * + *

Creates a network resource with the specified name, description and properties. If a network resource with the + * same name exists, then it is updated with the specified description and properties. + * + * @param resourceGroupName Azure resource group name. + * @param networkResourceName The identity of the network. + * @param networkResourceDescription Description for creating a Network resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return this type describes a network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkResourceDescriptionInner create( + String resourceGroupName, + String networkResourceName, + NetworkResourceDescriptionInner networkResourceDescription) { + return createWithResponse(resourceGroupName, networkResourceName, networkResourceDescription, Context.NONE) + .getValue(); + } + + /** + * Gets the network resource with the given name. + * + *

Gets the information about the network resource with the given name. The information include the description + * and other properties of the network. + * + * @param resourceGroupName Azure resource group name. + * @param networkResourceName The identity of the network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about the network resource with the given name along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String networkResourceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + networkResourceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the network resource with the given name. + * + *

Gets the information about the network resource with the given name. The information include the description + * and other properties of the network. + * + * @param resourceGroupName Azure resource group name. + * @param networkResourceName The identity of the network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about the network resource with the given name along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String networkResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + networkResourceName, + accept, + context); + } + + /** + * Gets the network resource with the given name. + * + *

Gets the information about the network resource with the given name. The information include the description + * and other properties of the network. + * + * @param resourceGroupName Azure resource group name. + * @param networkResourceName The identity of the network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about the network resource with the given name on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String networkResourceName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, networkResourceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the network resource with the given name. + * + *

Gets the information about the network resource with the given name. The information include the description + * and other properties of the network. + * + * @param resourceGroupName Azure resource group name. + * @param networkResourceName The identity of the network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about the network resource with the given name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String networkResourceName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, networkResourceName, context).block(); + } + + /** + * Gets the network resource with the given name. + * + *

Gets the information about the network resource with the given name. The information include the description + * and other properties of the network. + * + * @param resourceGroupName Azure resource group name. + * @param networkResourceName The identity of the network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about the network resource with the given name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkResourceDescriptionInner getByResourceGroup(String resourceGroupName, String networkResourceName) { + return getByResourceGroupWithResponse(resourceGroupName, networkResourceName, Context.NONE).getValue(); + } + + /** + * Deletes the network resource. + * + *

Deletes the network resource identified by the name. + * + * @param resourceGroupName Azure resource group name. + * @param networkResourceName The identity of the network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String networkResourceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + networkResourceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the network resource. + * + *

Deletes the network resource identified by the name. + * + * @param resourceGroupName Azure resource group name. + * @param networkResourceName The identity of the network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String networkResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + networkResourceName, + accept, + context); + } + + /** + * Deletes the network resource. + * + *

Deletes the network resource identified by the name. + * + * @param resourceGroupName Azure resource group name. + * @param networkResourceName The identity of the network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String networkResourceName) { + return deleteWithResponseAsync(resourceGroupName, networkResourceName).flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes the network resource. + * + *

Deletes the network resource identified by the name. + * + * @param resourceGroupName Azure resource group name. + * @param networkResourceName The identity of the network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String networkResourceName, Context context) { + return deleteWithResponseAsync(resourceGroupName, networkResourceName, context).block(); + } + + /** + * Deletes the network resource. + * + *

Deletes the network resource identified by the name. + * + * @param resourceGroupName Azure resource group name. + * @param networkResourceName The identity of the network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 networkResourceName) { + deleteWithResponse(resourceGroupName, networkResourceName, Context.NONE); + } + + /** + * Gets all the network resources in a given resource group. + * + *

Gets the information about all network resources in a given resource group. The information include the + * description and other properties of the Network. + * + * @param resourceGroupName Azure resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about all network resources in a given resource group along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all the network resources in a given resource group. + * + *

Gets the information about all network resources in a given resource group. The information include the + * description and other properties of the Network. + * + * @param resourceGroupName Azure resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about all network resources in a given resource group along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the network resources in a given resource group. + * + *

Gets the information about all network resources in a given resource group. The information include the + * description and other properties of the Network. + * + * @param resourceGroupName Azure resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about all network resources in a given resource group as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the network resources in a given resource group. + * + *

Gets the information about all network resources in a given resource group. The information include the + * description and other properties of the Network. + * + * @param resourceGroupName Azure resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about all network resources in a given resource group as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the network resources in a given resource group. + * + *

Gets the information about all network resources in a given resource group. The information include the + * description and other properties of the Network. + * + * @param resourceGroupName Azure resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about all network resources in a given resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets all the network resources in a given resource group. + * + *

Gets the information about all network resources in a given resource group. The information include the + * description and other properties of the Network. + * + * @param resourceGroupName Azure resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about all network resources in a given resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup( + String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets all the network resources in a given subscription. + * + *

Gets the information about all network resources in a given resource group. The information include the + * description and other properties of the network. + * + * @throws ErrorErrorModelException 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 about all network resources in a given resource group along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all the network resources in a given subscription. + * + *

Gets the information about all network resources in a given resource group. The information include the + * description and other properties of the network. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about all network resources in a given resource group along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the network resources in a given subscription. + * + *

Gets the information about all network resources in a given resource group. The information include the + * description and other properties of the network. + * + * @throws ErrorErrorModelException 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 about all network resources in a given resource group as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the network resources in a given subscription. + * + *

Gets the information about all network resources in a given resource group. The information include the + * description and other properties of the network. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about all network resources in a given resource group as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the network resources in a given subscription. + * + *

Gets the information about all network resources in a given resource group. The information include the + * description and other properties of the network. + * + * @throws ErrorErrorModelException 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 about all network resources in a given resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all the network resources in a given subscription. + * + *

Gets the information about all network resources in a given resource group. The information include the + * description and other properties of the network. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about all network resources in a given resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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

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

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a pageable list of network resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/NetworksImpl.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/NetworksImpl.java new file mode 100644 index 000000000000..bd87426a7462 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/NetworksImpl.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.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.servicefabricmesh.fluent.NetworksClient; +import com.azure.resourcemanager.servicefabricmesh.fluent.models.NetworkResourceDescriptionInner; +import com.azure.resourcemanager.servicefabricmesh.models.NetworkResourceDescription; +import com.azure.resourcemanager.servicefabricmesh.models.Networks; + +public final class NetworksImpl implements Networks { + private static final ClientLogger LOGGER = new ClientLogger(NetworksImpl.class); + + private final NetworksClient innerClient; + + private final com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager serviceManager; + + public NetworksImpl( + NetworksClient innerClient, + com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String networkResourceName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, networkResourceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NetworkResourceDescriptionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public NetworkResourceDescription getByResourceGroup(String resourceGroupName, String networkResourceName) { + NetworkResourceDescriptionInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, networkResourceName); + if (inner != null) { + return new NetworkResourceDescriptionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteByResourceGroupWithResponse( + String resourceGroupName, String networkResourceName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, networkResourceName, context); + } + + public void deleteByResourceGroup(String resourceGroupName, String networkResourceName) { + this.serviceClient().delete(resourceGroupName, networkResourceName); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new NetworkResourceDescriptionImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new NetworkResourceDescriptionImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new NetworkResourceDescriptionImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new NetworkResourceDescriptionImpl(inner1, this.manager())); + } + + public NetworkResourceDescription 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 networkResourceName = Utils.getValueFromIdByName(id, "networks"); + if (networkResourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networks'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, networkResourceName, 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 networkResourceName = Utils.getValueFromIdByName(id, "networks"); + if (networkResourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networks'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, networkResourceName, 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 networkResourceName = Utils.getValueFromIdByName(id, "networks"); + if (networkResourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networks'.", id))); + } + this.deleteByResourceGroupWithResponse(resourceGroupName, networkResourceName, Context.NONE); + } + + public Response 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 networkResourceName = Utils.getValueFromIdByName(id, "networks"); + if (networkResourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networks'.", id))); + } + return this.deleteByResourceGroupWithResponse(resourceGroupName, networkResourceName, context); + } + + private NetworksClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager() { + return this.serviceManager; + } + + public NetworkResourceDescriptionImpl define(String name) { + return new NetworkResourceDescriptionImpl(name, this.manager()); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/OperationResultImpl.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/OperationResultImpl.java new file mode 100644 index 000000000000..dccaed15f0eb --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/OperationResultImpl.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.servicefabricmesh.implementation; + +import com.azure.resourcemanager.servicefabricmesh.fluent.models.OperationResultInner; +import com.azure.resourcemanager.servicefabricmesh.models.AvailableOperationDescriptionProperties; +import com.azure.resourcemanager.servicefabricmesh.models.AvailableOperationDisplay; +import com.azure.resourcemanager.servicefabricmesh.models.OperationResult; + +public final class OperationResultImpl implements OperationResult { + private OperationResultInner innerObject; + + private final com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager serviceManager; + + OperationResultImpl( + OperationResultInner innerObject, + com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public AvailableOperationDisplay display() { + return this.innerModel().display(); + } + + public String origin() { + return this.innerModel().origin(); + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public AvailableOperationDescriptionProperties properties() { + return this.innerModel().properties(); + } + + public OperationResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/OperationsClientImpl.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/OperationsClientImpl.java new file mode 100644 index 000000000000..fd03e96cd5cf --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/OperationsClientImpl.java @@ -0,0 +1,288 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.servicefabricmesh.fluent.OperationsClient; +import com.azure.resourcemanager.servicefabricmesh.fluent.models.OperationResultInner; +import com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException; +import com.azure.resourcemanager.servicefabricmesh.models.OperationListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public final class OperationsClientImpl implements OperationsClient { + /** The proxy service used to perform REST calls. */ + private final OperationsService service; + + /** The service client containing this operation class. */ + private final ServiceFabricMeshManagementClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(ServiceFabricMeshManagementClientImpl client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ServiceFabricMeshManagementClientOperations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ServiceFabricMeshMan") + public interface OperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.ServiceFabricMesh/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorErrorModelException.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(ErrorErrorModelException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all of the available operations. + * + *

Lists all the available operations provided by Service Fabric SeaBreeze resource provider. + * + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the result of the request to list Service Fabric operations along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all of the available operations. + * + *

Lists all the available operations provided by Service Fabric SeaBreeze resource provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the result of the request to list Service Fabric operations along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all of the available operations. + * + *

Lists all the available operations provided by Service Fabric SeaBreeze resource provider. + * + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the result of the request to list Service Fabric operations as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the available operations. + * + *

Lists all the available operations provided by Service Fabric SeaBreeze resource provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the result of the request to list Service Fabric operations as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the available operations. + * + *

Lists all the available operations provided by Service Fabric SeaBreeze resource provider. + * + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the result of the request to list Service Fabric operations as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all of the available operations. + * + *

Lists all the available operations provided by Service Fabric SeaBreeze resource provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the result of the request to list Service Fabric operations as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the result of the request to list Service Fabric operations along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/OperationsImpl.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/OperationsImpl.java new file mode 100644 index 000000000000..322409a92ec2 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/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.servicefabricmesh.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.servicefabricmesh.fluent.OperationsClient; +import com.azure.resourcemanager.servicefabricmesh.fluent.models.OperationResultInner; +import com.azure.resourcemanager.servicefabricmesh.models.OperationResult; +import com.azure.resourcemanager.servicefabricmesh.models.Operations; + +public final class OperationsImpl implements Operations { + private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager serviceManager; + + public OperationsImpl( + OperationsClient innerClient, + com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new OperationResultImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new OperationResultImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/SecretResourceDescriptionImpl.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/SecretResourceDescriptionImpl.java new file mode 100644 index 000000000000..9ddbb7d6fee0 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/SecretResourceDescriptionImpl.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicefabricmesh.fluent.models.SecretResourceDescriptionInner; +import com.azure.resourcemanager.servicefabricmesh.models.SecretResourceDescription; +import com.azure.resourcemanager.servicefabricmesh.models.SecretResourceProperties; +import java.util.Collections; +import java.util.Map; + +public final class SecretResourceDescriptionImpl + implements SecretResourceDescription, SecretResourceDescription.Definition { + private SecretResourceDescriptionInner innerObject; + + private final com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager serviceManager; + + SecretResourceDescriptionImpl( + SecretResourceDescriptionInner innerObject, + com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SecretResourceProperties properties() { + return this.innerModel().properties(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public SecretResourceDescriptionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String secretResourceName; + + public SecretResourceDescriptionImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public SecretResourceDescription create() { + this.innerObject = + serviceManager + .serviceClient() + .getSecrets() + .createWithResponse(resourceGroupName, secretResourceName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public SecretResourceDescription create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSecrets() + .createWithResponse(resourceGroupName, secretResourceName, this.innerModel(), context) + .getValue(); + return this; + } + + SecretResourceDescriptionImpl( + String name, com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager serviceManager) { + this.innerObject = new SecretResourceDescriptionInner(); + this.serviceManager = serviceManager; + this.secretResourceName = name; + } + + public SecretResourceDescription refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getSecrets() + .getByResourceGroupWithResponse(resourceGroupName, secretResourceName, Context.NONE) + .getValue(); + return this; + } + + public SecretResourceDescription refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSecrets() + .getByResourceGroupWithResponse(resourceGroupName, secretResourceName, context) + .getValue(); + return this; + } + + public SecretResourceDescriptionImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public SecretResourceDescriptionImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public SecretResourceDescriptionImpl withProperties(SecretResourceProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + public SecretResourceDescriptionImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/SecretValueImpl.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/SecretValueImpl.java new file mode 100644 index 000000000000..bdb377ddfa1a --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/SecretValueImpl.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.servicefabricmesh.implementation; + +import com.azure.resourcemanager.servicefabricmesh.fluent.models.SecretValueInner; +import com.azure.resourcemanager.servicefabricmesh.models.SecretValue; + +public final class SecretValueImpl implements SecretValue { + private SecretValueInner innerObject; + + private final com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager serviceManager; + + SecretValueImpl( + SecretValueInner innerObject, + com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String value() { + return this.innerModel().value(); + } + + public SecretValueInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/SecretValueResourceDescriptionImpl.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/SecretValueResourceDescriptionImpl.java new file mode 100644 index 000000000000..4570fd1e3207 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/SecretValueResourceDescriptionImpl.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.servicefabricmesh.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicefabricmesh.fluent.models.SecretValueResourceDescriptionInner; +import com.azure.resourcemanager.servicefabricmesh.models.SecretValue; +import com.azure.resourcemanager.servicefabricmesh.models.SecretValueResourceDescription; +import java.util.Collections; +import java.util.Map; + +public final class SecretValueResourceDescriptionImpl + implements SecretValueResourceDescription, SecretValueResourceDescription.Definition { + private SecretValueResourceDescriptionInner innerObject; + + private final com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager serviceManager; + + SecretValueResourceDescriptionImpl( + SecretValueResourceDescriptionInner innerObject, + com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String value() { + return this.innerModel().value(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public SecretValueResourceDescriptionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String secretResourceName; + + private String secretValueResourceName; + + public SecretValueResourceDescriptionImpl withExistingSecret(String resourceGroupName, String secretResourceName) { + this.resourceGroupName = resourceGroupName; + this.secretResourceName = secretResourceName; + return this; + } + + public SecretValueResourceDescription create() { + this.innerObject = + serviceManager + .serviceClient() + .getSecretValues() + .createWithResponse( + resourceGroupName, secretResourceName, secretValueResourceName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public SecretValueResourceDescription create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSecretValues() + .createWithResponse( + resourceGroupName, secretResourceName, secretValueResourceName, this.innerModel(), context) + .getValue(); + return this; + } + + SecretValueResourceDescriptionImpl( + String name, com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager serviceManager) { + this.innerObject = new SecretValueResourceDescriptionInner(); + this.serviceManager = serviceManager; + this.secretValueResourceName = name; + } + + public SecretValueResourceDescription refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getSecretValues() + .getWithResponse(resourceGroupName, secretResourceName, secretValueResourceName, Context.NONE) + .getValue(); + return this; + } + + public SecretValueResourceDescription refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSecretValues() + .getWithResponse(resourceGroupName, secretResourceName, secretValueResourceName, context) + .getValue(); + return this; + } + + public Response listValueWithResponse(Context context) { + return serviceManager + .secretValues() + .listValueWithResponse(resourceGroupName, secretResourceName, secretValueResourceName, context); + } + + public SecretValue listValue() { + return serviceManager.secretValues().listValue(resourceGroupName, secretResourceName, secretValueResourceName); + } + + public SecretValueResourceDescriptionImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public SecretValueResourceDescriptionImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public SecretValueResourceDescriptionImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public SecretValueResourceDescriptionImpl withValue(String value) { + this.innerModel().withValue(value); + return this; + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/SecretValuesClientImpl.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/SecretValuesClientImpl.java new file mode 100644 index 000000000000..75e314839815 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/SecretValuesClientImpl.java @@ -0,0 +1,1221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.servicefabricmesh.fluent.SecretValuesClient; +import com.azure.resourcemanager.servicefabricmesh.fluent.models.SecretValueInner; +import com.azure.resourcemanager.servicefabricmesh.fluent.models.SecretValueResourceDescriptionInner; +import com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException; +import com.azure.resourcemanager.servicefabricmesh.models.SecretValueResourceDescriptionList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SecretValuesClient. */ +public final class SecretValuesClientImpl implements SecretValuesClient { + /** The proxy service used to perform REST calls. */ + private final SecretValuesService service; + + /** The service client containing this operation class. */ + private final ServiceFabricMeshManagementClientImpl client; + + /** + * Initializes an instance of SecretValuesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SecretValuesClientImpl(ServiceFabricMeshManagementClientImpl client) { + this.service = + RestProxy.create(SecretValuesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ServiceFabricMeshManagementClientSecretValues to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ServiceFabricMeshMan") + public interface SecretValuesService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh" + + "/secrets/{secretResourceName}/values/{secretValueResourceName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ErrorErrorModelException.class) + Mono> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam(value = "secretResourceName", encoded = true) String secretResourceName, + @PathParam(value = "secretValueResourceName", encoded = true) String secretValueResourceName, + @BodyParam("application/json") SecretValueResourceDescriptionInner secretValueResourceDescription, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh" + + "/secrets/{secretResourceName}/values/{secretValueResourceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorErrorModelException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam(value = "secretResourceName", encoded = true) String secretResourceName, + @PathParam(value = "secretValueResourceName", encoded = true) String secretValueResourceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh" + + "/secrets/{secretResourceName}/values/{secretValueResourceName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ErrorErrorModelException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam(value = "secretResourceName", encoded = true) String secretResourceName, + @PathParam(value = "secretValueResourceName", encoded = true) String secretValueResourceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh" + + "/secrets/{secretResourceName}/values") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorErrorModelException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam(value = "secretResourceName", encoded = true) String secretResourceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh" + + "/secrets/{secretResourceName}/values/{secretValueResourceName}/list_value") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorErrorModelException.class) + Mono> listValue( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam(value = "secretResourceName", encoded = true) String secretResourceName, + @PathParam(value = "secretValueResourceName", encoded = true) String secretValueResourceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorErrorModelException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Adds the specified value as a new version of the specified secret resource. + * + *

Creates a new value of the specified secret resource. The name of the value is typically the version + * identifier. Once created the value cannot be changed. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier + * for the value. + * @param secretValueResourceDescription Description for creating a value of a secret resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return this type describes a value of a secret resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, + String secretResourceName, + String secretValueResourceName, + SecretValueResourceDescriptionInner secretValueResourceDescription) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (secretResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter secretResourceName is required and cannot be null.")); + } + if (secretValueResourceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter secretValueResourceName is required and cannot be null.")); + } + if (secretValueResourceDescription == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter secretValueResourceDescription is required and cannot be null.")); + } else { + secretValueResourceDescription.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + secretResourceName, + secretValueResourceName, + secretValueResourceDescription, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Adds the specified value as a new version of the specified secret resource. + * + *

Creates a new value of the specified secret resource. The name of the value is typically the version + * identifier. Once created the value cannot be changed. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier + * for the value. + * @param secretValueResourceDescription Description for creating a value of a secret resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return this type describes a value of a secret resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, + String secretResourceName, + String secretValueResourceName, + SecretValueResourceDescriptionInner secretValueResourceDescription, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (secretResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter secretResourceName is required and cannot be null.")); + } + if (secretValueResourceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter secretValueResourceName is required and cannot be null.")); + } + if (secretValueResourceDescription == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter secretValueResourceDescription is required and cannot be null.")); + } else { + secretValueResourceDescription.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + secretResourceName, + secretValueResourceName, + secretValueResourceDescription, + accept, + context); + } + + /** + * Adds the specified value as a new version of the specified secret resource. + * + *

Creates a new value of the specified secret resource. The name of the value is typically the version + * identifier. Once created the value cannot be changed. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier + * for the value. + * @param secretValueResourceDescription Description for creating a value of a secret resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return this type describes a value of a secret resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String secretResourceName, + String secretValueResourceName, + SecretValueResourceDescriptionInner secretValueResourceDescription) { + return createWithResponseAsync( + resourceGroupName, secretResourceName, secretValueResourceName, secretValueResourceDescription) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Adds the specified value as a new version of the specified secret resource. + * + *

Creates a new value of the specified secret resource. The name of the value is typically the version + * identifier. Once created the value cannot be changed. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier + * for the value. + * @param secretValueResourceDescription Description for creating a value of a secret resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return this type describes a value of a secret resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse( + String resourceGroupName, + String secretResourceName, + String secretValueResourceName, + SecretValueResourceDescriptionInner secretValueResourceDescription, + Context context) { + return createWithResponseAsync( + resourceGroupName, secretResourceName, secretValueResourceName, secretValueResourceDescription, context) + .block(); + } + + /** + * Adds the specified value as a new version of the specified secret resource. + * + *

Creates a new value of the specified secret resource. The name of the value is typically the version + * identifier. Once created the value cannot be changed. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier + * for the value. + * @param secretValueResourceDescription Description for creating a value of a secret resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return this type describes a value of a secret resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecretValueResourceDescriptionInner create( + String resourceGroupName, + String secretResourceName, + String secretValueResourceName, + SecretValueResourceDescriptionInner secretValueResourceDescription) { + return createWithResponse( + resourceGroupName, + secretResourceName, + secretValueResourceName, + secretValueResourceDescription, + Context.NONE) + .getValue(); + } + + /** + * Gets the specified secret value resource. + * + *

Get the information about the specified named secret value resources. The information does not include the + * actual value of the secret. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier + * for the value. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about the specified named secret value resources along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String secretResourceName, String secretValueResourceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (secretResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter secretResourceName is required and cannot be null.")); + } + if (secretValueResourceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter secretValueResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + secretResourceName, + secretValueResourceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified secret value resource. + * + *

Get the information about the specified named secret value resources. The information does not include the + * actual value of the secret. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier + * for the value. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about the specified named secret value resources along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String secretResourceName, String secretValueResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (secretResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter secretResourceName is required and cannot be null.")); + } + if (secretValueResourceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter secretValueResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + secretResourceName, + secretValueResourceName, + accept, + context); + } + + /** + * Gets the specified secret value resource. + * + *

Get the information about the specified named secret value resources. The information does not include the + * actual value of the secret. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier + * for the value. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about the specified named secret value resources on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String secretResourceName, String secretValueResourceName) { + return getWithResponseAsync(resourceGroupName, secretResourceName, secretValueResourceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the specified secret value resource. + * + *

Get the information about the specified named secret value resources. The information does not include the + * actual value of the secret. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier + * for the value. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about the specified named secret value resources along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String secretResourceName, String secretValueResourceName, Context context) { + return getWithResponseAsync(resourceGroupName, secretResourceName, secretValueResourceName, context).block(); + } + + /** + * Gets the specified secret value resource. + * + *

Get the information about the specified named secret value resources. The information does not include the + * actual value of the secret. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier + * for the value. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about the specified named secret value resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecretValueResourceDescriptionInner get( + String resourceGroupName, String secretResourceName, String secretValueResourceName) { + return getWithResponse(resourceGroupName, secretResourceName, secretValueResourceName, Context.NONE).getValue(); + } + + /** + * Deletes the specified value of the named secret resource. + * + *

Deletes the secret value resource identified by the name. The name of the resource is typically the version + * associated with that value. Deletion will fail if the specified value is in use. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier + * for the value. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String secretResourceName, String secretValueResourceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (secretResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter secretResourceName is required and cannot be null.")); + } + if (secretValueResourceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter secretValueResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + secretResourceName, + secretValueResourceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified value of the named secret resource. + * + *

Deletes the secret value resource identified by the name. The name of the resource is typically the version + * associated with that value. Deletion will fail if the specified value is in use. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier + * for the value. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String secretResourceName, String secretValueResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (secretResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter secretResourceName is required and cannot be null.")); + } + if (secretValueResourceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter secretValueResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + secretResourceName, + secretValueResourceName, + accept, + context); + } + + /** + * Deletes the specified value of the named secret resource. + * + *

Deletes the secret value resource identified by the name. The name of the resource is typically the version + * associated with that value. Deletion will fail if the specified value is in use. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier + * for the value. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String secretResourceName, String secretValueResourceName) { + return deleteWithResponseAsync(resourceGroupName, secretResourceName, secretValueResourceName) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes the specified value of the named secret resource. + * + *

Deletes the secret value resource identified by the name. The name of the resource is typically the version + * associated with that value. Deletion will fail if the specified value is in use. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier + * for the value. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String secretResourceName, String secretValueResourceName, Context context) { + return deleteWithResponseAsync(resourceGroupName, secretResourceName, secretValueResourceName, context).block(); + } + + /** + * Deletes the specified value of the named secret resource. + * + *

Deletes the secret value resource identified by the name. The name of the resource is typically the version + * associated with that value. Deletion will fail if the specified value is in use. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier + * for the value. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 secretResourceName, String secretValueResourceName) { + deleteWithResponse(resourceGroupName, secretResourceName, secretValueResourceName, Context.NONE); + } + + /** + * List names of all values of the specified secret resource. + * + *

Gets information about all secret value resources of the specified secret resource. The information includes + * the names of the secret value resources, but not the actual values. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 all secret value resources of the specified secret resource along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String secretResourceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (secretResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter secretResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + secretResourceName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List names of all values of the specified secret resource. + * + *

Gets information about all secret value resources of the specified secret resource. The information includes + * the names of the secret value resources, but not the actual values. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 all secret value resources of the specified secret resource along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String secretResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (secretResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter secretResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + secretResourceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List names of all values of the specified secret resource. + * + *

Gets information about all secret value resources of the specified secret resource. The information includes + * the names of the secret value resources, but not the actual values. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 all secret value resources of the specified secret resource as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String secretResourceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, secretResourceName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List names of all values of the specified secret resource. + * + *

Gets information about all secret value resources of the specified secret resource. The information includes + * the names of the secret value resources, but not the actual values. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 all secret value resources of the specified secret resource as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String secretResourceName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, secretResourceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List names of all values of the specified secret resource. + * + *

Gets information about all secret value resources of the specified secret resource. The information includes + * the names of the secret value resources, but not the actual values. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 all secret value resources of the specified secret resource as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String secretResourceName) { + return new PagedIterable<>(listAsync(resourceGroupName, secretResourceName)); + } + + /** + * List names of all values of the specified secret resource. + * + *

Gets information about all secret value resources of the specified secret resource. The information includes + * the names of the secret value resources, but not the actual values. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 all secret value resources of the specified secret resource as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String secretResourceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, secretResourceName, context)); + } + + /** + * Lists the specified value of the secret resource. + * + *

Lists the decrypted value of the specified named value of the secret resource. This is a privileged operation. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier + * for the value. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return this type represents the unencrypted value of the secret along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listValueWithResponseAsync( + String resourceGroupName, String secretResourceName, String secretValueResourceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (secretResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter secretResourceName is required and cannot be null.")); + } + if (secretValueResourceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter secretValueResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listValue( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + secretResourceName, + secretValueResourceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the specified value of the secret resource. + * + *

Lists the decrypted value of the specified named value of the secret resource. This is a privileged operation. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier + * for the value. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return this type represents the unencrypted value of the secret along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listValueWithResponseAsync( + String resourceGroupName, String secretResourceName, String secretValueResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (secretResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter secretResourceName is required and cannot be null.")); + } + if (secretValueResourceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter secretValueResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listValue( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + secretResourceName, + secretValueResourceName, + accept, + context); + } + + /** + * Lists the specified value of the secret resource. + * + *

Lists the decrypted value of the specified named value of the secret resource. This is a privileged operation. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier + * for the value. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return this type represents the unencrypted value of the secret on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listValueAsync( + String resourceGroupName, String secretResourceName, String secretValueResourceName) { + return listValueWithResponseAsync(resourceGroupName, secretResourceName, secretValueResourceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Lists the specified value of the secret resource. + * + *

Lists the decrypted value of the specified named value of the secret resource. This is a privileged operation. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier + * for the value. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return this type represents the unencrypted value of the secret along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listValueWithResponse( + String resourceGroupName, String secretResourceName, String secretValueResourceName, Context context) { + return listValueWithResponseAsync(resourceGroupName, secretResourceName, secretValueResourceName, context) + .block(); + } + + /** + * Lists the specified value of the secret resource. + * + *

Lists the decrypted value of the specified named value of the secret resource. This is a privileged operation. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier + * for the value. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return this type represents the unencrypted value of the secret. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecretValueInner listValue( + String resourceGroupName, String secretResourceName, String secretValueResourceName) { + return listValueWithResponse(resourceGroupName, secretResourceName, secretValueResourceName, Context.NONE) + .getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a pageable list of values of a secret resource along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/SecretValuesImpl.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/SecretValuesImpl.java new file mode 100644 index 000000000000..c95d9a0357a0 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/SecretValuesImpl.java @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.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.servicefabricmesh.fluent.SecretValuesClient; +import com.azure.resourcemanager.servicefabricmesh.fluent.models.SecretValueInner; +import com.azure.resourcemanager.servicefabricmesh.fluent.models.SecretValueResourceDescriptionInner; +import com.azure.resourcemanager.servicefabricmesh.models.SecretValue; +import com.azure.resourcemanager.servicefabricmesh.models.SecretValueResourceDescription; +import com.azure.resourcemanager.servicefabricmesh.models.SecretValues; + +public final class SecretValuesImpl implements SecretValues { + private static final ClientLogger LOGGER = new ClientLogger(SecretValuesImpl.class); + + private final SecretValuesClient innerClient; + + private final com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager serviceManager; + + public SecretValuesImpl( + SecretValuesClient innerClient, + com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String resourceGroupName, String secretResourceName, String secretValueResourceName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, secretResourceName, secretValueResourceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SecretValueResourceDescriptionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SecretValueResourceDescription get( + String resourceGroupName, String secretResourceName, String secretValueResourceName) { + SecretValueResourceDescriptionInner inner = + this.serviceClient().get(resourceGroupName, secretResourceName, secretValueResourceName); + if (inner != null) { + return new SecretValueResourceDescriptionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteWithResponse( + String resourceGroupName, String secretResourceName, String secretValueResourceName, Context context) { + return this + .serviceClient() + .deleteWithResponse(resourceGroupName, secretResourceName, secretValueResourceName, context); + } + + public void delete(String resourceGroupName, String secretResourceName, String secretValueResourceName) { + this.serviceClient().delete(resourceGroupName, secretResourceName, secretValueResourceName); + } + + public PagedIterable list(String resourceGroupName, String secretResourceName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, secretResourceName); + return Utils.mapPage(inner, inner1 -> new SecretValueResourceDescriptionImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String secretResourceName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, secretResourceName, context); + return Utils.mapPage(inner, inner1 -> new SecretValueResourceDescriptionImpl(inner1, this.manager())); + } + + public Response listValueWithResponse( + String resourceGroupName, String secretResourceName, String secretValueResourceName, Context context) { + Response inner = + this + .serviceClient() + .listValueWithResponse(resourceGroupName, secretResourceName, secretValueResourceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SecretValueImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SecretValue listValue(String resourceGroupName, String secretResourceName, String secretValueResourceName) { + SecretValueInner inner = + this.serviceClient().listValue(resourceGroupName, secretResourceName, secretValueResourceName); + if (inner != null) { + return new SecretValueImpl(inner, this.manager()); + } else { + return null; + } + } + + public SecretValueResourceDescription 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 secretResourceName = Utils.getValueFromIdByName(id, "secrets"); + if (secretResourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'secrets'.", id))); + } + String secretValueResourceName = Utils.getValueFromIdByName(id, "values"); + if (secretValueResourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'values'.", id))); + } + return this + .getWithResponse(resourceGroupName, secretResourceName, secretValueResourceName, 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 secretResourceName = Utils.getValueFromIdByName(id, "secrets"); + if (secretResourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'secrets'.", id))); + } + String secretValueResourceName = Utils.getValueFromIdByName(id, "values"); + if (secretValueResourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'values'.", id))); + } + return this.getWithResponse(resourceGroupName, secretResourceName, secretValueResourceName, 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 secretResourceName = Utils.getValueFromIdByName(id, "secrets"); + if (secretResourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'secrets'.", id))); + } + String secretValueResourceName = Utils.getValueFromIdByName(id, "values"); + if (secretValueResourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'values'.", id))); + } + this.deleteWithResponse(resourceGroupName, secretResourceName, secretValueResourceName, Context.NONE); + } + + public Response 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 secretResourceName = Utils.getValueFromIdByName(id, "secrets"); + if (secretResourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'secrets'.", id))); + } + String secretValueResourceName = Utils.getValueFromIdByName(id, "values"); + if (secretValueResourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'values'.", id))); + } + return this.deleteWithResponse(resourceGroupName, secretResourceName, secretValueResourceName, context); + } + + private SecretValuesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager() { + return this.serviceManager; + } + + public SecretValueResourceDescriptionImpl define(String name) { + return new SecretValueResourceDescriptionImpl(name, this.manager()); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/SecretsClientImpl.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/SecretsClientImpl.java new file mode 100644 index 000000000000..204524688f91 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/SecretsClientImpl.java @@ -0,0 +1,1168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.servicefabricmesh.fluent.SecretsClient; +import com.azure.resourcemanager.servicefabricmesh.fluent.models.SecretResourceDescriptionInner; +import com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException; +import com.azure.resourcemanager.servicefabricmesh.models.SecretResourceDescriptionList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SecretsClient. */ +public final class SecretsClientImpl implements SecretsClient { + /** The proxy service used to perform REST calls. */ + private final SecretsService service; + + /** The service client containing this operation class. */ + private final ServiceFabricMeshManagementClientImpl client; + + /** + * Initializes an instance of SecretsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SecretsClientImpl(ServiceFabricMeshManagementClientImpl client) { + this.service = RestProxy.create(SecretsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ServiceFabricMeshManagementClientSecrets to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ServiceFabricMeshMan") + public interface SecretsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh" + + "/secrets/{secretResourceName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ErrorErrorModelException.class) + Mono> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam(value = "secretResourceName", encoded = true) String secretResourceName, + @BodyParam("application/json") SecretResourceDescriptionInner secretResourceDescription, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh" + + "/secrets/{secretResourceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorErrorModelException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam(value = "secretResourceName", encoded = true) String secretResourceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh" + + "/secrets/{secretResourceName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ErrorErrorModelException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam(value = "secretResourceName", encoded = true) String secretResourceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh" + + "/secrets") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorErrorModelException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabricMesh/secrets") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorErrorModelException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorErrorModelException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorErrorModelException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Creates or updates a secret resource. + * + *

Creates a secret resource with the specified name, description and properties. If a secret resource with the + * same name exists, then it is updated with the specified description and properties. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @param secretResourceDescription Description for creating a secret resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return this type describes a secret resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, String secretResourceName, SecretResourceDescriptionInner secretResourceDescription) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (secretResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter secretResourceName is required and cannot be null.")); + } + if (secretResourceDescription == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter secretResourceDescription is required and cannot be null.")); + } else { + secretResourceDescription.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + secretResourceName, + secretResourceDescription, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a secret resource. + * + *

Creates a secret resource with the specified name, description and properties. If a secret resource with the + * same name exists, then it is updated with the specified description and properties. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @param secretResourceDescription Description for creating a secret resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return this type describes a secret resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, + String secretResourceName, + SecretResourceDescriptionInner secretResourceDescription, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (secretResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter secretResourceName is required and cannot be null.")); + } + if (secretResourceDescription == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter secretResourceDescription is required and cannot be null.")); + } else { + secretResourceDescription.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + secretResourceName, + secretResourceDescription, + accept, + context); + } + + /** + * Creates or updates a secret resource. + * + *

Creates a secret resource with the specified name, description and properties. If a secret resource with the + * same name exists, then it is updated with the specified description and properties. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @param secretResourceDescription Description for creating a secret resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return this type describes a secret resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String secretResourceName, SecretResourceDescriptionInner secretResourceDescription) { + return createWithResponseAsync(resourceGroupName, secretResourceName, secretResourceDescription) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates or updates a secret resource. + * + *

Creates a secret resource with the specified name, description and properties. If a secret resource with the + * same name exists, then it is updated with the specified description and properties. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @param secretResourceDescription Description for creating a secret resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return this type describes a secret resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse( + String resourceGroupName, + String secretResourceName, + SecretResourceDescriptionInner secretResourceDescription, + Context context) { + return createWithResponseAsync(resourceGroupName, secretResourceName, secretResourceDescription, context) + .block(); + } + + /** + * Creates or updates a secret resource. + * + *

Creates a secret resource with the specified name, description and properties. If a secret resource with the + * same name exists, then it is updated with the specified description and properties. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @param secretResourceDescription Description for creating a secret resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return this type describes a secret resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecretResourceDescriptionInner create( + String resourceGroupName, String secretResourceName, SecretResourceDescriptionInner secretResourceDescription) { + return createWithResponse(resourceGroupName, secretResourceName, secretResourceDescription, Context.NONE) + .getValue(); + } + + /** + * Gets the secret resource with the given name. + * + *

Gets the information about the secret resource with the given name. The information include the description + * and other properties of the secret. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about the secret resource with the given name along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String secretResourceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (secretResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter secretResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + secretResourceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the secret resource with the given name. + * + *

Gets the information about the secret resource with the given name. The information include the description + * and other properties of the secret. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about the secret resource with the given name along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String secretResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (secretResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter secretResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + secretResourceName, + accept, + context); + } + + /** + * Gets the secret resource with the given name. + * + *

Gets the information about the secret resource with the given name. The information include the description + * and other properties of the secret. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about the secret resource with the given name on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String secretResourceName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, secretResourceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the secret resource with the given name. + * + *

Gets the information about the secret resource with the given name. The information include the description + * and other properties of the secret. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about the secret resource with the given name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String secretResourceName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, secretResourceName, context).block(); + } + + /** + * Gets the secret resource with the given name. + * + *

Gets the information about the secret resource with the given name. The information include the description + * and other properties of the secret. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about the secret resource with the given name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecretResourceDescriptionInner getByResourceGroup(String resourceGroupName, String secretResourceName) { + return getByResourceGroupWithResponse(resourceGroupName, secretResourceName, Context.NONE).getValue(); + } + + /** + * Deletes the secret resource. + * + *

Deletes the secret resource identified by the name. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String secretResourceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (secretResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter secretResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + secretResourceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the secret resource. + * + *

Deletes the secret resource identified by the name. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String secretResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (secretResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter secretResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + secretResourceName, + accept, + context); + } + + /** + * Deletes the secret resource. + * + *

Deletes the secret resource identified by the name. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String secretResourceName) { + return deleteWithResponseAsync(resourceGroupName, secretResourceName).flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes the secret resource. + * + *

Deletes the secret resource identified by the name. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String secretResourceName, Context context) { + return deleteWithResponseAsync(resourceGroupName, secretResourceName, context).block(); + } + + /** + * Deletes the secret resource. + * + *

Deletes the secret resource identified by the name. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 secretResourceName) { + deleteWithResponse(resourceGroupName, secretResourceName, Context.NONE); + } + + /** + * Gets all the secret resources in a given resource group. + * + *

Gets the information about all secret resources in a given resource group. The information include the + * description and other properties of the Secret. + * + * @param resourceGroupName Azure resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about all secret resources in a given resource group along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all the secret resources in a given resource group. + * + *

Gets the information about all secret resources in a given resource group. The information include the + * description and other properties of the Secret. + * + * @param resourceGroupName Azure resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about all secret resources in a given resource group along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the secret resources in a given resource group. + * + *

Gets the information about all secret resources in a given resource group. The information include the + * description and other properties of the Secret. + * + * @param resourceGroupName Azure resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about all secret resources in a given resource group as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the secret resources in a given resource group. + * + *

Gets the information about all secret resources in a given resource group. The information include the + * description and other properties of the Secret. + * + * @param resourceGroupName Azure resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about all secret resources in a given resource group as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the secret resources in a given resource group. + * + *

Gets the information about all secret resources in a given resource group. The information include the + * description and other properties of the Secret. + * + * @param resourceGroupName Azure resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about all secret resources in a given resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets all the secret resources in a given resource group. + * + *

Gets the information about all secret resources in a given resource group. The information include the + * description and other properties of the Secret. + * + * @param resourceGroupName Azure resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about all secret resources in a given resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup( + String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets all the secret resources in a given subscription. + * + *

Gets the information about all secret resources in a given resource group. The information include the + * description and other properties of the secret. + * + * @throws ErrorErrorModelException 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 about all secret resources in a given resource group along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all the secret resources in a given subscription. + * + *

Gets the information about all secret resources in a given resource group. The information include the + * description and other properties of the secret. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about all secret resources in a given resource group along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the secret resources in a given subscription. + * + *

Gets the information about all secret resources in a given resource group. The information include the + * description and other properties of the secret. + * + * @throws ErrorErrorModelException 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 about all secret resources in a given resource group as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the secret resources in a given subscription. + * + *

Gets the information about all secret resources in a given resource group. The information include the + * description and other properties of the secret. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about all secret resources in a given resource group as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the secret resources in a given subscription. + * + *

Gets the information about all secret resources in a given resource group. The information include the + * description and other properties of the secret. + * + * @throws ErrorErrorModelException 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 about all secret resources in a given resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all the secret resources in a given subscription. + * + *

Gets the information about all secret resources in a given resource group. The information include the + * description and other properties of the secret. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about all secret resources in a given resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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

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

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a pageable list of secret resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/SecretsImpl.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/SecretsImpl.java new file mode 100644 index 000000000000..103fc9470a11 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/SecretsImpl.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.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.servicefabricmesh.fluent.SecretsClient; +import com.azure.resourcemanager.servicefabricmesh.fluent.models.SecretResourceDescriptionInner; +import com.azure.resourcemanager.servicefabricmesh.models.SecretResourceDescription; +import com.azure.resourcemanager.servicefabricmesh.models.Secrets; + +public final class SecretsImpl implements Secrets { + private static final ClientLogger LOGGER = new ClientLogger(SecretsImpl.class); + + private final SecretsClient innerClient; + + private final com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager serviceManager; + + public SecretsImpl( + SecretsClient innerClient, + com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String secretResourceName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, secretResourceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SecretResourceDescriptionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SecretResourceDescription getByResourceGroup(String resourceGroupName, String secretResourceName) { + SecretResourceDescriptionInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, secretResourceName); + if (inner != null) { + return new SecretResourceDescriptionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteByResourceGroupWithResponse( + String resourceGroupName, String secretResourceName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, secretResourceName, context); + } + + public void deleteByResourceGroup(String resourceGroupName, String secretResourceName) { + this.serviceClient().delete(resourceGroupName, secretResourceName); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new SecretResourceDescriptionImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new SecretResourceDescriptionImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new SecretResourceDescriptionImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new SecretResourceDescriptionImpl(inner1, this.manager())); + } + + public SecretResourceDescription 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 secretResourceName = Utils.getValueFromIdByName(id, "secrets"); + if (secretResourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'secrets'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, secretResourceName, 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 secretResourceName = Utils.getValueFromIdByName(id, "secrets"); + if (secretResourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'secrets'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, secretResourceName, 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 secretResourceName = Utils.getValueFromIdByName(id, "secrets"); + if (secretResourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'secrets'.", id))); + } + this.deleteByResourceGroupWithResponse(resourceGroupName, secretResourceName, Context.NONE); + } + + public Response 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 secretResourceName = Utils.getValueFromIdByName(id, "secrets"); + if (secretResourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'secrets'.", id))); + } + return this.deleteByResourceGroupWithResponse(resourceGroupName, secretResourceName, context); + } + + private SecretsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager() { + return this.serviceManager; + } + + public SecretResourceDescriptionImpl define(String name) { + return new SecretResourceDescriptionImpl(name, this.manager()); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/ServiceFabricMeshManagementClientBuilder.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/ServiceFabricMeshManagementClientBuilder.java new file mode 100644 index 000000000000..566738cb7149 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/ServiceFabricMeshManagementClientBuilder.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** A builder for creating a new instance of the ServiceFabricMeshManagementClientImpl type. */ +@ServiceClientBuilder(serviceClients = {ServiceFabricMeshManagementClientImpl.class}) +public final class ServiceFabricMeshManagementClientBuilder { + /* + * The customer subscription identifier + */ + private String subscriptionId; + + /** + * Sets The customer subscription identifier. + * + * @param subscriptionId the subscriptionId value. + * @return the ServiceFabricMeshManagementClientBuilder. + */ + public ServiceFabricMeshManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the ServiceFabricMeshManagementClientBuilder. + */ + public ServiceFabricMeshManagementClientBuilder 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 ServiceFabricMeshManagementClientBuilder. + */ + public ServiceFabricMeshManagementClientBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the ServiceFabricMeshManagementClientBuilder. + */ + public ServiceFabricMeshManagementClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the ServiceFabricMeshManagementClientBuilder. + */ + public ServiceFabricMeshManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the ServiceFabricMeshManagementClientBuilder. + */ + public ServiceFabricMeshManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of ServiceFabricMeshManagementClientImpl with the provided parameters. + * + * @return an instance of ServiceFabricMeshManagementClientImpl. + */ + public ServiceFabricMeshManagementClientImpl buildClient() { + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; + AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; + HttpPipeline localPipeline = + (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval = + (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = + (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); + ServiceFabricMeshManagementClientImpl client = + new ServiceFabricMeshManagementClientImpl( + localPipeline, + localSerializerAdapter, + localDefaultPollInterval, + localEnvironment, + subscriptionId, + localEndpoint); + return client; + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/ServiceFabricMeshManagementClientImpl.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/ServiceFabricMeshManagementClientImpl.java new file mode 100644 index 000000000000..2f5a93a06ebb --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/ServiceFabricMeshManagementClientImpl.java @@ -0,0 +1,416 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.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.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.servicefabricmesh.fluent.ApplicationsClient; +import com.azure.resourcemanager.servicefabricmesh.fluent.CodePackagesClient; +import com.azure.resourcemanager.servicefabricmesh.fluent.GatewaysClient; +import com.azure.resourcemanager.servicefabricmesh.fluent.NetworksClient; +import com.azure.resourcemanager.servicefabricmesh.fluent.OperationsClient; +import com.azure.resourcemanager.servicefabricmesh.fluent.SecretValuesClient; +import com.azure.resourcemanager.servicefabricmesh.fluent.SecretsClient; +import com.azure.resourcemanager.servicefabricmesh.fluent.ServiceFabricMeshManagementClient; +import com.azure.resourcemanager.servicefabricmesh.fluent.ServiceReplicasClient; +import com.azure.resourcemanager.servicefabricmesh.fluent.ServicesClient; +import com.azure.resourcemanager.servicefabricmesh.fluent.VolumesClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the ServiceFabricMeshManagementClientImpl type. */ +@ServiceClient(builder = ServiceFabricMeshManagementClientBuilder.class) +public final class ServiceFabricMeshManagementClientImpl implements ServiceFabricMeshManagementClient { + /** The customer subscription identifier. */ + private final String subscriptionId; + + /** + * Gets The customer subscription identifier. + * + * @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 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 SecretsClient object to access its operations. */ + private final SecretsClient secrets; + + /** + * Gets the SecretsClient object to access its operations. + * + * @return the SecretsClient object. + */ + public SecretsClient getSecrets() { + return this.secrets; + } + + /** The SecretValuesClient object to access its operations. */ + private final SecretValuesClient secretValues; + + /** + * Gets the SecretValuesClient object to access its operations. + * + * @return the SecretValuesClient object. + */ + public SecretValuesClient getSecretValues() { + return this.secretValues; + } + + /** The VolumesClient object to access its operations. */ + private final VolumesClient volumes; + + /** + * Gets the VolumesClient object to access its operations. + * + * @return the VolumesClient object. + */ + public VolumesClient getVolumes() { + return this.volumes; + } + + /** The NetworksClient object to access its operations. */ + private final NetworksClient networks; + + /** + * Gets the NetworksClient object to access its operations. + * + * @return the NetworksClient object. + */ + public NetworksClient getNetworks() { + return this.networks; + } + + /** The GatewaysClient object to access its operations. */ + private final GatewaysClient gateways; + + /** + * Gets the GatewaysClient object to access its operations. + * + * @return the GatewaysClient object. + */ + public GatewaysClient getGateways() { + return this.gateways; + } + + /** The ApplicationsClient object to access its operations. */ + private final ApplicationsClient applications; + + /** + * Gets the ApplicationsClient object to access its operations. + * + * @return the ApplicationsClient object. + */ + public ApplicationsClient getApplications() { + return this.applications; + } + + /** The ServicesClient object to access its operations. */ + private final ServicesClient services; + + /** + * Gets the ServicesClient object to access its operations. + * + * @return the ServicesClient object. + */ + public ServicesClient getServices() { + return this.services; + } + + /** The ServiceReplicasClient object to access its operations. */ + private final ServiceReplicasClient serviceReplicas; + + /** + * Gets the ServiceReplicasClient object to access its operations. + * + * @return the ServiceReplicasClient object. + */ + public ServiceReplicasClient getServiceReplicas() { + return this.serviceReplicas; + } + + /** The CodePackagesClient object to access its operations. */ + private final CodePackagesClient codePackages; + + /** + * Gets the CodePackagesClient object to access its operations. + * + * @return the CodePackagesClient object. + */ + public CodePackagesClient getCodePackages() { + return this.codePackages; + } + + /** + * Initializes an instance of ServiceFabricMeshManagementClient 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 customer subscription identifier. + * @param endpoint server parameter. + */ + ServiceFabricMeshManagementClientImpl( + 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 = "2018-09-01-preview"; + this.operations = new OperationsClientImpl(this); + this.secrets = new SecretsClientImpl(this); + this.secretValues = new SecretValuesClientImpl(this); + this.volumes = new VolumesClientImpl(this); + this.networks = new NetworksClientImpl(this); + this.gateways = new GatewaysClientImpl(this); + this.applications = new ApplicationsClientImpl(this); + this.services = new ServicesClientImpl(this); + this.serviceReplicas = new ServiceReplicasClientImpl(this); + this.codePackages = new CodePackagesClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + return CoreUtils.mergeContexts(this.getContext(), context); + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult( + Mono>> activationResponse, + HttpPipeline httpPipeline, + Type pollResultType, + Type finalResultType, + Context context) { + return PollerFactory + .create( + serializerAdapter, + httpPipeline, + pollResultType, + finalResultType, + defaultPollInterval, + activationResponse, + context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = + new HttpResponseImpl( + lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = + this + .getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + LOGGER.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(s); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ServiceFabricMeshManagementClientImpl.class); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/ServiceReplicaDescriptionImpl.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/ServiceReplicaDescriptionImpl.java new file mode 100644 index 000000000000..b479dcc9d243 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/ServiceReplicaDescriptionImpl.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.implementation; + +import com.azure.resourcemanager.servicefabricmesh.fluent.models.ServiceReplicaDescriptionInner; +import com.azure.resourcemanager.servicefabricmesh.models.ContainerCodePackageProperties; +import com.azure.resourcemanager.servicefabricmesh.models.DiagnosticsRef; +import com.azure.resourcemanager.servicefabricmesh.models.NetworkRef; +import com.azure.resourcemanager.servicefabricmesh.models.OperatingSystemType; +import com.azure.resourcemanager.servicefabricmesh.models.ServiceReplicaDescription; +import java.util.Collections; +import java.util.List; + +public final class ServiceReplicaDescriptionImpl implements ServiceReplicaDescription { + private ServiceReplicaDescriptionInner innerObject; + + private final com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager serviceManager; + + ServiceReplicaDescriptionImpl( + ServiceReplicaDescriptionInner innerObject, + com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public OperatingSystemType osType() { + return this.innerModel().osType(); + } + + public List codePackages() { + List inner = this.innerModel().codePackages(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List networkRefs() { + List inner = this.innerModel().networkRefs(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public DiagnosticsRef diagnostics() { + return this.innerModel().diagnostics(); + } + + public String replicaName() { + return this.innerModel().replicaName(); + } + + public ServiceReplicaDescriptionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/ServiceReplicasClientImpl.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/ServiceReplicasClientImpl.java new file mode 100644 index 000000000000..f44c5c5ae73e --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/ServiceReplicasClientImpl.java @@ -0,0 +1,609 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.servicefabricmesh.fluent.ServiceReplicasClient; +import com.azure.resourcemanager.servicefabricmesh.fluent.models.ServiceReplicaDescriptionInner; +import com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException; +import com.azure.resourcemanager.servicefabricmesh.models.ServiceReplicaDescriptionList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ServiceReplicasClient. */ +public final class ServiceReplicasClientImpl implements ServiceReplicasClient { + /** The proxy service used to perform REST calls. */ + private final ServiceReplicasService service; + + /** The service client containing this operation class. */ + private final ServiceFabricMeshManagementClientImpl client; + + /** + * Initializes an instance of ServiceReplicasClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ServiceReplicasClientImpl(ServiceFabricMeshManagementClientImpl client) { + this.service = + RestProxy.create(ServiceReplicasService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ServiceFabricMeshManagementClientServiceReplicas to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ServiceFabricMeshMan") + public interface ServiceReplicasService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh" + + "/applications/{applicationResourceName}/services/{serviceResourceName}/replicas/{replicaName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorErrorModelException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam(value = "applicationResourceName", encoded = true) String applicationResourceName, + @PathParam(value = "serviceResourceName", encoded = true) String serviceResourceName, + @PathParam(value = "replicaName", encoded = true) String replicaName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh" + + "/applications/{applicationResourceName}/services/{serviceResourceName}/replicas") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorErrorModelException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam(value = "applicationResourceName", encoded = true) String applicationResourceName, + @PathParam(value = "serviceResourceName", encoded = true) String serviceResourceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorErrorModelException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the given replica of the service of an application. + * + *

Gets the information about the service replica with the given name. The information include the description + * and other properties of the service replica. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @param serviceResourceName The identity of the service. + * @param replicaName Service Fabric replica name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about the service replica with the given name along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String applicationResourceName, String serviceResourceName, String replicaName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (applicationResourceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter applicationResourceName is required and cannot be null.")); + } + if (serviceResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter serviceResourceName is required and cannot be null.")); + } + if (replicaName == null) { + return Mono.error(new IllegalArgumentException("Parameter replicaName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + applicationResourceName, + serviceResourceName, + replicaName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the given replica of the service of an application. + * + *

Gets the information about the service replica with the given name. The information include the description + * and other properties of the service replica. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @param serviceResourceName The identity of the service. + * @param replicaName Service Fabric replica name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about the service replica with the given name along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String applicationResourceName, + String serviceResourceName, + String replicaName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (applicationResourceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter applicationResourceName is required and cannot be null.")); + } + if (serviceResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter serviceResourceName is required and cannot be null.")); + } + if (replicaName == null) { + return Mono.error(new IllegalArgumentException("Parameter replicaName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + applicationResourceName, + serviceResourceName, + replicaName, + accept, + context); + } + + /** + * Gets the given replica of the service of an application. + * + *

Gets the information about the service replica with the given name. The information include the description + * and other properties of the service replica. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @param serviceResourceName The identity of the service. + * @param replicaName Service Fabric replica name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about the service replica with the given name on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String applicationResourceName, String serviceResourceName, String replicaName) { + return getWithResponseAsync(resourceGroupName, applicationResourceName, serviceResourceName, replicaName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the given replica of the service of an application. + * + *

Gets the information about the service replica with the given name. The information include the description + * and other properties of the service replica. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @param serviceResourceName The identity of the service. + * @param replicaName Service Fabric replica name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about the service replica with the given name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String applicationResourceName, + String serviceResourceName, + String replicaName, + Context context) { + return getWithResponseAsync( + resourceGroupName, applicationResourceName, serviceResourceName, replicaName, context) + .block(); + } + + /** + * Gets the given replica of the service of an application. + * + *

Gets the information about the service replica with the given name. The information include the description + * and other properties of the service replica. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @param serviceResourceName The identity of the service. + * @param replicaName Service Fabric replica name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about the service replica with the given name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServiceReplicaDescriptionInner get( + String resourceGroupName, String applicationResourceName, String serviceResourceName, String replicaName) { + return getWithResponse( + resourceGroupName, applicationResourceName, serviceResourceName, replicaName, Context.NONE) + .getValue(); + } + + /** + * Gets replicas of a given service. + * + *

Gets the information about all replicas of a given service of an application. The information includes the + * runtime properties of the replica instance. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @param serviceResourceName The identity of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about all replicas of a given service of an application along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String applicationResourceName, String serviceResourceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (applicationResourceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter applicationResourceName is required and cannot be null.")); + } + if (serviceResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter serviceResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + applicationResourceName, + serviceResourceName, + 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 replicas of a given service. + * + *

Gets the information about all replicas of a given service of an application. The information includes the + * runtime properties of the replica instance. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @param serviceResourceName The identity of the service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about all replicas of a given service of an application along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String applicationResourceName, String serviceResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (applicationResourceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter applicationResourceName is required and cannot be null.")); + } + if (serviceResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter serviceResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + applicationResourceName, + serviceResourceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets replicas of a given service. + * + *

Gets the information about all replicas of a given service of an application. The information includes the + * runtime properties of the replica instance. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @param serviceResourceName The identity of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about all replicas of a given service of an application as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String applicationResourceName, String serviceResourceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, applicationResourceName, serviceResourceName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets replicas of a given service. + * + *

Gets the information about all replicas of a given service of an application. The information includes the + * runtime properties of the replica instance. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @param serviceResourceName The identity of the service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about all replicas of a given service of an application as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String applicationResourceName, String serviceResourceName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, applicationResourceName, serviceResourceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets replicas of a given service. + * + *

Gets the information about all replicas of a given service of an application. The information includes the + * runtime properties of the replica instance. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @param serviceResourceName The identity of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about all replicas of a given service of an application as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String applicationResourceName, String serviceResourceName) { + return new PagedIterable<>(listAsync(resourceGroupName, applicationResourceName, serviceResourceName)); + } + + /** + * Gets replicas of a given service. + * + *

Gets the information about all replicas of a given service of an application. The information includes the + * runtime properties of the replica instance. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @param serviceResourceName The identity of the service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about all replicas of a given service of an application as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String applicationResourceName, String serviceResourceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, applicationResourceName, serviceResourceName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a pageable list of service replicas along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/ServiceReplicasImpl.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/ServiceReplicasImpl.java new file mode 100644 index 000000000000..e3000c29f139 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/ServiceReplicasImpl.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.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.servicefabricmesh.fluent.ServiceReplicasClient; +import com.azure.resourcemanager.servicefabricmesh.fluent.models.ServiceReplicaDescriptionInner; +import com.azure.resourcemanager.servicefabricmesh.models.ServiceReplicaDescription; +import com.azure.resourcemanager.servicefabricmesh.models.ServiceReplicas; + +public final class ServiceReplicasImpl implements ServiceReplicas { + private static final ClientLogger LOGGER = new ClientLogger(ServiceReplicasImpl.class); + + private final ServiceReplicasClient innerClient; + + private final com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager serviceManager; + + public ServiceReplicasImpl( + ServiceReplicasClient innerClient, + com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String resourceGroupName, + String applicationResourceName, + String serviceResourceName, + String replicaName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, applicationResourceName, serviceResourceName, replicaName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ServiceReplicaDescriptionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ServiceReplicaDescription get( + String resourceGroupName, String applicationResourceName, String serviceResourceName, String replicaName) { + ServiceReplicaDescriptionInner inner = + this.serviceClient().get(resourceGroupName, applicationResourceName, serviceResourceName, replicaName); + if (inner != null) { + return new ServiceReplicaDescriptionImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list( + String resourceGroupName, String applicationResourceName, String serviceResourceName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, applicationResourceName, serviceResourceName); + return Utils.mapPage(inner, inner1 -> new ServiceReplicaDescriptionImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String applicationResourceName, String serviceResourceName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, applicationResourceName, serviceResourceName, context); + return Utils.mapPage(inner, inner1 -> new ServiceReplicaDescriptionImpl(inner1, this.manager())); + } + + private ServiceReplicasClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/ServiceResourceDescriptionImpl.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/ServiceResourceDescriptionImpl.java new file mode 100644 index 000000000000..d400d8d7409c --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/ServiceResourceDescriptionImpl.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.implementation; + +import com.azure.resourcemanager.servicefabricmesh.fluent.models.ServiceResourceDescriptionInner; +import com.azure.resourcemanager.servicefabricmesh.models.AutoScalingPolicy; +import com.azure.resourcemanager.servicefabricmesh.models.ContainerCodePackageProperties; +import com.azure.resourcemanager.servicefabricmesh.models.DiagnosticsRef; +import com.azure.resourcemanager.servicefabricmesh.models.HealthState; +import com.azure.resourcemanager.servicefabricmesh.models.NetworkRef; +import com.azure.resourcemanager.servicefabricmesh.models.OperatingSystemType; +import com.azure.resourcemanager.servicefabricmesh.models.ResourceStatus; +import com.azure.resourcemanager.servicefabricmesh.models.ServiceResourceDescription; +import java.util.Collections; +import java.util.List; + +public final class ServiceResourceDescriptionImpl implements ServiceResourceDescription { + private ServiceResourceDescriptionInner innerObject; + + private final com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager serviceManager; + + ServiceResourceDescriptionImpl( + ServiceResourceDescriptionInner innerObject, + com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String type() { + return this.innerModel().type(); + } + + public String name() { + return this.innerModel().name(); + } + + public OperatingSystemType osType() { + return this.innerModel().osType(); + } + + public List codePackages() { + List inner = this.innerModel().codePackages(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List networkRefs() { + List inner = this.innerModel().networkRefs(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public DiagnosticsRef diagnostics() { + return this.innerModel().diagnostics(); + } + + public String description() { + return this.innerModel().description(); + } + + public Integer replicaCount() { + return this.innerModel().replicaCount(); + } + + public List autoScalingPolicies() { + List inner = this.innerModel().autoScalingPolicies(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ResourceStatus status() { + return this.innerModel().status(); + } + + public String statusDetails() { + return this.innerModel().statusDetails(); + } + + public HealthState healthState() { + return this.innerModel().healthState(); + } + + public String unhealthyEvaluation() { + return this.innerModel().unhealthyEvaluation(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public ServiceResourceDescriptionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/ServicesClientImpl.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/ServicesClientImpl.java new file mode 100644 index 000000000000..ab949edd4d52 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/ServicesClientImpl.java @@ -0,0 +1,566 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.servicefabricmesh.fluent.ServicesClient; +import com.azure.resourcemanager.servicefabricmesh.fluent.models.ServiceResourceDescriptionInner; +import com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException; +import com.azure.resourcemanager.servicefabricmesh.models.ServiceResourceDescriptionList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ServicesClient. */ +public final class ServicesClientImpl implements ServicesClient { + /** The proxy service used to perform REST calls. */ + private final ServicesService service; + + /** The service client containing this operation class. */ + private final ServiceFabricMeshManagementClientImpl client; + + /** + * Initializes an instance of ServicesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ServicesClientImpl(ServiceFabricMeshManagementClientImpl client) { + this.service = RestProxy.create(ServicesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ServiceFabricMeshManagementClientServices to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ServiceFabricMeshMan") + public interface ServicesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh" + + "/applications/{applicationResourceName}/services/{serviceResourceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorErrorModelException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam(value = "applicationResourceName", encoded = true) String applicationResourceName, + @PathParam(value = "serviceResourceName", encoded = true) String serviceResourceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh" + + "/applications/{applicationResourceName}/services") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorErrorModelException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam(value = "applicationResourceName", encoded = true) String applicationResourceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorErrorModelException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the service resource with the given name. + * + *

Gets the information about the service resource with the given name. The information include the description + * and other properties of the service. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @param serviceResourceName The identity of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about the service resource with the given name along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String applicationResourceName, String serviceResourceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (applicationResourceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter applicationResourceName is required and cannot be null.")); + } + if (serviceResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter serviceResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + applicationResourceName, + serviceResourceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the service resource with the given name. + * + *

Gets the information about the service resource with the given name. The information include the description + * and other properties of the service. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @param serviceResourceName The identity of the service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about the service resource with the given name along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String applicationResourceName, String serviceResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (applicationResourceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter applicationResourceName is required and cannot be null.")); + } + if (serviceResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter serviceResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + applicationResourceName, + serviceResourceName, + accept, + context); + } + + /** + * Gets the service resource with the given name. + * + *

Gets the information about the service resource with the given name. The information include the description + * and other properties of the service. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @param serviceResourceName The identity of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about the service resource with the given name on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String applicationResourceName, String serviceResourceName) { + return getWithResponseAsync(resourceGroupName, applicationResourceName, serviceResourceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the service resource with the given name. + * + *

Gets the information about the service resource with the given name. The information include the description + * and other properties of the service. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @param serviceResourceName The identity of the service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about the service resource with the given name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String applicationResourceName, String serviceResourceName, Context context) { + return getWithResponseAsync(resourceGroupName, applicationResourceName, serviceResourceName, context).block(); + } + + /** + * Gets the service resource with the given name. + * + *

Gets the information about the service resource with the given name. The information include the description + * and other properties of the service. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @param serviceResourceName The identity of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about the service resource with the given name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServiceResourceDescriptionInner get( + String resourceGroupName, String applicationResourceName, String serviceResourceName) { + return getWithResponse(resourceGroupName, applicationResourceName, serviceResourceName, Context.NONE) + .getValue(); + } + + /** + * Lists all the service resources. + * + *

Gets the information about all services of an application resource. The information include the description + * and other properties of the Service. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about all services of an application resource along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String applicationResourceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (applicationResourceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter applicationResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + applicationResourceName, + 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 service resources. + * + *

Gets the information about all services of an application resource. The information include the description + * and other properties of the Service. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about all services of an application resource along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String applicationResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (applicationResourceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter applicationResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + applicationResourceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the service resources. + * + *

Gets the information about all services of an application resource. The information include the description + * and other properties of the Service. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about all services of an application resource as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String applicationResourceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, applicationResourceName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the service resources. + * + *

Gets the information about all services of an application resource. The information include the description + * and other properties of the Service. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about all services of an application resource as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String applicationResourceName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, applicationResourceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the service resources. + * + *

Gets the information about all services of an application resource. The information include the description + * and other properties of the Service. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about all services of an application resource as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String applicationResourceName) { + return new PagedIterable<>(listAsync(resourceGroupName, applicationResourceName)); + } + + /** + * Lists all the service resources. + * + *

Gets the information about all services of an application resource. The information include the description + * and other properties of the Service. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about all services of an application resource as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String applicationResourceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, applicationResourceName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a pageable list of service resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/ServicesImpl.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/ServicesImpl.java new file mode 100644 index 000000000000..7cf38acf5640 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/ServicesImpl.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.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.servicefabricmesh.fluent.ServicesClient; +import com.azure.resourcemanager.servicefabricmesh.fluent.models.ServiceResourceDescriptionInner; +import com.azure.resourcemanager.servicefabricmesh.models.ServiceResourceDescription; +import com.azure.resourcemanager.servicefabricmesh.models.Services; + +public final class ServicesImpl implements Services { + private static final ClientLogger LOGGER = new ClientLogger(ServicesImpl.class); + + private final ServicesClient innerClient; + + private final com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager serviceManager; + + public ServicesImpl( + ServicesClient innerClient, + com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String resourceGroupName, String applicationResourceName, String serviceResourceName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, applicationResourceName, serviceResourceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ServiceResourceDescriptionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ServiceResourceDescription get( + String resourceGroupName, String applicationResourceName, String serviceResourceName) { + ServiceResourceDescriptionInner inner = + this.serviceClient().get(resourceGroupName, applicationResourceName, serviceResourceName); + if (inner != null) { + return new ServiceResourceDescriptionImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String applicationResourceName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, applicationResourceName); + return Utils.mapPage(inner, inner1 -> new ServiceResourceDescriptionImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String applicationResourceName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, applicationResourceName, context); + return Utils.mapPage(inner, inner1 -> new ServiceResourceDescriptionImpl(inner1, this.manager())); + } + + private ServicesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/Utils.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/Utils.java new file mode 100644 index 000000000000..4f785ef551ec --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/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.servicefabricmesh.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/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/VolumeResourceDescriptionImpl.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/VolumeResourceDescriptionImpl.java new file mode 100644 index 000000000000..6da48a5d8bbf --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/VolumeResourceDescriptionImpl.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.servicefabricmesh.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicefabricmesh.fluent.models.VolumeResourceDescriptionInner; +import com.azure.resourcemanager.servicefabricmesh.models.ResourceStatus; +import com.azure.resourcemanager.servicefabricmesh.models.VolumeProvider; +import com.azure.resourcemanager.servicefabricmesh.models.VolumeProviderParametersAzureFile; +import com.azure.resourcemanager.servicefabricmesh.models.VolumeResourceDescription; +import java.util.Collections; +import java.util.Map; + +public final class VolumeResourceDescriptionImpl + implements VolumeResourceDescription, VolumeResourceDescription.Definition { + private VolumeResourceDescriptionInner innerObject; + + private final com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager serviceManager; + + VolumeResourceDescriptionImpl( + VolumeResourceDescriptionInner innerObject, + com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String description() { + return this.innerModel().description(); + } + + public ResourceStatus status() { + return this.innerModel().status(); + } + + public String statusDetails() { + return this.innerModel().statusDetails(); + } + + public VolumeProvider provider() { + return this.innerModel().provider(); + } + + public VolumeProviderParametersAzureFile azureFileParameters() { + return this.innerModel().azureFileParameters(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public VolumeResourceDescriptionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String volumeResourceName; + + public VolumeResourceDescriptionImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public VolumeResourceDescription create() { + this.innerObject = + serviceManager + .serviceClient() + .getVolumes() + .createWithResponse(resourceGroupName, volumeResourceName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public VolumeResourceDescription create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVolumes() + .createWithResponse(resourceGroupName, volumeResourceName, this.innerModel(), context) + .getValue(); + return this; + } + + VolumeResourceDescriptionImpl( + String name, com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager serviceManager) { + this.innerObject = new VolumeResourceDescriptionInner(); + this.serviceManager = serviceManager; + this.volumeResourceName = name; + } + + public VolumeResourceDescription refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getVolumes() + .getByResourceGroupWithResponse(resourceGroupName, volumeResourceName, Context.NONE) + .getValue(); + return this; + } + + public VolumeResourceDescription refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVolumes() + .getByResourceGroupWithResponse(resourceGroupName, volumeResourceName, context) + .getValue(); + return this; + } + + public VolumeResourceDescriptionImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public VolumeResourceDescriptionImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public VolumeResourceDescriptionImpl withProvider(VolumeProvider provider) { + this.innerModel().withProvider(provider); + return this; + } + + public VolumeResourceDescriptionImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public VolumeResourceDescriptionImpl withDescription(String description) { + this.innerModel().withDescription(description); + return this; + } + + public VolumeResourceDescriptionImpl withAzureFileParameters( + VolumeProviderParametersAzureFile azureFileParameters) { + this.innerModel().withAzureFileParameters(azureFileParameters); + return this; + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/VolumesClientImpl.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/VolumesClientImpl.java new file mode 100644 index 000000000000..1062856d1ef6 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/VolumesClientImpl.java @@ -0,0 +1,1168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.servicefabricmesh.fluent.VolumesClient; +import com.azure.resourcemanager.servicefabricmesh.fluent.models.VolumeResourceDescriptionInner; +import com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException; +import com.azure.resourcemanager.servicefabricmesh.models.VolumeResourceDescriptionList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in VolumesClient. */ +public final class VolumesClientImpl implements VolumesClient { + /** The proxy service used to perform REST calls. */ + private final VolumesService service; + + /** The service client containing this operation class. */ + private final ServiceFabricMeshManagementClientImpl client; + + /** + * Initializes an instance of VolumesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VolumesClientImpl(ServiceFabricMeshManagementClientImpl client) { + this.service = RestProxy.create(VolumesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ServiceFabricMeshManagementClientVolumes to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ServiceFabricMeshMan") + public interface VolumesService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh" + + "/volumes/{volumeResourceName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ErrorErrorModelException.class) + Mono> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam(value = "volumeResourceName", encoded = true) String volumeResourceName, + @BodyParam("application/json") VolumeResourceDescriptionInner volumeResourceDescription, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh" + + "/volumes/{volumeResourceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorErrorModelException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam(value = "volumeResourceName", encoded = true) String volumeResourceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh" + + "/volumes/{volumeResourceName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ErrorErrorModelException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam(value = "volumeResourceName", encoded = true) String volumeResourceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh" + + "/volumes") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorErrorModelException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabricMesh/volumes") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorErrorModelException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorErrorModelException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorErrorModelException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Creates or updates a volume resource. + * + *

Creates a volume resource with the specified name, description and properties. If a volume resource with the + * same name exists, then it is updated with the specified description and properties. + * + * @param resourceGroupName Azure resource group name. + * @param volumeResourceName The identity of the volume. + * @param volumeResourceDescription Description for creating a Volume resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return this type describes a volume resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, String volumeResourceName, VolumeResourceDescriptionInner volumeResourceDescription) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (volumeResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter volumeResourceName is required and cannot be null.")); + } + if (volumeResourceDescription == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter volumeResourceDescription is required and cannot be null.")); + } else { + volumeResourceDescription.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + volumeResourceName, + volumeResourceDescription, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a volume resource. + * + *

Creates a volume resource with the specified name, description and properties. If a volume resource with the + * same name exists, then it is updated with the specified description and properties. + * + * @param resourceGroupName Azure resource group name. + * @param volumeResourceName The identity of the volume. + * @param volumeResourceDescription Description for creating a Volume resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return this type describes a volume resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, + String volumeResourceName, + VolumeResourceDescriptionInner volumeResourceDescription, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (volumeResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter volumeResourceName is required and cannot be null.")); + } + if (volumeResourceDescription == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter volumeResourceDescription is required and cannot be null.")); + } else { + volumeResourceDescription.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + volumeResourceName, + volumeResourceDescription, + accept, + context); + } + + /** + * Creates or updates a volume resource. + * + *

Creates a volume resource with the specified name, description and properties. If a volume resource with the + * same name exists, then it is updated with the specified description and properties. + * + * @param resourceGroupName Azure resource group name. + * @param volumeResourceName The identity of the volume. + * @param volumeResourceDescription Description for creating a Volume resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return this type describes a volume resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String volumeResourceName, VolumeResourceDescriptionInner volumeResourceDescription) { + return createWithResponseAsync(resourceGroupName, volumeResourceName, volumeResourceDescription) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates or updates a volume resource. + * + *

Creates a volume resource with the specified name, description and properties. If a volume resource with the + * same name exists, then it is updated with the specified description and properties. + * + * @param resourceGroupName Azure resource group name. + * @param volumeResourceName The identity of the volume. + * @param volumeResourceDescription Description for creating a Volume resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return this type describes a volume resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse( + String resourceGroupName, + String volumeResourceName, + VolumeResourceDescriptionInner volumeResourceDescription, + Context context) { + return createWithResponseAsync(resourceGroupName, volumeResourceName, volumeResourceDescription, context) + .block(); + } + + /** + * Creates or updates a volume resource. + * + *

Creates a volume resource with the specified name, description and properties. If a volume resource with the + * same name exists, then it is updated with the specified description and properties. + * + * @param resourceGroupName Azure resource group name. + * @param volumeResourceName The identity of the volume. + * @param volumeResourceDescription Description for creating a Volume resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return this type describes a volume resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VolumeResourceDescriptionInner create( + String resourceGroupName, String volumeResourceName, VolumeResourceDescriptionInner volumeResourceDescription) { + return createWithResponse(resourceGroupName, volumeResourceName, volumeResourceDescription, Context.NONE) + .getValue(); + } + + /** + * Gets the volume resource with the given name. + * + *

Gets the information about the volume resource with the given name. The information include the description + * and other properties of the volume. + * + * @param resourceGroupName Azure resource group name. + * @param volumeResourceName The identity of the volume. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about the volume resource with the given name along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String volumeResourceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (volumeResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter volumeResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + volumeResourceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the volume resource with the given name. + * + *

Gets the information about the volume resource with the given name. The information include the description + * and other properties of the volume. + * + * @param resourceGroupName Azure resource group name. + * @param volumeResourceName The identity of the volume. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about the volume resource with the given name along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String volumeResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (volumeResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter volumeResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + volumeResourceName, + accept, + context); + } + + /** + * Gets the volume resource with the given name. + * + *

Gets the information about the volume resource with the given name. The information include the description + * and other properties of the volume. + * + * @param resourceGroupName Azure resource group name. + * @param volumeResourceName The identity of the volume. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about the volume resource with the given name on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String volumeResourceName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, volumeResourceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the volume resource with the given name. + * + *

Gets the information about the volume resource with the given name. The information include the description + * and other properties of the volume. + * + * @param resourceGroupName Azure resource group name. + * @param volumeResourceName The identity of the volume. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about the volume resource with the given name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String volumeResourceName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, volumeResourceName, context).block(); + } + + /** + * Gets the volume resource with the given name. + * + *

Gets the information about the volume resource with the given name. The information include the description + * and other properties of the volume. + * + * @param resourceGroupName Azure resource group name. + * @param volumeResourceName The identity of the volume. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about the volume resource with the given name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VolumeResourceDescriptionInner getByResourceGroup(String resourceGroupName, String volumeResourceName) { + return getByResourceGroupWithResponse(resourceGroupName, volumeResourceName, Context.NONE).getValue(); + } + + /** + * Deletes the volume resource. + * + *

Deletes the volume resource identified by the name. + * + * @param resourceGroupName Azure resource group name. + * @param volumeResourceName The identity of the volume. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String volumeResourceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (volumeResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter volumeResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + volumeResourceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the volume resource. + * + *

Deletes the volume resource identified by the name. + * + * @param resourceGroupName Azure resource group name. + * @param volumeResourceName The identity of the volume. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String volumeResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (volumeResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter volumeResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + volumeResourceName, + accept, + context); + } + + /** + * Deletes the volume resource. + * + *

Deletes the volume resource identified by the name. + * + * @param resourceGroupName Azure resource group name. + * @param volumeResourceName The identity of the volume. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String volumeResourceName) { + return deleteWithResponseAsync(resourceGroupName, volumeResourceName).flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes the volume resource. + * + *

Deletes the volume resource identified by the name. + * + * @param resourceGroupName Azure resource group name. + * @param volumeResourceName The identity of the volume. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String volumeResourceName, Context context) { + return deleteWithResponseAsync(resourceGroupName, volumeResourceName, context).block(); + } + + /** + * Deletes the volume resource. + * + *

Deletes the volume resource identified by the name. + * + * @param resourceGroupName Azure resource group name. + * @param volumeResourceName The identity of the volume. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 volumeResourceName) { + deleteWithResponse(resourceGroupName, volumeResourceName, Context.NONE); + } + + /** + * Gets all the volume resources in a given resource group. + * + *

Gets the information about all volume resources in a given resource group. The information include the + * description and other properties of the Volume. + * + * @param resourceGroupName Azure resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about all volume resources in a given resource group along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all the volume resources in a given resource group. + * + *

Gets the information about all volume resources in a given resource group. The information include the + * description and other properties of the Volume. + * + * @param resourceGroupName Azure resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about all volume resources in a given resource group along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the volume resources in a given resource group. + * + *

Gets the information about all volume resources in a given resource group. The information include the + * description and other properties of the Volume. + * + * @param resourceGroupName Azure resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about all volume resources in a given resource group as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the volume resources in a given resource group. + * + *

Gets the information about all volume resources in a given resource group. The information include the + * description and other properties of the Volume. + * + * @param resourceGroupName Azure resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about all volume resources in a given resource group as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the volume resources in a given resource group. + * + *

Gets the information about all volume resources in a given resource group. The information include the + * description and other properties of the Volume. + * + * @param resourceGroupName Azure resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about all volume resources in a given resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets all the volume resources in a given resource group. + * + *

Gets the information about all volume resources in a given resource group. The information include the + * description and other properties of the Volume. + * + * @param resourceGroupName Azure resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about all volume resources in a given resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup( + String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets all the volume resources in a given subscription. + * + *

Gets the information about all volume resources in a given resource group. The information include the + * description and other properties of the volume. + * + * @throws ErrorErrorModelException 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 about all volume resources in a given resource group along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all the volume resources in a given subscription. + * + *

Gets the information about all volume resources in a given resource group. The information include the + * description and other properties of the volume. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about all volume resources in a given resource group along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the volume resources in a given subscription. + * + *

Gets the information about all volume resources in a given resource group. The information include the + * description and other properties of the volume. + * + * @throws ErrorErrorModelException 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 about all volume resources in a given resource group as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the volume resources in a given subscription. + * + *

Gets the information about all volume resources in a given resource group. The information include the + * description and other properties of the volume. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about all volume resources in a given resource group as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the volume resources in a given subscription. + * + *

Gets the information about all volume resources in a given resource group. The information include the + * description and other properties of the volume. + * + * @throws ErrorErrorModelException 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 about all volume resources in a given resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all the volume resources in a given subscription. + * + *

Gets the information about all volume resources in a given resource group. The information include the + * description and other properties of the volume. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException 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 about all volume resources in a given resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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

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

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorErrorModelException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a pageable list of volume resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/VolumesImpl.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/VolumesImpl.java new file mode 100644 index 000000000000..7106f6b777c6 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/VolumesImpl.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.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.servicefabricmesh.fluent.VolumesClient; +import com.azure.resourcemanager.servicefabricmesh.fluent.models.VolumeResourceDescriptionInner; +import com.azure.resourcemanager.servicefabricmesh.models.VolumeResourceDescription; +import com.azure.resourcemanager.servicefabricmesh.models.Volumes; + +public final class VolumesImpl implements Volumes { + private static final ClientLogger LOGGER = new ClientLogger(VolumesImpl.class); + + private final VolumesClient innerClient; + + private final com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager serviceManager; + + public VolumesImpl( + VolumesClient innerClient, + com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String volumeResourceName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, volumeResourceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VolumeResourceDescriptionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public VolumeResourceDescription getByResourceGroup(String resourceGroupName, String volumeResourceName) { + VolumeResourceDescriptionInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, volumeResourceName); + if (inner != null) { + return new VolumeResourceDescriptionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteByResourceGroupWithResponse( + String resourceGroupName, String volumeResourceName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, volumeResourceName, context); + } + + public void deleteByResourceGroup(String resourceGroupName, String volumeResourceName) { + this.serviceClient().delete(resourceGroupName, volumeResourceName); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new VolumeResourceDescriptionImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new VolumeResourceDescriptionImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new VolumeResourceDescriptionImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new VolumeResourceDescriptionImpl(inner1, this.manager())); + } + + public VolumeResourceDescription 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 volumeResourceName = Utils.getValueFromIdByName(id, "volumes"); + if (volumeResourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'volumes'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, volumeResourceName, 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 volumeResourceName = Utils.getValueFromIdByName(id, "volumes"); + if (volumeResourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'volumes'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, volumeResourceName, 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 volumeResourceName = Utils.getValueFromIdByName(id, "volumes"); + if (volumeResourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'volumes'.", id))); + } + this.deleteByResourceGroupWithResponse(resourceGroupName, volumeResourceName, Context.NONE); + } + + public Response 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 volumeResourceName = Utils.getValueFromIdByName(id, "volumes"); + if (volumeResourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'volumes'.", id))); + } + return this.deleteByResourceGroupWithResponse(resourceGroupName, volumeResourceName, context); + } + + private VolumesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager() { + return this.serviceManager; + } + + public VolumeResourceDescriptionImpl define(String name) { + return new VolumeResourceDescriptionImpl(name, this.manager()); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/package-info.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/package-info.java new file mode 100644 index 000000000000..8b81b6886bef --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/implementation/package-info.java @@ -0,0 +1,8 @@ +// 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 ServiceFabricMeshManagementClient. Service Fabric Mesh Management Client. + */ +package com.azure.resourcemanager.servicefabricmesh.implementation; diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/AddRemoveReplicaScalingMechanism.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/AddRemoveReplicaScalingMechanism.java new file mode 100644 index 000000000000..01ed7e988d1c --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/AddRemoveReplicaScalingMechanism.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.servicefabricmesh.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Describes the horizontal auto scaling mechanism that adds or removes replicas (containers or container groups). */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("AddRemoveReplica") +@Fluent +public final class AddRemoveReplicaScalingMechanism extends AutoScalingMechanism { + /* + * Minimum number of containers (scale down won't be performed below this number). + */ + @JsonProperty(value = "minCount", required = true) + private int minCount; + + /* + * Maximum number of containers (scale up won't be performed above this number). + */ + @JsonProperty(value = "maxCount", required = true) + private int maxCount; + + /* + * Each time auto scaling is performed, this number of containers will be added or removed. + */ + @JsonProperty(value = "scaleIncrement", required = true) + private int scaleIncrement; + + /** Creates an instance of AddRemoveReplicaScalingMechanism class. */ + public AddRemoveReplicaScalingMechanism() { + } + + /** + * Get the minCount property: Minimum number of containers (scale down won't be performed below this number). + * + * @return the minCount value. + */ + public int minCount() { + return this.minCount; + } + + /** + * Set the minCount property: Minimum number of containers (scale down won't be performed below this number). + * + * @param minCount the minCount value to set. + * @return the AddRemoveReplicaScalingMechanism object itself. + */ + public AddRemoveReplicaScalingMechanism withMinCount(int minCount) { + this.minCount = minCount; + return this; + } + + /** + * Get the maxCount property: Maximum number of containers (scale up won't be performed above this number). + * + * @return the maxCount value. + */ + public int maxCount() { + return this.maxCount; + } + + /** + * Set the maxCount property: Maximum number of containers (scale up won't be performed above this number). + * + * @param maxCount the maxCount value to set. + * @return the AddRemoveReplicaScalingMechanism object itself. + */ + public AddRemoveReplicaScalingMechanism withMaxCount(int maxCount) { + this.maxCount = maxCount; + return this; + } + + /** + * Get the scaleIncrement property: Each time auto scaling is performed, this number of containers will be added or + * removed. + * + * @return the scaleIncrement value. + */ + public int scaleIncrement() { + return this.scaleIncrement; + } + + /** + * Set the scaleIncrement property: Each time auto scaling is performed, this number of containers will be added or + * removed. + * + * @param scaleIncrement the scaleIncrement value to set. + * @return the AddRemoveReplicaScalingMechanism object itself. + */ + public AddRemoveReplicaScalingMechanism withScaleIncrement(int scaleIncrement) { + this.scaleIncrement = scaleIncrement; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ApplicationProperties.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ApplicationProperties.java new file mode 100644 index 000000000000..1118ecf603f2 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ApplicationProperties.java @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.servicefabricmesh.fluent.models.ServiceResourceDescriptionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes properties of a application resource. */ +@Fluent +public class ApplicationProperties { + /* + * User readable description of the application. + */ + @JsonProperty(value = "description") + private String description; + + /* + * Describes the services in the application. This property is used to create or modify services of the + * application. On get only the name of the service is returned. The service description can be obtained by + * querying for the service resource. + */ + @JsonProperty(value = "services") + private List services; + + /* + * Describes the diagnostics definition and usage for an application resource. + */ + @JsonProperty(value = "diagnostics") + private DiagnosticsDescription diagnostics; + + /* + * Internal - used by Visual Studio to setup the debugging session on the local development environment. + */ + @JsonProperty(value = "debugParams") + private String debugParams; + + /* + * Names of the services in the application. + */ + @JsonProperty(value = "serviceNames", access = JsonProperty.Access.WRITE_ONLY) + private List serviceNames; + + /* + * Status of the application. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private ResourceStatus status; + + /* + * Gives additional information about the current status of the application. + */ + @JsonProperty(value = "statusDetails", access = JsonProperty.Access.WRITE_ONLY) + private String statusDetails; + + /* + * Describes the health state of an application resource. + */ + @JsonProperty(value = "healthState", access = JsonProperty.Access.WRITE_ONLY) + private HealthState healthState; + + /* + * When the application's health state is not 'Ok', this additional details from service fabric Health Manager for + * the user to know why the application is marked unhealthy. + */ + @JsonProperty(value = "unhealthyEvaluation", access = JsonProperty.Access.WRITE_ONLY) + private String unhealthyEvaluation; + + /** Creates an instance of ApplicationProperties class. */ + public ApplicationProperties() { + } + + /** + * Get the description property: User readable description of the application. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: User readable description of the application. + * + * @param description the description value to set. + * @return the ApplicationProperties object itself. + */ + public ApplicationProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the services property: Describes the services in the application. This property is used to create or modify + * services of the application. On get only the name of the service is returned. The service description can be + * obtained by querying for the service resource. + * + * @return the services value. + */ + public List services() { + return this.services; + } + + /** + * Set the services property: Describes the services in the application. This property is used to create or modify + * services of the application. On get only the name of the service is returned. The service description can be + * obtained by querying for the service resource. + * + * @param services the services value to set. + * @return the ApplicationProperties object itself. + */ + public ApplicationProperties withServices(List services) { + this.services = services; + return this; + } + + /** + * Get the diagnostics property: Describes the diagnostics definition and usage for an application resource. + * + * @return the diagnostics value. + */ + public DiagnosticsDescription diagnostics() { + return this.diagnostics; + } + + /** + * Set the diagnostics property: Describes the diagnostics definition and usage for an application resource. + * + * @param diagnostics the diagnostics value to set. + * @return the ApplicationProperties object itself. + */ + public ApplicationProperties withDiagnostics(DiagnosticsDescription diagnostics) { + this.diagnostics = diagnostics; + return this; + } + + /** + * Get the debugParams property: Internal - used by Visual Studio to setup the debugging session on the local + * development environment. + * + * @return the debugParams value. + */ + public String debugParams() { + return this.debugParams; + } + + /** + * Set the debugParams property: Internal - used by Visual Studio to setup the debugging session on the local + * development environment. + * + * @param debugParams the debugParams value to set. + * @return the ApplicationProperties object itself. + */ + public ApplicationProperties withDebugParams(String debugParams) { + this.debugParams = debugParams; + return this; + } + + /** + * Get the serviceNames property: Names of the services in the application. + * + * @return the serviceNames value. + */ + public List serviceNames() { + return this.serviceNames; + } + + /** + * Get the status property: Status of the application. + * + * @return the status value. + */ + public ResourceStatus status() { + return this.status; + } + + /** + * Get the statusDetails property: Gives additional information about the current status of the application. + * + * @return the statusDetails value. + */ + public String statusDetails() { + return this.statusDetails; + } + + /** + * Get the healthState property: Describes the health state of an application resource. + * + * @return the healthState value. + */ + public HealthState healthState() { + return this.healthState; + } + + /** + * Get the unhealthyEvaluation property: When the application's health state is not 'Ok', this additional details + * from service fabric Health Manager for the user to know why the application is marked unhealthy. + * + * @return the unhealthyEvaluation value. + */ + public String unhealthyEvaluation() { + return this.unhealthyEvaluation; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (services() != null) { + services().forEach(e -> e.validate()); + } + if (diagnostics() != null) { + diagnostics().validate(); + } + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ApplicationResourceDescription.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ApplicationResourceDescription.java new file mode 100644 index 000000000000..d9b2976502be --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ApplicationResourceDescription.java @@ -0,0 +1,284 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicefabricmesh.fluent.models.ApplicationResourceDescriptionInner; +import com.azure.resourcemanager.servicefabricmesh.fluent.models.ServiceResourceDescriptionInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of ApplicationResourceDescription. */ +public interface ApplicationResourceDescription { + /** + * 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 description property: User readable description of the application. + * + * @return the description value. + */ + String description(); + + /** + * Gets the services property: Describes the services in the application. This property is used to create or modify + * services of the application. On get only the name of the service is returned. The service description can be + * obtained by querying for the service resource. + * + * @return the services value. + */ + List services(); + + /** + * Gets the diagnostics property: Describes the diagnostics definition and usage for an application resource. + * + * @return the diagnostics value. + */ + DiagnosticsDescription diagnostics(); + + /** + * Gets the debugParams property: Internal - used by Visual Studio to setup the debugging session on the local + * development environment. + * + * @return the debugParams value. + */ + String debugParams(); + + /** + * Gets the serviceNames property: Names of the services in the application. + * + * @return the serviceNames value. + */ + List serviceNames(); + + /** + * Gets the status property: Status of the application. + * + * @return the status value. + */ + ResourceStatus status(); + + /** + * Gets the statusDetails property: Gives additional information about the current status of the application. + * + * @return the statusDetails value. + */ + String statusDetails(); + + /** + * Gets the healthState property: Describes the health state of an application resource. + * + * @return the healthState value. + */ + HealthState healthState(); + + /** + * Gets the unhealthyEvaluation property: When the application's health state is not 'Ok', this additional details + * from service fabric Health Manager for the user to know why the application is marked unhealthy. + * + * @return the unhealthyEvaluation value. + */ + String unhealthyEvaluation(); + + /** + * Gets the provisioningState property: State of the resource. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * 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.servicefabricmesh.fluent.models.ApplicationResourceDescriptionInner + * object. + * + * @return the inner object. + */ + ApplicationResourceDescriptionInner innerModel(); + + /** The entirety of the ApplicationResourceDescription definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The ApplicationResourceDescription definition stages. */ + interface DefinitionStages { + /** The first stage of the ApplicationResourceDescription definition. */ + interface Blank extends WithLocation { + } + /** The stage of the ApplicationResourceDescription 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 ApplicationResourceDescription definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName Azure resource group name. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the ApplicationResourceDescription 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.WithDescription, + DefinitionStages.WithServices, + DefinitionStages.WithDiagnostics, + DefinitionStages.WithDebugParams { + /** + * Executes the create request. + * + * @return the created resource. + */ + ApplicationResourceDescription create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ApplicationResourceDescription create(Context context); + } + /** The stage of the ApplicationResourceDescription 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 ApplicationResourceDescription definition allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: User readable description of the application.. + * + * @param description User readable description of the application. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + /** The stage of the ApplicationResourceDescription definition allowing to specify services. */ + interface WithServices { + /** + * Specifies the services property: Describes the services in the application. This property is used to + * create or modify services of the application. On get only the name of the service is returned. The + * service description can be obtained by querying for the service resource.. + * + * @param services Describes the services in the application. This property is used to create or modify + * services of the application. On get only the name of the service is returned. The service description + * can be obtained by querying for the service resource. + * @return the next definition stage. + */ + WithCreate withServices(List services); + } + /** The stage of the ApplicationResourceDescription definition allowing to specify diagnostics. */ + interface WithDiagnostics { + /** + * Specifies the diagnostics property: Describes the diagnostics definition and usage for an application + * resource.. + * + * @param diagnostics Describes the diagnostics definition and usage for an application resource. + * @return the next definition stage. + */ + WithCreate withDiagnostics(DiagnosticsDescription diagnostics); + } + /** The stage of the ApplicationResourceDescription definition allowing to specify debugParams. */ + interface WithDebugParams { + /** + * Specifies the debugParams property: Internal - used by Visual Studio to setup the debugging session on + * the local development environment.. + * + * @param debugParams Internal - used by Visual Studio to setup the debugging session on the local + * development environment. + * @return the next definition stage. + */ + WithCreate withDebugParams(String debugParams); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ApplicationResourceDescription refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ApplicationResourceDescription refresh(Context context); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ApplicationResourceDescriptionList.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ApplicationResourceDescriptionList.java new file mode 100644 index 000000000000..7ac6ed19cca6 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ApplicationResourceDescriptionList.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.servicefabricmesh.fluent.models.ApplicationResourceDescriptionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A pageable list of application resources. */ +@Fluent +public final class ApplicationResourceDescriptionList { + /* + * One page of the list. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URI to fetch the next page of the list. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of ApplicationResourceDescriptionList class. */ + public ApplicationResourceDescriptionList() { + } + + /** + * Get the value property: One page of the list. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: One page of the list. + * + * @param value the value value to set. + * @return the ApplicationResourceDescriptionList object itself. + */ + public ApplicationResourceDescriptionList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URI to fetch the next page of the list. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URI to fetch the next page of the list. + * + * @param nextLink the nextLink value to set. + * @return the ApplicationResourceDescriptionList object itself. + */ + public ApplicationResourceDescriptionList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ApplicationScopedVolume.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ApplicationScopedVolume.java new file mode 100644 index 000000000000..afa5a0a04499 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ApplicationScopedVolume.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a volume whose lifetime is scoped to the application's lifetime. */ +@Fluent +public final class ApplicationScopedVolume extends VolumeReference { + /* + * Describes parameters for creating application-scoped volumes. + */ + @JsonProperty(value = "creationParameters", required = true) + private ApplicationScopedVolumeCreationParameters creationParameters; + + /** Creates an instance of ApplicationScopedVolume class. */ + public ApplicationScopedVolume() { + } + + /** + * Get the creationParameters property: Describes parameters for creating application-scoped volumes. + * + * @return the creationParameters value. + */ + public ApplicationScopedVolumeCreationParameters creationParameters() { + return this.creationParameters; + } + + /** + * Set the creationParameters property: Describes parameters for creating application-scoped volumes. + * + * @param creationParameters the creationParameters value to set. + * @return the ApplicationScopedVolume object itself. + */ + public ApplicationScopedVolume withCreationParameters( + ApplicationScopedVolumeCreationParameters creationParameters) { + this.creationParameters = creationParameters; + return this; + } + + /** {@inheritDoc} */ + @Override + public ApplicationScopedVolume withName(String name) { + super.withName(name); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApplicationScopedVolume withReadOnly(Boolean readOnly) { + super.withReadOnly(readOnly); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApplicationScopedVolume withDestinationPath(String destinationPath) { + super.withDestinationPath(destinationPath); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (creationParameters() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property creationParameters in model ApplicationScopedVolume")); + } else { + creationParameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ApplicationScopedVolume.class); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ApplicationScopedVolumeCreationParameters.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ApplicationScopedVolumeCreationParameters.java new file mode 100644 index 000000000000..eea0139b94b6 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ApplicationScopedVolumeCreationParameters.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Describes parameters for creating application-scoped volumes. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "kind", + defaultImpl = ApplicationScopedVolumeCreationParameters.class) +@JsonTypeName("ApplicationScopedVolumeCreationParameters") +@JsonSubTypes({ + @JsonSubTypes.Type( + name = "ServiceFabricVolumeDisk", + value = ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk.class) +}) +@Fluent +public class ApplicationScopedVolumeCreationParameters { + /* + * User readable description of the volume. + */ + @JsonProperty(value = "description") + private String description; + + /** Creates an instance of ApplicationScopedVolumeCreationParameters class. */ + public ApplicationScopedVolumeCreationParameters() { + } + + /** + * Get the description property: User readable description of the volume. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: User readable description of the volume. + * + * @param description the description value to set. + * @return the ApplicationScopedVolumeCreationParameters object itself. + */ + public ApplicationScopedVolumeCreationParameters 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/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk.java new file mode 100644 index 000000000000..f97f32e97431 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Describes parameters for creating application-scoped volumes provided by Service Fabric Volume Disks. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("ServiceFabricVolumeDisk") +@Fluent +public final class ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk + extends ApplicationScopedVolumeCreationParameters { + /* + * Volume size + */ + @JsonProperty(value = "sizeDisk", required = true) + private SizeTypes sizeDisk; + + /** Creates an instance of ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk class. */ + public ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk() { + } + + /** + * Get the sizeDisk property: Volume size. + * + * @return the sizeDisk value. + */ + public SizeTypes sizeDisk() { + return this.sizeDisk; + } + + /** + * Set the sizeDisk property: Volume size. + * + * @param sizeDisk the sizeDisk value to set. + * @return the ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk object itself. + */ + public ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk withSizeDisk(SizeTypes sizeDisk) { + this.sizeDisk = sizeDisk; + return this; + } + + /** {@inheritDoc} */ + @Override + public ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk withDescription(String description) { + super.withDescription(description); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (sizeDisk() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sizeDisk in model" + + " ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk")); + } + } + + private static final ClientLogger LOGGER = + new ClientLogger(ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk.class); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ApplicationScopedVolumeKind.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ApplicationScopedVolumeKind.java new file mode 100644 index 000000000000..0109d3ccd80c --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ApplicationScopedVolumeKind.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Specifies the application-scoped volume kind. */ +public final class ApplicationScopedVolumeKind extends ExpandableStringEnum { + /** Static value ServiceFabricVolumeDisk for ApplicationScopedVolumeKind. */ + public static final ApplicationScopedVolumeKind SERVICE_FABRIC_VOLUME_DISK = fromString("ServiceFabricVolumeDisk"); + + /** + * Creates a new instance of ApplicationScopedVolumeKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ApplicationScopedVolumeKind() { + } + + /** + * Creates or finds a ApplicationScopedVolumeKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApplicationScopedVolumeKind. + */ + @JsonCreator + public static ApplicationScopedVolumeKind fromString(String name) { + return fromString(name, ApplicationScopedVolumeKind.class); + } + + /** + * Gets known ApplicationScopedVolumeKind values. + * + * @return known ApplicationScopedVolumeKind values. + */ + public static Collection values() { + return values(ApplicationScopedVolumeKind.class); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/Applications.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/Applications.java new file mode 100644 index 000000000000..0068ac063f76 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/Applications.java @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.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 Applications. */ +public interface Applications { + /** + * Gets the application resource with the given name. + * + *

Gets the information about the application resource with the given name. The information include the + * description and other properties of the application. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about the application resource with the given name along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String applicationResourceName, Context context); + + /** + * Gets the application resource with the given name. + * + *

Gets the information about the application resource with the given name. The information include the + * description and other properties of the application. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about the application resource with the given name. + */ + ApplicationResourceDescription getByResourceGroup(String resourceGroupName, String applicationResourceName); + + /** + * Deletes the application resource. + * + *

Deletes the application resource identified by the name. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByResourceGroupWithResponse( + String resourceGroupName, String applicationResourceName, Context context); + + /** + * Deletes the application resource. + * + *

Deletes the application resource identified by the name. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 applicationResourceName); + + /** + * Gets all the application resources in a given resource group. + * + *

Gets the information about all application resources in a given resource group. The information include the + * description and other properties of the Application. + * + * @param resourceGroupName Azure resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about all application resources in a given resource group as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all the application resources in a given resource group. + * + *

Gets the information about all application resources in a given resource group. The information include the + * description and other properties of the Application. + * + * @param resourceGroupName Azure resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about all application resources in a given resource group as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all the application resources in a given subscription. + * + *

Gets the information about all application resources in a given resource group. The information include the + * description and other properties of the application. + * + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about all application resources in a given resource group as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Gets all the application resources in a given subscription. + * + *

Gets the information about all application resources in a given resource group. The information include the + * description and other properties of the application. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about all application resources in a given resource group as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Gets the application resource with the given name. + * + *

Gets the information about the application resource with the given name. The information include the + * description and other properties of the application. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about the application resource with the given name along with {@link Response}. + */ + ApplicationResourceDescription getById(String id); + + /** + * Gets the application resource with the given name. + * + *

Gets the information about the application resource with the given name. The information include the + * description and other properties of the application. + * + * @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.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about the application resource with the given name along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the application resource. + * + *

Deletes the application resource identified by the name. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 application resource. + * + *

Deletes the application resource identified by the name. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ApplicationResourceDescription resource. + * + * @param name resource name. + * @return the first stage of the new ApplicationResourceDescription definition. + */ + ApplicationResourceDescription.DefinitionStages.Blank define(String name); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/AutoScalingMechanism.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/AutoScalingMechanism.java new file mode 100644 index 000000000000..476261ac1e10 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/AutoScalingMechanism.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.servicefabricmesh.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the mechanism for performing auto scaling operation. Derived classes will describe the actual mechanism. + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "kind", + defaultImpl = AutoScalingMechanism.class) +@JsonTypeName("AutoScalingMechanism") +@JsonSubTypes({@JsonSubTypes.Type(name = "AddRemoveReplica", value = AddRemoveReplicaScalingMechanism.class)}) +@Immutable +public class AutoScalingMechanism { + /** Creates an instance of AutoScalingMechanism class. */ + public AutoScalingMechanism() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/AutoScalingMechanismKind.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/AutoScalingMechanismKind.java new file mode 100644 index 000000000000..f97e8828d2a1 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/AutoScalingMechanismKind.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Enumerates the mechanisms for auto scaling. */ +public final class AutoScalingMechanismKind extends ExpandableStringEnum { + /** Static value AddRemoveReplica for AutoScalingMechanismKind. */ + public static final AutoScalingMechanismKind ADD_REMOVE_REPLICA = fromString("AddRemoveReplica"); + + /** + * Creates a new instance of AutoScalingMechanismKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AutoScalingMechanismKind() { + } + + /** + * Creates or finds a AutoScalingMechanismKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding AutoScalingMechanismKind. + */ + @JsonCreator + public static AutoScalingMechanismKind fromString(String name) { + return fromString(name, AutoScalingMechanismKind.class); + } + + /** + * Gets known AutoScalingMechanismKind values. + * + * @return known AutoScalingMechanismKind values. + */ + public static Collection values() { + return values(AutoScalingMechanismKind.class); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/AutoScalingMetric.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/AutoScalingMetric.java new file mode 100644 index 000000000000..436766e9337d --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/AutoScalingMetric.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.servicefabricmesh.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the metric that is used for triggering auto scaling operation. Derived classes will describe resources or + * metrics. + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "kind", + defaultImpl = AutoScalingMetric.class) +@JsonTypeName("AutoScalingMetric") +@JsonSubTypes({@JsonSubTypes.Type(name = "Resource", value = AutoScalingResourceMetric.class)}) +@Immutable +public class AutoScalingMetric { + /** Creates an instance of AutoScalingMetric class. */ + public AutoScalingMetric() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/AutoScalingMetricKind.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/AutoScalingMetricKind.java new file mode 100644 index 000000000000..c5bac181f7c1 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/AutoScalingMetricKind.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Enumerates the metrics that are used for triggering auto scaling. */ +public final class AutoScalingMetricKind extends ExpandableStringEnum { + /** Static value Resource for AutoScalingMetricKind. */ + public static final AutoScalingMetricKind RESOURCE = fromString("Resource"); + + /** + * Creates a new instance of AutoScalingMetricKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AutoScalingMetricKind() { + } + + /** + * Creates or finds a AutoScalingMetricKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding AutoScalingMetricKind. + */ + @JsonCreator + public static AutoScalingMetricKind fromString(String name) { + return fromString(name, AutoScalingMetricKind.class); + } + + /** + * Gets known AutoScalingMetricKind values. + * + * @return known AutoScalingMetricKind values. + */ + public static Collection values() { + return values(AutoScalingMetricKind.class); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/AutoScalingPolicy.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/AutoScalingPolicy.java new file mode 100644 index 000000000000..d63733a93b59 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/AutoScalingPolicy.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.servicefabricmesh.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the auto scaling policy. */ +@Fluent +public final class AutoScalingPolicy { + /* + * The name of the auto scaling policy. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Determines when auto scaling operation will be invoked. + */ + @JsonProperty(value = "trigger", required = true) + private AutoScalingTrigger trigger; + + /* + * The mechanism that is used to scale when auto scaling operation is invoked. + */ + @JsonProperty(value = "mechanism", required = true) + private AutoScalingMechanism mechanism; + + /** Creates an instance of AutoScalingPolicy class. */ + public AutoScalingPolicy() { + } + + /** + * Get the name property: The name of the auto scaling policy. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the auto scaling policy. + * + * @param name the name value to set. + * @return the AutoScalingPolicy object itself. + */ + public AutoScalingPolicy withName(String name) { + this.name = name; + return this; + } + + /** + * Get the trigger property: Determines when auto scaling operation will be invoked. + * + * @return the trigger value. + */ + public AutoScalingTrigger trigger() { + return this.trigger; + } + + /** + * Set the trigger property: Determines when auto scaling operation will be invoked. + * + * @param trigger the trigger value to set. + * @return the AutoScalingPolicy object itself. + */ + public AutoScalingPolicy withTrigger(AutoScalingTrigger trigger) { + this.trigger = trigger; + return this; + } + + /** + * Get the mechanism property: The mechanism that is used to scale when auto scaling operation is invoked. + * + * @return the mechanism value. + */ + public AutoScalingMechanism mechanism() { + return this.mechanism; + } + + /** + * Set the mechanism property: The mechanism that is used to scale when auto scaling operation is invoked. + * + * @param mechanism the mechanism value to set. + * @return the AutoScalingPolicy object itself. + */ + public AutoScalingPolicy withMechanism(AutoScalingMechanism mechanism) { + this.mechanism = mechanism; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model AutoScalingPolicy")); + } + if (trigger() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property trigger in model AutoScalingPolicy")); + } else { + trigger().validate(); + } + if (mechanism() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property mechanism in model AutoScalingPolicy")); + } else { + mechanism().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AutoScalingPolicy.class); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/AutoScalingResourceMetric.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/AutoScalingResourceMetric.java new file mode 100644 index 000000000000..ad51a94ec968 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/AutoScalingResourceMetric.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Describes the resource that is used for triggering auto scaling. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("Resource") +@Fluent +public final class AutoScalingResourceMetric extends AutoScalingMetric { + /* + * Name of the resource. + */ + @JsonProperty(value = "name", required = true) + private AutoScalingResourceMetricName name; + + /** Creates an instance of AutoScalingResourceMetric class. */ + public AutoScalingResourceMetric() { + } + + /** + * Get the name property: Name of the resource. + * + * @return the name value. + */ + public AutoScalingResourceMetricName name() { + return this.name; + } + + /** + * Set the name property: Name of the resource. + * + * @param name the name value to set. + * @return the AutoScalingResourceMetric object itself. + */ + public AutoScalingResourceMetric withName(AutoScalingResourceMetricName name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (name() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model AutoScalingResourceMetric")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AutoScalingResourceMetric.class); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/AutoScalingResourceMetricName.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/AutoScalingResourceMetricName.java new file mode 100644 index 000000000000..3b8e5d7c15c3 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/AutoScalingResourceMetricName.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.servicefabricmesh.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Enumerates the resources that are used for triggering auto scaling. */ +public final class AutoScalingResourceMetricName extends ExpandableStringEnum { + /** Static value cpu for AutoScalingResourceMetricName. */ + public static final AutoScalingResourceMetricName CPU = fromString("cpu"); + + /** Static value memoryInGB for AutoScalingResourceMetricName. */ + public static final AutoScalingResourceMetricName MEMORY_IN_GB = fromString("memoryInGB"); + + /** + * Creates a new instance of AutoScalingResourceMetricName value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AutoScalingResourceMetricName() { + } + + /** + * Creates or finds a AutoScalingResourceMetricName from its string representation. + * + * @param name a name to look for. + * @return the corresponding AutoScalingResourceMetricName. + */ + @JsonCreator + public static AutoScalingResourceMetricName fromString(String name) { + return fromString(name, AutoScalingResourceMetricName.class); + } + + /** + * Gets known AutoScalingResourceMetricName values. + * + * @return known AutoScalingResourceMetricName values. + */ + public static Collection values() { + return values(AutoScalingResourceMetricName.class); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/AutoScalingTrigger.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/AutoScalingTrigger.java new file mode 100644 index 000000000000..943ae04b4a0e --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/AutoScalingTrigger.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.servicefabricmesh.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Describes the trigger for performing auto scaling operation. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "kind", + defaultImpl = AutoScalingTrigger.class) +@JsonTypeName("AutoScalingTrigger") +@JsonSubTypes({@JsonSubTypes.Type(name = "AverageLoad", value = AverageLoadScalingTrigger.class)}) +@Immutable +public class AutoScalingTrigger { + /** Creates an instance of AutoScalingTrigger class. */ + public AutoScalingTrigger() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/AutoScalingTriggerKind.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/AutoScalingTriggerKind.java new file mode 100644 index 000000000000..c89d94890790 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/AutoScalingTriggerKind.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Enumerates the triggers for auto scaling. */ +public final class AutoScalingTriggerKind extends ExpandableStringEnum { + /** Static value AverageLoad for AutoScalingTriggerKind. */ + public static final AutoScalingTriggerKind AVERAGE_LOAD = fromString("AverageLoad"); + + /** + * Creates a new instance of AutoScalingTriggerKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AutoScalingTriggerKind() { + } + + /** + * Creates or finds a AutoScalingTriggerKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding AutoScalingTriggerKind. + */ + @JsonCreator + public static AutoScalingTriggerKind fromString(String name) { + return fromString(name, AutoScalingTriggerKind.class); + } + + /** + * Gets known AutoScalingTriggerKind values. + * + * @return known AutoScalingTriggerKind values. + */ + public static Collection values() { + return values(AutoScalingTriggerKind.class); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/AvailableOperationDescriptionProperties.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/AvailableOperationDescriptionProperties.java new file mode 100644 index 000000000000..089364ba4c77 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/AvailableOperationDescriptionProperties.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.servicefabricmesh.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties available for a Microsoft.Web resource provider operation. */ +@Fluent +public final class AvailableOperationDescriptionProperties { + /* + * Resource metrics service provided by Microsoft.Insights resource provider. + */ + @JsonProperty(value = "serviceSpecification") + private ServiceSpecification serviceSpecification; + + /** Creates an instance of AvailableOperationDescriptionProperties class. */ + public AvailableOperationDescriptionProperties() { + } + + /** + * Get the serviceSpecification property: Resource metrics service provided by Microsoft.Insights resource provider. + * + * @return the serviceSpecification value. + */ + public ServiceSpecification serviceSpecification() { + return this.serviceSpecification; + } + + /** + * Set the serviceSpecification property: Resource metrics service provided by Microsoft.Insights resource provider. + * + * @param serviceSpecification the serviceSpecification value to set. + * @return the AvailableOperationDescriptionProperties object itself. + */ + public AvailableOperationDescriptionProperties withServiceSpecification(ServiceSpecification serviceSpecification) { + this.serviceSpecification = serviceSpecification; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (serviceSpecification() != null) { + serviceSpecification().validate(); + } + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/AvailableOperationDisplay.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/AvailableOperationDisplay.java new file mode 100644 index 000000000000..9d257db1abbf --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/AvailableOperationDisplay.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.servicefabricmesh.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An operation available at the listed Azure resource provider. */ +@Fluent +public final class AvailableOperationDisplay { + /* + * Name of the operation provider. + */ + @JsonProperty(value = "provider") + private String provider; + + /* + * Name of the resource on which the operation is available. + */ + @JsonProperty(value = "resource") + private String resource; + + /* + * Name of the available operation. + */ + @JsonProperty(value = "operation") + private String operation; + + /* + * Description of the available operation. + */ + @JsonProperty(value = "description") + private String description; + + /** Creates an instance of AvailableOperationDisplay class. */ + public AvailableOperationDisplay() { + } + + /** + * Get the provider property: Name of the operation provider. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider property: Name of the operation provider. + * + * @param provider the provider value to set. + * @return the AvailableOperationDisplay object itself. + */ + public AvailableOperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the resource property: Name of the resource on which the operation is available. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource property: Name of the resource on which the operation is available. + * + * @param resource the resource value to set. + * @return the AvailableOperationDisplay object itself. + */ + public AvailableOperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the operation property: Name of the available operation. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation property: Name of the available operation. + * + * @param operation the operation value to set. + * @return the AvailableOperationDisplay object itself. + */ + public AvailableOperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the description property: Description of the available operation. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of the available operation. + * + * @param description the description value to set. + * @return the AvailableOperationDisplay object itself. + */ + public AvailableOperationDisplay 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/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/AverageLoadScalingTrigger.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/AverageLoadScalingTrigger.java new file mode 100644 index 000000000000..860f4a87fdb3 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/AverageLoadScalingTrigger.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Describes the average load trigger used for auto scaling. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("AverageLoad") +@Fluent +public final class AverageLoadScalingTrigger extends AutoScalingTrigger { + /* + * Description of the metric that is used for scaling. + */ + @JsonProperty(value = "metric", required = true) + private AutoScalingMetric metric; + + /* + * Lower load threshold (if average load is below this threshold, service will scale down). + */ + @JsonProperty(value = "lowerLoadThreshold", required = true) + private double lowerLoadThreshold; + + /* + * Upper load threshold (if average load is above this threshold, service will scale up). + */ + @JsonProperty(value = "upperLoadThreshold", required = true) + private double upperLoadThreshold; + + /* + * Scale interval that indicates how often will this trigger be checked. + */ + @JsonProperty(value = "scaleIntervalInSeconds", required = true) + private int scaleIntervalInSeconds; + + /** Creates an instance of AverageLoadScalingTrigger class. */ + public AverageLoadScalingTrigger() { + } + + /** + * Get the metric property: Description of the metric that is used for scaling. + * + * @return the metric value. + */ + public AutoScalingMetric metric() { + return this.metric; + } + + /** + * Set the metric property: Description of the metric that is used for scaling. + * + * @param metric the metric value to set. + * @return the AverageLoadScalingTrigger object itself. + */ + public AverageLoadScalingTrigger withMetric(AutoScalingMetric metric) { + this.metric = metric; + return this; + } + + /** + * Get the lowerLoadThreshold property: Lower load threshold (if average load is below this threshold, service will + * scale down). + * + * @return the lowerLoadThreshold value. + */ + public double lowerLoadThreshold() { + return this.lowerLoadThreshold; + } + + /** + * Set the lowerLoadThreshold property: Lower load threshold (if average load is below this threshold, service will + * scale down). + * + * @param lowerLoadThreshold the lowerLoadThreshold value to set. + * @return the AverageLoadScalingTrigger object itself. + */ + public AverageLoadScalingTrigger withLowerLoadThreshold(double lowerLoadThreshold) { + this.lowerLoadThreshold = lowerLoadThreshold; + return this; + } + + /** + * Get the upperLoadThreshold property: Upper load threshold (if average load is above this threshold, service will + * scale up). + * + * @return the upperLoadThreshold value. + */ + public double upperLoadThreshold() { + return this.upperLoadThreshold; + } + + /** + * Set the upperLoadThreshold property: Upper load threshold (if average load is above this threshold, service will + * scale up). + * + * @param upperLoadThreshold the upperLoadThreshold value to set. + * @return the AverageLoadScalingTrigger object itself. + */ + public AverageLoadScalingTrigger withUpperLoadThreshold(double upperLoadThreshold) { + this.upperLoadThreshold = upperLoadThreshold; + return this; + } + + /** + * Get the scaleIntervalInSeconds property: Scale interval that indicates how often will this trigger be checked. + * + * @return the scaleIntervalInSeconds value. + */ + public int scaleIntervalInSeconds() { + return this.scaleIntervalInSeconds; + } + + /** + * Set the scaleIntervalInSeconds property: Scale interval that indicates how often will this trigger be checked. + * + * @param scaleIntervalInSeconds the scaleIntervalInSeconds value to set. + * @return the AverageLoadScalingTrigger object itself. + */ + public AverageLoadScalingTrigger withScaleIntervalInSeconds(int scaleIntervalInSeconds) { + this.scaleIntervalInSeconds = scaleIntervalInSeconds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (metric() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property metric in model AverageLoadScalingTrigger")); + } else { + metric().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AverageLoadScalingTrigger.class); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/AzureInternalMonitoringPipelineSinkDescription.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/AzureInternalMonitoringPipelineSinkDescription.java new file mode 100644 index 000000000000..bcaa3f670cd5 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/AzureInternalMonitoringPipelineSinkDescription.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Diagnostics settings for Geneva. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("AzureInternalMonitoringPipeline") +@Fluent +public final class AzureInternalMonitoringPipelineSinkDescription extends DiagnosticsSinkProperties { + /* + * Azure Internal monitoring pipeline account. + */ + @JsonProperty(value = "accountName") + private String accountName; + + /* + * Azure Internal monitoring pipeline account namespace. + */ + @JsonProperty(value = "namespace") + private String namespace; + + /* + * Azure Internal monitoring agent configuration. + */ + @JsonProperty(value = "maConfigUrl") + private String maConfigUrl; + + /* + * Azure Internal monitoring agent fluentd configuration. + */ + @JsonProperty(value = "fluentdConfigUrl") + private Object fluentdConfigUrl; + + /* + * Azure Internal monitoring pipeline autokey associated with the certificate. + */ + @JsonProperty(value = "autoKeyConfigUrl") + private String autoKeyConfigUrl; + + /** Creates an instance of AzureInternalMonitoringPipelineSinkDescription class. */ + public AzureInternalMonitoringPipelineSinkDescription() { + } + + /** + * Get the accountName property: Azure Internal monitoring pipeline account. + * + * @return the accountName value. + */ + public String accountName() { + return this.accountName; + } + + /** + * Set the accountName property: Azure Internal monitoring pipeline account. + * + * @param accountName the accountName value to set. + * @return the AzureInternalMonitoringPipelineSinkDescription object itself. + */ + public AzureInternalMonitoringPipelineSinkDescription withAccountName(String accountName) { + this.accountName = accountName; + return this; + } + + /** + * Get the namespace property: Azure Internal monitoring pipeline account namespace. + * + * @return the namespace value. + */ + public String namespace() { + return this.namespace; + } + + /** + * Set the namespace property: Azure Internal monitoring pipeline account namespace. + * + * @param namespace the namespace value to set. + * @return the AzureInternalMonitoringPipelineSinkDescription object itself. + */ + public AzureInternalMonitoringPipelineSinkDescription withNamespace(String namespace) { + this.namespace = namespace; + return this; + } + + /** + * Get the maConfigUrl property: Azure Internal monitoring agent configuration. + * + * @return the maConfigUrl value. + */ + public String maConfigUrl() { + return this.maConfigUrl; + } + + /** + * Set the maConfigUrl property: Azure Internal monitoring agent configuration. + * + * @param maConfigUrl the maConfigUrl value to set. + * @return the AzureInternalMonitoringPipelineSinkDescription object itself. + */ + public AzureInternalMonitoringPipelineSinkDescription withMaConfigUrl(String maConfigUrl) { + this.maConfigUrl = maConfigUrl; + return this; + } + + /** + * Get the fluentdConfigUrl property: Azure Internal monitoring agent fluentd configuration. + * + * @return the fluentdConfigUrl value. + */ + public Object fluentdConfigUrl() { + return this.fluentdConfigUrl; + } + + /** + * Set the fluentdConfigUrl property: Azure Internal monitoring agent fluentd configuration. + * + * @param fluentdConfigUrl the fluentdConfigUrl value to set. + * @return the AzureInternalMonitoringPipelineSinkDescription object itself. + */ + public AzureInternalMonitoringPipelineSinkDescription withFluentdConfigUrl(Object fluentdConfigUrl) { + this.fluentdConfigUrl = fluentdConfigUrl; + return this; + } + + /** + * Get the autoKeyConfigUrl property: Azure Internal monitoring pipeline autokey associated with the certificate. + * + * @return the autoKeyConfigUrl value. + */ + public String autoKeyConfigUrl() { + return this.autoKeyConfigUrl; + } + + /** + * Set the autoKeyConfigUrl property: Azure Internal monitoring pipeline autokey associated with the certificate. + * + * @param autoKeyConfigUrl the autoKeyConfigUrl value to set. + * @return the AzureInternalMonitoringPipelineSinkDescription object itself. + */ + public AzureInternalMonitoringPipelineSinkDescription withAutoKeyConfigUrl(String autoKeyConfigUrl) { + this.autoKeyConfigUrl = autoKeyConfigUrl; + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureInternalMonitoringPipelineSinkDescription withName(String name) { + super.withName(name); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureInternalMonitoringPipelineSinkDescription withDescription(String description) { + super.withDescription(description); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/CodePackages.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/CodePackages.java new file mode 100644 index 000000000000..8cf4f0550498 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/CodePackages.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.servicefabricmesh.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of CodePackages. */ +public interface CodePackages { + /** + * Gets the logs from the container. + * + *

Gets the logs for the container of the specified code package of the service replica. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @param serviceResourceName The identity of the service. + * @param replicaName Service Fabric replica name. + * @param codePackageName The name of code package of the service. + * @param tail Number of lines to show from the end of the logs. Default is 100. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the logs for the container of the specified code package of the service replica along with {@link + * Response}. + */ + Response getContainerLogsWithResponse( + String resourceGroupName, + String applicationResourceName, + String serviceResourceName, + String replicaName, + String codePackageName, + Integer tail, + Context context); + + /** + * Gets the logs from the container. + * + *

Gets the logs for the container of the specified code package of the service replica. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @param serviceResourceName The identity of the service. + * @param replicaName Service Fabric replica name. + * @param codePackageName The name of code package of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the logs for the container of the specified code package of the service replica. + */ + ContainerLogs getContainerLogs( + String resourceGroupName, + String applicationResourceName, + String serviceResourceName, + String replicaName, + String codePackageName); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ContainerCodePackageProperties.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ContainerCodePackageProperties.java new file mode 100644 index 000000000000..e78a9b9690b9 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ContainerCodePackageProperties.java @@ -0,0 +1,472 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a container and its runtime properties. */ +@Fluent +public final class ContainerCodePackageProperties { + /* + * The name of the code package. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The Container image to use. + */ + @JsonProperty(value = "image", required = true) + private String image; + + /* + * Image registry credential. + */ + @JsonProperty(value = "imageRegistryCredential") + private ImageRegistryCredential imageRegistryCredential; + + /* + * Override for the default entry point in the container. + */ + @JsonProperty(value = "entrypoint") + private String entrypoint; + + /* + * Command array to execute within the container in exec form. + */ + @JsonProperty(value = "commands") + private List commands; + + /* + * The environment variables to set in this container + */ + @JsonProperty(value = "environmentVariables") + private List environmentVariables; + + /* + * The settings to set in this container. The setting file path can be fetched from environment variable + * "Fabric_SettingPath". The path for Windows container is "C:\\secrets". The path for Linux container is + * "/var/secrets". + */ + @JsonProperty(value = "settings") + private List settings; + + /* + * The labels to set in this container. + */ + @JsonProperty(value = "labels") + private List labels; + + /* + * The endpoints exposed by this container. + */ + @JsonProperty(value = "endpoints") + private List endpoints; + + /* + * The resources required by this container. + */ + @JsonProperty(value = "resources", required = true) + private ResourceRequirements resources; + + /* + * Volumes to be attached to the container. The lifetime of these volumes is independent of the application's + * lifetime. + */ + @JsonProperty(value = "volumeRefs") + private List volumeRefs; + + /* + * Volumes to be attached to the container. The lifetime of these volumes is scoped to the application's lifetime. + */ + @JsonProperty(value = "volumes") + private List volumes; + + /* + * Reference to sinks in DiagnosticsDescription. + */ + @JsonProperty(value = "diagnostics") + private DiagnosticsRef diagnostics; + + /* + * A list of ReliableCollection resources used by this particular code package. Please refer to + * ReliableCollectionsRef for more details. + */ + @JsonProperty(value = "reliableCollectionsRefs") + private List reliableCollectionsRefs; + + /* + * Runtime information of a container instance. + */ + @JsonProperty(value = "instanceView", access = JsonProperty.Access.WRITE_ONLY) + private ContainerInstanceView instanceView; + + /** Creates an instance of ContainerCodePackageProperties class. */ + public ContainerCodePackageProperties() { + } + + /** + * Get the name property: The name of the code package. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the code package. + * + * @param name the name value to set. + * @return the ContainerCodePackageProperties object itself. + */ + public ContainerCodePackageProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get the image property: The Container image to use. + * + * @return the image value. + */ + public String image() { + return this.image; + } + + /** + * Set the image property: The Container image to use. + * + * @param image the image value to set. + * @return the ContainerCodePackageProperties object itself. + */ + public ContainerCodePackageProperties withImage(String image) { + this.image = image; + return this; + } + + /** + * Get the imageRegistryCredential property: Image registry credential. + * + * @return the imageRegistryCredential value. + */ + public ImageRegistryCredential imageRegistryCredential() { + return this.imageRegistryCredential; + } + + /** + * Set the imageRegistryCredential property: Image registry credential. + * + * @param imageRegistryCredential the imageRegistryCredential value to set. + * @return the ContainerCodePackageProperties object itself. + */ + public ContainerCodePackageProperties withImageRegistryCredential(ImageRegistryCredential imageRegistryCredential) { + this.imageRegistryCredential = imageRegistryCredential; + return this; + } + + /** + * Get the entrypoint property: Override for the default entry point in the container. + * + * @return the entrypoint value. + */ + public String entrypoint() { + return this.entrypoint; + } + + /** + * Set the entrypoint property: Override for the default entry point in the container. + * + * @param entrypoint the entrypoint value to set. + * @return the ContainerCodePackageProperties object itself. + */ + public ContainerCodePackageProperties withEntrypoint(String entrypoint) { + this.entrypoint = entrypoint; + return this; + } + + /** + * Get the commands property: Command array to execute within the container in exec form. + * + * @return the commands value. + */ + public List commands() { + return this.commands; + } + + /** + * Set the commands property: Command array to execute within the container in exec form. + * + * @param commands the commands value to set. + * @return the ContainerCodePackageProperties object itself. + */ + public ContainerCodePackageProperties withCommands(List commands) { + this.commands = commands; + return this; + } + + /** + * Get the environmentVariables property: The environment variables to set in this container. + * + * @return the environmentVariables value. + */ + public List environmentVariables() { + return this.environmentVariables; + } + + /** + * Set the environmentVariables property: The environment variables to set in this container. + * + * @param environmentVariables the environmentVariables value to set. + * @return the ContainerCodePackageProperties object itself. + */ + public ContainerCodePackageProperties withEnvironmentVariables(List environmentVariables) { + this.environmentVariables = environmentVariables; + return this; + } + + /** + * Get the settings property: The settings to set in this container. The setting file path can be fetched from + * environment variable "Fabric_SettingPath". The path for Windows container is "C:\\secrets". The path for Linux + * container is "/var/secrets". + * + * @return the settings value. + */ + public List settings() { + return this.settings; + } + + /** + * Set the settings property: The settings to set in this container. The setting file path can be fetched from + * environment variable "Fabric_SettingPath". The path for Windows container is "C:\\secrets". The path for Linux + * container is "/var/secrets". + * + * @param settings the settings value to set. + * @return the ContainerCodePackageProperties object itself. + */ + public ContainerCodePackageProperties withSettings(List settings) { + this.settings = settings; + return this; + } + + /** + * Get the labels property: The labels to set in this container. + * + * @return the labels value. + */ + public List labels() { + return this.labels; + } + + /** + * Set the labels property: The labels to set in this container. + * + * @param labels the labels value to set. + * @return the ContainerCodePackageProperties object itself. + */ + public ContainerCodePackageProperties withLabels(List labels) { + this.labels = labels; + return this; + } + + /** + * Get the endpoints property: The endpoints exposed by this container. + * + * @return the endpoints value. + */ + public List endpoints() { + return this.endpoints; + } + + /** + * Set the endpoints property: The endpoints exposed by this container. + * + * @param endpoints the endpoints value to set. + * @return the ContainerCodePackageProperties object itself. + */ + public ContainerCodePackageProperties withEndpoints(List endpoints) { + this.endpoints = endpoints; + return this; + } + + /** + * Get the resources property: The resources required by this container. + * + * @return the resources value. + */ + public ResourceRequirements resources() { + return this.resources; + } + + /** + * Set the resources property: The resources required by this container. + * + * @param resources the resources value to set. + * @return the ContainerCodePackageProperties object itself. + */ + public ContainerCodePackageProperties withResources(ResourceRequirements resources) { + this.resources = resources; + return this; + } + + /** + * Get the volumeRefs property: Volumes to be attached to the container. The lifetime of these volumes is + * independent of the application's lifetime. + * + * @return the volumeRefs value. + */ + public List volumeRefs() { + return this.volumeRefs; + } + + /** + * Set the volumeRefs property: Volumes to be attached to the container. The lifetime of these volumes is + * independent of the application's lifetime. + * + * @param volumeRefs the volumeRefs value to set. + * @return the ContainerCodePackageProperties object itself. + */ + public ContainerCodePackageProperties withVolumeRefs(List volumeRefs) { + this.volumeRefs = volumeRefs; + return this; + } + + /** + * Get the volumes property: Volumes to be attached to the container. The lifetime of these volumes is scoped to the + * application's lifetime. + * + * @return the volumes value. + */ + public List volumes() { + return this.volumes; + } + + /** + * Set the volumes property: Volumes to be attached to the container. The lifetime of these volumes is scoped to the + * application's lifetime. + * + * @param volumes the volumes value to set. + * @return the ContainerCodePackageProperties object itself. + */ + public ContainerCodePackageProperties withVolumes(List volumes) { + this.volumes = volumes; + return this; + } + + /** + * Get the diagnostics property: Reference to sinks in DiagnosticsDescription. + * + * @return the diagnostics value. + */ + public DiagnosticsRef diagnostics() { + return this.diagnostics; + } + + /** + * Set the diagnostics property: Reference to sinks in DiagnosticsDescription. + * + * @param diagnostics the diagnostics value to set. + * @return the ContainerCodePackageProperties object itself. + */ + public ContainerCodePackageProperties withDiagnostics(DiagnosticsRef diagnostics) { + this.diagnostics = diagnostics; + return this; + } + + /** + * Get the reliableCollectionsRefs property: A list of ReliableCollection resources used by this particular code + * package. Please refer to ReliableCollectionsRef for more details. + * + * @return the reliableCollectionsRefs value. + */ + public List reliableCollectionsRefs() { + return this.reliableCollectionsRefs; + } + + /** + * Set the reliableCollectionsRefs property: A list of ReliableCollection resources used by this particular code + * package. Please refer to ReliableCollectionsRef for more details. + * + * @param reliableCollectionsRefs the reliableCollectionsRefs value to set. + * @return the ContainerCodePackageProperties object itself. + */ + public ContainerCodePackageProperties withReliableCollectionsRefs( + List reliableCollectionsRefs) { + this.reliableCollectionsRefs = reliableCollectionsRefs; + return this; + } + + /** + * Get the instanceView property: Runtime information of a container instance. + * + * @return the instanceView value. + */ + public ContainerInstanceView instanceView() { + return this.instanceView; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property name in model ContainerCodePackageProperties")); + } + if (image() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property image in model ContainerCodePackageProperties")); + } + if (imageRegistryCredential() != null) { + imageRegistryCredential().validate(); + } + if (environmentVariables() != null) { + environmentVariables().forEach(e -> e.validate()); + } + if (settings() != null) { + settings().forEach(e -> e.validate()); + } + if (labels() != null) { + labels().forEach(e -> e.validate()); + } + if (endpoints() != null) { + endpoints().forEach(e -> e.validate()); + } + if (resources() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property resources in model ContainerCodePackageProperties")); + } else { + resources().validate(); + } + if (volumeRefs() != null) { + volumeRefs().forEach(e -> e.validate()); + } + if (volumes() != null) { + volumes().forEach(e -> e.validate()); + } + if (diagnostics() != null) { + diagnostics().validate(); + } + if (reliableCollectionsRefs() != null) { + reliableCollectionsRefs().forEach(e -> e.validate()); + } + if (instanceView() != null) { + instanceView().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ContainerCodePackageProperties.class); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ContainerEvent.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ContainerEvent.java new file mode 100644 index 000000000000..736777c3886b --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ContainerEvent.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.servicefabricmesh.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A container event. */ +@Fluent +public final class ContainerEvent { + /* + * The name of the container event. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The count of the event. + */ + @JsonProperty(value = "count") + private Integer count; + + /* + * Date/time of the first event. + */ + @JsonProperty(value = "firstTimestamp") + private String firstTimestamp; + + /* + * Date/time of the last event. + */ + @JsonProperty(value = "lastTimestamp") + private String lastTimestamp; + + /* + * The event message + */ + @JsonProperty(value = "message") + private String message; + + /* + * The event type. + */ + @JsonProperty(value = "type") + private String type; + + /** Creates an instance of ContainerEvent class. */ + public ContainerEvent() { + } + + /** + * Get the name property: The name of the container event. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the container event. + * + * @param name the name value to set. + * @return the ContainerEvent object itself. + */ + public ContainerEvent withName(String name) { + this.name = name; + return this; + } + + /** + * Get the count property: The count of the event. + * + * @return the count value. + */ + public Integer count() { + return this.count; + } + + /** + * Set the count property: The count of the event. + * + * @param count the count value to set. + * @return the ContainerEvent object itself. + */ + public ContainerEvent withCount(Integer count) { + this.count = count; + return this; + } + + /** + * Get the firstTimestamp property: Date/time of the first event. + * + * @return the firstTimestamp value. + */ + public String firstTimestamp() { + return this.firstTimestamp; + } + + /** + * Set the firstTimestamp property: Date/time of the first event. + * + * @param firstTimestamp the firstTimestamp value to set. + * @return the ContainerEvent object itself. + */ + public ContainerEvent withFirstTimestamp(String firstTimestamp) { + this.firstTimestamp = firstTimestamp; + return this; + } + + /** + * Get the lastTimestamp property: Date/time of the last event. + * + * @return the lastTimestamp value. + */ + public String lastTimestamp() { + return this.lastTimestamp; + } + + /** + * Set the lastTimestamp property: Date/time of the last event. + * + * @param lastTimestamp the lastTimestamp value to set. + * @return the ContainerEvent object itself. + */ + public ContainerEvent withLastTimestamp(String lastTimestamp) { + this.lastTimestamp = lastTimestamp; + return this; + } + + /** + * Get the message property: The event message. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: The event message. + * + * @param message the message value to set. + * @return the ContainerEvent object itself. + */ + public ContainerEvent withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the type property: The event type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The event type. + * + * @param type the type value to set. + * @return the ContainerEvent object itself. + */ + public ContainerEvent withType(String type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ContainerInstanceView.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ContainerInstanceView.java new file mode 100644 index 000000000000..6d3b9724c34b --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ContainerInstanceView.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Runtime information of a container instance. */ +@Fluent +public final class ContainerInstanceView { + /* + * The number of times the container has been restarted. + */ + @JsonProperty(value = "restartCount") + private Integer restartCount; + + /* + * Current container instance state. + */ + @JsonProperty(value = "currentState") + private ContainerState currentState; + + /* + * Previous container instance state. + */ + @JsonProperty(value = "previousState") + private ContainerState previousState; + + /* + * The events of this container instance. + */ + @JsonProperty(value = "events") + private List events; + + /** Creates an instance of ContainerInstanceView class. */ + public ContainerInstanceView() { + } + + /** + * Get the restartCount property: The number of times the container has been restarted. + * + * @return the restartCount value. + */ + public Integer restartCount() { + return this.restartCount; + } + + /** + * Set the restartCount property: The number of times the container has been restarted. + * + * @param restartCount the restartCount value to set. + * @return the ContainerInstanceView object itself. + */ + public ContainerInstanceView withRestartCount(Integer restartCount) { + this.restartCount = restartCount; + return this; + } + + /** + * Get the currentState property: Current container instance state. + * + * @return the currentState value. + */ + public ContainerState currentState() { + return this.currentState; + } + + /** + * Set the currentState property: Current container instance state. + * + * @param currentState the currentState value to set. + * @return the ContainerInstanceView object itself. + */ + public ContainerInstanceView withCurrentState(ContainerState currentState) { + this.currentState = currentState; + return this; + } + + /** + * Get the previousState property: Previous container instance state. + * + * @return the previousState value. + */ + public ContainerState previousState() { + return this.previousState; + } + + /** + * Set the previousState property: Previous container instance state. + * + * @param previousState the previousState value to set. + * @return the ContainerInstanceView object itself. + */ + public ContainerInstanceView withPreviousState(ContainerState previousState) { + this.previousState = previousState; + return this; + } + + /** + * Get the events property: The events of this container instance. + * + * @return the events value. + */ + public List events() { + return this.events; + } + + /** + * Set the events property: The events of this container instance. + * + * @param events the events value to set. + * @return the ContainerInstanceView object itself. + */ + public ContainerInstanceView withEvents(List events) { + this.events = events; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (currentState() != null) { + currentState().validate(); + } + if (previousState() != null) { + previousState().validate(); + } + if (events() != null) { + events().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ContainerLabel.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ContainerLabel.java new file mode 100644 index 000000000000..8800824c20e3 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ContainerLabel.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a container label. */ +@Fluent +public final class ContainerLabel { + /* + * The name of the container label. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The value of the container label. + */ + @JsonProperty(value = "value", required = true) + private String value; + + /** Creates an instance of ContainerLabel class. */ + public ContainerLabel() { + } + + /** + * Get the name property: The name of the container label. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the container label. + * + * @param name the name value to set. + * @return the ContainerLabel object itself. + */ + public ContainerLabel withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value property: The value of the container label. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The value of the container label. + * + * @param value the value value to set. + * @return the ContainerLabel object itself. + */ + public ContainerLabel withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model ContainerLabel")); + } + if (value() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model ContainerLabel")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ContainerLabel.class); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ContainerLogs.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ContainerLogs.java new file mode 100644 index 000000000000..838d5b57ba8f --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ContainerLogs.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.servicefabricmesh.models; + +import com.azure.resourcemanager.servicefabricmesh.fluent.models.ContainerLogsInner; + +/** An immutable client-side representation of ContainerLogs. */ +public interface ContainerLogs { + /** + * Gets the content property: Container logs. + * + * @return the content value. + */ + String content(); + + /** + * Gets the inner com.azure.resourcemanager.servicefabricmesh.fluent.models.ContainerLogsInner object. + * + * @return the inner object. + */ + ContainerLogsInner innerModel(); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ContainerState.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ContainerState.java new file mode 100644 index 000000000000..aca8b29b8e86 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ContainerState.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The container state. */ +@Fluent +public final class ContainerState { + /* + * The state of this container + */ + @JsonProperty(value = "state") + private String state; + + /* + * Date/time when the container state started. + */ + @JsonProperty(value = "startTime") + private OffsetDateTime startTime; + + /* + * The container exit code. + */ + @JsonProperty(value = "exitCode") + private String exitCode; + + /* + * Date/time when the container state finished. + */ + @JsonProperty(value = "finishTime") + private OffsetDateTime finishTime; + + /* + * Human-readable status of this state. + */ + @JsonProperty(value = "detailStatus") + private String detailStatus; + + /** Creates an instance of ContainerState class. */ + public ContainerState() { + } + + /** + * Get the state property: The state of this container. + * + * @return the state value. + */ + public String state() { + return this.state; + } + + /** + * Set the state property: The state of this container. + * + * @param state the state value to set. + * @return the ContainerState object itself. + */ + public ContainerState withState(String state) { + this.state = state; + return this; + } + + /** + * Get the startTime property: Date/time when the container state started. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime property: Date/time when the container state started. + * + * @param startTime the startTime value to set. + * @return the ContainerState object itself. + */ + public ContainerState withStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the exitCode property: The container exit code. + * + * @return the exitCode value. + */ + public String exitCode() { + return this.exitCode; + } + + /** + * Set the exitCode property: The container exit code. + * + * @param exitCode the exitCode value to set. + * @return the ContainerState object itself. + */ + public ContainerState withExitCode(String exitCode) { + this.exitCode = exitCode; + return this; + } + + /** + * Get the finishTime property: Date/time when the container state finished. + * + * @return the finishTime value. + */ + public OffsetDateTime finishTime() { + return this.finishTime; + } + + /** + * Set the finishTime property: Date/time when the container state finished. + * + * @param finishTime the finishTime value to set. + * @return the ContainerState object itself. + */ + public ContainerState withFinishTime(OffsetDateTime finishTime) { + this.finishTime = finishTime; + return this; + } + + /** + * Get the detailStatus property: Human-readable status of this state. + * + * @return the detailStatus value. + */ + public String detailStatus() { + return this.detailStatus; + } + + /** + * Set the detailStatus property: Human-readable status of this state. + * + * @param detailStatus the detailStatus value to set. + * @return the ContainerState object itself. + */ + public ContainerState withDetailStatus(String detailStatus) { + this.detailStatus = detailStatus; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/DiagnosticsDescription.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/DiagnosticsDescription.java new file mode 100644 index 000000000000..ab3e58b7f595 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/DiagnosticsDescription.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.servicefabricmesh.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes the diagnostics options available. */ +@Fluent +public final class DiagnosticsDescription { + /* + * List of supported sinks that can be referenced. + */ + @JsonProperty(value = "sinks") + private List sinks; + + /* + * Status of whether or not sinks are enabled. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * The sinks to be used if diagnostics is enabled. Sink choices can be overridden at the service and code package + * level. + */ + @JsonProperty(value = "defaultSinkRefs") + private List defaultSinkRefs; + + /** Creates an instance of DiagnosticsDescription class. */ + public DiagnosticsDescription() { + } + + /** + * Get the sinks property: List of supported sinks that can be referenced. + * + * @return the sinks value. + */ + public List sinks() { + return this.sinks; + } + + /** + * Set the sinks property: List of supported sinks that can be referenced. + * + * @param sinks the sinks value to set. + * @return the DiagnosticsDescription object itself. + */ + public DiagnosticsDescription withSinks(List sinks) { + this.sinks = sinks; + return this; + } + + /** + * Get the enabled property: Status of whether or not sinks are enabled. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Status of whether or not sinks are enabled. + * + * @param enabled the enabled value to set. + * @return the DiagnosticsDescription object itself. + */ + public DiagnosticsDescription withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the defaultSinkRefs property: The sinks to be used if diagnostics is enabled. Sink choices can be overridden + * at the service and code package level. + * + * @return the defaultSinkRefs value. + */ + public List defaultSinkRefs() { + return this.defaultSinkRefs; + } + + /** + * Set the defaultSinkRefs property: The sinks to be used if diagnostics is enabled. Sink choices can be overridden + * at the service and code package level. + * + * @param defaultSinkRefs the defaultSinkRefs value to set. + * @return the DiagnosticsDescription object itself. + */ + public DiagnosticsDescription withDefaultSinkRefs(List defaultSinkRefs) { + this.defaultSinkRefs = defaultSinkRefs; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sinks() != null) { + sinks().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/DiagnosticsRef.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/DiagnosticsRef.java new file mode 100644 index 000000000000..1a113db8ccba --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/DiagnosticsRef.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Reference to sinks in DiagnosticsDescription. */ +@Fluent +public final class DiagnosticsRef { + /* + * Status of whether or not sinks are enabled. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * List of sinks to be used if enabled. References the list of sinks in DiagnosticsDescription. + */ + @JsonProperty(value = "sinkRefs") + private List sinkRefs; + + /** Creates an instance of DiagnosticsRef class. */ + public DiagnosticsRef() { + } + + /** + * Get the enabled property: Status of whether or not sinks are enabled. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Status of whether or not sinks are enabled. + * + * @param enabled the enabled value to set. + * @return the DiagnosticsRef object itself. + */ + public DiagnosticsRef withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the sinkRefs property: List of sinks to be used if enabled. References the list of sinks in + * DiagnosticsDescription. + * + * @return the sinkRefs value. + */ + public List sinkRefs() { + return this.sinkRefs; + } + + /** + * Set the sinkRefs property: List of sinks to be used if enabled. References the list of sinks in + * DiagnosticsDescription. + * + * @param sinkRefs the sinkRefs value to set. + * @return the DiagnosticsRef object itself. + */ + public DiagnosticsRef withSinkRefs(List sinkRefs) { + this.sinkRefs = sinkRefs; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/DiagnosticsSinkKind.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/DiagnosticsSinkKind.java new file mode 100644 index 000000000000..9266df10e9db --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/DiagnosticsSinkKind.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The kind of DiagnosticsSink. */ +public final class DiagnosticsSinkKind extends ExpandableStringEnum { + /** Static value Invalid for DiagnosticsSinkKind. */ + public static final DiagnosticsSinkKind INVALID = fromString("Invalid"); + + /** Static value AzureInternalMonitoringPipeline for DiagnosticsSinkKind. */ + public static final DiagnosticsSinkKind AZURE_INTERNAL_MONITORING_PIPELINE = + fromString("AzureInternalMonitoringPipeline"); + + /** + * Creates a new instance of DiagnosticsSinkKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DiagnosticsSinkKind() { + } + + /** + * Creates or finds a DiagnosticsSinkKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding DiagnosticsSinkKind. + */ + @JsonCreator + public static DiagnosticsSinkKind fromString(String name) { + return fromString(name, DiagnosticsSinkKind.class); + } + + /** + * Gets known DiagnosticsSinkKind values. + * + * @return known DiagnosticsSinkKind values. + */ + public static Collection values() { + return values(DiagnosticsSinkKind.class); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/DiagnosticsSinkProperties.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/DiagnosticsSinkProperties.java new file mode 100644 index 000000000000..0aaf1a19a7a6 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/DiagnosticsSinkProperties.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Properties of a DiagnosticsSink. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "kind", + defaultImpl = DiagnosticsSinkProperties.class) +@JsonTypeName("DiagnosticsSinkProperties") +@JsonSubTypes({ + @JsonSubTypes.Type( + name = "AzureInternalMonitoringPipeline", + value = AzureInternalMonitoringPipelineSinkDescription.class) +}) +@Fluent +public class DiagnosticsSinkProperties { + /* + * Name of the sink. This value is referenced by DiagnosticsReferenceDescription + */ + @JsonProperty(value = "name") + private String name; + + /* + * A description of the sink. + */ + @JsonProperty(value = "description") + private String description; + + /** Creates an instance of DiagnosticsSinkProperties class. */ + public DiagnosticsSinkProperties() { + } + + /** + * Get the name property: Name of the sink. This value is referenced by DiagnosticsReferenceDescription. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the sink. This value is referenced by DiagnosticsReferenceDescription. + * + * @param name the name value to set. + * @return the DiagnosticsSinkProperties object itself. + */ + public DiagnosticsSinkProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get the description property: A description of the sink. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: A description of the sink. + * + * @param description the description value to set. + * @return the DiagnosticsSinkProperties object itself. + */ + public DiagnosticsSinkProperties 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/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/Dimension.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/Dimension.java new file mode 100644 index 000000000000..3c2e03247f99 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/Dimension.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.servicefabricmesh.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Dimension of a resource metric. For e.g. instance specific HTTP requests for a web app, where instance name is + * dimension of the metric HTTP request. + */ +@Fluent +public final class Dimension { + /* + * The name property. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The displayName property. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * The internalName property. + */ + @JsonProperty(value = "internalName") + private String internalName; + + /* + * The toBeExportedForShoebox property. + */ + @JsonProperty(value = "toBeExportedForShoebox") + private Boolean toBeExportedForShoebox; + + /** Creates an instance of Dimension class. */ + public Dimension() { + } + + /** + * Get the name property: The name property. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name property. + * + * @param name the name value to set. + * @return the Dimension object itself. + */ + public Dimension withName(String name) { + this.name = name; + return this; + } + + /** + * Get the displayName property: The displayName property. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The displayName property. + * + * @param displayName the displayName value to set. + * @return the Dimension object itself. + */ + public Dimension withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the internalName property: The internalName property. + * + * @return the internalName value. + */ + public String internalName() { + return this.internalName; + } + + /** + * Set the internalName property: The internalName property. + * + * @param internalName the internalName value to set. + * @return the Dimension object itself. + */ + public Dimension withInternalName(String internalName) { + this.internalName = internalName; + return this; + } + + /** + * Get the toBeExportedForShoebox property: The toBeExportedForShoebox property. + * + * @return the toBeExportedForShoebox value. + */ + public Boolean toBeExportedForShoebox() { + return this.toBeExportedForShoebox; + } + + /** + * Set the toBeExportedForShoebox property: The toBeExportedForShoebox property. + * + * @param toBeExportedForShoebox the toBeExportedForShoebox value to set. + * @return the Dimension object itself. + */ + public Dimension withToBeExportedForShoebox(Boolean toBeExportedForShoebox) { + this.toBeExportedForShoebox = toBeExportedForShoebox; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/EndpointProperties.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/EndpointProperties.java new file mode 100644 index 000000000000..bdc0c4d6e347 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/EndpointProperties.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a container endpoint. */ +@Fluent +public final class EndpointProperties { + /* + * The name of the endpoint. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Port used by the container. + */ + @JsonProperty(value = "port") + private Integer port; + + /** Creates an instance of EndpointProperties class. */ + public EndpointProperties() { + } + + /** + * Get the name property: The name of the endpoint. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the endpoint. + * + * @param name the name value to set. + * @return the EndpointProperties object itself. + */ + public EndpointProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get the port property: Port used by the container. + * + * @return the port value. + */ + public Integer port() { + return this.port; + } + + /** + * Set the port property: Port used by the container. + * + * @param port the port value to set. + * @return the EndpointProperties object itself. + */ + public EndpointProperties withPort(Integer port) { + this.port = port; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model EndpointProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(EndpointProperties.class); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/EndpointRef.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/EndpointRef.java new file mode 100644 index 000000000000..5af1cb1dbfcc --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/EndpointRef.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.servicefabricmesh.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a reference to a service endpoint. */ +@Fluent +public final class EndpointRef { + /* + * Name of the endpoint. + */ + @JsonProperty(value = "name") + private String name; + + /** Creates an instance of EndpointRef class. */ + public EndpointRef() { + } + + /** + * Get the name property: Name of the endpoint. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the endpoint. + * + * @param name the name value to set. + * @return the EndpointRef object itself. + */ + public EndpointRef withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/EnvironmentVariable.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/EnvironmentVariable.java new file mode 100644 index 000000000000..85e301cf26db --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/EnvironmentVariable.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.servicefabricmesh.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes an environment variable for the container. */ +@Fluent +public final class EnvironmentVariable { + /* + * The name of the environment variable. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The value of the environment variable. + */ + @JsonProperty(value = "value") + private String value; + + /** Creates an instance of EnvironmentVariable class. */ + public EnvironmentVariable() { + } + + /** + * Get the name property: The name of the environment variable. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the environment variable. + * + * @param name the name value to set. + * @return the EnvironmentVariable object itself. + */ + public EnvironmentVariable withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value property: The value of the environment variable. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The value of the environment variable. + * + * @param value the value value to set. + * @return the EnvironmentVariable object itself. + */ + public EnvironmentVariable withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ErrorErrorModel.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ErrorErrorModel.java new file mode 100644 index 000000000000..3d397293f712 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ErrorErrorModel.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.servicefabricmesh.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.exception.ManagementError; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The error details. */ +@Immutable +public final class ErrorErrorModel extends ManagementError { + /* + * The innerError property. + */ + @JsonProperty(value = "innerError", access = JsonProperty.Access.WRITE_ONLY) + private String innerError; + + /** Creates an instance of ErrorErrorModel class. */ + public ErrorErrorModel() { + } + + /** + * Get the innerError property: The innerError property. + * + * @return the innerError value. + */ + public String getInnerError() { + return this.innerError; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ErrorErrorModelException.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ErrorErrorModelException.java new file mode 100644 index 000000000000..8d23baf4337f --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ErrorErrorModelException.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.models; + +import com.azure.core.http.HttpResponse; +import com.azure.core.management.exception.ManagementException; + +/** Exception thrown for an invalid response with ErrorErrorModel information. */ +public final class ErrorErrorModelException extends ManagementException { + /** + * Initializes a new instance of the ErrorErrorModelException class. + * + * @param message the exception message or the response content if a message is not available. + * @param response the HTTP response. + */ + public ErrorErrorModelException(String message, HttpResponse response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorErrorModelException class. + * + * @param message the exception message or the response content if a message is not available. + * @param response the HTTP response. + * @param value the deserialized response value. + */ + public ErrorErrorModelException(String message, HttpResponse response, ErrorErrorModel value) { + super(message, response, value); + } + + /** {@inheritDoc} */ + @Override + public ErrorErrorModel getValue() { + return (ErrorErrorModel) super.getValue(); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/GatewayDestination.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/GatewayDestination.java new file mode 100644 index 000000000000..c065be685097 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/GatewayDestination.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes destination endpoint for routing traffic. */ +@Fluent +public final class GatewayDestination { + /* + * Name of the service fabric Mesh application. + */ + @JsonProperty(value = "applicationName", required = true) + private String applicationName; + + /* + * service that contains the endpoint. + */ + @JsonProperty(value = "serviceName", required = true) + private String serviceName; + + /* + * name of the endpoint in the service. + */ + @JsonProperty(value = "endpointName", required = true) + private String endpointName; + + /** Creates an instance of GatewayDestination class. */ + public GatewayDestination() { + } + + /** + * Get the applicationName property: Name of the service fabric Mesh application. + * + * @return the applicationName value. + */ + public String applicationName() { + return this.applicationName; + } + + /** + * Set the applicationName property: Name of the service fabric Mesh application. + * + * @param applicationName the applicationName value to set. + * @return the GatewayDestination object itself. + */ + public GatewayDestination withApplicationName(String applicationName) { + this.applicationName = applicationName; + return this; + } + + /** + * Get the serviceName property: service that contains the endpoint. + * + * @return the serviceName value. + */ + public String serviceName() { + return this.serviceName; + } + + /** + * Set the serviceName property: service that contains the endpoint. + * + * @param serviceName the serviceName value to set. + * @return the GatewayDestination object itself. + */ + public GatewayDestination withServiceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + + /** + * Get the endpointName property: name of the endpoint in the service. + * + * @return the endpointName value. + */ + public String endpointName() { + return this.endpointName; + } + + /** + * Set the endpointName property: name of the endpoint in the service. + * + * @param endpointName the endpointName value to set. + * @return the GatewayDestination object itself. + */ + public GatewayDestination withEndpointName(String endpointName) { + this.endpointName = endpointName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (applicationName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property applicationName in model GatewayDestination")); + } + if (serviceName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property serviceName in model GatewayDestination")); + } + if (endpointName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property endpointName in model GatewayDestination")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GatewayDestination.class); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/GatewayProperties.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/GatewayProperties.java new file mode 100644 index 000000000000..6265209f6dd5 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/GatewayProperties.java @@ -0,0 +1,225 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes properties of a gateway resource. */ +@Fluent +public class GatewayProperties { + /* + * User readable description of the gateway. + */ + @JsonProperty(value = "description") + private String description; + + /* + * Network the gateway should listen on for requests. + */ + @JsonProperty(value = "sourceNetwork", required = true) + private NetworkRef sourceNetwork; + + /* + * Network that the Application is using. + */ + @JsonProperty(value = "destinationNetwork", required = true) + private NetworkRef destinationNetwork; + + /* + * Configuration for tcp connectivity for this gateway. + */ + @JsonProperty(value = "tcp") + private List tcp; + + /* + * Configuration for http connectivity for this gateway. + */ + @JsonProperty(value = "http") + private List http; + + /* + * Status of the resource. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private ResourceStatus status; + + /* + * Gives additional information about the current status of the gateway. + */ + @JsonProperty(value = "statusDetails", access = JsonProperty.Access.WRITE_ONLY) + private String statusDetails; + + /* + * IP address of the gateway. This is populated in the response and is ignored for incoming requests. + */ + @JsonProperty(value = "ipAddress", access = JsonProperty.Access.WRITE_ONLY) + private String ipAddress; + + /** Creates an instance of GatewayProperties class. */ + public GatewayProperties() { + } + + /** + * Get the description property: User readable description of the gateway. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: User readable description of the gateway. + * + * @param description the description value to set. + * @return the GatewayProperties object itself. + */ + public GatewayProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the sourceNetwork property: Network the gateway should listen on for requests. + * + * @return the sourceNetwork value. + */ + public NetworkRef sourceNetwork() { + return this.sourceNetwork; + } + + /** + * Set the sourceNetwork property: Network the gateway should listen on for requests. + * + * @param sourceNetwork the sourceNetwork value to set. + * @return the GatewayProperties object itself. + */ + public GatewayProperties withSourceNetwork(NetworkRef sourceNetwork) { + this.sourceNetwork = sourceNetwork; + return this; + } + + /** + * Get the destinationNetwork property: Network that the Application is using. + * + * @return the destinationNetwork value. + */ + public NetworkRef destinationNetwork() { + return this.destinationNetwork; + } + + /** + * Set the destinationNetwork property: Network that the Application is using. + * + * @param destinationNetwork the destinationNetwork value to set. + * @return the GatewayProperties object itself. + */ + public GatewayProperties withDestinationNetwork(NetworkRef destinationNetwork) { + this.destinationNetwork = destinationNetwork; + return this; + } + + /** + * Get the tcp property: Configuration for tcp connectivity for this gateway. + * + * @return the tcp value. + */ + public List tcp() { + return this.tcp; + } + + /** + * Set the tcp property: Configuration for tcp connectivity for this gateway. + * + * @param tcp the tcp value to set. + * @return the GatewayProperties object itself. + */ + public GatewayProperties withTcp(List tcp) { + this.tcp = tcp; + return this; + } + + /** + * Get the http property: Configuration for http connectivity for this gateway. + * + * @return the http value. + */ + public List http() { + return this.http; + } + + /** + * Set the http property: Configuration for http connectivity for this gateway. + * + * @param http the http value to set. + * @return the GatewayProperties object itself. + */ + public GatewayProperties withHttp(List http) { + this.http = http; + return this; + } + + /** + * Get the status property: Status of the resource. + * + * @return the status value. + */ + public ResourceStatus status() { + return this.status; + } + + /** + * Get the statusDetails property: Gives additional information about the current status of the gateway. + * + * @return the statusDetails value. + */ + public String statusDetails() { + return this.statusDetails; + } + + /** + * Get the ipAddress property: IP address of the gateway. This is populated in the response and is ignored for + * incoming requests. + * + * @return the ipAddress value. + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sourceNetwork() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property sourceNetwork in model GatewayProperties")); + } else { + sourceNetwork().validate(); + } + if (destinationNetwork() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property destinationNetwork in model GatewayProperties")); + } else { + destinationNetwork().validate(); + } + if (tcp() != null) { + tcp().forEach(e -> e.validate()); + } + if (http() != null) { + http().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GatewayProperties.class); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/GatewayResourceDescription.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/GatewayResourceDescription.java new file mode 100644 index 000000000000..b7810d0fa3ad --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/GatewayResourceDescription.java @@ -0,0 +1,276 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicefabricmesh.fluent.models.GatewayResourceDescriptionInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of GatewayResourceDescription. */ +public interface GatewayResourceDescription { + /** + * 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 description property: User readable description of the gateway. + * + * @return the description value. + */ + String description(); + + /** + * Gets the sourceNetwork property: Network the gateway should listen on for requests. + * + * @return the sourceNetwork value. + */ + NetworkRef sourceNetwork(); + + /** + * Gets the destinationNetwork property: Network that the Application is using. + * + * @return the destinationNetwork value. + */ + NetworkRef destinationNetwork(); + + /** + * Gets the tcp property: Configuration for tcp connectivity for this gateway. + * + * @return the tcp value. + */ + List tcp(); + + /** + * Gets the http property: Configuration for http connectivity for this gateway. + * + * @return the http value. + */ + List http(); + + /** + * Gets the status property: Status of the resource. + * + * @return the status value. + */ + ResourceStatus status(); + + /** + * Gets the statusDetails property: Gives additional information about the current status of the gateway. + * + * @return the statusDetails value. + */ + String statusDetails(); + + /** + * Gets the ipAddress property: IP address of the gateway. This is populated in the response and is ignored for + * incoming requests. + * + * @return the ipAddress value. + */ + String ipAddress(); + + /** + * Gets the provisioningState property: State of the resource. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * 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.servicefabricmesh.fluent.models.GatewayResourceDescriptionInner object. + * + * @return the inner object. + */ + GatewayResourceDescriptionInner innerModel(); + + /** The entirety of the GatewayResourceDescription definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithSourceNetwork, + DefinitionStages.WithDestinationNetwork, + DefinitionStages.WithCreate { + } + /** The GatewayResourceDescription definition stages. */ + interface DefinitionStages { + /** The first stage of the GatewayResourceDescription definition. */ + interface Blank extends WithLocation { + } + /** The stage of the GatewayResourceDescription 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 GatewayResourceDescription definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName Azure resource group name. + * @return the next definition stage. + */ + WithSourceNetwork withExistingResourceGroup(String resourceGroupName); + } + /** The stage of the GatewayResourceDescription definition allowing to specify sourceNetwork. */ + interface WithSourceNetwork { + /** + * Specifies the sourceNetwork property: Network the gateway should listen on for requests.. + * + * @param sourceNetwork Network the gateway should listen on for requests. + * @return the next definition stage. + */ + WithDestinationNetwork withSourceNetwork(NetworkRef sourceNetwork); + } + /** The stage of the GatewayResourceDescription definition allowing to specify destinationNetwork. */ + interface WithDestinationNetwork { + /** + * Specifies the destinationNetwork property: Network that the Application is using.. + * + * @param destinationNetwork Network that the Application is using. + * @return the next definition stage. + */ + WithCreate withDestinationNetwork(NetworkRef destinationNetwork); + } + /** + * The stage of the GatewayResourceDescription 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.WithDescription, + DefinitionStages.WithTcp, + DefinitionStages.WithHttp { + /** + * Executes the create request. + * + * @return the created resource. + */ + GatewayResourceDescription create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + GatewayResourceDescription create(Context context); + } + /** The stage of the GatewayResourceDescription 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 GatewayResourceDescription definition allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: User readable description of the gateway.. + * + * @param description User readable description of the gateway. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + /** The stage of the GatewayResourceDescription definition allowing to specify tcp. */ + interface WithTcp { + /** + * Specifies the tcp property: Configuration for tcp connectivity for this gateway.. + * + * @param tcp Configuration for tcp connectivity for this gateway. + * @return the next definition stage. + */ + WithCreate withTcp(List tcp); + } + /** The stage of the GatewayResourceDescription definition allowing to specify http. */ + interface WithHttp { + /** + * Specifies the http property: Configuration for http connectivity for this gateway.. + * + * @param http Configuration for http connectivity for this gateway. + * @return the next definition stage. + */ + WithCreate withHttp(List http); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + GatewayResourceDescription refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + GatewayResourceDescription refresh(Context context); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/GatewayResourceDescriptionList.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/GatewayResourceDescriptionList.java new file mode 100644 index 000000000000..2366e9deef04 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/GatewayResourceDescriptionList.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.servicefabricmesh.fluent.models.GatewayResourceDescriptionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A pageable list of gateway resources. */ +@Fluent +public final class GatewayResourceDescriptionList { + /* + * One page of the list. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URI to fetch the next page of the list. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of GatewayResourceDescriptionList class. */ + public GatewayResourceDescriptionList() { + } + + /** + * Get the value property: One page of the list. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: One page of the list. + * + * @param value the value value to set. + * @return the GatewayResourceDescriptionList object itself. + */ + public GatewayResourceDescriptionList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URI to fetch the next page of the list. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URI to fetch the next page of the list. + * + * @param nextLink the nextLink value to set. + * @return the GatewayResourceDescriptionList object itself. + */ + public GatewayResourceDescriptionList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/Gateways.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/Gateways.java new file mode 100644 index 000000000000..7b45caf1da49 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/Gateways.java @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.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 Gateways. */ +public interface Gateways { + /** + * Gets the gateway resource with the given name. + * + *

Gets the information about the gateway resource with the given name. The information include the description + * and other properties of the gateway. + * + * @param resourceGroupName Azure resource group name. + * @param gatewayResourceName The identity of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about the gateway resource with the given name along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String gatewayResourceName, Context context); + + /** + * Gets the gateway resource with the given name. + * + *

Gets the information about the gateway resource with the given name. The information include the description + * and other properties of the gateway. + * + * @param resourceGroupName Azure resource group name. + * @param gatewayResourceName The identity of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about the gateway resource with the given name. + */ + GatewayResourceDescription getByResourceGroup(String resourceGroupName, String gatewayResourceName); + + /** + * Deletes the gateway resource. + * + *

Deletes the gateway resource identified by the name. + * + * @param resourceGroupName Azure resource group name. + * @param gatewayResourceName The identity of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByResourceGroupWithResponse( + String resourceGroupName, String gatewayResourceName, Context context); + + /** + * Deletes the gateway resource. + * + *

Deletes the gateway resource identified by the name. + * + * @param resourceGroupName Azure resource group name. + * @param gatewayResourceName The identity of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 gatewayResourceName); + + /** + * Gets all the gateway resources in a given resource group. + * + *

Gets the information about all gateway resources in a given resource group. The information include the + * description and other properties of the Gateway. + * + * @param resourceGroupName Azure resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about all gateway resources in a given resource group as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all the gateway resources in a given resource group. + * + *

Gets the information about all gateway resources in a given resource group. The information include the + * description and other properties of the Gateway. + * + * @param resourceGroupName Azure resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about all gateway resources in a given resource group as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all the gateway resources in a given subscription. + * + *

Gets the information about all gateway resources in a given resource group. The information include the + * description and other properties of the gateway. + * + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about all gateway resources in a given resource group as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(); + + /** + * Gets all the gateway resources in a given subscription. + * + *

Gets the information about all gateway resources in a given resource group. The information include the + * description and other properties of the gateway. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about all gateway resources in a given resource group as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Gets the gateway resource with the given name. + * + *

Gets the information about the gateway resource with the given name. The information include the description + * and other properties of the gateway. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about the gateway resource with the given name along with {@link Response}. + */ + GatewayResourceDescription getById(String id); + + /** + * Gets the gateway resource with the given name. + * + *

Gets the information about the gateway resource with the given name. The information include the description + * and other properties of the gateway. + * + * @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.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about the gateway resource with the given name along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the gateway resource. + * + *

Deletes the gateway resource identified by the name. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 gateway resource. + * + *

Deletes the gateway resource identified by the name. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new GatewayResourceDescription resource. + * + * @param name resource name. + * @return the first stage of the new GatewayResourceDescription definition. + */ + GatewayResourceDescription.DefinitionStages.Blank define(String name); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/HeaderMatchType.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/HeaderMatchType.java new file mode 100644 index 000000000000..1268175be3cf --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/HeaderMatchType.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** how to match header value. */ +public final class HeaderMatchType extends ExpandableStringEnum { + /** Static value exact for HeaderMatchType. */ + public static final HeaderMatchType EXACT = fromString("exact"); + + /** + * Creates a new instance of HeaderMatchType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public HeaderMatchType() { + } + + /** + * Creates or finds a HeaderMatchType from its string representation. + * + * @param name a name to look for. + * @return the corresponding HeaderMatchType. + */ + @JsonCreator + public static HeaderMatchType fromString(String name) { + return fromString(name, HeaderMatchType.class); + } + + /** + * Gets known HeaderMatchType values. + * + * @return known HeaderMatchType values. + */ + public static Collection values() { + return values(HeaderMatchType.class); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/HealthState.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/HealthState.java new file mode 100644 index 000000000000..2278b5d955a8 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/HealthState.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The health state of a Service Fabric entity such as Cluster, Node, Application, Service, Partition, Replica etc. */ +public final class HealthState extends ExpandableStringEnum { + /** Static value Invalid for HealthState. */ + public static final HealthState INVALID = fromString("Invalid"); + + /** Static value Ok for HealthState. */ + public static final HealthState OK = fromString("Ok"); + + /** Static value Warning for HealthState. */ + public static final HealthState WARNING = fromString("Warning"); + + /** Static value Error for HealthState. */ + public static final HealthState ERROR = fromString("Error"); + + /** Static value Unknown for HealthState. */ + public static final HealthState UNKNOWN = fromString("Unknown"); + + /** + * Creates a new instance of HealthState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public HealthState() { + } + + /** + * Creates or finds a HealthState from its string representation. + * + * @param name a name to look for. + * @return the corresponding HealthState. + */ + @JsonCreator + public static HealthState fromString(String name) { + return fromString(name, HealthState.class); + } + + /** + * Gets known HealthState values. + * + * @return known HealthState values. + */ + public static Collection values() { + return values(HealthState.class); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/HttpConfig.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/HttpConfig.java new file mode 100644 index 000000000000..899e44efe579 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/HttpConfig.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes the http configuration for external connectivity for this network. */ +@Fluent +public final class HttpConfig { + /* + * http gateway config name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Specifies the port at which the service endpoint below needs to be exposed. + */ + @JsonProperty(value = "port", required = true) + private int port; + + /* + * description for routing. + */ + @JsonProperty(value = "hosts", required = true) + private List hosts; + + /** Creates an instance of HttpConfig class. */ + public HttpConfig() { + } + + /** + * Get the name property: http gateway config name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: http gateway config name. + * + * @param name the name value to set. + * @return the HttpConfig object itself. + */ + public HttpConfig withName(String name) { + this.name = name; + return this; + } + + /** + * Get the port property: Specifies the port at which the service endpoint below needs to be exposed. + * + * @return the port value. + */ + public int port() { + return this.port; + } + + /** + * Set the port property: Specifies the port at which the service endpoint below needs to be exposed. + * + * @param port the port value to set. + * @return the HttpConfig object itself. + */ + public HttpConfig withPort(int port) { + this.port = port; + return this; + } + + /** + * Get the hosts property: description for routing. + * + * @return the hosts value. + */ + public List hosts() { + return this.hosts; + } + + /** + * Set the hosts property: description for routing. + * + * @param hosts the hosts value to set. + * @return the HttpConfig object itself. + */ + public HttpConfig withHosts(List hosts) { + this.hosts = hosts; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model HttpConfig")); + } + if (hosts() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property hosts in model HttpConfig")); + } else { + hosts().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(HttpConfig.class); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/HttpHostConfig.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/HttpHostConfig.java new file mode 100644 index 000000000000..f1112e804147 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/HttpHostConfig.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes the hostname properties for http routing. */ +@Fluent +public final class HttpHostConfig { + /* + * http hostname config name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Route information to use for routing. Routes are processed in the order they are specified. Specify routes that + * are more specific before routes that can handle general cases. + */ + @JsonProperty(value = "routes", required = true) + private List routes; + + /** Creates an instance of HttpHostConfig class. */ + public HttpHostConfig() { + } + + /** + * Get the name property: http hostname config name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: http hostname config name. + * + * @param name the name value to set. + * @return the HttpHostConfig object itself. + */ + public HttpHostConfig withName(String name) { + this.name = name; + return this; + } + + /** + * Get the routes property: Route information to use for routing. Routes are processed in the order they are + * specified. Specify routes that are more specific before routes that can handle general cases. + * + * @return the routes value. + */ + public List routes() { + return this.routes; + } + + /** + * Set the routes property: Route information to use for routing. Routes are processed in the order they are + * specified. Specify routes that are more specific before routes that can handle general cases. + * + * @param routes the routes value to set. + * @return the HttpHostConfig object itself. + */ + public HttpHostConfig withRoutes(List routes) { + this.routes = routes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model HttpHostConfig")); + } + if (routes() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property routes in model HttpHostConfig")); + } else { + routes().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(HttpHostConfig.class); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/HttpRouteConfig.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/HttpRouteConfig.java new file mode 100644 index 000000000000..e69bf1962cd4 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/HttpRouteConfig.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.servicefabricmesh.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the hostname properties for http routing. */ +@Fluent +public final class HttpRouteConfig { + /* + * http route name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Describes a rule for http route matching. + */ + @JsonProperty(value = "match", required = true) + private HttpRouteMatchRule match; + + /* + * Describes destination endpoint for routing traffic. + */ + @JsonProperty(value = "destination", required = true) + private GatewayDestination destination; + + /** Creates an instance of HttpRouteConfig class. */ + public HttpRouteConfig() { + } + + /** + * Get the name property: http route name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: http route name. + * + * @param name the name value to set. + * @return the HttpRouteConfig object itself. + */ + public HttpRouteConfig withName(String name) { + this.name = name; + return this; + } + + /** + * Get the match property: Describes a rule for http route matching. + * + * @return the match value. + */ + public HttpRouteMatchRule match() { + return this.match; + } + + /** + * Set the match property: Describes a rule for http route matching. + * + * @param match the match value to set. + * @return the HttpRouteConfig object itself. + */ + public HttpRouteConfig withMatch(HttpRouteMatchRule match) { + this.match = match; + return this; + } + + /** + * Get the destination property: Describes destination endpoint for routing traffic. + * + * @return the destination value. + */ + public GatewayDestination destination() { + return this.destination; + } + + /** + * Set the destination property: Describes destination endpoint for routing traffic. + * + * @param destination the destination value to set. + * @return the HttpRouteConfig object itself. + */ + public HttpRouteConfig withDestination(GatewayDestination destination) { + this.destination = destination; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model HttpRouteConfig")); + } + if (match() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property match in model HttpRouteConfig")); + } else { + match().validate(); + } + if (destination() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property destination in model HttpRouteConfig")); + } else { + destination().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(HttpRouteConfig.class); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/HttpRouteMatchHeader.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/HttpRouteMatchHeader.java new file mode 100644 index 000000000000..8b30797198fd --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/HttpRouteMatchHeader.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.servicefabricmesh.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes header information for http route matching. */ +@Fluent +public final class HttpRouteMatchHeader { + /* + * Name of header to match in request. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Value of header to match in request. + */ + @JsonProperty(value = "value") + private String value; + + /* + * how to match header value + */ + @JsonProperty(value = "type") + private HeaderMatchType type; + + /** Creates an instance of HttpRouteMatchHeader class. */ + public HttpRouteMatchHeader() { + } + + /** + * Get the name property: Name of header to match in request. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of header to match in request. + * + * @param name the name value to set. + * @return the HttpRouteMatchHeader object itself. + */ + public HttpRouteMatchHeader withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value property: Value of header to match in request. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Value of header to match in request. + * + * @param value the value value to set. + * @return the HttpRouteMatchHeader object itself. + */ + public HttpRouteMatchHeader withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the type property: how to match header value. + * + * @return the type value. + */ + public HeaderMatchType type() { + return this.type; + } + + /** + * Set the type property: how to match header value. + * + * @param type the type value to set. + * @return the HttpRouteMatchHeader object itself. + */ + public HttpRouteMatchHeader withType(HeaderMatchType type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model HttpRouteMatchHeader")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(HttpRouteMatchHeader.class); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/HttpRouteMatchPath.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/HttpRouteMatchPath.java new file mode 100644 index 000000000000..a48050697391 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/HttpRouteMatchPath.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Path to match for routing. */ +@Fluent +public final class HttpRouteMatchPath { + /* + * Uri path to match for request. + */ + @JsonProperty(value = "value", required = true) + private String value; + + /* + * replacement string for matched part of the Uri. + */ + @JsonProperty(value = "rewrite") + private String rewrite; + + /* + * how to match value in the Uri + */ + @JsonProperty(value = "type", required = true) + private PathMatchType type; + + /** Creates an instance of HttpRouteMatchPath class. */ + public HttpRouteMatchPath() { + } + + /** + * Get the value property: Uri path to match for request. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Uri path to match for request. + * + * @param value the value value to set. + * @return the HttpRouteMatchPath object itself. + */ + public HttpRouteMatchPath withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the rewrite property: replacement string for matched part of the Uri. + * + * @return the rewrite value. + */ + public String rewrite() { + return this.rewrite; + } + + /** + * Set the rewrite property: replacement string for matched part of the Uri. + * + * @param rewrite the rewrite value to set. + * @return the HttpRouteMatchPath object itself. + */ + public HttpRouteMatchPath withRewrite(String rewrite) { + this.rewrite = rewrite; + return this; + } + + /** + * Get the type property: how to match value in the Uri. + * + * @return the type value. + */ + public PathMatchType type() { + return this.type; + } + + /** + * Set the type property: how to match value in the Uri. + * + * @param type the type value to set. + * @return the HttpRouteMatchPath object itself. + */ + public HttpRouteMatchPath withType(PathMatchType type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model HttpRouteMatchPath")); + } + if (type() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property type in model HttpRouteMatchPath")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(HttpRouteMatchPath.class); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/HttpRouteMatchRule.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/HttpRouteMatchRule.java new file mode 100644 index 000000000000..a99a65e272ee --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/HttpRouteMatchRule.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a rule for http route matching. */ +@Fluent +public final class HttpRouteMatchRule { + /* + * Path to match for routing. + */ + @JsonProperty(value = "path", required = true) + private HttpRouteMatchPath path; + + /* + * headers and their values to match in request. + */ + @JsonProperty(value = "headers") + private List headers; + + /** Creates an instance of HttpRouteMatchRule class. */ + public HttpRouteMatchRule() { + } + + /** + * Get the path property: Path to match for routing. + * + * @return the path value. + */ + public HttpRouteMatchPath path() { + return this.path; + } + + /** + * Set the path property: Path to match for routing. + * + * @param path the path value to set. + * @return the HttpRouteMatchRule object itself. + */ + public HttpRouteMatchRule withPath(HttpRouteMatchPath path) { + this.path = path; + return this; + } + + /** + * Get the headers property: headers and their values to match in request. + * + * @return the headers value. + */ + public List headers() { + return this.headers; + } + + /** + * Set the headers property: headers and their values to match in request. + * + * @param headers the headers value to set. + * @return the HttpRouteMatchRule object itself. + */ + public HttpRouteMatchRule withHeaders(List headers) { + this.headers = headers; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (path() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property path in model HttpRouteMatchRule")); + } else { + path().validate(); + } + if (headers() != null) { + headers().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(HttpRouteMatchRule.class); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ImageRegistryCredential.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ImageRegistryCredential.java new file mode 100644 index 000000000000..de4bf5b958c5 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ImageRegistryCredential.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Image registry credential. */ +@Fluent +public final class ImageRegistryCredential { + /* + * Docker image registry server, without protocol such as `http` and `https`. + */ + @JsonProperty(value = "server", required = true) + private String server; + + /* + * The username for the private registry. + */ + @JsonProperty(value = "username", required = true) + private String username; + + /* + * The password for the private registry. The password is required for create or update operations, however it is + * not returned in the get or list operations. + */ + @JsonProperty(value = "password") + private String password; + + /** Creates an instance of ImageRegistryCredential class. */ + public ImageRegistryCredential() { + } + + /** + * Get the server property: Docker image registry server, without protocol such as `http` and `https`. + * + * @return the server value. + */ + public String server() { + return this.server; + } + + /** + * Set the server property: Docker image registry server, without protocol such as `http` and `https`. + * + * @param server the server value to set. + * @return the ImageRegistryCredential object itself. + */ + public ImageRegistryCredential withServer(String server) { + this.server = server; + return this; + } + + /** + * Get the username property: The username for the private registry. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: The username for the private registry. + * + * @param username the username value to set. + * @return the ImageRegistryCredential object itself. + */ + public ImageRegistryCredential withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the password property: The password for the private registry. The password is required for create or update + * operations, however it is not returned in the get or list operations. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Set the password property: The password for the private registry. The password is required for create or update + * operations, however it is not returned in the get or list operations. + * + * @param password the password value to set. + * @return the ImageRegistryCredential object itself. + */ + public ImageRegistryCredential withPassword(String password) { + this.password = password; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (server() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property server in model ImageRegistryCredential")); + } + if (username() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property username in model ImageRegistryCredential")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ImageRegistryCredential.class); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/InlinedValueSecretResourceProperties.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/InlinedValueSecretResourceProperties.java new file mode 100644 index 000000000000..ace695cf70e0 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/InlinedValueSecretResourceProperties.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.servicefabricmesh.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the properties of a secret resource whose value is provided explicitly as plaintext. The secret resource + * may have multiple values, each being uniquely versioned. The secret value of each version is stored encrypted, and + * delivered as plaintext into the context of applications referencing it. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("inlinedValue") +@Fluent +public final class InlinedValueSecretResourceProperties extends SecretResourceProperties { + /** Creates an instance of InlinedValueSecretResourceProperties class. */ + public InlinedValueSecretResourceProperties() { + } + + /** {@inheritDoc} */ + @Override + public InlinedValueSecretResourceProperties withDescription(String description) { + super.withDescription(description); + return this; + } + + /** {@inheritDoc} */ + @Override + public InlinedValueSecretResourceProperties withContentType(String contentType) { + super.withContentType(contentType); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/LocalNetworkResourceProperties.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/LocalNetworkResourceProperties.java new file mode 100644 index 000000000000..9898bef2c86f --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/LocalNetworkResourceProperties.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Information about a Service Fabric container network local to a single Service Fabric cluster. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("Local") +@Fluent +public final class LocalNetworkResourceProperties extends NetworkResourceProperties { + /* + * Address space for the local container network. + */ + @JsonProperty(value = "networkAddressPrefix") + private String networkAddressPrefix; + + /** Creates an instance of LocalNetworkResourceProperties class. */ + public LocalNetworkResourceProperties() { + } + + /** + * Get the networkAddressPrefix property: Address space for the local container network. + * + * @return the networkAddressPrefix value. + */ + public String networkAddressPrefix() { + return this.networkAddressPrefix; + } + + /** + * Set the networkAddressPrefix property: Address space for the local container network. + * + * @param networkAddressPrefix the networkAddressPrefix value to set. + * @return the LocalNetworkResourceProperties object itself. + */ + public LocalNetworkResourceProperties withNetworkAddressPrefix(String networkAddressPrefix) { + this.networkAddressPrefix = networkAddressPrefix; + return this; + } + + /** {@inheritDoc} */ + @Override + public LocalNetworkResourceProperties withDescription(String description) { + super.withDescription(description); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/LogSpecification.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/LogSpecification.java new file mode 100644 index 000000000000..0516c2d46cd0 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/LogSpecification.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.servicefabricmesh.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Log Definition of a single resource metric. */ +@Fluent +public final class LogSpecification { + /* + * The name property. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The displayName property. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * The blobDuration property. + */ + @JsonProperty(value = "blobDuration") + private String blobDuration; + + /* + * The logFilterPattern property. + */ + @JsonProperty(value = "logFilterPattern") + private String logFilterPattern; + + /** Creates an instance of LogSpecification class. */ + public LogSpecification() { + } + + /** + * Get the name property: The name property. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name property. + * + * @param name the name value to set. + * @return the LogSpecification object itself. + */ + public LogSpecification withName(String name) { + this.name = name; + return this; + } + + /** + * Get the displayName property: The displayName property. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The displayName property. + * + * @param displayName the displayName value to set. + * @return the LogSpecification object itself. + */ + public LogSpecification withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the blobDuration property: The blobDuration property. + * + * @return the blobDuration value. + */ + public String blobDuration() { + return this.blobDuration; + } + + /** + * Set the blobDuration property: The blobDuration property. + * + * @param blobDuration the blobDuration value to set. + * @return the LogSpecification object itself. + */ + public LogSpecification withBlobDuration(String blobDuration) { + this.blobDuration = blobDuration; + return this; + } + + /** + * Get the logFilterPattern property: The logFilterPattern property. + * + * @return the logFilterPattern value. + */ + public String logFilterPattern() { + return this.logFilterPattern; + } + + /** + * Set the logFilterPattern property: The logFilterPattern property. + * + * @param logFilterPattern the logFilterPattern value to set. + * @return the LogSpecification object itself. + */ + public LogSpecification withLogFilterPattern(String logFilterPattern) { + this.logFilterPattern = logFilterPattern; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ManagedProxyResource.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ManagedProxyResource.java new file mode 100644 index 000000000000..3967a1cc733f --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ManagedProxyResource.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.servicefabricmesh.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The resource model definition for Azure Resource Manager proxy resource. It will have everything other than required + * location and tags. This proxy resource is explicitly created or updated by including it in the parent resource. + */ +@Fluent +public class ManagedProxyResource extends ProxyResource { + /* + * The name of the resource + */ + @JsonProperty(value = "name") + private String name; + + /** Creates an instance of ManagedProxyResource class. */ + public ManagedProxyResource() { + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the resource. + * + * @param name the name value to set. + * @return the ManagedProxyResource object itself. + */ + public ManagedProxyResource withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/MetricAvailability.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/MetricAvailability.java new file mode 100644 index 000000000000..dad88a766b1a --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/MetricAvailability.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.servicefabricmesh.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Retention policy of a resource metric. */ +@Fluent +public final class MetricAvailability { + /* + * The timeGrain property. + */ + @JsonProperty(value = "timeGrain") + private String timeGrain; + + /* + * The blobDuration property. + */ + @JsonProperty(value = "blobDuration") + private String blobDuration; + + /** Creates an instance of MetricAvailability class. */ + public MetricAvailability() { + } + + /** + * Get the timeGrain property: The timeGrain property. + * + * @return the timeGrain value. + */ + public String timeGrain() { + return this.timeGrain; + } + + /** + * Set the timeGrain property: The timeGrain property. + * + * @param timeGrain the timeGrain value to set. + * @return the MetricAvailability object itself. + */ + public MetricAvailability withTimeGrain(String timeGrain) { + this.timeGrain = timeGrain; + return this; + } + + /** + * Get the blobDuration property: The blobDuration property. + * + * @return the blobDuration value. + */ + public String blobDuration() { + return this.blobDuration; + } + + /** + * Set the blobDuration property: The blobDuration property. + * + * @param blobDuration the blobDuration value to set. + * @return the MetricAvailability object itself. + */ + public MetricAvailability withBlobDuration(String blobDuration) { + this.blobDuration = blobDuration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/MetricSpecification.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/MetricSpecification.java new file mode 100644 index 000000000000..283ccec25da3 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/MetricSpecification.java @@ -0,0 +1,473 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Definition of a single resource metric. */ +@Fluent +public final class MetricSpecification { + /* + * The name property. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The displayName property. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * The displayDescription property. + */ + @JsonProperty(value = "displayDescription") + private String displayDescription; + + /* + * The unit property. + */ + @JsonProperty(value = "unit") + private String unit; + + /* + * The aggregationType property. + */ + @JsonProperty(value = "aggregationType") + private String aggregationType; + + /* + * The supportsInstanceLevelAggregation property. + */ + @JsonProperty(value = "supportsInstanceLevelAggregation") + private Boolean supportsInstanceLevelAggregation; + + /* + * The enableRegionalMdmAccount property. + */ + @JsonProperty(value = "enableRegionalMdmAccount") + private Boolean enableRegionalMdmAccount; + + /* + * The sourceMdmAccount property. + */ + @JsonProperty(value = "sourceMdmAccount") + private String sourceMdmAccount; + + /* + * The sourceMdmNamespace property. + */ + @JsonProperty(value = "sourceMdmNamespace") + private String sourceMdmNamespace; + + /* + * The metricFilterPattern property. + */ + @JsonProperty(value = "metricFilterPattern") + private String metricFilterPattern; + + /* + * The fillGapWithZero property. + */ + @JsonProperty(value = "fillGapWithZero") + private Boolean fillGapWithZero; + + /* + * The isInternal property. + */ + @JsonProperty(value = "isInternal") + private Boolean isInternal; + + /* + * The dimensions property. + */ + @JsonProperty(value = "dimensions") + private List dimensions; + + /* + * The category property. + */ + @JsonProperty(value = "category") + private String category; + + /* + * The availabilities property. + */ + @JsonProperty(value = "availabilities") + private List availabilities; + + /* + * The supportedTimeGrainTypes property. + */ + @JsonProperty(value = "supportedTimeGrainTypes") + private List supportedTimeGrainTypes; + + /* + * The supportedAggregationTypes property. + */ + @JsonProperty(value = "supportedAggregationTypes") + private List supportedAggregationTypes; + + /** Creates an instance of MetricSpecification class. */ + public MetricSpecification() { + } + + /** + * Get the name property: The name property. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name property. + * + * @param name the name value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withName(String name) { + this.name = name; + return this; + } + + /** + * Get the displayName property: The displayName property. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The displayName property. + * + * @param displayName the displayName value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the displayDescription property: The displayDescription property. + * + * @return the displayDescription value. + */ + public String displayDescription() { + return this.displayDescription; + } + + /** + * Set the displayDescription property: The displayDescription property. + * + * @param displayDescription the displayDescription value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDisplayDescription(String displayDescription) { + this.displayDescription = displayDescription; + return this; + } + + /** + * Get the unit property: The unit property. + * + * @return the unit value. + */ + public String unit() { + return this.unit; + } + + /** + * Set the unit property: The unit property. + * + * @param unit the unit value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withUnit(String unit) { + this.unit = unit; + return this; + } + + /** + * Get the aggregationType property: The aggregationType property. + * + * @return the aggregationType value. + */ + public String aggregationType() { + return this.aggregationType; + } + + /** + * Set the aggregationType property: The aggregationType property. + * + * @param aggregationType the aggregationType value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withAggregationType(String aggregationType) { + this.aggregationType = aggregationType; + return this; + } + + /** + * Get the supportsInstanceLevelAggregation property: The supportsInstanceLevelAggregation property. + * + * @return the supportsInstanceLevelAggregation value. + */ + public Boolean supportsInstanceLevelAggregation() { + return this.supportsInstanceLevelAggregation; + } + + /** + * Set the supportsInstanceLevelAggregation property: The supportsInstanceLevelAggregation property. + * + * @param supportsInstanceLevelAggregation the supportsInstanceLevelAggregation value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withSupportsInstanceLevelAggregation(Boolean supportsInstanceLevelAggregation) { + this.supportsInstanceLevelAggregation = supportsInstanceLevelAggregation; + return this; + } + + /** + * Get the enableRegionalMdmAccount property: The enableRegionalMdmAccount property. + * + * @return the enableRegionalMdmAccount value. + */ + public Boolean enableRegionalMdmAccount() { + return this.enableRegionalMdmAccount; + } + + /** + * Set the enableRegionalMdmAccount property: The enableRegionalMdmAccount property. + * + * @param enableRegionalMdmAccount the enableRegionalMdmAccount value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withEnableRegionalMdmAccount(Boolean enableRegionalMdmAccount) { + this.enableRegionalMdmAccount = enableRegionalMdmAccount; + return this; + } + + /** + * Get the sourceMdmAccount property: The sourceMdmAccount property. + * + * @return the sourceMdmAccount value. + */ + public String sourceMdmAccount() { + return this.sourceMdmAccount; + } + + /** + * Set the sourceMdmAccount property: The sourceMdmAccount property. + * + * @param sourceMdmAccount the sourceMdmAccount value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withSourceMdmAccount(String sourceMdmAccount) { + this.sourceMdmAccount = sourceMdmAccount; + return this; + } + + /** + * Get the sourceMdmNamespace property: The sourceMdmNamespace property. + * + * @return the sourceMdmNamespace value. + */ + public String sourceMdmNamespace() { + return this.sourceMdmNamespace; + } + + /** + * Set the sourceMdmNamespace property: The sourceMdmNamespace property. + * + * @param sourceMdmNamespace the sourceMdmNamespace value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withSourceMdmNamespace(String sourceMdmNamespace) { + this.sourceMdmNamespace = sourceMdmNamespace; + return this; + } + + /** + * Get the metricFilterPattern property: The metricFilterPattern property. + * + * @return the metricFilterPattern value. + */ + public String metricFilterPattern() { + return this.metricFilterPattern; + } + + /** + * Set the metricFilterPattern property: The metricFilterPattern property. + * + * @param metricFilterPattern the metricFilterPattern value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withMetricFilterPattern(String metricFilterPattern) { + this.metricFilterPattern = metricFilterPattern; + return this; + } + + /** + * Get the fillGapWithZero property: The fillGapWithZero property. + * + * @return the fillGapWithZero value. + */ + public Boolean fillGapWithZero() { + return this.fillGapWithZero; + } + + /** + * Set the fillGapWithZero property: The fillGapWithZero property. + * + * @param fillGapWithZero the fillGapWithZero value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withFillGapWithZero(Boolean fillGapWithZero) { + this.fillGapWithZero = fillGapWithZero; + return this; + } + + /** + * Get the isInternal property: The isInternal property. + * + * @return the isInternal value. + */ + public Boolean isInternal() { + return this.isInternal; + } + + /** + * Set the isInternal property: The isInternal property. + * + * @param isInternal the isInternal value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withIsInternal(Boolean isInternal) { + this.isInternal = isInternal; + return this; + } + + /** + * Get the dimensions property: The dimensions property. + * + * @return the dimensions value. + */ + public List dimensions() { + return this.dimensions; + } + + /** + * Set the dimensions property: The dimensions property. + * + * @param dimensions the dimensions value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDimensions(List dimensions) { + this.dimensions = dimensions; + return this; + } + + /** + * Get the category property: The category property. + * + * @return the category value. + */ + public String category() { + return this.category; + } + + /** + * Set the category property: The category property. + * + * @param category the category value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withCategory(String category) { + this.category = category; + return this; + } + + /** + * Get the availabilities property: The availabilities property. + * + * @return the availabilities value. + */ + public List availabilities() { + return this.availabilities; + } + + /** + * Set the availabilities property: The availabilities property. + * + * @param availabilities the availabilities value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withAvailabilities(List availabilities) { + this.availabilities = availabilities; + return this; + } + + /** + * Get the supportedTimeGrainTypes property: The supportedTimeGrainTypes property. + * + * @return the supportedTimeGrainTypes value. + */ + public List supportedTimeGrainTypes() { + return this.supportedTimeGrainTypes; + } + + /** + * Set the supportedTimeGrainTypes property: The supportedTimeGrainTypes property. + * + * @param supportedTimeGrainTypes the supportedTimeGrainTypes value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withSupportedTimeGrainTypes(List supportedTimeGrainTypes) { + this.supportedTimeGrainTypes = supportedTimeGrainTypes; + return this; + } + + /** + * Get the supportedAggregationTypes property: The supportedAggregationTypes property. + * + * @return the supportedAggregationTypes value. + */ + public List supportedAggregationTypes() { + return this.supportedAggregationTypes; + } + + /** + * Set the supportedAggregationTypes property: The supportedAggregationTypes property. + * + * @param supportedAggregationTypes the supportedAggregationTypes value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withSupportedAggregationTypes(List supportedAggregationTypes) { + this.supportedAggregationTypes = supportedAggregationTypes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dimensions() != null) { + dimensions().forEach(e -> e.validate()); + } + if (availabilities() != null) { + availabilities().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/NetworkKind.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/NetworkKind.java new file mode 100644 index 000000000000..1ada92ff5a8e --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/NetworkKind.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The type of a Service Fabric container network. */ +public final class NetworkKind extends ExpandableStringEnum { + /** Static value Local for NetworkKind. */ + public static final NetworkKind LOCAL = fromString("Local"); + + /** + * Creates a new instance of NetworkKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NetworkKind() { + } + + /** + * Creates or finds a NetworkKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding NetworkKind. + */ + @JsonCreator + public static NetworkKind fromString(String name) { + return fromString(name, NetworkKind.class); + } + + /** + * Gets known NetworkKind values. + * + * @return known NetworkKind values. + */ + public static Collection values() { + return values(NetworkKind.class); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/NetworkRef.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/NetworkRef.java new file mode 100644 index 000000000000..03f7b4b0c988 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/NetworkRef.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a network reference in a service. */ +@Fluent +public final class NetworkRef { + /* + * Name of the network + */ + @JsonProperty(value = "name") + private String name; + + /* + * A list of endpoints that are exposed on this network. + */ + @JsonProperty(value = "endpointRefs") + private List endpointRefs; + + /** Creates an instance of NetworkRef class. */ + public NetworkRef() { + } + + /** + * Get the name property: Name of the network. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the network. + * + * @param name the name value to set. + * @return the NetworkRef object itself. + */ + public NetworkRef withName(String name) { + this.name = name; + return this; + } + + /** + * Get the endpointRefs property: A list of endpoints that are exposed on this network. + * + * @return the endpointRefs value. + */ + public List endpointRefs() { + return this.endpointRefs; + } + + /** + * Set the endpointRefs property: A list of endpoints that are exposed on this network. + * + * @param endpointRefs the endpointRefs value to set. + * @return the NetworkRef object itself. + */ + public NetworkRef withEndpointRefs(List endpointRefs) { + this.endpointRefs = endpointRefs; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (endpointRefs() != null) { + endpointRefs().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/NetworkResourceDescription.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/NetworkResourceDescription.java new file mode 100644 index 000000000000..1bbee8b3a8a8 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/NetworkResourceDescription.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicefabricmesh.fluent.models.NetworkResourceDescriptionInner; +import java.util.Map; + +/** An immutable client-side representation of NetworkResourceDescription. */ +public interface NetworkResourceDescription { + /** + * 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 properties property: Describes properties of a network resource. + * + * @return the properties value. + */ + NetworkResourceProperties properties(); + + /** + * 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.servicefabricmesh.fluent.models.NetworkResourceDescriptionInner object. + * + * @return the inner object. + */ + NetworkResourceDescriptionInner innerModel(); + + /** The entirety of the NetworkResourceDescription definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithProperties, + DefinitionStages.WithCreate { + } + /** The NetworkResourceDescription definition stages. */ + interface DefinitionStages { + /** The first stage of the NetworkResourceDescription definition. */ + interface Blank extends WithLocation { + } + /** The stage of the NetworkResourceDescription 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 NetworkResourceDescription definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName Azure resource group name. + * @return the next definition stage. + */ + WithProperties withExistingResourceGroup(String resourceGroupName); + } + /** The stage of the NetworkResourceDescription definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Describes properties of a network resource.. + * + * @param properties Describes properties of a network resource. + * @return the next definition stage. + */ + WithCreate withProperties(NetworkResourceProperties properties); + } + /** + * The stage of the NetworkResourceDescription 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 { + /** + * Executes the create request. + * + * @return the created resource. + */ + NetworkResourceDescription create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + NetworkResourceDescription create(Context context); + } + /** The stage of the NetworkResourceDescription 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); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + NetworkResourceDescription refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + NetworkResourceDescription refresh(Context context); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/NetworkResourceDescriptionList.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/NetworkResourceDescriptionList.java new file mode 100644 index 000000000000..b34b62952af4 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/NetworkResourceDescriptionList.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.servicefabricmesh.fluent.models.NetworkResourceDescriptionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A pageable list of network resources. */ +@Fluent +public final class NetworkResourceDescriptionList { + /* + * One page of the list. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URI to fetch the next page of the list. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of NetworkResourceDescriptionList class. */ + public NetworkResourceDescriptionList() { + } + + /** + * Get the value property: One page of the list. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: One page of the list. + * + * @param value the value value to set. + * @return the NetworkResourceDescriptionList object itself. + */ + public NetworkResourceDescriptionList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URI to fetch the next page of the list. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URI to fetch the next page of the list. + * + * @param nextLink the nextLink value to set. + * @return the NetworkResourceDescriptionList object itself. + */ + public NetworkResourceDescriptionList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/NetworkResourceProperties.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/NetworkResourceProperties.java new file mode 100644 index 000000000000..f9348066087f --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/NetworkResourceProperties.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.servicefabricmesh.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Describes properties of a network resource. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "kind", + defaultImpl = NetworkResourceProperties.class) +@JsonTypeName("NetworkResourceProperties") +@JsonSubTypes({@JsonSubTypes.Type(name = "Local", value = LocalNetworkResourceProperties.class)}) +@Fluent +public class NetworkResourceProperties extends NetworkResourcePropertiesBase { + /* + * User readable description of the network. + */ + @JsonProperty(value = "description") + private String description; + + /* + * Status of the network. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private ResourceStatus status; + + /* + * Gives additional information about the current status of the network. + */ + @JsonProperty(value = "statusDetails", access = JsonProperty.Access.WRITE_ONLY) + private String statusDetails; + + /** Creates an instance of NetworkResourceProperties class. */ + public NetworkResourceProperties() { + } + + /** + * Get the description property: User readable description of the network. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: User readable description of the network. + * + * @param description the description value to set. + * @return the NetworkResourceProperties object itself. + */ + public NetworkResourceProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the status property: Status of the network. + * + * @return the status value. + */ + public ResourceStatus status() { + return this.status; + } + + /** + * Get the statusDetails property: Gives additional information about the current status of the network. + * + * @return the statusDetails value. + */ + public String statusDetails() { + return this.statusDetails; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/NetworkResourcePropertiesBase.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/NetworkResourcePropertiesBase.java new file mode 100644 index 000000000000..30bd6e3ff77d --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/NetworkResourcePropertiesBase.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.servicefabricmesh.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** This type describes the properties of a network resource, including its kind. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "kind", + defaultImpl = NetworkResourcePropertiesBase.class) +@JsonTypeName("NetworkResourcePropertiesBase") +@JsonSubTypes({@JsonSubTypes.Type(name = "NetworkResourceProperties", value = NetworkResourceProperties.class)}) +@Immutable +public class NetworkResourcePropertiesBase extends ProvisionedResourceProperties { + /** Creates an instance of NetworkResourcePropertiesBase class. */ + public NetworkResourcePropertiesBase() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/Networks.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/Networks.java new file mode 100644 index 000000000000..3b7538fb7983 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/Networks.java @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.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 Networks. */ +public interface Networks { + /** + * Gets the network resource with the given name. + * + *

Gets the information about the network resource with the given name. The information include the description + * and other properties of the network. + * + * @param resourceGroupName Azure resource group name. + * @param networkResourceName The identity of the network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about the network resource with the given name along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String networkResourceName, Context context); + + /** + * Gets the network resource with the given name. + * + *

Gets the information about the network resource with the given name. The information include the description + * and other properties of the network. + * + * @param resourceGroupName Azure resource group name. + * @param networkResourceName The identity of the network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about the network resource with the given name. + */ + NetworkResourceDescription getByResourceGroup(String resourceGroupName, String networkResourceName); + + /** + * Deletes the network resource. + * + *

Deletes the network resource identified by the name. + * + * @param resourceGroupName Azure resource group name. + * @param networkResourceName The identity of the network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByResourceGroupWithResponse( + String resourceGroupName, String networkResourceName, Context context); + + /** + * Deletes the network resource. + * + *

Deletes the network resource identified by the name. + * + * @param resourceGroupName Azure resource group name. + * @param networkResourceName The identity of the network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 networkResourceName); + + /** + * Gets all the network resources in a given resource group. + * + *

Gets the information about all network resources in a given resource group. The information include the + * description and other properties of the Network. + * + * @param resourceGroupName Azure resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about all network resources in a given resource group as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all the network resources in a given resource group. + * + *

Gets the information about all network resources in a given resource group. The information include the + * description and other properties of the Network. + * + * @param resourceGroupName Azure resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about all network resources in a given resource group as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all the network resources in a given subscription. + * + *

Gets the information about all network resources in a given resource group. The information include the + * description and other properties of the network. + * + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about all network resources in a given resource group as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(); + + /** + * Gets all the network resources in a given subscription. + * + *

Gets the information about all network resources in a given resource group. The information include the + * description and other properties of the network. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about all network resources in a given resource group as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Gets the network resource with the given name. + * + *

Gets the information about the network resource with the given name. The information include the description + * and other properties of the network. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about the network resource with the given name along with {@link Response}. + */ + NetworkResourceDescription getById(String id); + + /** + * Gets the network resource with the given name. + * + *

Gets the information about the network resource with the given name. The information include the description + * and other properties of the network. + * + * @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.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about the network resource with the given name along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the network resource. + * + *

Deletes the network resource identified by the name. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 network resource. + * + *

Deletes the network resource identified by the name. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new NetworkResourceDescription resource. + * + * @param name resource name. + * @return the first stage of the new NetworkResourceDescription definition. + */ + NetworkResourceDescription.DefinitionStages.Blank define(String name); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/OperatingSystemType.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/OperatingSystemType.java new file mode 100644 index 000000000000..ef71446d7164 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/OperatingSystemType.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.servicefabricmesh.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The operation system required by the code in service. */ +public final class OperatingSystemType extends ExpandableStringEnum { + /** Static value Linux for OperatingSystemType. */ + public static final OperatingSystemType LINUX = fromString("Linux"); + + /** Static value Windows for OperatingSystemType. */ + public static final OperatingSystemType WINDOWS = fromString("Windows"); + + /** + * Creates a new instance of OperatingSystemType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public OperatingSystemType() { + } + + /** + * Creates or finds a OperatingSystemType from its string representation. + * + * @param name a name to look for. + * @return the corresponding OperatingSystemType. + */ + @JsonCreator + public static OperatingSystemType fromString(String name) { + return fromString(name, OperatingSystemType.class); + } + + /** + * Gets known OperatingSystemType values. + * + * @return known OperatingSystemType values. + */ + public static Collection values() { + return values(OperatingSystemType.class); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/OperationListResult.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/OperationListResult.java new file mode 100644 index 000000000000..5123c2da586b --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/OperationListResult.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.servicefabricmesh.fluent.models.OperationResultInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes the result of the request to list Service Fabric operations. */ +@Fluent +public final class OperationListResult { + /* + * List of Service Fabric operations supported by the Microsoft.ServiceFabric resource provider. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** Creates an instance of OperationListResult class. */ + public OperationListResult() { + } + + /** + * Get the value property: List of Service Fabric operations supported by the Microsoft.ServiceFabric resource + * provider. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of Service Fabric operations supported by the Microsoft.ServiceFabric resource + * provider. + * + * @param value the value value to set. + * @return the OperationListResult object itself. + */ + public OperationListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results if there are any. + * + * @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/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/OperationResult.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/OperationResult.java new file mode 100644 index 000000000000..ed9244f9dc81 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/OperationResult.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.servicefabricmesh.models; + +import com.azure.resourcemanager.servicefabricmesh.fluent.models.OperationResultInner; + +/** An immutable client-side representation of OperationResult. */ +public interface OperationResult { + /** + * Gets the name property: The name of the operation. + * + * @return the name value. + */ + String name(); + + /** + * Gets the display property: The object that represents the operation. + * + * @return the display value. + */ + AvailableOperationDisplay display(); + + /** + * Gets the origin property: Origin result. + * + * @return the origin value. + */ + String origin(); + + /** + * Gets the nextLink property: The URL to use for getting the next set of results. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the properties property: Properties of the operation. + * + * @return the properties value. + */ + AvailableOperationDescriptionProperties properties(); + + /** + * Gets the inner com.azure.resourcemanager.servicefabricmesh.fluent.models.OperationResultInner object. + * + * @return the inner object. + */ + OperationResultInner innerModel(); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/Operations.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/Operations.java new file mode 100644 index 000000000000..c8dafb33bef4 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/Operations.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.servicefabricmesh.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Operations. */ +public interface Operations { + /** + * Lists all of the available operations. + * + *

Lists all the available operations provided by Service Fabric SeaBreeze resource provider. + * + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the result of the request to list Service Fabric operations as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(); + + /** + * Lists all of the available operations. + * + *

Lists all the available operations provided by Service Fabric SeaBreeze resource provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the result of the request to list Service Fabric operations as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/PathMatchType.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/PathMatchType.java new file mode 100644 index 000000000000..1c919a2755e1 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/PathMatchType.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** how to match value in the Uri. */ +public final class PathMatchType extends ExpandableStringEnum { + /** Static value prefix for PathMatchType. */ + public static final PathMatchType PREFIX = fromString("prefix"); + + /** + * Creates a new instance of PathMatchType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PathMatchType() { + } + + /** + * Creates or finds a PathMatchType from its string representation. + * + * @param name a name to look for. + * @return the corresponding PathMatchType. + */ + @JsonCreator + public static PathMatchType fromString(String name) { + return fromString(name, PathMatchType.class); + } + + /** + * Gets known PathMatchType values. + * + * @return known PathMatchType values. + */ + public static Collection values() { + return values(PathMatchType.class); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ProvisionedResourceProperties.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ProvisionedResourceProperties.java new file mode 100644 index 000000000000..bf1f5a07047f --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ProvisionedResourceProperties.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.servicefabricmesh.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes common properties of a provisioned resource. */ +@Immutable +public class ProvisionedResourceProperties { + /* + * State of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** Creates an instance of ProvisionedResourceProperties class. */ + public ProvisionedResourceProperties() { + } + + /** + * Get the provisioningState property: State of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ReliableCollectionsRef.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ReliableCollectionsRef.java new file mode 100644 index 000000000000..2db7899c0744 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ReliableCollectionsRef.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Specifying this parameter adds support for reliable collections. */ +@Fluent +public final class ReliableCollectionsRef { + /* + * Name of ReliableCollection resource. Right now it's not used and you can use any string. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * False (the default) if ReliableCollections state is persisted to disk as usual. True if you do not want to + * persist state, in which case replication is still enabled and you can use ReliableCollections as distributed + * cache. + */ + @JsonProperty(value = "doNotPersistState") + private Boolean doNotPersistState; + + /** Creates an instance of ReliableCollectionsRef class. */ + public ReliableCollectionsRef() { + } + + /** + * Get the name property: Name of ReliableCollection resource. Right now it's not used and you can use any string. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of ReliableCollection resource. Right now it's not used and you can use any string. + * + * @param name the name value to set. + * @return the ReliableCollectionsRef object itself. + */ + public ReliableCollectionsRef withName(String name) { + this.name = name; + return this; + } + + /** + * Get the doNotPersistState property: False (the default) if ReliableCollections state is persisted to disk as + * usual. True if you do not want to persist state, in which case replication is still enabled and you can use + * ReliableCollections as distributed cache. + * + * @return the doNotPersistState value. + */ + public Boolean doNotPersistState() { + return this.doNotPersistState; + } + + /** + * Set the doNotPersistState property: False (the default) if ReliableCollections state is persisted to disk as + * usual. True if you do not want to persist state, in which case replication is still enabled and you can use + * ReliableCollections as distributed cache. + * + * @param doNotPersistState the doNotPersistState value to set. + * @return the ReliableCollectionsRef object itself. + */ + public ReliableCollectionsRef withDoNotPersistState(Boolean doNotPersistState) { + this.doNotPersistState = doNotPersistState; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model ReliableCollectionsRef")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ReliableCollectionsRef.class); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ResourceLimits.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ResourceLimits.java new file mode 100644 index 000000000000..7f0140cafd1b --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ResourceLimits.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * This type describes the resource limits for a given container. It describes the most amount of resources a container + * is allowed to use before being restarted. + */ +@Fluent +public final class ResourceLimits { + /* + * The memory limit in GB. + */ + @JsonProperty(value = "memoryInGB") + private Double memoryInGB; + + /* + * CPU limits in cores. At present, only full cores are supported. + */ + @JsonProperty(value = "cpu") + private Double cpu; + + /** Creates an instance of ResourceLimits class. */ + public ResourceLimits() { + } + + /** + * Get the memoryInGB property: The memory limit in GB. + * + * @return the memoryInGB value. + */ + public Double memoryInGB() { + return this.memoryInGB; + } + + /** + * Set the memoryInGB property: The memory limit in GB. + * + * @param memoryInGB the memoryInGB value to set. + * @return the ResourceLimits object itself. + */ + public ResourceLimits withMemoryInGB(Double memoryInGB) { + this.memoryInGB = memoryInGB; + return this; + } + + /** + * Get the cpu property: CPU limits in cores. At present, only full cores are supported. + * + * @return the cpu value. + */ + public Double cpu() { + return this.cpu; + } + + /** + * Set the cpu property: CPU limits in cores. At present, only full cores are supported. + * + * @param cpu the cpu value to set. + * @return the ResourceLimits object itself. + */ + public ResourceLimits withCpu(Double cpu) { + this.cpu = cpu; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ResourceRequests.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ResourceRequests.java new file mode 100644 index 000000000000..8b6d9e1b5119 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ResourceRequests.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * This type describes the requested resources for a given container. It describes the least amount of resources + * required for the container. A container can consume more than requested resources up to the specified limits before + * being restarted. Currently, the requested resources are treated as limits. + */ +@Fluent +public final class ResourceRequests { + /* + * The memory request in GB for this container. + */ + @JsonProperty(value = "memoryInGB", required = true) + private double memoryInGB; + + /* + * Requested number of CPU cores. At present, only full cores are supported. + */ + @JsonProperty(value = "cpu", required = true) + private double cpu; + + /** Creates an instance of ResourceRequests class. */ + public ResourceRequests() { + } + + /** + * Get the memoryInGB property: The memory request in GB for this container. + * + * @return the memoryInGB value. + */ + public double memoryInGB() { + return this.memoryInGB; + } + + /** + * Set the memoryInGB property: The memory request in GB for this container. + * + * @param memoryInGB the memoryInGB value to set. + * @return the ResourceRequests object itself. + */ + public ResourceRequests withMemoryInGB(double memoryInGB) { + this.memoryInGB = memoryInGB; + return this; + } + + /** + * Get the cpu property: Requested number of CPU cores. At present, only full cores are supported. + * + * @return the cpu value. + */ + public double cpu() { + return this.cpu; + } + + /** + * Set the cpu property: Requested number of CPU cores. At present, only full cores are supported. + * + * @param cpu the cpu value to set. + * @return the ResourceRequests object itself. + */ + public ResourceRequests withCpu(double cpu) { + this.cpu = cpu; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ResourceRequirements.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ResourceRequirements.java new file mode 100644 index 000000000000..b69511d60340 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ResourceRequirements.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** This type describes the resource requirements for a container or a service. */ +@Fluent +public final class ResourceRequirements { + /* + * Describes the requested resources for a given container. + */ + @JsonProperty(value = "requests", required = true) + private ResourceRequests requests; + + /* + * Describes the maximum limits on the resources for a given container. + */ + @JsonProperty(value = "limits") + private ResourceLimits limits; + + /** Creates an instance of ResourceRequirements class. */ + public ResourceRequirements() { + } + + /** + * Get the requests property: Describes the requested resources for a given container. + * + * @return the requests value. + */ + public ResourceRequests requests() { + return this.requests; + } + + /** + * Set the requests property: Describes the requested resources for a given container. + * + * @param requests the requests value to set. + * @return the ResourceRequirements object itself. + */ + public ResourceRequirements withRequests(ResourceRequests requests) { + this.requests = requests; + return this; + } + + /** + * Get the limits property: Describes the maximum limits on the resources for a given container. + * + * @return the limits value. + */ + public ResourceLimits limits() { + return this.limits; + } + + /** + * Set the limits property: Describes the maximum limits on the resources for a given container. + * + * @param limits the limits value to set. + * @return the ResourceRequirements object itself. + */ + public ResourceRequirements withLimits(ResourceLimits limits) { + this.limits = limits; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (requests() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property requests in model ResourceRequirements")); + } else { + requests().validate(); + } + if (limits() != null) { + limits().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ResourceRequirements.class); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ResourceStatus.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ResourceStatus.java new file mode 100644 index 000000000000..c972c718e3b5 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ResourceStatus.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.servicefabricmesh.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Status of the resource. */ +public final class ResourceStatus extends ExpandableStringEnum { + /** Static value Unknown for ResourceStatus. */ + public static final ResourceStatus UNKNOWN = fromString("Unknown"); + + /** Static value Ready for ResourceStatus. */ + public static final ResourceStatus READY = fromString("Ready"); + + /** Static value Upgrading for ResourceStatus. */ + public static final ResourceStatus UPGRADING = fromString("Upgrading"); + + /** Static value Creating for ResourceStatus. */ + public static final ResourceStatus CREATING = fromString("Creating"); + + /** Static value Deleting for ResourceStatus. */ + public static final ResourceStatus DELETING = fromString("Deleting"); + + /** Static value Failed for ResourceStatus. */ + public static final ResourceStatus FAILED = fromString("Failed"); + + /** + * Creates a new instance of ResourceStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ResourceStatus() { + } + + /** + * Creates or finds a ResourceStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResourceStatus. + */ + @JsonCreator + public static ResourceStatus fromString(String name) { + return fromString(name, ResourceStatus.class); + } + + /** + * Gets known ResourceStatus values. + * + * @return known ResourceStatus values. + */ + public static Collection values() { + return values(ResourceStatus.class); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/SecretKind.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/SecretKind.java new file mode 100644 index 000000000000..884ae22143ad --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/SecretKind.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Describes the kind of secret. */ +public final class SecretKind extends ExpandableStringEnum { + /** Static value inlinedValue for SecretKind. */ + public static final SecretKind INLINED_VALUE = fromString("inlinedValue"); + + /** + * Creates a new instance of SecretKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SecretKind() { + } + + /** + * Creates or finds a SecretKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding SecretKind. + */ + @JsonCreator + public static SecretKind fromString(String name) { + return fromString(name, SecretKind.class); + } + + /** + * Gets known SecretKind values. + * + * @return known SecretKind values. + */ + public static Collection values() { + return values(SecretKind.class); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/SecretResourceDescription.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/SecretResourceDescription.java new file mode 100644 index 000000000000..b524a4f2d566 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/SecretResourceDescription.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicefabricmesh.fluent.models.SecretResourceDescriptionInner; +import java.util.Map; + +/** An immutable client-side representation of SecretResourceDescription. */ +public interface SecretResourceDescription { + /** + * 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 properties property: Describes the properties of a secret resource. + * + * @return the properties value. + */ + SecretResourceProperties properties(); + + /** + * 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.servicefabricmesh.fluent.models.SecretResourceDescriptionInner object. + * + * @return the inner object. + */ + SecretResourceDescriptionInner innerModel(); + + /** The entirety of the SecretResourceDescription definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithProperties, + DefinitionStages.WithCreate { + } + /** The SecretResourceDescription definition stages. */ + interface DefinitionStages { + /** The first stage of the SecretResourceDescription definition. */ + interface Blank extends WithLocation { + } + /** The stage of the SecretResourceDescription 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 SecretResourceDescription definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName Azure resource group name. + * @return the next definition stage. + */ + WithProperties withExistingResourceGroup(String resourceGroupName); + } + /** The stage of the SecretResourceDescription definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Describes the properties of a secret resource.. + * + * @param properties Describes the properties of a secret resource. + * @return the next definition stage. + */ + WithCreate withProperties(SecretResourceProperties properties); + } + /** + * The stage of the SecretResourceDescription 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 { + /** + * Executes the create request. + * + * @return the created resource. + */ + SecretResourceDescription create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SecretResourceDescription create(Context context); + } + /** The stage of the SecretResourceDescription 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); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SecretResourceDescription refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SecretResourceDescription refresh(Context context); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/SecretResourceDescriptionList.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/SecretResourceDescriptionList.java new file mode 100644 index 000000000000..024ca32f76f4 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/SecretResourceDescriptionList.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.servicefabricmesh.fluent.models.SecretResourceDescriptionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A pageable list of secret resources. */ +@Fluent +public final class SecretResourceDescriptionList { + /* + * One page of the list. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URI to fetch the next page of the list. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of SecretResourceDescriptionList class. */ + public SecretResourceDescriptionList() { + } + + /** + * Get the value property: One page of the list. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: One page of the list. + * + * @param value the value value to set. + * @return the SecretResourceDescriptionList object itself. + */ + public SecretResourceDescriptionList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URI to fetch the next page of the list. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URI to fetch the next page of the list. + * + * @param nextLink the nextLink value to set. + * @return the SecretResourceDescriptionList object itself. + */ + public SecretResourceDescriptionList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/SecretResourceProperties.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/SecretResourceProperties.java new file mode 100644 index 000000000000..f81303d0de6b --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/SecretResourceProperties.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Describes the properties of a secret resource. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "kind", + defaultImpl = SecretResourceProperties.class) +@JsonTypeName("SecretResourceProperties") +@JsonSubTypes({@JsonSubTypes.Type(name = "inlinedValue", value = InlinedValueSecretResourceProperties.class)}) +@Fluent +public class SecretResourceProperties extends SecretResourcePropertiesBase { + /* + * User readable description of the secret. + */ + @JsonProperty(value = "description") + private String description; + + /* + * Status of the resource. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private ResourceStatus status; + + /* + * Gives additional information about the current status of the secret. + */ + @JsonProperty(value = "statusDetails", access = JsonProperty.Access.WRITE_ONLY) + private String statusDetails; + + /* + * The type of the content stored in the secret value. The value of this property is opaque to Service Fabric. Once + * set, the value of this property cannot be changed. + */ + @JsonProperty(value = "contentType") + private String contentType; + + /** Creates an instance of SecretResourceProperties class. */ + public SecretResourceProperties() { + } + + /** + * Get the description property: User readable description of the secret. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: User readable description of the secret. + * + * @param description the description value to set. + * @return the SecretResourceProperties object itself. + */ + public SecretResourceProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the status property: Status of the resource. + * + * @return the status value. + */ + public ResourceStatus status() { + return this.status; + } + + /** + * Get the statusDetails property: Gives additional information about the current status of the secret. + * + * @return the statusDetails value. + */ + public String statusDetails() { + return this.statusDetails; + } + + /** + * Get the contentType property: The type of the content stored in the secret value. The value of this property is + * opaque to Service Fabric. Once set, the value of this property cannot be changed. + * + * @return the contentType value. + */ + public String contentType() { + return this.contentType; + } + + /** + * Set the contentType property: The type of the content stored in the secret value. The value of this property is + * opaque to Service Fabric. Once set, the value of this property cannot be changed. + * + * @param contentType the contentType value to set. + * @return the SecretResourceProperties object itself. + */ + public SecretResourceProperties withContentType(String contentType) { + this.contentType = contentType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/SecretResourcePropertiesBase.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/SecretResourcePropertiesBase.java new file mode 100644 index 000000000000..53cb2b8295f6 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/SecretResourcePropertiesBase.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.servicefabricmesh.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** This type describes the properties of a secret resource, including its kind. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "kind", + defaultImpl = SecretResourcePropertiesBase.class) +@JsonTypeName("SecretResourcePropertiesBase") +@JsonSubTypes({@JsonSubTypes.Type(name = "SecretResourceProperties", value = SecretResourceProperties.class)}) +@Immutable +public class SecretResourcePropertiesBase extends ProvisionedResourceProperties { + /** Creates an instance of SecretResourcePropertiesBase class. */ + public SecretResourcePropertiesBase() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/SecretValue.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/SecretValue.java new file mode 100644 index 000000000000..4fbdb10c6053 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/SecretValue.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.servicefabricmesh.models; + +import com.azure.resourcemanager.servicefabricmesh.fluent.models.SecretValueInner; + +/** An immutable client-side representation of SecretValue. */ +public interface SecretValue { + /** + * Gets the value property: The actual value of the secret. + * + * @return the value value. + */ + String value(); + + /** + * Gets the inner com.azure.resourcemanager.servicefabricmesh.fluent.models.SecretValueInner object. + * + * @return the inner object. + */ + SecretValueInner innerModel(); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/SecretValueProperties.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/SecretValueProperties.java new file mode 100644 index 000000000000..459404c55d1c --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/SecretValueProperties.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.servicefabricmesh.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** This type describes properties of secret value resource. */ +@Fluent +public class SecretValueProperties { + /* + * The actual value of the secret. + */ + @JsonProperty(value = "value") + private String value; + + /** Creates an instance of SecretValueProperties class. */ + public SecretValueProperties() { + } + + /** + * Get the value property: The actual value of the secret. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The actual value of the secret. + * + * @param value the value value to set. + * @return the SecretValueProperties object itself. + */ + public SecretValueProperties withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/SecretValueResourceDescription.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/SecretValueResourceDescription.java new file mode 100644 index 000000000000..3251108974f8 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/SecretValueResourceDescription.java @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicefabricmesh.fluent.models.SecretValueResourceDescriptionInner; +import java.util.Map; + +/** An immutable client-side representation of SecretValueResourceDescription. */ +public interface SecretValueResourceDescription { + /** + * 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 value property: The actual value of the secret. + * + * @return the value value. + */ + String value(); + + /** + * Gets the provisioningState property: State of the resource. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * 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.servicefabricmesh.fluent.models.SecretValueResourceDescriptionInner + * object. + * + * @return the inner object. + */ + SecretValueResourceDescriptionInner innerModel(); + + /** The entirety of the SecretValueResourceDescription definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreate { + } + /** The SecretValueResourceDescription definition stages. */ + interface DefinitionStages { + /** The first stage of the SecretValueResourceDescription definition. */ + interface Blank extends WithLocation { + } + /** The stage of the SecretValueResourceDescription definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the SecretValueResourceDescription definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, secretResourceName. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @return the next definition stage. + */ + WithCreate withExistingSecret(String resourceGroupName, String secretResourceName); + } + /** + * The stage of the SecretValueResourceDescription 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.WithValue { + /** + * Executes the create request. + * + * @return the created resource. + */ + SecretValueResourceDescription create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SecretValueResourceDescription create(Context context); + } + /** The stage of the SecretValueResourceDescription 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 SecretValueResourceDescription definition allowing to specify value. */ + interface WithValue { + /** + * Specifies the value property: The actual value of the secret.. + * + * @param value The actual value of the secret. + * @return the next definition stage. + */ + WithCreate withValue(String value); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SecretValueResourceDescription refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SecretValueResourceDescription refresh(Context context); + + /** + * Lists the specified value of the secret resource. + * + *

Lists the decrypted value of the specified named value of the secret resource. This is a privileged operation. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return this type represents the unencrypted value of the secret along with {@link Response}. + */ + Response listValueWithResponse(Context context); + + /** + * Lists the specified value of the secret resource. + * + *

Lists the decrypted value of the specified named value of the secret resource. This is a privileged operation. + * + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return this type represents the unencrypted value of the secret. + */ + SecretValue listValue(); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/SecretValueResourceDescriptionList.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/SecretValueResourceDescriptionList.java new file mode 100644 index 000000000000..72823c260840 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/SecretValueResourceDescriptionList.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.servicefabricmesh.fluent.models.SecretValueResourceDescriptionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * A pageable list of values of a secret resource. The information does not include only the name of the value and not + * the actual unencrypted value. + */ +@Fluent +public final class SecretValueResourceDescriptionList { + /* + * One page of the list. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URI to fetch the next page of the list. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of SecretValueResourceDescriptionList class. */ + public SecretValueResourceDescriptionList() { + } + + /** + * Get the value property: One page of the list. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: One page of the list. + * + * @param value the value value to set. + * @return the SecretValueResourceDescriptionList object itself. + */ + public SecretValueResourceDescriptionList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URI to fetch the next page of the list. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URI to fetch the next page of the list. + * + * @param nextLink the nextLink value to set. + * @return the SecretValueResourceDescriptionList object itself. + */ + public SecretValueResourceDescriptionList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/SecretValues.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/SecretValues.java new file mode 100644 index 000000000000..afa97474a8d7 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/SecretValues.java @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.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 SecretValues. */ +public interface SecretValues { + /** + * Gets the specified secret value resource. + * + *

Get the information about the specified named secret value resources. The information does not include the + * actual value of the secret. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier + * for the value. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about the specified named secret value resources along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String secretResourceName, String secretValueResourceName, Context context); + + /** + * Gets the specified secret value resource. + * + *

Get the information about the specified named secret value resources. The information does not include the + * actual value of the secret. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier + * for the value. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about the specified named secret value resources. + */ + SecretValueResourceDescription get( + String resourceGroupName, String secretResourceName, String secretValueResourceName); + + /** + * Deletes the specified value of the named secret resource. + * + *

Deletes the secret value resource identified by the name. The name of the resource is typically the version + * associated with that value. Deletion will fail if the specified value is in use. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier + * for the value. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteWithResponse( + String resourceGroupName, String secretResourceName, String secretValueResourceName, Context context); + + /** + * Deletes the specified value of the named secret resource. + * + *

Deletes the secret value resource identified by the name. The name of the resource is typically the version + * associated with that value. Deletion will fail if the specified value is in use. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier + * for the value. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 secretResourceName, String secretValueResourceName); + + /** + * List names of all values of the specified secret resource. + * + *

Gets information about all secret value resources of the specified secret resource. The information includes + * the names of the secret value resources, but not the actual values. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 all secret value resources of the specified secret resource as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String secretResourceName); + + /** + * List names of all values of the specified secret resource. + * + *

Gets information about all secret value resources of the specified secret resource. The information includes + * the names of the secret value resources, but not the actual values. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 all secret value resources of the specified secret resource as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, String secretResourceName, Context context); + + /** + * Lists the specified value of the secret resource. + * + *

Lists the decrypted value of the specified named value of the secret resource. This is a privileged operation. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier + * for the value. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return this type represents the unencrypted value of the secret along with {@link Response}. + */ + Response listValueWithResponse( + String resourceGroupName, String secretResourceName, String secretValueResourceName, Context context); + + /** + * Lists the specified value of the secret resource. + * + *

Lists the decrypted value of the specified named value of the secret resource. This is a privileged operation. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier + * for the value. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return this type represents the unencrypted value of the secret. + */ + SecretValue listValue(String resourceGroupName, String secretResourceName, String secretValueResourceName); + + /** + * Gets the specified secret value resource. + * + *

Get the information about the specified named secret value resources. The information does not include the + * actual value of the secret. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about the specified named secret value resources along with {@link Response}. + */ + SecretValueResourceDescription getById(String id); + + /** + * Gets the specified secret value resource. + * + *

Get the information about the specified named secret value resources. The information does not include the + * actual value of the secret. + * + * @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.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about the specified named secret value resources along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified value of the named secret resource. + * + *

Deletes the secret value resource identified by the name. The name of the resource is typically the version + * associated with that value. Deletion will fail if the specified value is in use. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 value of the named secret resource. + * + *

Deletes the secret value resource identified by the name. The name of the resource is typically the version + * associated with that value. Deletion will fail if the specified value is in use. + * + * @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.resourcemanager.servicefabricmesh.models.ErrorErrorModelException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new SecretValueResourceDescription resource. + * + * @param name resource name. + * @return the first stage of the new SecretValueResourceDescription definition. + */ + SecretValueResourceDescription.DefinitionStages.Blank define(String name); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/Secrets.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/Secrets.java new file mode 100644 index 000000000000..85be36bcc47b --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/Secrets.java @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.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 Secrets. */ +public interface Secrets { + /** + * Gets the secret resource with the given name. + * + *

Gets the information about the secret resource with the given name. The information include the description + * and other properties of the secret. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about the secret resource with the given name along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String secretResourceName, Context context); + + /** + * Gets the secret resource with the given name. + * + *

Gets the information about the secret resource with the given name. The information include the description + * and other properties of the secret. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about the secret resource with the given name. + */ + SecretResourceDescription getByResourceGroup(String resourceGroupName, String secretResourceName); + + /** + * Deletes the secret resource. + * + *

Deletes the secret resource identified by the name. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByResourceGroupWithResponse( + String resourceGroupName, String secretResourceName, Context context); + + /** + * Deletes the secret resource. + * + *

Deletes the secret resource identified by the name. + * + * @param resourceGroupName Azure resource group name. + * @param secretResourceName The name of the secret resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 secretResourceName); + + /** + * Gets all the secret resources in a given resource group. + * + *

Gets the information about all secret resources in a given resource group. The information include the + * description and other properties of the Secret. + * + * @param resourceGroupName Azure resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about all secret resources in a given resource group as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all the secret resources in a given resource group. + * + *

Gets the information about all secret resources in a given resource group. The information include the + * description and other properties of the Secret. + * + * @param resourceGroupName Azure resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about all secret resources in a given resource group as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all the secret resources in a given subscription. + * + *

Gets the information about all secret resources in a given resource group. The information include the + * description and other properties of the secret. + * + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about all secret resources in a given resource group as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(); + + /** + * Gets all the secret resources in a given subscription. + * + *

Gets the information about all secret resources in a given resource group. The information include the + * description and other properties of the secret. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about all secret resources in a given resource group as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Gets the secret resource with the given name. + * + *

Gets the information about the secret resource with the given name. The information include the description + * and other properties of the secret. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about the secret resource with the given name along with {@link Response}. + */ + SecretResourceDescription getById(String id); + + /** + * Gets the secret resource with the given name. + * + *

Gets the information about the secret resource with the given name. The information include the description + * and other properties of the secret. + * + * @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.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about the secret resource with the given name along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the secret resource. + * + *

Deletes the secret resource identified by the name. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 secret resource. + * + *

Deletes the secret resource identified by the name. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new SecretResourceDescription resource. + * + * @param name resource name. + * @return the first stage of the new SecretResourceDescription definition. + */ + SecretResourceDescription.DefinitionStages.Blank define(String name); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ServiceProperties.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ServiceProperties.java new file mode 100644 index 000000000000..785f1967497e --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ServiceProperties.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.servicefabricmesh.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes properties of a service resource. */ +@Fluent +public class ServiceProperties { + /* + * User readable description of the service. + */ + @JsonProperty(value = "description") + private String description; + + /* + * The number of replicas of the service to create. Defaults to 1 if not specified. + */ + @JsonProperty(value = "replicaCount") + private Integer replicaCount; + + /* + * Auto scaling policies + */ + @JsonProperty(value = "autoScalingPolicies") + private List autoScalingPolicies; + + /* + * Status of the service. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private ResourceStatus status; + + /* + * Gives additional information about the current status of the service. + */ + @JsonProperty(value = "statusDetails", access = JsonProperty.Access.WRITE_ONLY) + private String statusDetails; + + /* + * Describes the health state of an application resource. + */ + @JsonProperty(value = "healthState", access = JsonProperty.Access.WRITE_ONLY) + private HealthState healthState; + + /* + * When the service's health state is not 'Ok', this additional details from service fabric Health Manager for the + * user to know why the service is marked unhealthy. + */ + @JsonProperty(value = "unhealthyEvaluation", access = JsonProperty.Access.WRITE_ONLY) + private String unhealthyEvaluation; + + /** Creates an instance of ServiceProperties class. */ + public ServiceProperties() { + } + + /** + * Get the description property: User readable description of the service. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: User readable description of the service. + * + * @param description the description value to set. + * @return the ServiceProperties object itself. + */ + public ServiceProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the replicaCount property: The number of replicas of the service to create. Defaults to 1 if not specified. + * + * @return the replicaCount value. + */ + public Integer replicaCount() { + return this.replicaCount; + } + + /** + * Set the replicaCount property: The number of replicas of the service to create. Defaults to 1 if not specified. + * + * @param replicaCount the replicaCount value to set. + * @return the ServiceProperties object itself. + */ + public ServiceProperties withReplicaCount(Integer replicaCount) { + this.replicaCount = replicaCount; + return this; + } + + /** + * Get the autoScalingPolicies property: Auto scaling policies. + * + * @return the autoScalingPolicies value. + */ + public List autoScalingPolicies() { + return this.autoScalingPolicies; + } + + /** + * Set the autoScalingPolicies property: Auto scaling policies. + * + * @param autoScalingPolicies the autoScalingPolicies value to set. + * @return the ServiceProperties object itself. + */ + public ServiceProperties withAutoScalingPolicies(List autoScalingPolicies) { + this.autoScalingPolicies = autoScalingPolicies; + return this; + } + + /** + * Get the status property: Status of the service. + * + * @return the status value. + */ + public ResourceStatus status() { + return this.status; + } + + /** + * Get the statusDetails property: Gives additional information about the current status of the service. + * + * @return the statusDetails value. + */ + public String statusDetails() { + return this.statusDetails; + } + + /** + * Get the healthState property: Describes the health state of an application resource. + * + * @return the healthState value. + */ + public HealthState healthState() { + return this.healthState; + } + + /** + * Get the unhealthyEvaluation property: When the service's health state is not 'Ok', this additional details from + * service fabric Health Manager for the user to know why the service is marked unhealthy. + * + * @return the unhealthyEvaluation value. + */ + public String unhealthyEvaluation() { + return this.unhealthyEvaluation; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (autoScalingPolicies() != null) { + autoScalingPolicies().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ServiceReplicaDescription.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ServiceReplicaDescription.java new file mode 100644 index 000000000000..b1594c9ad50b --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ServiceReplicaDescription.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.servicefabricmesh.models; + +import com.azure.resourcemanager.servicefabricmesh.fluent.models.ServiceReplicaDescriptionInner; +import java.util.List; + +/** An immutable client-side representation of ServiceReplicaDescription. */ +public interface ServiceReplicaDescription { + /** + * Gets the osType property: The operation system required by the code in service. + * + * @return the osType value. + */ + OperatingSystemType osType(); + + /** + * Gets the codePackages property: Describes the set of code packages that forms the service. A code package + * describes the container and the properties for running it. All the code packages are started together on the same + * host and share the same context (network, process etc.). + * + * @return the codePackages value. + */ + List codePackages(); + + /** + * Gets the networkRefs property: The names of the private networks that this service needs to be part of. + * + * @return the networkRefs value. + */ + List networkRefs(); + + /** + * Gets the diagnostics property: Reference to sinks in DiagnosticsDescription. + * + * @return the diagnostics value. + */ + DiagnosticsRef diagnostics(); + + /** + * Gets the replicaName property: Name of the replica. + * + * @return the replicaName value. + */ + String replicaName(); + + /** + * Gets the inner com.azure.resourcemanager.servicefabricmesh.fluent.models.ServiceReplicaDescriptionInner object. + * + * @return the inner object. + */ + ServiceReplicaDescriptionInner innerModel(); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ServiceReplicaDescriptionList.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ServiceReplicaDescriptionList.java new file mode 100644 index 000000000000..35d678af2c88 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ServiceReplicaDescriptionList.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.servicefabricmesh.fluent.models.ServiceReplicaDescriptionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A pageable list of service replicas. */ +@Fluent +public final class ServiceReplicaDescriptionList { + /* + * One page of the list. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URI to fetch the next page of the list. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of ServiceReplicaDescriptionList class. */ + public ServiceReplicaDescriptionList() { + } + + /** + * Get the value property: One page of the list. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: One page of the list. + * + * @param value the value value to set. + * @return the ServiceReplicaDescriptionList object itself. + */ + public ServiceReplicaDescriptionList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URI to fetch the next page of the list. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URI to fetch the next page of the list. + * + * @param nextLink the nextLink value to set. + * @return the ServiceReplicaDescriptionList object itself. + */ + public ServiceReplicaDescriptionList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ServiceReplicaProperties.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ServiceReplicaProperties.java new file mode 100644 index 000000000000..7ce35688a903 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ServiceReplicaProperties.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.servicefabricmesh.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes the properties of a service replica. */ +@Fluent +public class ServiceReplicaProperties { + /* + * The operation system required by the code in service. + */ + @JsonProperty(value = "osType", required = true) + private OperatingSystemType osType; + + /* + * Describes the set of code packages that forms the service. A code package describes the container and the + * properties for running it. All the code packages are started together on the same host and share the same + * context (network, process etc.). + */ + @JsonProperty(value = "codePackages", required = true) + private List codePackages; + + /* + * The names of the private networks that this service needs to be part of. + */ + @JsonProperty(value = "networkRefs") + private List networkRefs; + + /* + * Reference to sinks in DiagnosticsDescription. + */ + @JsonProperty(value = "diagnostics") + private DiagnosticsRef diagnostics; + + /** Creates an instance of ServiceReplicaProperties class. */ + public ServiceReplicaProperties() { + } + + /** + * Get the osType property: The operation system required by the code in service. + * + * @return the osType value. + */ + public OperatingSystemType osType() { + return this.osType; + } + + /** + * Set the osType property: The operation system required by the code in service. + * + * @param osType the osType value to set. + * @return the ServiceReplicaProperties object itself. + */ + public ServiceReplicaProperties withOsType(OperatingSystemType osType) { + this.osType = osType; + return this; + } + + /** + * Get the codePackages property: Describes the set of code packages that forms the service. A code package + * describes the container and the properties for running it. All the code packages are started together on the same + * host and share the same context (network, process etc.). + * + * @return the codePackages value. + */ + public List codePackages() { + return this.codePackages; + } + + /** + * Set the codePackages property: Describes the set of code packages that forms the service. A code package + * describes the container and the properties for running it. All the code packages are started together on the same + * host and share the same context (network, process etc.). + * + * @param codePackages the codePackages value to set. + * @return the ServiceReplicaProperties object itself. + */ + public ServiceReplicaProperties withCodePackages(List codePackages) { + this.codePackages = codePackages; + return this; + } + + /** + * Get the networkRefs property: The names of the private networks that this service needs to be part of. + * + * @return the networkRefs value. + */ + public List networkRefs() { + return this.networkRefs; + } + + /** + * Set the networkRefs property: The names of the private networks that this service needs to be part of. + * + * @param networkRefs the networkRefs value to set. + * @return the ServiceReplicaProperties object itself. + */ + public ServiceReplicaProperties withNetworkRefs(List networkRefs) { + this.networkRefs = networkRefs; + return this; + } + + /** + * Get the diagnostics property: Reference to sinks in DiagnosticsDescription. + * + * @return the diagnostics value. + */ + public DiagnosticsRef diagnostics() { + return this.diagnostics; + } + + /** + * Set the diagnostics property: Reference to sinks in DiagnosticsDescription. + * + * @param diagnostics the diagnostics value to set. + * @return the ServiceReplicaProperties object itself. + */ + public ServiceReplicaProperties withDiagnostics(DiagnosticsRef diagnostics) { + this.diagnostics = diagnostics; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (osType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property osType in model ServiceReplicaProperties")); + } + if (codePackages() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property codePackages in model ServiceReplicaProperties")); + } else { + codePackages().forEach(e -> e.validate()); + } + if (networkRefs() != null) { + networkRefs().forEach(e -> e.validate()); + } + if (diagnostics() != null) { + diagnostics().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ServiceReplicaProperties.class); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ServiceReplicas.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ServiceReplicas.java new file mode 100644 index 000000000000..02ebd79bfb99 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ServiceReplicas.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.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 ServiceReplicas. */ +public interface ServiceReplicas { + /** + * Gets the given replica of the service of an application. + * + *

Gets the information about the service replica with the given name. The information include the description + * and other properties of the service replica. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @param serviceResourceName The identity of the service. + * @param replicaName Service Fabric replica name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about the service replica with the given name along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, + String applicationResourceName, + String serviceResourceName, + String replicaName, + Context context); + + /** + * Gets the given replica of the service of an application. + * + *

Gets the information about the service replica with the given name. The information include the description + * and other properties of the service replica. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @param serviceResourceName The identity of the service. + * @param replicaName Service Fabric replica name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about the service replica with the given name. + */ + ServiceReplicaDescription get( + String resourceGroupName, String applicationResourceName, String serviceResourceName, String replicaName); + + /** + * Gets replicas of a given service. + * + *

Gets the information about all replicas of a given service of an application. The information includes the + * runtime properties of the replica instance. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @param serviceResourceName The identity of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about all replicas of a given service of an application as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, String applicationResourceName, String serviceResourceName); + + /** + * Gets replicas of a given service. + * + *

Gets the information about all replicas of a given service of an application. The information includes the + * runtime properties of the replica instance. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @param serviceResourceName The identity of the service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about all replicas of a given service of an application as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, String applicationResourceName, String serviceResourceName, Context context); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ServiceResourceDescription.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ServiceResourceDescription.java new file mode 100644 index 000000000000..2de67993fb01 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ServiceResourceDescription.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.servicefabricmesh.models; + +import com.azure.resourcemanager.servicefabricmesh.fluent.models.ServiceResourceDescriptionInner; +import java.util.List; + +/** An immutable client-side representation of ServiceResourceDescription. */ +public interface ServiceResourceDescription { + /** + * Gets the id property: Fully qualified resource Id for 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 name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the osType property: The operation system required by the code in service. + * + * @return the osType value. + */ + OperatingSystemType osType(); + + /** + * Gets the codePackages property: Describes the set of code packages that forms the service. A code package + * describes the container and the properties for running it. All the code packages are started together on the same + * host and share the same context (network, process etc.). + * + * @return the codePackages value. + */ + List codePackages(); + + /** + * Gets the networkRefs property: The names of the private networks that this service needs to be part of. + * + * @return the networkRefs value. + */ + List networkRefs(); + + /** + * Gets the diagnostics property: Reference to sinks in DiagnosticsDescription. + * + * @return the diagnostics value. + */ + DiagnosticsRef diagnostics(); + + /** + * Gets the description property: User readable description of the service. + * + * @return the description value. + */ + String description(); + + /** + * Gets the replicaCount property: The number of replicas of the service to create. Defaults to 1 if not specified. + * + * @return the replicaCount value. + */ + Integer replicaCount(); + + /** + * Gets the autoScalingPolicies property: Auto scaling policies. + * + * @return the autoScalingPolicies value. + */ + List autoScalingPolicies(); + + /** + * Gets the status property: Status of the service. + * + * @return the status value. + */ + ResourceStatus status(); + + /** + * Gets the statusDetails property: Gives additional information about the current status of the service. + * + * @return the statusDetails value. + */ + String statusDetails(); + + /** + * Gets the healthState property: Describes the health state of an application resource. + * + * @return the healthState value. + */ + HealthState healthState(); + + /** + * Gets the unhealthyEvaluation property: When the service's health state is not 'Ok', this additional details from + * service fabric Health Manager for the user to know why the service is marked unhealthy. + * + * @return the unhealthyEvaluation value. + */ + String unhealthyEvaluation(); + + /** + * Gets the provisioningState property: State of the resource. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.servicefabricmesh.fluent.models.ServiceResourceDescriptionInner object. + * + * @return the inner object. + */ + ServiceResourceDescriptionInner innerModel(); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ServiceResourceDescriptionList.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ServiceResourceDescriptionList.java new file mode 100644 index 000000000000..0b8c615f7700 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ServiceResourceDescriptionList.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.servicefabricmesh.fluent.models.ServiceResourceDescriptionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A pageable list of service resources. */ +@Fluent +public final class ServiceResourceDescriptionList { + /* + * One page of the list. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URI to fetch the next page of the list. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of ServiceResourceDescriptionList class. */ + public ServiceResourceDescriptionList() { + } + + /** + * Get the value property: One page of the list. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: One page of the list. + * + * @param value the value value to set. + * @return the ServiceResourceDescriptionList object itself. + */ + public ServiceResourceDescriptionList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URI to fetch the next page of the list. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URI to fetch the next page of the list. + * + * @param nextLink the nextLink value to set. + * @return the ServiceResourceDescriptionList object itself. + */ + public ServiceResourceDescriptionList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ServiceSpecification.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ServiceSpecification.java new file mode 100644 index 000000000000..b59798104dc0 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/ServiceSpecification.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Resource metrics service provided by Microsoft.Insights resource provider. */ +@Fluent +public final class ServiceSpecification { + /* + * The metricSpecifications property. + */ + @JsonProperty(value = "metricSpecifications") + private List metricSpecifications; + + /* + * The logSpecifications property. + */ + @JsonProperty(value = "logSpecifications") + private List logSpecifications; + + /** Creates an instance of ServiceSpecification class. */ + public ServiceSpecification() { + } + + /** + * Get the metricSpecifications property: The metricSpecifications property. + * + * @return the metricSpecifications value. + */ + public List metricSpecifications() { + return this.metricSpecifications; + } + + /** + * Set the metricSpecifications property: The metricSpecifications property. + * + * @param metricSpecifications the metricSpecifications value to set. + * @return the ServiceSpecification object itself. + */ + public ServiceSpecification withMetricSpecifications(List metricSpecifications) { + this.metricSpecifications = metricSpecifications; + return this; + } + + /** + * Get the logSpecifications property: The logSpecifications property. + * + * @return the logSpecifications value. + */ + public List logSpecifications() { + return this.logSpecifications; + } + + /** + * Set the logSpecifications property: The logSpecifications property. + * + * @param logSpecifications the logSpecifications value to set. + * @return the ServiceSpecification object itself. + */ + public ServiceSpecification withLogSpecifications(List logSpecifications) { + this.logSpecifications = logSpecifications; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (metricSpecifications() != null) { + metricSpecifications().forEach(e -> e.validate()); + } + if (logSpecifications() != null) { + logSpecifications().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/Services.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/Services.java new file mode 100644 index 000000000000..7985e46c7d9b --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/Services.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.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 Services. */ +public interface Services { + /** + * Gets the service resource with the given name. + * + *

Gets the information about the service resource with the given name. The information include the description + * and other properties of the service. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @param serviceResourceName The identity of the service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about the service resource with the given name along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String applicationResourceName, String serviceResourceName, Context context); + + /** + * Gets the service resource with the given name. + * + *

Gets the information about the service resource with the given name. The information include the description + * and other properties of the service. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @param serviceResourceName The identity of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about the service resource with the given name. + */ + ServiceResourceDescription get( + String resourceGroupName, String applicationResourceName, String serviceResourceName); + + /** + * Lists all the service resources. + * + *

Gets the information about all services of an application resource. The information include the description + * and other properties of the Service. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about all services of an application resource as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String applicationResourceName); + + /** + * Lists all the service resources. + * + *

Gets the information about all services of an application resource. The information include the description + * and other properties of the Service. + * + * @param resourceGroupName Azure resource group name. + * @param applicationResourceName The identity of the application. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about all services of an application resource as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, String applicationResourceName, Context context); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/Setting.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/Setting.java new file mode 100644 index 000000000000..671326b2b14d --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/Setting.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a setting for the container. The setting file path can be fetched from environment variable + * "Fabric_SettingPath". The path for Windows container is "C:\\secrets". The path for Linux container is + * "/var/secrets". + */ +@Fluent +public final class Setting { + /* + * The name of the setting. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The value of the setting. + */ + @JsonProperty(value = "value") + private String value; + + /** Creates an instance of Setting class. */ + public Setting() { + } + + /** + * Get the name property: The name of the setting. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the setting. + * + * @param name the name value to set. + * @return the Setting object itself. + */ + public Setting withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value property: The value of the setting. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The value of the setting. + * + * @param value the value value to set. + * @return the Setting object itself. + */ + public Setting withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/SizeTypes.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/SizeTypes.java new file mode 100644 index 000000000000..68a4c98be853 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/SizeTypes.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.servicefabricmesh.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Volume size. */ +public final class SizeTypes extends ExpandableStringEnum { + /** Static value Small for SizeTypes. */ + public static final SizeTypes SMALL = fromString("Small"); + + /** Static value Medium for SizeTypes. */ + public static final SizeTypes MEDIUM = fromString("Medium"); + + /** Static value Large for SizeTypes. */ + public static final SizeTypes LARGE = fromString("Large"); + + /** + * Creates a new instance of SizeTypes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SizeTypes() { + } + + /** + * Creates or finds a SizeTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding SizeTypes. + */ + @JsonCreator + public static SizeTypes fromString(String name) { + return fromString(name, SizeTypes.class); + } + + /** + * Gets known SizeTypes values. + * + * @return known SizeTypes values. + */ + public static Collection values() { + return values(SizeTypes.class); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/TcpConfig.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/TcpConfig.java new file mode 100644 index 000000000000..c0e4741aa02d --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/TcpConfig.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.servicefabricmesh.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the tcp configuration for external connectivity for this network. */ +@Fluent +public final class TcpConfig { + /* + * tcp gateway config name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Specifies the port at which the service endpoint below needs to be exposed. + */ + @JsonProperty(value = "port", required = true) + private int port; + + /* + * Describes destination endpoint for routing traffic. + */ + @JsonProperty(value = "destination", required = true) + private GatewayDestination destination; + + /** Creates an instance of TcpConfig class. */ + public TcpConfig() { + } + + /** + * Get the name property: tcp gateway config name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: tcp gateway config name. + * + * @param name the name value to set. + * @return the TcpConfig object itself. + */ + public TcpConfig withName(String name) { + this.name = name; + return this; + } + + /** + * Get the port property: Specifies the port at which the service endpoint below needs to be exposed. + * + * @return the port value. + */ + public int port() { + return this.port; + } + + /** + * Set the port property: Specifies the port at which the service endpoint below needs to be exposed. + * + * @param port the port value to set. + * @return the TcpConfig object itself. + */ + public TcpConfig withPort(int port) { + this.port = port; + return this; + } + + /** + * Get the destination property: Describes destination endpoint for routing traffic. + * + * @return the destination value. + */ + public GatewayDestination destination() { + return this.destination; + } + + /** + * Set the destination property: Describes destination endpoint for routing traffic. + * + * @param destination the destination value to set. + * @return the TcpConfig object itself. + */ + public TcpConfig withDestination(GatewayDestination destination) { + this.destination = destination; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("Missing required property name in model TcpConfig")); + } + if (destination() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property destination in model TcpConfig")); + } else { + destination().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(TcpConfig.class); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/VolumeProperties.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/VolumeProperties.java new file mode 100644 index 000000000000..831fbc1380cd --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/VolumeProperties.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes properties of a volume resource. */ +@Fluent +public class VolumeProperties { + /* + * User readable description of the volume. + */ + @JsonProperty(value = "description") + private String description; + + /* + * Status of the volume. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private ResourceStatus status; + + /* + * Gives additional information about the current status of the volume. + */ + @JsonProperty(value = "statusDetails", access = JsonProperty.Access.WRITE_ONLY) + private String statusDetails; + + /* + * Provider of the volume. + */ + @JsonProperty(value = "provider", required = true) + private VolumeProvider provider; + + /* + * This type describes a volume provided by an Azure Files file share. + */ + @JsonProperty(value = "azureFileParameters") + private VolumeProviderParametersAzureFile azureFileParameters; + + /** Creates an instance of VolumeProperties class. */ + public VolumeProperties() { + } + + /** + * Get the description property: User readable description of the volume. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: User readable description of the volume. + * + * @param description the description value to set. + * @return the VolumeProperties object itself. + */ + public VolumeProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the status property: Status of the volume. + * + * @return the status value. + */ + public ResourceStatus status() { + return this.status; + } + + /** + * Get the statusDetails property: Gives additional information about the current status of the volume. + * + * @return the statusDetails value. + */ + public String statusDetails() { + return this.statusDetails; + } + + /** + * Get the provider property: Provider of the volume. + * + * @return the provider value. + */ + public VolumeProvider provider() { + return this.provider; + } + + /** + * Set the provider property: Provider of the volume. + * + * @param provider the provider value to set. + * @return the VolumeProperties object itself. + */ + public VolumeProperties withProvider(VolumeProvider provider) { + this.provider = provider; + return this; + } + + /** + * Get the azureFileParameters property: This type describes a volume provided by an Azure Files file share. + * + * @return the azureFileParameters value. + */ + public VolumeProviderParametersAzureFile azureFileParameters() { + return this.azureFileParameters; + } + + /** + * Set the azureFileParameters property: This type describes a volume provided by an Azure Files file share. + * + * @param azureFileParameters the azureFileParameters value to set. + * @return the VolumeProperties object itself. + */ + public VolumeProperties withAzureFileParameters(VolumeProviderParametersAzureFile azureFileParameters) { + this.azureFileParameters = azureFileParameters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (provider() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property provider in model VolumeProperties")); + } + if (azureFileParameters() != null) { + azureFileParameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VolumeProperties.class); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/VolumeProvider.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/VolumeProvider.java new file mode 100644 index 000000000000..84cace7c3085 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/VolumeProvider.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Describes the provider of the volume resource. */ +public final class VolumeProvider extends ExpandableStringEnum { + /** Static value SFAzureFile for VolumeProvider. */ + public static final VolumeProvider SFAZURE_FILE = fromString("SFAzureFile"); + + /** + * Creates a new instance of VolumeProvider value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VolumeProvider() { + } + + /** + * Creates or finds a VolumeProvider from its string representation. + * + * @param name a name to look for. + * @return the corresponding VolumeProvider. + */ + @JsonCreator + public static VolumeProvider fromString(String name) { + return fromString(name, VolumeProvider.class); + } + + /** + * Gets known VolumeProvider values. + * + * @return known VolumeProvider values. + */ + public static Collection values() { + return values(VolumeProvider.class); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/VolumeProviderParametersAzureFile.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/VolumeProviderParametersAzureFile.java new file mode 100644 index 000000000000..b915fc3db3bd --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/VolumeProviderParametersAzureFile.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** This type describes a volume provided by an Azure Files file share. */ +@Fluent +public final class VolumeProviderParametersAzureFile { + /* + * Name of the Azure storage account for the File Share. + */ + @JsonProperty(value = "accountName", required = true) + private String accountName; + + /* + * Access key of the Azure storage account for the File Share. + */ + @JsonProperty(value = "accountKey") + private String accountKey; + + /* + * Name of the Azure Files file share that provides storage for the volume. + */ + @JsonProperty(value = "shareName", required = true) + private String shareName; + + /** Creates an instance of VolumeProviderParametersAzureFile class. */ + public VolumeProviderParametersAzureFile() { + } + + /** + * Get the accountName property: Name of the Azure storage account for the File Share. + * + * @return the accountName value. + */ + public String accountName() { + return this.accountName; + } + + /** + * Set the accountName property: Name of the Azure storage account for the File Share. + * + * @param accountName the accountName value to set. + * @return the VolumeProviderParametersAzureFile object itself. + */ + public VolumeProviderParametersAzureFile withAccountName(String accountName) { + this.accountName = accountName; + return this; + } + + /** + * Get the accountKey property: Access key of the Azure storage account for the File Share. + * + * @return the accountKey value. + */ + public String accountKey() { + return this.accountKey; + } + + /** + * Set the accountKey property: Access key of the Azure storage account for the File Share. + * + * @param accountKey the accountKey value to set. + * @return the VolumeProviderParametersAzureFile object itself. + */ + public VolumeProviderParametersAzureFile withAccountKey(String accountKey) { + this.accountKey = accountKey; + return this; + } + + /** + * Get the shareName property: Name of the Azure Files file share that provides storage for the volume. + * + * @return the shareName value. + */ + public String shareName() { + return this.shareName; + } + + /** + * Set the shareName property: Name of the Azure Files file share that provides storage for the volume. + * + * @param shareName the shareName value to set. + * @return the VolumeProviderParametersAzureFile object itself. + */ + public VolumeProviderParametersAzureFile withShareName(String shareName) { + this.shareName = shareName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (accountName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property accountName in model VolumeProviderParametersAzureFile")); + } + if (shareName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property shareName in model VolumeProviderParametersAzureFile")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VolumeProviderParametersAzureFile.class); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/VolumeReference.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/VolumeReference.java new file mode 100644 index 000000000000..d29a804d5bfa --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/VolumeReference.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a reference to a volume resource. */ +@Fluent +public class VolumeReference { + /* + * Name of the volume being referenced. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The flag indicating whether the volume is read only. Default is 'false'. + */ + @JsonProperty(value = "readOnly") + private Boolean readOnly; + + /* + * The path within the container at which the volume should be mounted. Only valid path characters are allowed. + */ + @JsonProperty(value = "destinationPath", required = true) + private String destinationPath; + + /** Creates an instance of VolumeReference class. */ + public VolumeReference() { + } + + /** + * Get the name property: Name of the volume being referenced. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the volume being referenced. + * + * @param name the name value to set. + * @return the VolumeReference object itself. + */ + public VolumeReference withName(String name) { + this.name = name; + return this; + } + + /** + * Get the readOnly property: The flag indicating whether the volume is read only. Default is 'false'. + * + * @return the readOnly value. + */ + public Boolean readOnly() { + return this.readOnly; + } + + /** + * Set the readOnly property: The flag indicating whether the volume is read only. Default is 'false'. + * + * @param readOnly the readOnly value to set. + * @return the VolumeReference object itself. + */ + public VolumeReference withReadOnly(Boolean readOnly) { + this.readOnly = readOnly; + return this; + } + + /** + * Get the destinationPath property: The path within the container at which the volume should be mounted. Only valid + * path characters are allowed. + * + * @return the destinationPath value. + */ + public String destinationPath() { + return this.destinationPath; + } + + /** + * Set the destinationPath property: The path within the container at which the volume should be mounted. Only valid + * path characters are allowed. + * + * @param destinationPath the destinationPath value to set. + * @return the VolumeReference object itself. + */ + public VolumeReference withDestinationPath(String destinationPath) { + this.destinationPath = destinationPath; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model VolumeReference")); + } + if (destinationPath() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property destinationPath in model VolumeReference")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VolumeReference.class); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/VolumeResourceDescription.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/VolumeResourceDescription.java new file mode 100644 index 000000000000..6ba8f4926bb9 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/VolumeResourceDescription.java @@ -0,0 +1,232 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicefabricmesh.fluent.models.VolumeResourceDescriptionInner; +import java.util.Map; + +/** An immutable client-side representation of VolumeResourceDescription. */ +public interface VolumeResourceDescription { + /** + * 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 description property: User readable description of the volume. + * + * @return the description value. + */ + String description(); + + /** + * Gets the status property: Status of the volume. + * + * @return the status value. + */ + ResourceStatus status(); + + /** + * Gets the statusDetails property: Gives additional information about the current status of the volume. + * + * @return the statusDetails value. + */ + String statusDetails(); + + /** + * Gets the provider property: Provider of the volume. + * + * @return the provider value. + */ + VolumeProvider provider(); + + /** + * Gets the azureFileParameters property: This type describes a volume provided by an Azure Files file share. + * + * @return the azureFileParameters value. + */ + VolumeProviderParametersAzureFile azureFileParameters(); + + /** + * Gets the provisioningState property: State of the resource. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * 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.servicefabricmesh.fluent.models.VolumeResourceDescriptionInner object. + * + * @return the inner object. + */ + VolumeResourceDescriptionInner innerModel(); + + /** The entirety of the VolumeResourceDescription definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithProvider, + DefinitionStages.WithCreate { + } + /** The VolumeResourceDescription definition stages. */ + interface DefinitionStages { + /** The first stage of the VolumeResourceDescription definition. */ + interface Blank extends WithLocation { + } + /** The stage of the VolumeResourceDescription 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 VolumeResourceDescription definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName Azure resource group name. + * @return the next definition stage. + */ + WithProvider withExistingResourceGroup(String resourceGroupName); + } + /** The stage of the VolumeResourceDescription definition allowing to specify provider. */ + interface WithProvider { + /** + * Specifies the provider property: Provider of the volume.. + * + * @param provider Provider of the volume. + * @return the next definition stage. + */ + WithCreate withProvider(VolumeProvider provider); + } + /** + * The stage of the VolumeResourceDescription 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.WithDescription, + DefinitionStages.WithAzureFileParameters { + /** + * Executes the create request. + * + * @return the created resource. + */ + VolumeResourceDescription create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + VolumeResourceDescription create(Context context); + } + /** The stage of the VolumeResourceDescription 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 VolumeResourceDescription definition allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: User readable description of the volume.. + * + * @param description User readable description of the volume. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + /** The stage of the VolumeResourceDescription definition allowing to specify azureFileParameters. */ + interface WithAzureFileParameters { + /** + * Specifies the azureFileParameters property: This type describes a volume provided by an Azure Files file + * share.. + * + * @param azureFileParameters This type describes a volume provided by an Azure Files file share. + * @return the next definition stage. + */ + WithCreate withAzureFileParameters(VolumeProviderParametersAzureFile azureFileParameters); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + VolumeResourceDescription refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + VolumeResourceDescription refresh(Context context); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/VolumeResourceDescriptionList.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/VolumeResourceDescriptionList.java new file mode 100644 index 000000000000..f6c8b5fd6eb0 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/VolumeResourceDescriptionList.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.servicefabricmesh.fluent.models.VolumeResourceDescriptionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A pageable list of volume resources. */ +@Fluent +public final class VolumeResourceDescriptionList { + /* + * One page of the list. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URI to fetch the next page of the list. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of VolumeResourceDescriptionList class. */ + public VolumeResourceDescriptionList() { + } + + /** + * Get the value property: One page of the list. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: One page of the list. + * + * @param value the value value to set. + * @return the VolumeResourceDescriptionList object itself. + */ + public VolumeResourceDescriptionList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URI to fetch the next page of the list. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URI to fetch the next page of the list. + * + * @param nextLink the nextLink value to set. + * @return the VolumeResourceDescriptionList object itself. + */ + public VolumeResourceDescriptionList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/Volumes.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/Volumes.java new file mode 100644 index 000000000000..a0a73789b78d --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/Volumes.java @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.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 Volumes. */ +public interface Volumes { + /** + * Gets the volume resource with the given name. + * + *

Gets the information about the volume resource with the given name. The information include the description + * and other properties of the volume. + * + * @param resourceGroupName Azure resource group name. + * @param volumeResourceName The identity of the volume. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about the volume resource with the given name along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String volumeResourceName, Context context); + + /** + * Gets the volume resource with the given name. + * + *

Gets the information about the volume resource with the given name. The information include the description + * and other properties of the volume. + * + * @param resourceGroupName Azure resource group name. + * @param volumeResourceName The identity of the volume. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about the volume resource with the given name. + */ + VolumeResourceDescription getByResourceGroup(String resourceGroupName, String volumeResourceName); + + /** + * Deletes the volume resource. + * + *

Deletes the volume resource identified by the name. + * + * @param resourceGroupName Azure resource group name. + * @param volumeResourceName The identity of the volume. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByResourceGroupWithResponse( + String resourceGroupName, String volumeResourceName, Context context); + + /** + * Deletes the volume resource. + * + *

Deletes the volume resource identified by the name. + * + * @param resourceGroupName Azure resource group name. + * @param volumeResourceName The identity of the volume. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 volumeResourceName); + + /** + * Gets all the volume resources in a given resource group. + * + *

Gets the information about all volume resources in a given resource group. The information include the + * description and other properties of the Volume. + * + * @param resourceGroupName Azure resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about all volume resources in a given resource group as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all the volume resources in a given resource group. + * + *

Gets the information about all volume resources in a given resource group. The information include the + * description and other properties of the Volume. + * + * @param resourceGroupName Azure resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about all volume resources in a given resource group as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all the volume resources in a given subscription. + * + *

Gets the information about all volume resources in a given resource group. The information include the + * description and other properties of the volume. + * + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about all volume resources in a given resource group as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(); + + /** + * Gets all the volume resources in a given subscription. + * + *

Gets the information about all volume resources in a given resource group. The information include the + * description and other properties of the volume. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about all volume resources in a given resource group as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Gets the volume resource with the given name. + * + *

Gets the information about the volume resource with the given name. The information include the description + * and other properties of the volume. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about the volume resource with the given name along with {@link Response}. + */ + VolumeResourceDescription getById(String id); + + /** + * Gets the volume resource with the given name. + * + *

Gets the information about the volume resource with the given name. The information include the description + * and other properties of the volume. + * + * @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.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 about the volume resource with the given name along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the volume resource. + * + *

Deletes the volume resource identified by the name. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException 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 volume resource. + * + *

Deletes the volume resource identified by the name. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.servicefabricmesh.models.ErrorErrorModelException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new VolumeResourceDescription resource. + * + * @param name resource name. + * @return the first stage of the new VolumeResourceDescription definition. + */ + VolumeResourceDescription.DefinitionStages.Blank define(String name); +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/package-info.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/package-info.java new file mode 100644 index 000000000000..07b708af72f0 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the data models for ServiceFabricMeshManagementClient. Service Fabric Mesh Management Client. */ +package com.azure.resourcemanager.servicefabricmesh.models; diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/package-info.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/package-info.java new file mode 100644 index 000000000000..fd8c00e16b7d --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/com/azure/resourcemanager/servicefabricmesh/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the classes for ServiceFabricMeshManagementClient. Service Fabric Mesh Management Client. */ +package com.azure.resourcemanager.servicefabricmesh; diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/module-info.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/main/java/module-info.java new file mode 100644 index 000000000000..8d1f55da70f4 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/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.servicefabricmesh { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.servicefabricmesh; + exports com.azure.resourcemanager.servicefabricmesh.fluent; + exports com.azure.resourcemanager.servicefabricmesh.fluent.models; + exports com.azure.resourcemanager.servicefabricmesh.models; + + opens com.azure.resourcemanager.servicefabricmesh.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.servicefabricmesh.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/ApplicationCreateSamples.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/ApplicationCreateSamples.java new file mode 100644 index 000000000000..88cab863b720 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/ApplicationCreateSamples.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.generated; + +import com.azure.resourcemanager.servicefabricmesh.fluent.models.ServiceResourceDescriptionInner; +import com.azure.resourcemanager.servicefabricmesh.models.ContainerCodePackageProperties; +import com.azure.resourcemanager.servicefabricmesh.models.EndpointProperties; +import com.azure.resourcemanager.servicefabricmesh.models.EndpointRef; +import com.azure.resourcemanager.servicefabricmesh.models.NetworkRef; +import com.azure.resourcemanager.servicefabricmesh.models.OperatingSystemType; +import com.azure.resourcemanager.servicefabricmesh.models.ResourceRequests; +import com.azure.resourcemanager.servicefabricmesh.models.ResourceRequirements; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Application Create. */ +public final class ApplicationCreateSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/applications/create_update.json + */ + /** + * Sample code: CreateOrUpdateApplication. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void createOrUpdateApplication( + com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager + .applications() + .define("sampleApplication") + .withRegion("EastUS") + .withExistingResourceGroup("sbz_demo") + .withTags(mapOf()) + .withDescription("Service Fabric Mesh sample application.") + .withServices( + Arrays + .asList( + new ServiceResourceDescriptionInner() + .withName("helloWorldService") + .withOsType(OperatingSystemType.LINUX) + .withCodePackages( + Arrays + .asList( + new ContainerCodePackageProperties() + .withName("helloWorldCode") + .withImage("seabreeze/sbz-helloworld:1.0-alpine") + .withEndpoints( + Arrays + .asList( + new EndpointProperties() + .withName("helloWorldListener") + .withPort(80))) + .withResources( + new ResourceRequirements() + .withRequests( + new ResourceRequests().withMemoryInGB(1.0).withCpu(1.0))))) + .withNetworkRefs( + Arrays + .asList( + new NetworkRef() + .withName( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/sbz_demo/providers/Microsoft.ServiceFabricMesh/networks/sampleNetwork") + .withEndpointRefs( + Arrays.asList(new EndpointRef().withName("helloWorldListener"))))) + .withDescription("SeaBreeze Hello World Service.") + .withReplicaCount(1))) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/ApplicationDeleteSamples.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/ApplicationDeleteSamples.java new file mode 100644 index 000000000000..1b466278d15d --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/ApplicationDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.generated; + +/** Samples for Application Delete. */ +public final class ApplicationDeleteSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/applications/delete.json + */ + /** + * Sample code: DeleteApplication. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void deleteApplication(com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager + .applications() + .deleteByResourceGroupWithResponse("sbz_demo", "sampleApplication", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/ApplicationGetByResourceGroupSamples.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/ApplicationGetByResourceGroupSamples.java new file mode 100644 index 000000000000..318de00d264d --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/ApplicationGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.generated; + +/** Samples for Application GetByResourceGroup. */ +public final class ApplicationGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/applications/get.json + */ + /** + * Sample code: GetApplication. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void getApplication(com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager + .applications() + .getByResourceGroupWithResponse("sbz_demo", "sampleApplication", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/ApplicationListByResourceGroupSamples.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/ApplicationListByResourceGroupSamples.java new file mode 100644 index 000000000000..d46a6d7f9fb8 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/ApplicationListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.generated; + +/** Samples for Application ListByResourceGroup. */ +public final class ApplicationListByResourceGroupSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/applications/list_byResourceGroup.json + */ + /** + * Sample code: ListApplicationsByResourceGroup. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void listApplicationsByResourceGroup( + com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager.applications().listByResourceGroup("sbz_demo", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/ApplicationListSamples.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/ApplicationListSamples.java new file mode 100644 index 000000000000..6c71b4bea2b0 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/ApplicationListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.generated; + +/** Samples for Application List. */ +public final class ApplicationListSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/applications/list_bySubscriptionId.json + */ + /** + * Sample code: ListApplicationsBySubscriptionId. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void listApplicationsBySubscriptionId( + com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager.applications().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/CodePackageGetContainerLogsSamples.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/CodePackageGetContainerLogsSamples.java new file mode 100644 index 000000000000..1804821e0098 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/CodePackageGetContainerLogsSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.generated; + +/** Samples for CodePackage GetContainerLogs. */ +public final class CodePackageGetContainerLogsSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/applications/services/replicas/codepackages/get_logs.json + */ + /** + * Sample code: GetContainerLogs. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void getContainerLogs(com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager + .codePackages() + .getContainerLogsWithResponse( + "sbz_demo", "sbzDocApp", "sbzDocService", "0", "sbzDocCode", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/GatewayCreateSamples.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/GatewayCreateSamples.java new file mode 100644 index 000000000000..46285e9b5f85 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/GatewayCreateSamples.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.generated; + +import com.azure.resourcemanager.servicefabricmesh.models.GatewayDestination; +import com.azure.resourcemanager.servicefabricmesh.models.HeaderMatchType; +import com.azure.resourcemanager.servicefabricmesh.models.HttpConfig; +import com.azure.resourcemanager.servicefabricmesh.models.HttpHostConfig; +import com.azure.resourcemanager.servicefabricmesh.models.HttpRouteConfig; +import com.azure.resourcemanager.servicefabricmesh.models.HttpRouteMatchHeader; +import com.azure.resourcemanager.servicefabricmesh.models.HttpRouteMatchPath; +import com.azure.resourcemanager.servicefabricmesh.models.HttpRouteMatchRule; +import com.azure.resourcemanager.servicefabricmesh.models.NetworkRef; +import com.azure.resourcemanager.servicefabricmesh.models.PathMatchType; +import com.azure.resourcemanager.servicefabricmesh.models.TcpConfig; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Gateway Create. */ +public final class GatewayCreateSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/gateways/create_update.json + */ + /** + * Sample code: CreateOrUpdateGateway. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void createOrUpdateGateway( + com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager + .gateways() + .define("sampleGateway") + .withRegion("EastUS") + .withExistingResourceGroup("sbz_demo") + .withSourceNetwork(new NetworkRef().withName("Open")) + .withDestinationNetwork(new NetworkRef().withName("helloWorldNetwork")) + .withTags(mapOf()) + .withDescription("Service Fabric Mesh sample gateway.") + .withTcp( + Arrays + .asList( + new TcpConfig() + .withName("web") + .withPort(80) + .withDestination( + new GatewayDestination() + .withApplicationName("helloWorldApp") + .withServiceName("helloWorldService") + .withEndpointName("helloWorldListener")))) + .withHttp( + Arrays + .asList( + new HttpConfig() + .withName("contosoWebsite") + .withPort(8081) + .withHosts( + Arrays + .asList( + new HttpHostConfig() + .withName("contoso.com") + .withRoutes( + Arrays + .asList( + new HttpRouteConfig() + .withName("index") + .withMatch( + new HttpRouteMatchRule() + .withPath( + new HttpRouteMatchPath() + .withValue("/index") + .withRewrite("/") + .withType(PathMatchType.PREFIX)) + .withHeaders( + Arrays + .asList( + new HttpRouteMatchHeader() + .withName("accept") + .withValue("application/json") + .withType(HeaderMatchType.EXACT)))) + .withDestination( + new GatewayDestination() + .withApplicationName("httpHelloWorldApp") + .withServiceName("indexService") + .withEndpointName("indexHttpEndpoint")))))))) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/GatewayDeleteSamples.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/GatewayDeleteSamples.java new file mode 100644 index 000000000000..bd086d88352d --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/GatewayDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.generated; + +/** Samples for Gateway Delete. */ +public final class GatewayDeleteSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/gateways/delete.json + */ + /** + * Sample code: DeleteGateway. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void deleteGateway(com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager + .gateways() + .deleteByResourceGroupWithResponse("sbz_demo", "sampleGateway", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/GatewayGetByResourceGroupSamples.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/GatewayGetByResourceGroupSamples.java new file mode 100644 index 000000000000..7ee9a7dc03f4 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/GatewayGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.generated; + +/** Samples for Gateway GetByResourceGroup. */ +public final class GatewayGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/gateways/get.json + */ + /** + * Sample code: GetGateway. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void getGateway(com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager + .gateways() + .getByResourceGroupWithResponse("sbz_demo", "sampleGateway", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/GatewayListByResourceGroupSamples.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/GatewayListByResourceGroupSamples.java new file mode 100644 index 000000000000..c052fc71a691 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/GatewayListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.generated; + +/** Samples for Gateway ListByResourceGroup. */ +public final class GatewayListByResourceGroupSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/gateways/list_byResourceGroup.json + */ + /** + * Sample code: ListGatewaysByResourceGroup. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void listGatewaysByResourceGroup( + com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager.gateways().listByResourceGroup("sbz_demo", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/GatewayListSamples.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/GatewayListSamples.java new file mode 100644 index 000000000000..2a7c6aa88631 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/GatewayListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.generated; + +/** Samples for Gateway List. */ +public final class GatewayListSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/gateways/list_bySubscriptionId.json + */ + /** + * Sample code: ListGatewaysBySubscriptionId. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void listGatewaysBySubscriptionId( + com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager.gateways().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/NetworkCreateSamples.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/NetworkCreateSamples.java new file mode 100644 index 000000000000..057cac16a822 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/NetworkCreateSamples.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.servicefabricmesh.generated; + +import com.azure.resourcemanager.servicefabricmesh.models.LocalNetworkResourceProperties; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Network Create. */ +public final class NetworkCreateSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/networks/create_update.json + */ + /** + * Sample code: CreateOrUpdateNetwork. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void createOrUpdateNetwork( + com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager + .networks() + .define("sampleNetwork") + .withRegion("EastUS") + .withExistingResourceGroup("sbz_demo") + .withProperties( + new LocalNetworkResourceProperties() + .withDescription("Service Fabric Mesh sample network.") + .withNetworkAddressPrefix("2.0.0.0/16")) + .withTags(mapOf()) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/NetworkDeleteSamples.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/NetworkDeleteSamples.java new file mode 100644 index 000000000000..9a4c47c18c22 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/NetworkDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.generated; + +/** Samples for Network Delete. */ +public final class NetworkDeleteSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/networks/delete.json + */ + /** + * Sample code: DeleteNetwork. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void deleteNetwork(com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager + .networks() + .deleteByResourceGroupWithResponse("sbz_demo", "sampleNetwork", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/NetworkGetByResourceGroupSamples.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/NetworkGetByResourceGroupSamples.java new file mode 100644 index 000000000000..a978027c4856 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/NetworkGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.generated; + +/** Samples for Network GetByResourceGroup. */ +public final class NetworkGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/networks/get.json + */ + /** + * Sample code: GetNetwork. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void getNetwork(com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager + .networks() + .getByResourceGroupWithResponse("sbz_demo", "sampleNetwork", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/NetworkListByResourceGroupSamples.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/NetworkListByResourceGroupSamples.java new file mode 100644 index 000000000000..6fbd9a26bb36 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/NetworkListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.generated; + +/** Samples for Network ListByResourceGroup. */ +public final class NetworkListByResourceGroupSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/networks/list_byResourceGroup.json + */ + /** + * Sample code: ListNetworksByResourceGroup. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void listNetworksByResourceGroup( + com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager.networks().listByResourceGroup("sbz_demo", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/NetworkListSamples.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/NetworkListSamples.java new file mode 100644 index 000000000000..1ac689b5f4d5 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/NetworkListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.generated; + +/** Samples for Network List. */ +public final class NetworkListSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/networks/list_bySubscriptionId.json + */ + /** + * Sample code: ListNetworksBySubscriptionId. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void listNetworksBySubscriptionId( + com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager.networks().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/OperationsListSamples.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/OperationsListSamples.java new file mode 100644 index 000000000000..6e2ca9f87e14 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/OperationsListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.generated; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/listAllOperations.json + */ + /** + * Sample code: ListAllOperations. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void listAllOperations(com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/SecretCreateSamples.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/SecretCreateSamples.java new file mode 100644 index 000000000000..259ff5cd2146 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/SecretCreateSamples.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.servicefabricmesh.generated; + +import com.azure.resourcemanager.servicefabricmesh.models.InlinedValueSecretResourceProperties; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Secret Create. */ +public final class SecretCreateSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/secrets/create_update.json + */ + /** + * Sample code: CreateOrUpdateSecret. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void createOrUpdateSecret( + com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager + .secrets() + .define("dbConnectionString") + .withRegion("EastUS") + .withExistingResourceGroup("sbz_demo") + .withProperties( + new InlinedValueSecretResourceProperties() + .withDescription("Mongo DB connection string for backend database!") + .withContentType("text/plain")) + .withTags(mapOf()) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/SecretDeleteSamples.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/SecretDeleteSamples.java new file mode 100644 index 000000000000..0f6939fa5a02 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/SecretDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.generated; + +/** Samples for Secret Delete. */ +public final class SecretDeleteSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/secrets/delete.json + */ + /** + * Sample code: DeleteSecret. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void deleteSecret(com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager + .secrets() + .deleteByResourceGroupWithResponse("sbz_demo", "dbConnectionString", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/SecretGetByResourceGroupSamples.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/SecretGetByResourceGroupSamples.java new file mode 100644 index 000000000000..f12b2629215d --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/SecretGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.generated; + +/** Samples for Secret GetByResourceGroup. */ +public final class SecretGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/secrets/get.json + */ + /** + * Sample code: GetSecret. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void getSecret(com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager + .secrets() + .getByResourceGroupWithResponse("sbz_demo", "dbConnectionString", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/SecretListByResourceGroupSamples.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/SecretListByResourceGroupSamples.java new file mode 100644 index 000000000000..f714e7ed7914 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/SecretListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.generated; + +/** Samples for Secret ListByResourceGroup. */ +public final class SecretListByResourceGroupSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/secrets/list_byResourceGroup.json + */ + /** + * Sample code: ListSecretsByResourceGroup. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void listSecretsByResourceGroup( + com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager.secrets().listByResourceGroup("sbz_demo", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/SecretListSamples.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/SecretListSamples.java new file mode 100644 index 000000000000..73aeb207a3a7 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/SecretListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.generated; + +/** Samples for Secret List. */ +public final class SecretListSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/secrets/list_bySubscriptionId.json + */ + /** + * Sample code: ListSecretsBySubscriptionId. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void listSecretsBySubscriptionId( + com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager.secrets().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/SecretValueCreateSamples.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/SecretValueCreateSamples.java new file mode 100644 index 000000000000..86773e87b47f --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/SecretValueCreateSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.generated; + +/** Samples for SecretValue Create. */ +public final class SecretValueCreateSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/secrets/values/create.json + */ + /** + * Sample code: CreateSecretValue. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void createSecretValue(com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager + .secretValues() + .define("v1") + .withRegion("West US") + .withExistingSecret("sbz_demo", "dbConnectionString") + .withValue( + "mongodb://contoso123:0Fc3IolnL12312asdfawejunASDF@asdfYXX2t8a97kghVcUzcDv98hawelufhawefafnoQRGwNj2nMPL1Y9qsIr9Srdw==@contoso123.documents.azure.com:10255/mydatabase?ssl=true") + .create(); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/SecretValueDeleteSamples.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/SecretValueDeleteSamples.java new file mode 100644 index 000000000000..7cd290ab4901 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/SecretValueDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.generated; + +/** Samples for SecretValue Delete. */ +public final class SecretValueDeleteSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/secrets/values/delete.json + */ + /** + * Sample code: DeleteSecretValue. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void deleteSecretValue(com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager + .secretValues() + .deleteWithResponse("sbz_demo", "dbConnectionString", "v1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/SecretValueGetSamples.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/SecretValueGetSamples.java new file mode 100644 index 000000000000..937d71e7803a --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/SecretValueGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.generated; + +/** Samples for SecretValue Get. */ +public final class SecretValueGetSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/secrets/values/get.json + */ + /** + * Sample code: GetSecretValue. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void getSecretValue(com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager + .secretValues() + .getWithResponse("sbz_demo", "dbConnectionString", "v1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/SecretValueListSamples.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/SecretValueListSamples.java new file mode 100644 index 000000000000..3b5adbebea36 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/SecretValueListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.generated; + +/** Samples for SecretValue List. */ +public final class SecretValueListSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/secrets/values/list.json + */ + /** + * Sample code: ListSecretValues. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void listSecretValues(com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager.secretValues().list("sbz_demo", "dbConnectionString", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/SecretValueListValueSamples.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/SecretValueListValueSamples.java new file mode 100644 index 000000000000..7323bd60a62e --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/SecretValueListValueSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.generated; + +/** Samples for SecretValue ListValue. */ +public final class SecretValueListValueSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/secrets/values/list_value.json + */ + /** + * Sample code: ListSecretValue. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void listSecretValue(com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager + .secretValues() + .listValueWithResponse("sbz_demo", "dbConnectionString", "v1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/ServiceGetSamples.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/ServiceGetSamples.java new file mode 100644 index 000000000000..7611f542a165 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/ServiceGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.generated; + +/** Samples for Service Get. */ +public final class ServiceGetSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/applications/services/get.json + */ + /** + * Sample code: GetService. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void getService(com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager + .services() + .getWithResponse("sbz_demo", "sampleApplication", "helloWorldService", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/ServiceListSamples.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/ServiceListSamples.java new file mode 100644 index 000000000000..71f16fd1c75d --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/ServiceListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.generated; + +/** Samples for Service List. */ +public final class ServiceListSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/applications/services/list.json + */ + /** + * Sample code: ListServices. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void listServices(com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager.services().list("sbz_demo", "sampleApplication", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/ServiceReplicaGetSamples.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/ServiceReplicaGetSamples.java new file mode 100644 index 000000000000..e0172beaa813 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/ServiceReplicaGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.generated; + +/** Samples for ServiceReplica Get. */ +public final class ServiceReplicaGetSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/applications/services/replicas/get.json + */ + /** + * Sample code: ReplicaGet. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void replicaGet(com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager + .serviceReplicas() + .getWithResponse("sbz_demo", "helloWorldApp", "helloWorldService", "0", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/ServiceReplicaListSamples.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/ServiceReplicaListSamples.java new file mode 100644 index 000000000000..8f0975bac602 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/ServiceReplicaListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.generated; + +/** Samples for ServiceReplica List. */ +public final class ServiceReplicaListSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/applications/services/replicas/list.json + */ + /** + * Sample code: ReplicasGetAll. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void replicasGetAll(com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager + .serviceReplicas() + .list("sbz_demo", "sampleApplication", "helloWorldService", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/VolumeCreateSamples.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/VolumeCreateSamples.java new file mode 100644 index 000000000000..671f8492953c --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/VolumeCreateSamples.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.servicefabricmesh.generated; + +import com.azure.resourcemanager.servicefabricmesh.models.VolumeProvider; +import com.azure.resourcemanager.servicefabricmesh.models.VolumeProviderParametersAzureFile; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Volume Create. */ +public final class VolumeCreateSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/volumes/create_update.json + */ + /** + * Sample code: CreateOrUpdateVolume. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void createOrUpdateVolume( + com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager + .volumes() + .define("sampleVolume") + .withRegion("EastUS") + .withExistingResourceGroup("sbz_demo") + .withProvider(VolumeProvider.SFAZURE_FILE) + .withTags(mapOf()) + .withDescription("Service Fabric Mesh sample volume.") + .withAzureFileParameters( + new VolumeProviderParametersAzureFile() + .withAccountName("sbzdemoaccount") + .withAccountKey("fakeTokenPlaceholder") + .withShareName("sharel")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/VolumeDeleteSamples.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/VolumeDeleteSamples.java new file mode 100644 index 000000000000..86fa816814c7 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/VolumeDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.generated; + +/** Samples for Volume Delete. */ +public final class VolumeDeleteSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/volumes/delete.json + */ + /** + * Sample code: DeleteVolume. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void deleteVolume(com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager + .volumes() + .deleteByResourceGroupWithResponse("sbz_demo", "sampleVolume", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/VolumeGetByResourceGroupSamples.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/VolumeGetByResourceGroupSamples.java new file mode 100644 index 000000000000..2ea325a0e714 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/VolumeGetByResourceGroupSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.generated; + +/** Samples for Volume GetByResourceGroup. */ +public final class VolumeGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/volumes/get.json + */ + /** + * Sample code: GetVolume. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void getVolume(com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager.volumes().getByResourceGroupWithResponse("sbz_demo", "sampleVolume", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/VolumeListByResourceGroupSamples.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/VolumeListByResourceGroupSamples.java new file mode 100644 index 000000000000..401a862fd0e3 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/VolumeListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.generated; + +/** Samples for Volume ListByResourceGroup. */ +public final class VolumeListByResourceGroupSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/volumes/list_byResourceGroup.json + */ + /** + * Sample code: ListVolumesByResourceGroup. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void listVolumesByResourceGroup( + com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager.volumes().listByResourceGroup("sbz_demo", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/VolumeListSamples.java b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/VolumeListSamples.java new file mode 100644 index 000000000000..cf4501046e61 --- /dev/null +++ b/sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/src/samples/java/com/azure/resourcemanager/servicefabricmesh/generated/VolumeListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabricmesh.generated; + +/** Samples for Volume List. */ +public final class VolumeListSamples { + /* + * x-ms-original-file: specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/volumes/list_bySubscriptionId.json + */ + /** + * Sample code: ListVolumesBySubscriptionId. + * + * @param manager Entry point to ServiceFabricMeshManager. + */ + public static void listVolumesBySubscriptionId( + com.azure.resourcemanager.servicefabricmesh.ServiceFabricMeshManager manager) { + manager.volumes().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/servicefabricmesh/ci.yml b/sdk/servicefabricmesh/ci.yml new file mode 100644 index 000000000000..ef5c71459c34 --- /dev/null +++ b/sdk/servicefabricmesh/ci.yml @@ -0,0 +1,47 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/servicefabricmesh/ci.yml + - sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/ + exclude: + - sdk/servicefabricmesh/pom.xml + - sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/servicefabricmesh/ci.yml + - sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/ + exclude: + - sdk/servicefabricmesh/pom.xml + - sdk/servicefabricmesh/azure-resourcemanager-servicefabricmesh/pom.xml + +parameters: + - name: release_azureresourcemanagerservicefabricmesh + displayName: azure-resourcemanager-servicefabricmesh + type: boolean + default: false + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: servicefabricmesh + EnableBatchRelease: true + Artifacts: + - name: azure-resourcemanager-servicefabricmesh + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerservicefabricmesh + releaseInBatch: ${{ parameters.release_azureresourcemanagerservicefabricmesh }} diff --git a/sdk/servicefabricmesh/pom.xml b/sdk/servicefabricmesh/pom.xml new file mode 100644 index 000000000000..71633eaf7089 --- /dev/null +++ b/sdk/servicefabricmesh/pom.xml @@ -0,0 +1,15 @@ + + + 4.0.0 + com.azure + azure-servicefabricmesh-service + pom + 1.0.0 + + + azure-resourcemanager-servicefabricmesh + +