diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 8f386b9a3283..f9e3d61baa81 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -360,9 +360,6 @@ # ServiceLabel: %Load Testing # ServiceOwners: @Harshan01 @mitsha-microsoft @ninallam @prativen -# PRLabel: %Mixed Reality Authentication -/sdk/mixedreality/azure-mixedreality-authentication/ @Azure/azure-java-sdk @RamonArguelles - # PRLabel: %Models Repository /sdk/modelsrepository/ @abhipsaMisra @andyk-ms @Azure/azure-java-sdk @brycewang-microsoft @digimaun @timtay-microsoft diff --git a/eng/pipelines/patch_release_client.txt b/eng/pipelines/patch_release_client.txt index 3ffb2b0eedb1..c8fb1957e7f9 100644 --- a/eng/pipelines/patch_release_client.txt +++ b/eng/pipelines/patch_release_client.txt @@ -56,7 +56,6 @@ com.azure:azure-messaging-eventhubs-checkpointstore-blob # Tests owner: conniey com.azure:azure-messaging-servicebus # Tests owner: ki1729 com.azure:azure-messaging-webpubsub # Tests owner: weidongxu-microsoft com.azure:azure-messaging-webpubsub-client # Tests owner: weidongxu-microsoft -com.azure:azure-mixedreality-authentication # Tests owner: craigktreasure, RamonArguelles com.azure:azure-monitor-query-metrics # Tests owner: jairmyree, srnagar com.azure:azure-monitor-query-logs # Tests owner: jairmyree, srnagar com.azure:azure-monitor-ingestion # Tests owner: jairmyree, srnagar diff --git a/eng/scripts/aggregate_javadoc_configuration.txt b/eng/scripts/aggregate_javadoc_configuration.txt index e10c28e3c554..8d778128ee5a 100644 --- a/eng/scripts/aggregate_javadoc_configuration.txt +++ b/eng/scripts/aggregate_javadoc_configuration.txt @@ -35,7 +35,6 @@ Group;Azure Identity;com.azure.identity* Group;Azure IoT Models Repository;com.azure.iot.modelsrepository* Group;Azure Key Vault;com.azure.security.keyvault* Group;Azure Metrics Advisor;com.azure.ai.metricsadvisor* -Group;Azure Mixed Reality Authentication;com.azure.mixedreality.authentication* Group;Azure Monitor - Ingestion;com.azure.monitor.ingestion* Group;Azure Monitor - Logs and Metrics query;com.azure.monitor.query* Group;Azure Monitor - OpenTelemetry Exporter;com.azure.monitor.opentelemetry.exporter* diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 846ae9e2bc05..57c7afc7de10 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -164,7 +164,6 @@ com.azure:azure-messaging-servicebus-stress;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-messaging-servicebus-track2-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-messaging-webpubsub;1.5.4;1.6.0-beta.1 com.azure:azure-messaging-webpubsub-client;1.1.7;1.2.0-beta.1 -com.azure:azure-mixedreality-authentication;1.2.38;1.3.0-beta.1 com.azure:azure-monitor-opentelemetry-exporter;1.0.0-beta.32;1.0.0-beta.33 com.azure:azure-monitor-opentelemetry-autoconfigure;1.4.0;1.5.0-beta.1 com.azure:azure-monitor-ingestion;1.2.15;1.3.0-beta.1 @@ -330,7 +329,6 @@ com.azure.resourcemanager:azure-resourcemanager-resourcehealth;1.0.0;1.1.0-beta. com.azure.resourcemanager:azure-resourcemanager-databricks;1.0.0;1.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-databoxedge;1.0.0;1.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-frontdoor;1.1.0;1.2.0-beta.1 -com.azure.resourcemanager:azure-resourcemanager-mixedreality;1.0.1;1.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-automation;1.0.0;1.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-resourcemover;1.2.0;1.3.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-datafactory;1.2.0;1.3.0-beta.1 diff --git a/pom.xml b/pom.xml index 32e5aa9a78fb..01f8d17ea4dc 100644 --- a/pom.xml +++ b/pom.xml @@ -165,7 +165,6 @@ sdk/metricsadvisor sdk/migration sdk/migrationdiscoverysap - sdk/mixedreality sdk/mobilenetwork sdk/modelsrepository sdk/mongocluster diff --git a/sdk/boms/azure-sdk-bom/pom.xml b/sdk/boms/azure-sdk-bom/pom.xml index 1dc420e6807c..3f25b9c47e2e 100644 --- a/sdk/boms/azure-sdk-bom/pom.xml +++ b/sdk/boms/azure-sdk-bom/pom.xml @@ -295,11 +295,6 @@ azure-messaging-webpubsub-client 1.1.7 - - com.azure - azure-mixedreality-authentication - 1.2.38 - com.azure azure-monitor-ingestion diff --git a/sdk/mixedreality/azure-mixedreality-authentication/CHANGELOG.md b/sdk/mixedreality/azure-mixedreality-authentication/CHANGELOG.md deleted file mode 100644 index b72e74b02f45..000000000000 --- a/sdk/mixedreality/azure-mixedreality-authentication/CHANGELOG.md +++ /dev/null @@ -1,428 +0,0 @@ -# Release History - -## 1.3.0-beta.1 (2026-02-09) - -### Other Changes - -- Please note, this package has been deprecated and will no longer be maintained after 2025/10/01. There are no replacement packages, as all mixed reality services are deprecated. Refer to our deprecation policy (https://aka.ms/azsdk/support-policies) for more details. - -## 1.2.38 (2026-01-29) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core-http-netty` from `1.16.2` to version `1.16.3`. -- Upgraded `azure-core` from `1.57.0` to version `1.57.1`. - -## 1.2.37 (2025-10-27) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core` from `1.56.1` to version `1.57.0`. -- Upgraded `azure-core-http-netty` from `1.16.1` to version `1.16.2`. - -## 1.2.36 (2025-09-25) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core-http-netty` from `1.16.0` to version `1.16.1`. -- Upgraded `azure-core` from `1.56.0` to version `1.56.1`. - -## 1.2.35 (2025-08-21) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core` from `1.55.5` to version `1.56.0`. -- Upgraded `azure-core-http-netty` from `1.15.13` to version `1.16.0`. - -## 1.2.34 (2025-08-01) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core` from `1.55.4` to version `1.55.5`. -- Upgraded `azure-core-http-netty` from `1.15.12` to version `1.15.13`. - -## 1.2.33 (2025-06-19) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core` from `1.55.3` to version `1.55.4`. -- Upgraded `azure-core-http-netty` from `1.15.11` to version `1.15.12`. - -## 1.2.32 (2025-03-24) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core` from `1.55.2` to version `1.55.3`. -- Upgraded `azure-core-http-netty` from `1.15.10` to version `1.15.11`. - -## 1.2.31 (2025-02-25) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core-http-netty` from `1.15.7` to version `1.15.10`. -- Upgraded `azure-core` from `1.54.1` to version `1.55.2`. - -## 1.2.30 (2024-12-04) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core` from `1.53.0` to version `1.54.1`. -- Upgraded `azure-core-http-netty` from `1.15.5` to version `1.15.7`. - -## 1.2.29 (2024-10-27) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core` from `1.52.0` to version `1.53.0`. -- Upgraded `azure-core-http-netty` from `1.15.4` to version `1.15.5`. - -## 1.2.28 (2024-09-27) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core` from `1.51.0` to version `1.52.0`. -- Upgraded `azure-core-http-netty` from `1.15.3` to version `1.15.4`. - -## 1.2.27 (2024-08-24) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core-http-netty` from `1.15.2` to version `1.15.3`. -- Upgraded `azure-core` from `1.50.0` to version `1.51.0`. - -## 1.2.26 (2024-07-26) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core-http-netty` from `1.15.1` to version `1.15.2`. -- Upgraded `azure-core` from `1.49.1` to version `1.50.0`. - -## 1.2.25 (2024-06-27) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core-http-netty` from `1.15.0` to version `1.15.1`. -- Upgraded `azure-core` from `1.49.0` to version `1.49.1`. - -## 1.2.24 (2024-05-28) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core` from `1.48.0` to version `1.49.0`. -- Upgraded `azure-core-http-netty` from `1.14.2` to version `1.15.0`. - -## 1.2.23 (2024-04-23) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core` from `1.47.0` to version `1.48.0`. -- Upgraded `azure-core-http-netty` from `1.14.1` to version `1.14.2`. - -## 1.2.22 (2024-03-20) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core` from `1.46.0` to version `1.47.0`. -- Upgraded `azure-core-http-netty` from `1.14.0` to version `1.14.1`. - -## 1.2.21 (2024-02-20) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core-http-netty` from `1.13.11` to version `1.14.0`. -- Upgraded `azure-core` from `1.45.1` to version `1.46.0`. - -## 1.2.20 (2023-12-04) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core-http-netty` from `1.13.10` to version `1.13.11`. -- Upgraded `azure-core` from `1.45.0` to version `1.45.1`. - -## 1.2.19 (2023-11-20) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core` from `1.44.1` to version `1.45.0`. -- Upgraded `azure-core-http-netty` from `1.13.9` to version `1.13.10`. - -## 1.2.18 (2023-10-20) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core` from `1.43.0` to version `1.44.1`. -- Upgraded `azure-core-http-netty` from `1.13.7` to version `1.13.9`. - -## 1.2.17 (2023-09-22) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core` from `1.42.0` to version `1.43.0`. -- Upgraded `azure-core-http-netty` from `1.13.6` to version `1.13.7`. - -## 1.2.16 (2023-08-18) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core` from `1.41.0` to version `1.42.0`. -- Upgraded `azure-core-http-netty` from `1.13.5` to version `1.13.6`. - -## 1.2.15 (2023-07-25) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core` from `1.40.0` to version `1.41.0`. -- Upgraded `azure-core-http-netty` from `1.13.4` to version `1.13.5`. - -## 1.2.14 (2023-06-20) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core` from `1.39.0` to version `1.40.0`. -- Upgraded `azure-core-http-netty` from `1.13.3` to version `1.13.4`. - -## 1.2.13 (2023-05-23) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core-http-netty` from `1.13.2` to version `1.13.3`. -- Upgraded `azure-core` from `1.38.0` to version `1.39.0`. - -## 1.2.12 (2023-04-21) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core-http-netty` from `1.13.1` to version `1.13.2`. -- Upgraded `azure-core` from `1.37.0` to version `1.38.0`. - -## 1.2.11 (2023-03-16) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core-http-netty` from `1.13.0` to version `1.13.1`. -- Upgraded `azure-core` from `1.36.0` to version `1.37.0`. - -## 1.2.10 (2023-02-10) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core` from `1.35.0` to version `1.36.0`. -- Upgraded `azure-core-http-netty` from `1.12.8` to version `1.13.0`. - -## 1.2.9 (2023-01-09) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core` from `1.34.0` to version `1.35.0`. -- Upgraded `azure-core-http-netty` from `1.12.7` to version `1.12.8`. - -## 1.2.8 (2022-11-08) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core` from `1.33.0` to version `1.34.0`. -- Upgraded `azure-core-http-netty` from `1.12.6` to version `1.12.7`. - -## 1.2.7 (2022-10-17) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core` from `1.32.0` to version `1.33.0`. -- Upgraded `azure-core-http-netty` from `1.12.5` to version `1.12.6`. - -## 1.2.6 (2022-09-08) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core` from `1.31.0` to version `1.32.0`. -- Upgraded `azure-core-http-netty` from `1.12.4` to version `1.12.5`. - -## 1.2.5 (2022-08-10) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core` from `1.30.0` to version `1.31.0`. -- Upgraded `azure-core-http-netty` from `1.12.3` to version `1.12.4`. - -## 1.2.4 (2022-07-11) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core` from `1.29.1` to version `1.30.0`. -- Upgraded `azure-core-http-netty` from `1.12.2` to version `1.12.3`. - -## 1.2.3 (2022-06-09) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core` from `1.28.0` to version `1.29.1`. -- Upgraded `azure-core-http-netty` from `1.12.0` to version `1.12.2`. - -## 1.2.2 (2022-05-11) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core` from `1.27.0` to version `1.28.0`. -- Upgraded `azure-core-http-netty` from `1.11.9` to version `1.12.0`. - -## 1.2.1 (2022-04-06) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core` from `1.26.0` to version `1.27.0`. -- Upgraded `azure-core-http-netty` from `1.11.8` to version `1.11.9`. - -## 1.2.0 (2022-03-09) - -### Features Added - -- Added interfaces from `com.azure.core.client.traits` to `MixedRealityStsClientBuilder`. -- Added `retryOptions` to `MixedRealityStsClientBuilder`. - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core-http-netty` from `1.11.7` to version `1.11.8`. -- Upgraded `azure-core` from `1.25.0` to version `1.26.0`. -- Upgraded `azure-identity` from `1.4.4` to version `1.4.6`. - -## 1.1.5 (2022-02-14) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core-http-netty` from `1.11.6` to version `1.11.7`. -- Upgraded `azure-core` from `1.24.1` to version `1.25.0`. - -## 1.1.4 (2022-01-19) - -### Other Changes - -#### Dependency updates - -- Updated azure-core to 1.24.1. -- Updated azure-identity to 1.4.3. -- Updated azure-core-http-netty to 1.11.6. - -## 1.1.3 (2021-11-12) - -### Other Changes - -#### Dependency updates - -- Updated azure-core to 1.22.0. -- Updated azure-core-http-netty to 1.11.2. - -## 1.1.2 (2021-10-06) - -### Other Changes - -#### Dependency updates - -- Updated azure-core to 1.21.0. -- Updated azure-core-http-netty to 1.11.1. - -## 1.1.1 (2021-09-13) - -### Other changes - -#### Dependency updates - -- Updated azure-core to 1.20.0. -- Updated azure-core-http-netty to 1.11.0. - -## 1.1.0 (2021-07-07) - -Updated dependencies. - -## 1.0.0 (2021-02-26) - -This is the initial stable release of Azure Mixed Reality Authentication library. For more information, please see the [README][read_me] and [samples][samples]. - -## 1.0.0-beta.1 (2021-02-23) - -This is the initial release of Azure Mixed Reality Authentication library. For more information, please see the [README][read_me] and [samples][samples]. - -This is a Public Preview version, so breaking changes are possible in subsequent releases as we improve the product. To provide feedback, please submit an issue in our [Azure SDK for Java GitHub repo](https://github.com/Azure/azure-sdk-for-java/issues). - - -[read_me]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/mixedreality/azure-mixedreality-authentication/README.md -[samples]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/mixedreality/azure-mixedreality-authentication/src/samples/java/com/azure/mixedreality/authentication diff --git a/sdk/mixedreality/azure-mixedreality-authentication/README.md b/sdk/mixedreality/azure-mixedreality-authentication/README.md deleted file mode 100644 index f243b0744b11..000000000000 --- a/sdk/mixedreality/azure-mixedreality-authentication/README.md +++ /dev/null @@ -1,196 +0,0 @@ -# Azure Mixed Reality client library for Java - -## Disclaimer - -Please note, this package has been deprecated and will no longer be maintained after 2025/10/01. There are no replacement packages, as all mixed reality services are deprecated. Refer to our deprecation policy (https://aka.ms/azsdk/support-policies) for more details. - -## Overview - -Mixed Reality services, like Azure Spatial Anchors, Azure Remote Rendering, and others, use the Mixed Reality security -token service (STS) for authentication. This package supports exchanging Mixed Reality account credentials for an access -token from the STS that can be used to access Mixed Reality services. - -[Source code][source] | [Package (Maven)][package] | [API reference documentation][api_documentation] -| [Product documentation][product_docs] - -![Mixed Reality service authentication diagram](https://learn.microsoft.com/azure/spatial-anchors/concepts/media/spatial-anchors-authentication-overview.png) - -## Getting started - -### Prerequisites - -- You must have an [Azure subscription](https://azure.microsoft.com/free/). -- You must have an account with an [Azure Mixed Reality service](https://azure.microsoft.com/topic/mixed-reality/): - - [Azure Remote Rendering](https://learn.microsoft.com/azure/remote-rendering/) - - [Azure Spatial Anchors](https://learn.microsoft.com/azure/spatial-anchors/) -- [Java Development Kit (JDK)](https://learn.microsoft.com/java/azure/jdk/?view=azure-java-stable) version 8 or above. -- [Apache Maven](https://maven.apache.org/download.cgi). -- Familiarity with the authentication and credential concepts from [Azure.Identity](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/identity/azure-identity). - -### Include the package - -#### Include the BOM file - -Please include the azure-sdk-bom to your project to take dependency on the General Availability (GA) version of the library. In the following snippet, replace the {bom_version_to_target} placeholder with the version number. -To learn more about the BOM, see the [AZURE SDK BOM README](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/boms/azure-sdk-bom/README.md). - -```xml - - - - com.azure - azure-sdk-bom - {bom_version_to_target} - pom - import - - - -``` -and then include the direct dependency in the dependencies section without the version tag as shown below. - -```xml - - - com.azure - azure-mixedreality-authentication - - -``` - -#### Include direct dependency -If you want to take dependency on a particular version of the library that is not present in the BOM, -add the direct dependency to your project as follows. - -[//]: # ({x-version-update-start;com.azure:azure-mixedreality-authentication;current}) -```xml - - com.azure - azure-mixedreality-authentication - 1.3.0-beta.1 - -``` - -### Authenticate the client - -Mixed Reality services support a few different forms of authentication: - -- Account Key authentication - - Account keys enable you to get started quickly with using Mixed Reality services. But before you deploy your application - to production, we recommend that you update your app to use Azure AD authentication. -- Azure Active Directory (AD) token authentication - - If you're building an enterprise application and your company is using Azure AD as its identity system, you can use - user-based Azure AD authentication in your app. You then grant access to your Mixed Reality accounts by using your - existing Azure AD security groups. You can also grant access directly to users in your organization. - - Otherwise, we recommend that you obtain Azure AD tokens from a web service that supports your app. We recommend this - method for production applications because it allows you to avoid embedding the credentials for access to a Mixed - Reality service in your client application. - -See [here](https://learn.microsoft.com/azure/spatial-anchors/concepts/authentication) for detailed instructions and information. - -## Key concepts - -### MixedRealityStsClient - -The `MixedRealityStsClient` is the client library used to access the Mixed Reality STS to get an access token. - -Tokens obtained from the Mixed Reality STS have a lifetime of **24 hours**. - -## Examples - -### Create the client - -For a synchronous client: - -```java -AzureKeyCredential keyCredential = new AzureKeyCredential(accountKey); -MixedRealityStsClient client = new MixedRealityStsClientBuilder() - .accountDomain(accountDomain) - .accountId(accountId) - .credential(keyCredential) - .buildClient(); -``` - -For an asynchronous client (note the call to `buildAsyncClient` instead of `buildClient`): - -```java -AzureKeyCredential keyCredential = new AzureKeyCredential(accountKey); -MixedRealityStsAsyncClient client = new MixedRealityStsClientBuilder() - .accountDomain(accountDomain) - .accountId(accountId) - .credential(keyCredential) - .buildAsyncClient(); -``` - -### Retrieve an access token - -```java -AzureKeyCredential keyCredential = new AzureKeyCredential(accountKey); -MixedRealityStsClient client = new MixedRealityStsClientBuilder() - .accountDomain(accountDomain) - .accountId(accountId) - .credential(keyCredential) - .buildClient(); - -AccessToken token = client.getToken(); -``` - -See the authentication examples [above](#authenticate-the-client) for more complex authentication scenarios. - -#### Using the access token in a Mixed Reality client library - -Some Mixed Reality client libraries might accept an access token in place of a credential. For example: - -```java -// getMixedRealityAccessTokenFromWebService is a hypothetical method that retrieves -// a Mixed Reality access token from a web service. The web service would use the -// MixedRealityStsClient and credentials to obtain an access token to be returned -// to the client. -AccessToken accessToken = getMixedRealityAccessTokenFromWebService(); - -SpatialAnchorsAccount account = new SpatialAnchorsAccount(accountId, accountDomain); -SpatialAnchorsClient client = new SpatialAnchorsClient(account, accessToken); -``` - -Note: The `SpatialAnchorsClient` usage above is hypothetical and may not reflect the actual library. Consult the -documentation for the client library you're using to determine if and how this might be supported. - -## Troubleshooting - -Describe common errors and exceptions, how to "unpack" them if necessary, and include guidance for graceful handling and recovery. - -Provide information to help developers avoid throttling or other service-enforced errors they might encounter. For example, provide guidance and examples for using retry or connection policies in the API. - -If the package or a related package supports it, include tips for logging or enabling instrumentation to help them debug their code. - -## Next steps - -### Client libraries supporting authentication with Mixed Reality Authentication - -Libraries supporting the Mixed Reality Authentication are coming soon. - -## Contributing - -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 [https://cla.microsoft.com](https://cla.microsoft.com). - -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 repos using our CLA. - -This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). -For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact -[opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. - - -[cla]: https://cla.microsoft.com -[coc]: https://opensource.microsoft.com/codeofconduct/ -[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ -[coc_contact]: mailto:opencode@microsoft.com -[product_docs]: https://azure.microsoft.com/topic/mixed-reality/ -[package]: https://central.sonatype.com/artifact/com.azure/azure-mixedreality-authentication -[api_documentation]: https://aka.ms/java-docs -[source]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/mixedreality/azure-mixedreality-authentication - - diff --git a/sdk/mixedreality/azure-mixedreality-authentication/assets.json b/sdk/mixedreality/azure-mixedreality-authentication/assets.json deleted file mode 100644 index 4b6483fa7054..000000000000 --- a/sdk/mixedreality/azure-mixedreality-authentication/assets.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "AssetsRepo": "Azure/azure-sdk-assets", - "AssetsRepoPrefixPath": "java", - "TagPrefix": "java/mixedreality/azure-mixedreality-authentication", - "Tag": "java/mixedreality/azure-mixedreality-authentication_8c9f10a500" -} diff --git a/sdk/mixedreality/azure-mixedreality-authentication/checkstyle-suppressions.xml b/sdk/mixedreality/azure-mixedreality-authentication/checkstyle-suppressions.xml deleted file mode 100644 index ce51172a3ddd..000000000000 --- a/sdk/mixedreality/azure-mixedreality-authentication/checkstyle-suppressions.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/sdk/mixedreality/azure-mixedreality-authentication/pom.xml b/sdk/mixedreality/azure-mixedreality-authentication/pom.xml deleted file mode 100644 index f5da5a8ac598..000000000000 --- a/sdk/mixedreality/azure-mixedreality-authentication/pom.xml +++ /dev/null @@ -1,63 +0,0 @@ - - - 4.0.0 - - - com.azure - azure-client-sdk-parent - 1.7.0 - ../../parents/azure-client-sdk-parent - - - com.azure - azure-mixedreality-authentication - 1.3.0-beta.1 - - Microsoft Azure SDK for Mixed Reality Authentication - Please note, this package has been deprecated and will no longer be maintained after 2025/10/01. There are no replacement packages, as all mixed reality services are deprecated. Refer to our deprecation policy (https://aka.ms/azsdk/support-policies) for more details. This package contains Microsoft Azure SDK for Mixed Reality Authentication. - - - - azure-java-build-docs - ${site.url}/site/${project.artifactId} - - - - - https://github.com/Azure/azure-sdk-for-java - - - - false - - - - - com.azure - azure-core - 1.57.1 - - - com.azure - azure-core-http-netty - 1.16.3 - - - - - com.azure - azure-core-test - 1.27.0-beta.14 - test - - - com.azure - azure-identity - 1.18.2 - test - - - diff --git a/sdk/mixedreality/azure-mixedreality-authentication/spotbugs-exclude.xml b/sdk/mixedreality/azure-mixedreality-authentication/spotbugs-exclude.xml deleted file mode 100644 index b1c0a0302d65..000000000000 --- a/sdk/mixedreality/azure-mixedreality-authentication/spotbugs-exclude.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - diff --git a/sdk/mixedreality/azure-mixedreality-authentication/src/main/java/com/azure/mixedreality/authentication/AuthenticationEndpoint.java b/sdk/mixedreality/azure-mixedreality-authentication/src/main/java/com/azure/mixedreality/authentication/AuthenticationEndpoint.java deleted file mode 100644 index e2e9a5c754b0..000000000000 --- a/sdk/mixedreality/azure-mixedreality-authentication/src/main/java/com/azure/mixedreality/authentication/AuthenticationEndpoint.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.mixedreality.authentication; - -class AuthenticationEndpoint { - /** - * Constructs an authentication endpoint from a service domain. - * - * @param accountDomain The Mixed Reality service account domain. - * @return A Mixed Reality STS service endpoint. - */ - public static String constructFromDomain(String accountDomain) { - return "https://sts." + accountDomain; - } - - /** - * Constructs the authentication scope from the {@code endpoint}. - * - * @param endpoint The Mixed Reality STS service endpoint. - * @return An authentication scope. - */ - public static String constructScope(String endpoint) { - return String.format("%s/.default", endpoint); - } -} diff --git a/sdk/mixedreality/azure-mixedreality-authentication/src/main/java/com/azure/mixedreality/authentication/CorrelationVector.java b/sdk/mixedreality/azure-mixedreality-authentication/src/main/java/com/azure/mixedreality/authentication/CorrelationVector.java deleted file mode 100644 index 1b197a055328..000000000000 --- a/sdk/mixedreality/azure-mixedreality-authentication/src/main/java/com/azure/mixedreality/authentication/CorrelationVector.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// The logic here is a minimal implementation borrowed from the implementation at -// https://github.com/microsoft/CorrelationVector-Java/blob/1012460386acb6a91b304d3e43daba6a07fffb58/src/main/java/com/microsoft/correlationvector/CorrelationVector.java. -// License is MIT: https://github.com/microsoft/CorrelationVector-Java/blob/1012460386acb6a91b304d3e43daba6a07fffb58/LICENSE - -package com.azure.mixedreality.authentication; - -import java.nio.ByteBuffer; -import java.util.Base64; -import java.util.UUID; - -class CorrelationVector { - private static final byte CV_BASE_LENGTH_V2 = 22; - - /** - * Gets the CV base. - * - * @return A generated CV base. - */ - public static String generateCvBase() { - UUID uuid = UUID.randomUUID(); - return generateCvBaseFromUUID(uuid); - } - - /** - * Gets the CV base. - * - * @param uuid A UUID to seed the correlation vector. - * @return A generated CV base. - */ - public static String generateCvBaseFromUUID(UUID uuid) { - final ByteBuffer uuidBytes = ByteBuffer.wrap(new byte[16]); - uuidBytes.putLong(uuid.getMostSignificantBits()); - uuidBytes.putLong(uuid.getLeastSignificantBits()); - // Removes the base64 padding - final String cvBase = Base64.getEncoder().encodeToString(uuidBytes.array()); - return cvBase.substring(0, CV_BASE_LENGTH_V2); - } -} diff --git a/sdk/mixedreality/azure-mixedreality-authentication/src/main/java/com/azure/mixedreality/authentication/JsonWebToken.java b/sdk/mixedreality/azure-mixedreality-authentication/src/main/java/com/azure/mixedreality/authentication/JsonWebToken.java deleted file mode 100644 index ae4769012f1f..000000000000 --- a/sdk/mixedreality/azure-mixedreality-authentication/src/main/java/com/azure/mixedreality/authentication/JsonWebToken.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.mixedreality.authentication; - -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonProviders; -import com.azure.json.JsonReader; - -import java.io.IOException; -import java.time.Instant; -import java.time.OffsetDateTime; -import java.time.ZoneOffset; -import java.util.Base64; -import java.util.Map; - -class JsonWebToken { - /** - * Retrieves the expiration date from the specified JWT value. - * - * @param jwtValue The JWT value. - * @return The date the JWT expires or null if the expiration couldn't be retrieved. - * @throws IllegalArgumentException If the {@code jwtValue} is null or empty. - */ - public static OffsetDateTime retrieveExpiration(String jwtValue) { - if (CoreUtils.isNullOrEmpty(jwtValue)) { - throw new IllegalArgumentException("Value cannot be null or empty: 'jwtValue'."); - } - - String[] jwtParts = jwtValue.split("[.]"); - - // Would normally be 3, but 2 is the minimum here since Java's split ignores trailing empty strings. - if (jwtParts.length < 2) { - return null; - } - - String jwtPayloadEncoded = jwtParts[1]; - - if (CoreUtils.isNullOrEmpty(jwtPayloadEncoded)) { - return null; - } - - byte[] jwtPayloadDecodedData = Base64.getDecoder().decode(jwtPayloadEncoded); - - try (JsonReader jsonReader = JsonProviders.createReader(jwtPayloadDecodedData)) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - Object exp = jsonTree.get("exp"); - - if (exp == null) { - return null; - } else { - return OffsetDateTime.ofInstant(Instant.ofEpochSecond(Long.parseLong(exp.toString())), ZoneOffset.UTC); - } - } catch (IOException exception) { - return null; - } - } -} diff --git a/sdk/mixedreality/azure-mixedreality-authentication/src/main/java/com/azure/mixedreality/authentication/MixedRealityAccountKeyCredential.java b/sdk/mixedreality/azure-mixedreality-authentication/src/main/java/com/azure/mixedreality/authentication/MixedRealityAccountKeyCredential.java deleted file mode 100644 index 987ff98b538d..000000000000 --- a/sdk/mixedreality/azure-mixedreality-authentication/src/main/java/com/azure/mixedreality/authentication/MixedRealityAccountKeyCredential.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.mixedreality.authentication; - -import com.azure.core.credential.AccessToken; -import com.azure.core.credential.AzureKeyCredential; -import com.azure.core.credential.TokenCredential; -import com.azure.core.credential.TokenRequestContext; -import reactor.core.publisher.Mono; - -import java.time.OffsetDateTime; -import java.util.UUID; - -class MixedRealityAccountKeyCredential implements TokenCredential { - private final UUID accountId; - private final AzureKeyCredential keyCredential; - - MixedRealityAccountKeyCredential(UUID accountId, AzureKeyCredential keyCredential) { - this.accountId = accountId; - this.keyCredential = keyCredential; - } - - @Override - public Mono getToken(TokenRequestContext tokenRequestContext) { - return Mono.fromSupplier(() -> getTokenSync(tokenRequestContext)); - } - - @Override - public AccessToken getTokenSync(TokenRequestContext request) { - return new AccessToken(accountId + ":" + keyCredential.getKey(), OffsetDateTime.MAX); - } -} diff --git a/sdk/mixedreality/azure-mixedreality-authentication/src/main/java/com/azure/mixedreality/authentication/MixedRealityStsAsyncClient.java b/sdk/mixedreality/azure-mixedreality-authentication/src/main/java/com/azure/mixedreality/authentication/MixedRealityStsAsyncClient.java deleted file mode 100644 index 954ed59cbc0f..000000000000 --- a/sdk/mixedreality/azure-mixedreality-authentication/src/main/java/com/azure/mixedreality/authentication/MixedRealityStsAsyncClient.java +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.mixedreality.authentication; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.credential.AccessToken; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.ResponseBase; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.mixedreality.authentication.implementation.MixedRealityStsRestClientImpl; - -import com.azure.mixedreality.authentication.implementation.models.StsTokenResponseMessage; -import com.azure.mixedreality.authentication.implementation.models.TokenRequestOptions; -import reactor.core.publisher.Mono; - -import java.time.OffsetDateTime; -import java.util.UUID; - -import static com.azure.core.util.FluxUtil.monoError; -import static com.azure.core.util.FluxUtil.withContext; - -/** - * Represents the Mixed Reality STS client for retrieving STS tokens used to access Mixed Reality services. - * - * @see MixedRealityStsClientBuilder - */ -@ServiceClient(builder = MixedRealityStsClientBuilder.class, isAsync = true) -public final class MixedRealityStsAsyncClient { - private final UUID accountId; - private final ClientLogger logger = new ClientLogger(MixedRealityStsAsyncClient.class); - private final MixedRealityStsRestClientImpl serviceClient; - - /** - * Creates a {@link MixedRealityStsAsyncClient} that sends requests to the Mixed Reality STS service. Each - * service call goes through the {@code pipeline}. - * - * @param accountId The Mixed Reality service account identifier. - * @param serviceClient The service client used to make service calls. - */ - MixedRealityStsAsyncClient(UUID accountId, MixedRealityStsRestClientImpl serviceClient) { - this.accountId = accountId; - this.serviceClient = serviceClient; - } - - /** - * Retrieve a token from the STS service for the specified account information. - * - * @return An {@link AccessToken} used to access Mixed Reality services matching the account's permissions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getToken() { - try { - return this.getTokenWithResponse().map(response -> response.getValue()); - } catch (RuntimeException exception) { - return monoError(this.logger, exception); - } - } - - /** - * Retrieve a token from the STS service for the specified account information. - * - * @return A REST response contains the {@link AccessToken} used to access Mixed Reality services matching - * the account's permissions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getTokenWithResponse() { - try { - return withContext(context -> this.getTokenWithResponse(context)); - } catch (RuntimeException exception) { - return monoError(this.logger, exception); - } - } - - Mono> getTokenWithResponse(Context context) { - try { - TokenRequestOptions requestOptions = new TokenRequestOptions(); - requestOptions.setClientRequestId(CorrelationVector.generateCvBase()); - - return serviceClient.getTokenWithResponseAsync(this.accountId, requestOptions, context) - .map(originalResponse -> { - AccessToken accessToken = toAccessToken(originalResponse.getValue()); - return new ResponseBase<>(originalResponse.getRequest(), originalResponse.getStatusCode(), - originalResponse.getHeaders(), accessToken, originalResponse.getDeserializedHeaders()); - }); - } catch (RuntimeException exception) { - return monoError(this.logger, exception); - } - } - - private static AccessToken toAccessToken(StsTokenResponseMessage stsTokenResponseMessage) { - String accessToken = stsTokenResponseMessage.getAccessToken(); - OffsetDateTime tokenExpiration = JsonWebToken.retrieveExpiration(accessToken); - - return new AccessToken(accessToken, tokenExpiration); - } -} diff --git a/sdk/mixedreality/azure-mixedreality-authentication/src/main/java/com/azure/mixedreality/authentication/MixedRealityStsClient.java b/sdk/mixedreality/azure-mixedreality-authentication/src/main/java/com/azure/mixedreality/authentication/MixedRealityStsClient.java deleted file mode 100644 index 21266a1d0d12..000000000000 --- a/sdk/mixedreality/azure-mixedreality-authentication/src/main/java/com/azure/mixedreality/authentication/MixedRealityStsClient.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.mixedreality.authentication; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.credential.AccessToken; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Represents the Mixed Reality STS client for retrieving STS tokens used to access Mixed Reality services. - * - * @see MixedRealityStsClientBuilder - */ -@ServiceClient(builder = MixedRealityStsClientBuilder.class) -public final class MixedRealityStsClient { - private final MixedRealityStsAsyncClient asyncClient; - - /** - * Creates a {@link MixedRealityStsClient} that sends requests to the Mixed Reality STS service. Each - * service call goes through the {@code pipeline}. - * - * @param asyncClient The {@link MixedRealityStsAsyncClient} that the client routes its requests through. - */ - MixedRealityStsClient(MixedRealityStsAsyncClient asyncClient) { - this.asyncClient = asyncClient; - } - - /** - * Retrieve a token from the STS service for the specified account information. - * - * @return An {@link AccessToken} used to access Mixed Reality services matching the account's permissions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AccessToken getToken() { - return this.asyncClient.getToken().block(); - } - - /** - * Retrieve a token from the STS service for the specified account information. - * - * @param context Additional context that is passed through the Http pipeline during the service call. - * @return A REST response contains the {@link AccessToken} used to access Mixed Reality services matching - * the account's permissions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getTokenWithResponse(Context context) { - return this.asyncClient.getTokenWithResponse().block(); - } -} diff --git a/sdk/mixedreality/azure-mixedreality-authentication/src/main/java/com/azure/mixedreality/authentication/MixedRealityStsClientBuilder.java b/sdk/mixedreality/azure-mixedreality-authentication/src/main/java/com/azure/mixedreality/authentication/MixedRealityStsClientBuilder.java deleted file mode 100644 index e713f780460a..000000000000 --- a/sdk/mixedreality/azure-mixedreality-authentication/src/main/java/com/azure/mixedreality/authentication/MixedRealityStsClientBuilder.java +++ /dev/null @@ -1,506 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.mixedreality.authentication; - -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.client.traits.AzureKeyCredentialTrait; -import com.azure.core.client.traits.ConfigurationTrait; -import com.azure.core.client.traits.EndpointTrait; -import com.azure.core.client.traits.HttpTrait; -import com.azure.core.client.traits.TokenCredentialTrait; -import com.azure.core.credential.AzureKeyCredential; -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeader; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.policy.AddHeadersPolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.HttpLogDetailLevel; -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.RetryOptions; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.util.ClientOptions; -import com.azure.core.util.Configuration; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.TracingOptions; -import com.azure.core.util.HttpClientOptions; -import com.azure.core.util.builder.ClientBuilderUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.tracing.Tracer; -import com.azure.core.util.tracing.TracerProvider; - -import com.azure.mixedreality.authentication.implementation.MixedRealityStsRestClientImpl; -import com.azure.mixedreality.authentication.implementation.MixedRealityStsRestClientImplBuilder; - -import java.net.MalformedURLException; -import java.net.URL; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.UUID; - -/** - * This class provides a fluent builder API to help aid the configuration and instantiation of {@link - * MixedRealityStsClient MixedRealityStsClients} and {@link MixedRealityStsAsyncClient MixedRealityStsAsyncClient}, call {@link - * #buildClient() buildClient} and {@link #buildAsyncClient() buildAsyncClient} respectively to construct an instance of - * the desired client. - * - * @see MixedRealityStsAsyncClient - * @see MixedRealityStsClient - */ -@ServiceClientBuilder(serviceClients = { MixedRealityStsClient.class, MixedRealityStsAsyncClient.class }) -public final class MixedRealityStsClientBuilder implements AzureKeyCredentialTrait, - ConfigurationTrait, EndpointTrait, - HttpTrait, TokenCredentialTrait { - private static final String MIXED_REALITY_STS_PROPERTIES = "azure-mixedreality-authentication.properties"; - private static final String SDK_NAME = "name"; - private static final String SDK_VERSION = "version"; - private static final String MIXED_REALITY_TRACING_NAMESPACE_VALUE = "Microsoft.MixedReality"; - private static final Map PROPERTIES = CoreUtils.getProperties(MIXED_REALITY_STS_PROPERTIES); - private static final String CLIENT_NAME = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName"); - private static final String CLIENT_VERSION = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); - - private final List customPolicies = new ArrayList(); - private final ClientLogger logger = new ClientLogger(MixedRealityStsClientBuilder.class); - - private String accountDomain; - private String accountId; - private MixedRealityStsServiceVersion apiVersion; - private ClientOptions clientOptions; - private Configuration configuration; - private String endpoint; - private HttpClient httpClient; - private AzureKeyCredential keyCredential; - private HttpLogOptions logOptions = new HttpLogOptions(); - private HttpPipeline pipeline; - private RetryPolicy retryPolicy; - private RetryOptions retryOptions; - private TokenCredential tokenCredential; - - /** - * Constructs a new builder used to configure and build {@link MixedRealityStsClient MixedRealityStsClients} and - * {@link MixedRealityStsAsyncClient MixedRealityStsAsyncClients}. - */ - public MixedRealityStsClientBuilder() { - } - - /** - * Sets the Mixed Reality service account domain. - * - * @param accountDomain The Mixed Reality service account domain. - * @return The updated {@link MixedRealityStsClientBuilder} object. - * @throws IllegalArgumentException If {@code accountDomain} is null or empty. - */ - public MixedRealityStsClientBuilder accountDomain(String accountDomain) { - Objects.requireNonNull(accountDomain, "'accountDomain' cannot be null."); - - if (accountDomain.isEmpty()) { - throw logger - .logExceptionAsError(new IllegalArgumentException("'accountDomain' cannot be an empty string.")); - } - - this.accountDomain = accountDomain; - - return this; - } - - /** - * Sets the Mixed Reality service account identifier. - * - * @param accountId The Mixed Reality service account identifier. The value is expected to be in UUID format. - * @return The updated {@link MixedRealityStsClientBuilder} object. - * @throws IllegalArgumentException If {@code accountId} is null or empty. - */ - public MixedRealityStsClientBuilder accountId(String accountId) { - Objects.requireNonNull(accountId, "'accountId' cannot be null."); - - if (accountId.isEmpty()) { - throw logger.logExceptionAsError(new IllegalArgumentException("'accountId' cannot be an empty string.")); - } - - this.accountId = accountId; - - return this; - } - - /** - * Adds a {@link HttpPipelinePolicy pipeline policy} to apply on each request sent. - * - *

Note: It is important to understand the precedence order of the HttpTrait APIs. In - * particular, if a {@link HttpPipeline} is specified, this takes precedence over all other APIs in the trait, and - * they will be ignored. If no {@link HttpPipeline} is specified, a HTTP pipeline will be constructed internally - * based on the settings provided to this trait. Additionally, there may be other APIs in types that implement this - * trait that are also ignored if an {@link HttpPipeline} is specified, so please be sure to refer to the - * documentation of types that implement this trait to understand the full set of implications.

- * - * @param customPolicy A {@link HttpPipelinePolicy pipeline policy}. - * @return The updated {@link MixedRealityStsClientBuilder} object. - */ - @Override - public MixedRealityStsClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { - this.customPolicies.add(Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null.")); - - return this; - } - - /** - * Create a {@link MixedRealityStsClient} based on options set in the builder. Every time {@code buildClient()} is - * called a new instance of {@link MixedRealityStsClient} is created. - * - * @return A {@link MixedRealityStsClient} with the options set from the builder. - * @throws IllegalStateException If both {@link #retryOptions(RetryOptions)} - * and {@link #retryPolicy(RetryPolicy)} have been set. - */ - public MixedRealityStsClient buildClient() { - return new MixedRealityStsClient(this.buildAsyncClient()); - } - - /** - * Create a {@link MixedRealityStsAsyncClient} based on options set in the builder. Every time {@code buildAsyncClient()} is - * called a new instance of {@link MixedRealityStsAsyncClient} is created. - * - * @return A {@link MixedRealityStsAsyncClient} with the options set from the builder. - * @throws NullPointerException If any required values are null. - * @throws IllegalArgumentException If the accountId or endpoint are not properly formatted. - * @throws IllegalStateException If both {@link #retryOptions(RetryOptions)} - * and {@link #retryPolicy(RetryPolicy)} have been set. - */ - public MixedRealityStsAsyncClient buildAsyncClient() { - Objects.requireNonNull(this.accountId, "The 'accountId' has not been set and is required."); - Objects.requireNonNull(this.accountDomain, "The 'accountDomain' has not been set and is required."); - - UUID accountId; - try { - accountId = UUID.fromString(this.accountId); - } catch (IllegalArgumentException ex) { - throw logger.logExceptionAsWarning( - new IllegalArgumentException("The 'accountId' must be a UUID formatted value.", ex)); - } - - String endpoint; - if (this.endpoint != null) { - try { - new URL(this.endpoint); - endpoint = this.endpoint; - } catch (MalformedURLException ex) { - throw logger - .logExceptionAsWarning(new IllegalArgumentException("The 'endpoint' must be a valid URL.", ex)); - } - } else { - endpoint = AuthenticationEndpoint.constructFromDomain(this.accountDomain); - } - - if (this.pipeline == null) { - if (this.tokenCredential != null && this.keyCredential != null) { - throw logger.logExceptionAsWarning( - new IllegalArgumentException("Only a single type of credential may be specified.")); - } - - if (this.tokenCredential == null && this.keyCredential != null) { - this.tokenCredential = new MixedRealityAccountKeyCredential(accountId, this.keyCredential); - } - - Objects.requireNonNull(this.tokenCredential, "The 'credential' has not been set and is required."); - String scope = AuthenticationEndpoint.constructScope(endpoint); - HttpPipelinePolicy authPolicy = new BearerTokenAuthenticationPolicy(this.tokenCredential, scope); - this.pipeline = createHttpPipeline(this.httpClient, authPolicy, this.customPolicies); - } - - MixedRealityStsServiceVersion version; - - if (this.apiVersion != null) { - version = this.apiVersion; - } else { - version = MixedRealityStsServiceVersion.getLatest(); - } - - MixedRealityStsRestClientImpl serviceClient - = new MixedRealityStsRestClientImplBuilder().apiVersion(version.getVersion()) - .pipeline(this.pipeline) - .host(endpoint) - .buildClient(); - - return new MixedRealityStsAsyncClient(accountId, serviceClient); - } - - /** - * Allows for setting common properties such as application ID, headers, proxy configuration, etc. Note that it is - * recommended that this method be called with an instance of the {@link HttpClientOptions} - * class (a subclass of the {@link ClientOptions} base class). The HttpClientOptions subclass provides more - * configuration options suitable for HTTP clients, which is applicable for any class that implements this HttpTrait - * interface. - * - *

Note: It is important to understand the precedence order of the HttpTrait APIs. In - * particular, if a {@link HttpPipeline} is specified, this takes precedence over all other APIs in the trait, and - * they will be ignored. If no {@link HttpPipeline} is specified, a HTTP pipeline will be constructed internally - * based on the settings provided to this trait. Additionally, there may be other APIs in types that implement this - * trait that are also ignored if an {@link HttpPipeline} is specified, so please be sure to refer to the - * documentation of types that implement this trait to understand the full set of implications.

- * - * @param clientOptions A configured instance of {@link HttpClientOptions}. - * @return The updated {@link MixedRealityStsClientBuilder} object. - * @see HttpClientOptions - */ - @Override - public MixedRealityStsClientBuilder clientOptions(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - - return this; - } - - /** - * Sets the {@link TokenCredential} used to authorize requests sent to the service. Refer to the Azure SDK for Java - * identity and authentication - * documentation for more details on proper usage of the {@link TokenCredential} type. - * - * @param tokenCredential {@link TokenCredential} used to authorize requests sent to the service. - * @return The updated {@link MixedRealityStsClientBuilder} object. - * @throws NullPointerException If {@code tokenCredential} is null. - */ - @Override - public MixedRealityStsClientBuilder credential(TokenCredential tokenCredential) { - this.tokenCredential = Objects.requireNonNull(tokenCredential, "'tokenCredential' cannot be null."); - - return this; - } - - /** - * Sets the {@link AzureKeyCredential} used to authenticate HTTP requests. - * - *

- * Note: Not recommended for production applications. - * - * @param keyCredential The {@link AzureKeyCredential} used to authenticate HTTP requests. - * @return The updated {@link MixedRealityStsClientBuilder} object. - * @throws NullPointerException If {@code keyCredential} is null. - */ - @Override - public MixedRealityStsClientBuilder credential(AzureKeyCredential keyCredential) { - this.keyCredential = Objects.requireNonNull(keyCredential, "'keyCredential' cannot be null."); - - return this; - } - - /** - * Sets the configuration store that is used during construction of the service client. - * - * The default configuration store is a clone of the {@link Configuration#getGlobalConfiguration() global - * configuration store}, use {@link Configuration#NONE} to bypass using configuration settings during construction. - * - * @param configuration The configuration store used to - * @return The updated MixedRealityStsClientBuilder object. - */ - @Override - public MixedRealityStsClientBuilder configuration(Configuration configuration) { - this.configuration = configuration; - - return this; - } - - /** - * Sets the Mixed Reality STS service endpoint. - * - * @param endpoint The Mixed Reality STS service endpoint. - * @return The updated MixedRealityStsClientBuilder object. - * @throws IllegalArgumentException If {@code endpoint} is null or it cannot be parsed into a valid URL. - */ - @Override - public MixedRealityStsClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - - return this; - } - - /** - * Sets the {@link HttpClient} to use for sending and receiving requests to and from the service. - * - *

Note: It is important to understand the precedence order of the HttpTrait APIs. In - * particular, if a {@link HttpPipeline} is specified, this takes precedence over all other APIs in the trait, and - * they will be ignored. If no {@link HttpPipeline} is specified, a HTTP pipeline will be constructed internally - * based on the settings provided to this trait. Additionally, there may be other APIs in types that implement this - * trait that are also ignored if an {@link HttpPipeline} is specified, so please be sure to refer to the - * documentation of types that implement this trait to understand the full set of implications.

- * - * @param client The {@link HttpClient} to use for requests. - * @return The updated ConfigurationClientBuilder object. - */ - @Override - public MixedRealityStsClientBuilder httpClient(HttpClient client) { - if (this.httpClient != null && client == null) { - logger.info("HttpClient is being set to 'null' when it was previously configured."); - } - - this.httpClient = client; - - return this; - } - - /** - * Sets the {@link HttpLogOptions logging configuration} to use when sending and receiving requests to and from - * the service. If a {@code logLevel} is not provided, default value of {@link HttpLogDetailLevel#NONE} is set. - * - *

Note: It is important to understand the precedence order of the HttpTrait APIs. In - * particular, if a {@link HttpPipeline} is specified, this takes precedence over all other APIs in the trait, and - * they will be ignored. If no {@link HttpPipeline} is specified, a HTTP pipeline will be constructed internally - * based on the settings provided to this trait. Additionally, there may be other APIs in types that implement this - * trait that are also ignored if an {@link HttpPipeline} is specified, so please be sure to refer to the - * documentation of types that implement this trait to understand the full set of implications.

- * - * @param logOptions The {@link HttpLogOptions logging configuration} to use when sending and receiving requests to - * and from the service. - * @return The updated {@link MixedRealityStsClientBuilder} object. - */ - @Override - public MixedRealityStsClientBuilder httpLogOptions(HttpLogOptions logOptions) { - this.logOptions = Objects.requireNonNull(logOptions, "'logOptions' cannot be null."); - - return this; - } - - /** - * Sets the {@link HttpPipeline} to use for the service client. - * - *

Note: It is important to understand the precedence order of the HttpTrait APIs. In - * particular, if a {@link HttpPipeline} is specified, this takes precedence over all other APIs in the trait, and - * they will be ignored. If no {@link HttpPipeline} is specified, a HTTP pipeline will be constructed internally - * based on the settings provided to this trait. Additionally, there may be other APIs in types that implement this - * trait that are also ignored if an {@link HttpPipeline} is specified, so please be sure to refer to the - * documentation of types that implement this trait to understand the full set of implications.

- *

- * If {@code pipeline} is set, all other settings are ignored, aside from {@link - * MixedRealityStsClientBuilder#endpoint(String) endpoint} to build {@link MixedRealityStsAsyncClient} or {@link - * MixedRealityStsClient}. - * - * @param pipeline {@link HttpPipeline} to use for sending service requests and receiving responses. - * @return The updated {@link MixedRealityStsClientBuilder} object. - */ - @Override - public MixedRealityStsClientBuilder pipeline(HttpPipeline pipeline) { - if (this.pipeline != null && pipeline == null) { - logger.info("HttpPipeline is being set to 'null' when it was previously configured."); - } - - this.pipeline = pipeline; - - return this; - } - - /** - * Sets the {@link RetryPolicy} that is used to retry requests. - *

- * The default retry policy will be used if not provided {@link MixedRealityStsClientBuilder#buildAsyncClient()} to - * build {@link MixedRealityStsAsyncClient} or {@link MixedRealityStsClient}. - *

- * Setting this is mutually exclusive with using {@link #retryOptions(RetryOptions)}. - * - * @param retryPolicy The {@link RetryPolicy} that will be used to retry requests. - * @return The updated MixedRealityStsClientBuilder object. - */ - public MixedRealityStsClientBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - - return this; - } - - /** - * Sets the {@link RetryOptions} for all the requests made through the client. - * - *

Note: It is important to understand the precedence order of the HttpTrait APIs. In - * particular, if a {@link HttpPipeline} is specified, this takes precedence over all other APIs in the trait, and - * they will be ignored. If no {@link HttpPipeline} is specified, a HTTP pipeline will be constructed internally - * based on the settings provided to this trait. Additionally, there may be other APIs in types that implement this - * trait that are also ignored if an {@link HttpPipeline} is specified, so please be sure to refer to the - * documentation of types that implement this trait to understand the full set of implications.

- *

- * Setting this is mutually exclusive with using {@link #retryPolicy(RetryPolicy)}. - * - * @param retryOptions The {@link RetryOptions} to use for all the requests made through the client. - * @return The updated MixedRealityStsClientBuilder object. - */ - @Override - public MixedRealityStsClientBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** - * Sets the {@link MixedRealityStsServiceVersion} that is used when making API requests. - *

- * If a service version is not provided, the service version that will be used will be the latest known service - * version based on the version of the client library being used. If no service version is specified, updating to a - * newer version the client library will have the result of potentially moving to a newer service version. - * - * @param version {@link MixedRealityStsServiceVersion} of the service to be used when making requests. - * @return The updated ConfigurationClientBuilder object. - */ - public MixedRealityStsClientBuilder serviceVersion(MixedRealityStsServiceVersion version) { - this.apiVersion = version; - - return this; - } - - private void applyRequiredPolicies(List policies) { - policies.add(getUserAgentPolicy()); - - // If client options has headers configured, add a policy for each. - if (this.clientOptions != null) { - List httpHeaderList = new ArrayList<>(); - this.clientOptions.getHeaders() - .forEach(header -> httpHeaderList.add(new HttpHeader(header.getName(), header.getValue()))); - policies.add(new AddHeadersPolicy(new HttpHeaders(httpHeaderList))); - } - - policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions)); - policies.add(new CookiePolicy()); - policies.add(new HttpLoggingPolicy(this.logOptions)); - } - - private HttpPipeline createHttpPipeline(HttpClient httpClient, HttpPipelinePolicy authorizationPolicy, - List additionalPolicies) { - - List policies = new ArrayList(); - policies.add(authorizationPolicy); - applyRequiredPolicies(policies); - - if (additionalPolicies != null && additionalPolicies.size() > 0) { - policies.addAll(additionalPolicies); - } - - return new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) - .httpClient(httpClient) - .tracer(createTracer()) - .build(); - } - - /* - * Creates a {@link UserAgentPolicy} using the default service module name and version. - * - * @return The default {@link UserAgentPolicy} for the module. - */ - private UserAgentPolicy getUserAgentPolicy() { - // Give precedence to applicationId configured in clientOptions over the one configured in httpLogOptions. - // Azure.Core deprecated setting the applicationId in httpLogOptions, but we should still support it. - String applicationId - = this.clientOptions == null ? this.logOptions.getApplicationId() : this.clientOptions.getApplicationId(); - - return new UserAgentPolicy(applicationId, CLIENT_NAME, CLIENT_VERSION, this.configuration); - } - - private Tracer createTracer() { - TracingOptions tracingOptions = null; - if (clientOptions != null) { - tracingOptions = clientOptions.getTracingOptions(); - } - - return TracerProvider.getDefaultProvider() - .createTracer(CLIENT_NAME, CLIENT_VERSION, MIXED_REALITY_TRACING_NAMESPACE_VALUE, tracingOptions); - } -} diff --git a/sdk/mixedreality/azure-mixedreality-authentication/src/main/java/com/azure/mixedreality/authentication/MixedRealityStsServiceVersion.java b/sdk/mixedreality/azure-mixedreality-authentication/src/main/java/com/azure/mixedreality/authentication/MixedRealityStsServiceVersion.java deleted file mode 100644 index 3c683a507073..000000000000 --- a/sdk/mixedreality/azure-mixedreality-authentication/src/main/java/com/azure/mixedreality/authentication/MixedRealityStsServiceVersion.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.mixedreality.authentication; - -import com.azure.core.util.ServiceVersion; - -/** - * The versions of the Azure Mixed Reality STS supported by this client library. - */ -public enum MixedRealityStsServiceVersion implements ServiceVersion { - /** - * Service version {@code 2019-02-28-preview}. - */ - V2019_02_28_PREVIEW("2019-02-28-preview"); - - private final String version; - - MixedRealityStsServiceVersion(String version) { - this.version = version; - } - - /** - * {@inheritDoc} - */ - @Override - public String getVersion() { - return this.version; - } - - /** - * Gets the latest service version supported by this client library. - * - * @return the latest {@link MixedRealityStsServiceVersion} - */ - public static MixedRealityStsServiceVersion getLatest() { - return V2019_02_28_PREVIEW; - } -} diff --git a/sdk/mixedreality/azure-mixedreality-authentication/src/main/java/com/azure/mixedreality/authentication/implementation/MixedRealityStsRestClientImpl.java b/sdk/mixedreality/azure-mixedreality-authentication/src/main/java/com/azure/mixedreality/authentication/implementation/MixedRealityStsRestClientImpl.java deleted file mode 100644 index 00d195812751..000000000000 --- a/sdk/mixedreality/azure-mixedreality-authentication/src/main/java/com/azure/mixedreality/authentication/implementation/MixedRealityStsRestClientImpl.java +++ /dev/null @@ -1,288 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.mixedreality.authentication.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -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.exception.HttpResponseException; -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.http.rest.Response; -import com.azure.core.http.rest.ResponseBase; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.core.util.serializer.SerializerAdapter; -import com.azure.mixedreality.authentication.implementation.models.GetTokenHeaders; -import com.azure.mixedreality.authentication.implementation.models.StsTokenResponseMessage; -import com.azure.mixedreality.authentication.implementation.models.TokenRequestOptions; -import java.util.UUID; -import reactor.core.publisher.Mono; - -/** - * Initializes a new instance of the MixedRealityStsRestClient type. - */ -public final class MixedRealityStsRestClientImpl { - /** - * The proxy service used to perform REST calls. - */ - private final MixedRealityStsRestClientService service; - - /** - * server parameter. - */ - private final String host; - - /** - * Gets server parameter. - * - * @return the host value. - */ - public String getHost() { - return this.host; - } - - /** - * 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. - */ - public SerializerAdapter getSerializerAdapter() { - return this.serializerAdapter; - } - - /** - * Initializes an instance of MixedRealityStsRestClient client. - * - * @param host server parameter. - * @param apiVersion Api Version. - */ - MixedRealityStsRestClientImpl(String host, String apiVersion) { - this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter(), host, apiVersion); - } - - /** - * Initializes an instance of MixedRealityStsRestClient client. - * - * @param httpPipeline The HTTP pipeline to send requests through. - * @param host server parameter. - * @param apiVersion Api Version. - */ - MixedRealityStsRestClientImpl(HttpPipeline httpPipeline, String host, String apiVersion) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), host, apiVersion); - } - - /** - * Initializes an instance of MixedRealityStsRestClient client. - * - * @param httpPipeline The HTTP pipeline to send requests through. - * @param serializerAdapter The serializer to serialize an object into a string. - * @param host server parameter. - * @param apiVersion Api Version. - */ - MixedRealityStsRestClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String host, - String apiVersion) { - this.httpPipeline = httpPipeline; - this.serializerAdapter = serializerAdapter; - this.host = host; - this.apiVersion = apiVersion; - this.service - = RestProxy.create(MixedRealityStsRestClientService.class, this.httpPipeline, this.getSerializerAdapter()); - } - - /** - * The interface defining all the services for MixedRealityStsRestClient to be used by the proxy service to perform - * REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MixedRealityStsRestClient") - public interface MixedRealityStsRestClientService { - @Get("/Accounts/{accountId}/token") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = HttpResponseException.class, code = { 400, 401, 429 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getToken(@HostParam("$host") String host, - @PathParam("accountId") UUID accountId, @HeaderParam("X-MRC-CV") String clientRequestId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - - @Get("/Accounts/{accountId}/token") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = HttpResponseException.class, code = { 400, 401, 429 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getTokenNoCustomHeaders(@HostParam("$host") String host, - @PathParam("accountId") UUID accountId, @HeaderParam("X-MRC-CV") String clientRequestId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets an access token to be used with Mixed Reality services. - * - * @param accountId The Mixed Reality account identifier. - * @param tokenRequestOptions Parameter group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws HttpResponseException thrown if the request is rejected by server on status code 400, 401, 429. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an access token to be used with Mixed Reality services along with {@link ResponseBase} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getTokenWithResponseAsync(UUID accountId, - TokenRequestOptions tokenRequestOptions) { - return FluxUtil.withContext(context -> getTokenWithResponseAsync(accountId, tokenRequestOptions, context)); - } - - /** - * Gets an access token to be used with Mixed Reality services. - * - * @param accountId The Mixed Reality account identifier. - * @param tokenRequestOptions Parameter group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws HttpResponseException thrown if the request is rejected by server on status code 400, 401, 429. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an access token to be used with Mixed Reality services along with {@link ResponseBase} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getTokenWithResponseAsync(UUID accountId, - TokenRequestOptions tokenRequestOptions, Context context) { - final String accept = "application/json"; - String clientRequestIdInternal = null; - if (tokenRequestOptions != null) { - clientRequestIdInternal = tokenRequestOptions.getClientRequestId(); - } - String clientRequestId = clientRequestIdInternal; - return service.getToken(this.getHost(), accountId, clientRequestId, this.getApiVersion(), accept, context); - } - - /** - * Gets an access token to be used with Mixed Reality services. - * - * @param accountId The Mixed Reality account identifier. - * @param tokenRequestOptions Parameter group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws HttpResponseException thrown if the request is rejected by server on status code 400, 401, 429. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an access token to be used with Mixed Reality services on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getTokenAsync(UUID accountId, TokenRequestOptions tokenRequestOptions) { - return getTokenWithResponseAsync(accountId, tokenRequestOptions) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets an access token to be used with Mixed Reality services. - * - * @param accountId The Mixed Reality account identifier. - * @param tokenRequestOptions Parameter group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws HttpResponseException thrown if the request is rejected by server on status code 400, 401, 429. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an access token to be used with Mixed Reality services on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getTokenAsync(UUID accountId, TokenRequestOptions tokenRequestOptions, - Context context) { - return getTokenWithResponseAsync(accountId, tokenRequestOptions, context) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets an access token to be used with Mixed Reality services. - * - * @param accountId The Mixed Reality account identifier. - * @param tokenRequestOptions Parameter group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws HttpResponseException thrown if the request is rejected by server on status code 400, 401, 429. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an access token to be used with Mixed Reality services along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getTokenNoCustomHeadersWithResponseAsync(UUID accountId, - TokenRequestOptions tokenRequestOptions) { - return FluxUtil - .withContext(context -> getTokenNoCustomHeadersWithResponseAsync(accountId, tokenRequestOptions, context)); - } - - /** - * Gets an access token to be used with Mixed Reality services. - * - * @param accountId The Mixed Reality account identifier. - * @param tokenRequestOptions Parameter group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws HttpResponseException thrown if the request is rejected by server on status code 400, 401, 429. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an access token to be used with Mixed Reality services along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getTokenNoCustomHeadersWithResponseAsync(UUID accountId, - TokenRequestOptions tokenRequestOptions, Context context) { - final String accept = "application/json"; - String clientRequestIdInternal = null; - if (tokenRequestOptions != null) { - clientRequestIdInternal = tokenRequestOptions.getClientRequestId(); - } - String clientRequestId = clientRequestIdInternal; - return service.getTokenNoCustomHeaders(this.getHost(), accountId, clientRequestId, this.getApiVersion(), accept, - context); - } -} diff --git a/sdk/mixedreality/azure-mixedreality-authentication/src/main/java/com/azure/mixedreality/authentication/implementation/MixedRealityStsRestClientImplBuilder.java b/sdk/mixedreality/azure-mixedreality-authentication/src/main/java/com/azure/mixedreality/authentication/implementation/MixedRealityStsRestClientImplBuilder.java deleted file mode 100644 index 984aeed86c69..000000000000 --- a/sdk/mixedreality/azure-mixedreality-authentication/src/main/java/com/azure/mixedreality/authentication/implementation/MixedRealityStsRestClientImplBuilder.java +++ /dev/null @@ -1,308 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.mixedreality.authentication.implementation; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.client.traits.ConfigurationTrait; -import com.azure.core.client.traits.HttpTrait; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -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.AddHeadersPolicy; -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.util.ClientOptions; -import com.azure.core.util.Configuration; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.builder.ClientBuilderUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.core.util.serializer.SerializerAdapter; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** - * A builder for creating a new instance of the MixedRealityStsRestClient type. - */ -@ServiceClientBuilder(serviceClients = { MixedRealityStsRestClientImpl.class }) -public final class MixedRealityStsRestClientImplBuilder implements HttpTrait, - ConfigurationTrait { - @Generated - private static final String SDK_NAME = "name"; - - @Generated - private static final String SDK_VERSION = "version"; - - @Generated - private static final Map PROPERTIES = new HashMap<>(); - - @Generated - private final List pipelinePolicies; - - /** - * Create an instance of the MixedRealityStsRestClientImplBuilder. - */ - @Generated - public MixedRealityStsRestClientImplBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP client used to send the request. - */ - @Generated - private HttpClient httpClient; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public MixedRealityStsRestClientImplBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated - private HttpPipeline pipeline; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public MixedRealityStsRestClientImplBuilder pipeline(HttpPipeline pipeline) { - if (this.pipeline != null && pipeline == null) { - LOGGER.atInfo().log("HttpPipeline is being set to 'null' when it was previously configured."); - } - this.pipeline = pipeline; - return this; - } - - /* - * The logging configuration for HTTP requests and responses. - */ - @Generated - private HttpLogOptions httpLogOptions; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public MixedRealityStsRestClientImplBuilder httpLogOptions(HttpLogOptions httpLogOptions) { - this.httpLogOptions = httpLogOptions; - return this; - } - - /* - * The client options such as application ID and custom headers to set on a request. - */ - @Generated - private ClientOptions clientOptions; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public MixedRealityStsRestClientImplBuilder clientOptions(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - return this; - } - - /* - * The retry options to configure retry policy for failed requests. - */ - @Generated - private RetryOptions retryOptions; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public MixedRealityStsRestClientImplBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public MixedRealityStsRestClientImplBuilder addPolicy(HttpPipelinePolicy customPolicy) { - Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."); - pipelinePolicies.add(customPolicy); - return this; - } - - /* - * The configuration store that is used during construction of the service client. - */ - @Generated - private Configuration configuration; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public MixedRealityStsRestClientImplBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * server parameter - */ - @Generated - private String host; - - /** - * Sets server parameter. - * - * @param host the host value. - * @return the MixedRealityStsRestClientImplBuilder. - */ - @Generated - public MixedRealityStsRestClientImplBuilder host(String host) { - this.host = host; - return this; - } - - /* - * Api Version - */ - @Generated - private String apiVersion; - - /** - * Sets Api Version. - * - * @param apiVersion the apiVersion value. - * @return the MixedRealityStsRestClientImplBuilder. - */ - @Generated - public MixedRealityStsRestClientImplBuilder apiVersion(String apiVersion) { - this.apiVersion = apiVersion; - return this; - } - - /* - * The serializer to serialize an object into a string - */ - @Generated - private SerializerAdapter serializerAdapter; - - /** - * Sets The serializer to serialize an object into a string. - * - * @param serializerAdapter the serializerAdapter value. - * @return the MixedRealityStsRestClientImplBuilder. - */ - @Generated - public MixedRealityStsRestClientImplBuilder serializerAdapter(SerializerAdapter serializerAdapter) { - this.serializerAdapter = serializerAdapter; - return this; - } - - /* - * The retry policy that will attempt to retry failed requests, if applicable. - */ - @Generated - private RetryPolicy retryPolicy; - - /** - * Sets The retry policy that will attempt to retry failed requests, if applicable. - * - * @param retryPolicy the retryPolicy value. - * @return the MixedRealityStsRestClientImplBuilder. - */ - @Generated - public MixedRealityStsRestClientImplBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - return this; - } - - /** - * Builds an instance of MixedRealityStsRestClientImpl with the provided parameters. - * - * @return an instance of MixedRealityStsRestClientImpl. - */ - @Generated - public MixedRealityStsRestClientImpl buildClient() { - this.validateClient(); - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - String localHost = (host != null) ? host : "https://sts.mixedreality.azure.com"; - String localApiVersion = (apiVersion != null) ? apiVersion : "2019-02-28-preview"; - SerializerAdapter localSerializerAdapter - = (serializerAdapter != null) ? serializerAdapter : JacksonAdapter.createDefaultSerializerAdapter(); - MixedRealityStsRestClientImpl client - = new MixedRealityStsRestClientImpl(localPipeline, localSerializerAdapter, localHost, localApiVersion); - return client; - } - - @Generated - private void validateClient() { - // This method is invoked from 'buildInnerClient'/'buildClient' method. - // Developer can customize this method, to validate that the necessary conditions are met for the new client. - } - - @Generated - private HttpPipeline createHttpPipeline() { - Configuration buildConfiguration - = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; - HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; - ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions; - List policies = new ArrayList<>(); - String clientName = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName"); - String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); - String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions); - policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); - policies.add(new RequestIdPolicy()); - policies.add(new AddHeadersFromContextPolicy()); - HttpHeaders headers = CoreUtils.createHttpHeadersFromClientOptions(localClientOptions); - if (headers != null) { - policies.add(new AddHeadersPolicy(headers)); - } - this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .forEach(p -> policies.add(p)); - HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); - policies.add(new AddDatePolicy()); - this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .forEach(p -> policies.add(p)); - HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(localHttpLogOptions)); - HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) - .httpClient(httpClient) - .clientOptions(localClientOptions) - .build(); - return httpPipeline; - } - - private static final ClientLogger LOGGER = new ClientLogger(MixedRealityStsRestClientImplBuilder.class); -} diff --git a/sdk/mixedreality/azure-mixedreality-authentication/src/main/java/com/azure/mixedreality/authentication/implementation/models/GetTokenHeaders.java b/sdk/mixedreality/azure-mixedreality-authentication/src/main/java/com/azure/mixedreality/authentication/implementation/models/GetTokenHeaders.java deleted file mode 100644 index 83441574e389..000000000000 --- a/sdk/mixedreality/azure-mixedreality-authentication/src/main/java/com/azure/mixedreality/authentication/implementation/models/GetTokenHeaders.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.mixedreality.authentication.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.HttpHeaders; - -/** - * The GetTokenHeaders model. - */ -@Fluent -public final class GetTokenHeaders { - /* - * The MS-CV property. - */ - @Generated - private String msCV; - - private static final HttpHeaderName MS_CV = HttpHeaderName.fromString("MS-CV"); - - // HttpHeaders containing the raw property values. - /** - * Creates an instance of GetTokenHeaders class. - * - * @param rawHeaders The raw HttpHeaders that will be used to create the property values. - */ - public GetTokenHeaders(HttpHeaders rawHeaders) { - this.msCV = rawHeaders.getValue(MS_CV); - } - - /** - * Get the msCV property: The MS-CV property. - * - * @return the msCV value. - */ - @Generated - public String getMsCV() { - return this.msCV; - } - - /** - * Set the msCV property: The MS-CV property. - * - * @param msCV the msCV value to set. - * @return the GetTokenHeaders object itself. - */ - @Generated - public GetTokenHeaders setMsCV(String msCV) { - this.msCV = msCV; - return this; - } -} diff --git a/sdk/mixedreality/azure-mixedreality-authentication/src/main/java/com/azure/mixedreality/authentication/implementation/models/GetTokenResponse.java b/sdk/mixedreality/azure-mixedreality-authentication/src/main/java/com/azure/mixedreality/authentication/implementation/models/GetTokenResponse.java deleted file mode 100644 index fc579ed26637..000000000000 --- a/sdk/mixedreality/azure-mixedreality-authentication/src/main/java/com/azure/mixedreality/authentication/implementation/models/GetTokenResponse.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.mixedreality.authentication.implementation.models; - -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.rest.ResponseBase; - -/** Contains all response data for the getToken operation. */ -public final class GetTokenResponse extends ResponseBase { - /** - * Creates an instance of GetTokenResponse. - * - * @param request the request which resulted in this GetTokenResponse. - * @param statusCode the status code of the HTTP response. - * @param rawHeaders the raw headers of the HTTP response. - * @param value the deserialized value of the HTTP response. - * @param headers the deserialized headers of the HTTP response. - */ - public GetTokenResponse(HttpRequest request, int statusCode, HttpHeaders rawHeaders, StsTokenResponseMessage value, - GetTokenHeaders headers) { - super(request, statusCode, rawHeaders, value, headers); - } - - /** - * Gets the deserialized response body. - * - * @return the deserialized response body. - */ - @Override - public StsTokenResponseMessage getValue() { - return super.getValue(); - } -} diff --git a/sdk/mixedreality/azure-mixedreality-authentication/src/main/java/com/azure/mixedreality/authentication/implementation/models/StsTokenResponseMessage.java b/sdk/mixedreality/azure-mixedreality-authentication/src/main/java/com/azure/mixedreality/authentication/implementation/models/StsTokenResponseMessage.java deleted file mode 100644 index cdf9a25ce294..000000000000 --- a/sdk/mixedreality/azure-mixedreality-authentication/src/main/java/com/azure/mixedreality/authentication/implementation/models/StsTokenResponseMessage.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.mixedreality.authentication.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Represents a token response message from the STS service. - */ -@Fluent -public final class StsTokenResponseMessage implements JsonSerializable { - /* - * An access token for the account. - */ - @Generated - private String accessToken; - - /** - * Creates an instance of StsTokenResponseMessage class. - */ - @Generated - public StsTokenResponseMessage() { - } - - /** - * Get the accessToken property: An access token for the account. - * - * @return the accessToken value. - */ - @Generated - public String getAccessToken() { - return this.accessToken; - } - - /** - * Set the accessToken property: An access token for the account. - * - * @param accessToken the accessToken value to set. - * @return the StsTokenResponseMessage object itself. - */ - @Generated - public StsTokenResponseMessage setAccessToken(String accessToken) { - this.accessToken = accessToken; - return this; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("AccessToken", this.accessToken); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of StsTokenResponseMessage from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of StsTokenResponseMessage if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the StsTokenResponseMessage. - */ - @Generated - public static StsTokenResponseMessage fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - StsTokenResponseMessage deserializedStsTokenResponseMessage = new StsTokenResponseMessage(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("AccessToken".equals(fieldName)) { - deserializedStsTokenResponseMessage.accessToken = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedStsTokenResponseMessage; - }); - } -} diff --git a/sdk/mixedreality/azure-mixedreality-authentication/src/main/java/com/azure/mixedreality/authentication/implementation/models/TokenRequestOptions.java b/sdk/mixedreality/azure-mixedreality-authentication/src/main/java/com/azure/mixedreality/authentication/implementation/models/TokenRequestOptions.java deleted file mode 100644 index 1daef4c7be37..000000000000 --- a/sdk/mixedreality/azure-mixedreality-authentication/src/main/java/com/azure/mixedreality/authentication/implementation/models/TokenRequestOptions.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.mixedreality.authentication.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; - -/** - * Parameter group. - */ -@Fluent -public final class TokenRequestOptions { - /* - * The client request correlation vector, which should be set to a new value for each request. Useful when debugging - * with Microsoft. - */ - @Generated - private String clientRequestId; - - /** - * Creates an instance of TokenRequestOptions class. - */ - @Generated - public TokenRequestOptions() { - } - - /** - * Get the clientRequestId property: The client request correlation vector, which should be set to a new value for - * each request. Useful when debugging with Microsoft. - * - * @return the clientRequestId value. - */ - @Generated - public String getClientRequestId() { - return this.clientRequestId; - } - - /** - * Set the clientRequestId property: The client request correlation vector, which should be set to a new value for - * each request. Useful when debugging with Microsoft. - * - * @param clientRequestId the clientRequestId value to set. - * @return the TokenRequestOptions object itself. - */ - @Generated - public TokenRequestOptions setClientRequestId(String clientRequestId) { - this.clientRequestId = clientRequestId; - return this; - } -} diff --git a/sdk/mixedreality/azure-mixedreality-authentication/src/main/java/com/azure/mixedreality/authentication/implementation/models/package-info.java b/sdk/mixedreality/azure-mixedreality-authentication/src/main/java/com/azure/mixedreality/authentication/implementation/models/package-info.java deleted file mode 100644 index 8aa6330436b3..000000000000 --- a/sdk/mixedreality/azure-mixedreality-authentication/src/main/java/com/azure/mixedreality/authentication/implementation/models/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// 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 MixedRealityStsRestClient. - * Definition for the Mixed Reality Cloud STS service APIs. - */ -package com.azure.mixedreality.authentication.implementation.models; diff --git a/sdk/mixedreality/azure-mixedreality-authentication/src/main/java/com/azure/mixedreality/authentication/implementation/package-info.java b/sdk/mixedreality/azure-mixedreality-authentication/src/main/java/com/azure/mixedreality/authentication/implementation/package-info.java deleted file mode 100644 index 13291cb51625..000000000000 --- a/sdk/mixedreality/azure-mixedreality-authentication/src/main/java/com/azure/mixedreality/authentication/implementation/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// 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 MixedRealityStsRestClient. - * Definition for the Mixed Reality Cloud STS service APIs. - */ -package com.azure.mixedreality.authentication.implementation; diff --git a/sdk/mixedreality/azure-mixedreality-authentication/src/main/java/com/azure/mixedreality/authentication/package-info.java b/sdk/mixedreality/azure-mixedreality-authentication/src/main/java/com/azure/mixedreality/authentication/package-info.java deleted file mode 100644 index db2d5555deb1..000000000000 --- a/sdk/mixedreality/azure-mixedreality-authentication/src/main/java/com/azure/mixedreality/authentication/package-info.java +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -/** - * Package containing classes used for retrieving access tokens from - * the Mixed Reality STS service. - */ -package com.azure.mixedreality.authentication; diff --git a/sdk/mixedreality/azure-mixedreality-authentication/src/main/java/module-info.java b/sdk/mixedreality/azure-mixedreality-authentication/src/main/java/module-info.java deleted file mode 100644 index 3fc2dc11c362..000000000000 --- a/sdk/mixedreality/azure-mixedreality-authentication/src/main/java/module-info.java +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -/** - * Declares a module for Azure Mixed Reality Authentication. - */ -module com.azure.mixedreality.authentication { - requires transitive com.azure.core; - - exports com.azure.mixedreality.authentication; - - opens com.azure.mixedreality.authentication.implementation.models to com.azure.core; -} diff --git a/sdk/mixedreality/azure-mixedreality-authentication/src/samples/java/com/azure/mixedreality/authentication/GetToken.java b/sdk/mixedreality/azure-mixedreality-authentication/src/samples/java/com/azure/mixedreality/authentication/GetToken.java deleted file mode 100644 index 2634448d7246..000000000000 --- a/sdk/mixedreality/azure-mixedreality-authentication/src/samples/java/com/azure/mixedreality/authentication/GetToken.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.mixedreality.authentication; - -import com.azure.core.credential.AccessToken; -import com.azure.core.credential.AzureKeyCredential; - -/** - * Sample demonstrates how to get an access token from the Mixed Reality security - * token service (STS). - */ -public final class GetToken { - /** - * Runs the sample and demonstrates to get an access token from the Mixed - * Reality security token service (STS). - * @param args Unused. Arguments to the program. - */ - public static void main(String[] args) { - // You can get your account domain, Id, and key by viewing your Mixed - // Reality resource in the Azure portal. - final String accountDomain = ""; - final String accountId = "00000000-0000-0000-0000-000000000000"; - final String accountKey = ""; - - AzureKeyCredential keyCredential = new AzureKeyCredential(accountKey); - MixedRealityStsClient client = new MixedRealityStsClientBuilder() - .accountDomain(accountDomain) - .accountId(accountId) - .credential(keyCredential) - .buildClient(); - - AccessToken token = client.getToken(); - } -} diff --git a/sdk/mixedreality/azure-mixedreality-authentication/src/test/java/com/azure/mixedreality/authentication/CorrelationVectorTests.java b/sdk/mixedreality/azure-mixedreality-authentication/src/test/java/com/azure/mixedreality/authentication/CorrelationVectorTests.java deleted file mode 100644 index b57d5df939a8..000000000000 --- a/sdk/mixedreality/azure-mixedreality-authentication/src/test/java/com/azure/mixedreality/authentication/CorrelationVectorTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.mixedreality.authentication; - -import org.junit.jupiter.api.Test; - -import java.util.UUID; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; - -public class CorrelationVectorTests { - @Test - public void generateCvBase() { - String actual = CorrelationVector.generateCvBase(); - - assertNotNull(actual); - assertEquals(22, actual.length()); - } - - @Test - public void generateCvBaseFromUUID() { - UUID seedUuid = UUID.fromString("0d0cddc7-4eb1-4791-9870-b1a7413cecdf"); - String actual = CorrelationVector.generateCvBaseFromUUID(seedUuid); - - assertEquals("DQzdx06xR5GYcLGnQTzs3w", actual); - } -} diff --git a/sdk/mixedreality/azure-mixedreality-authentication/src/test/java/com/azure/mixedreality/authentication/JsonWebTokenTests.java b/sdk/mixedreality/azure-mixedreality-authentication/src/test/java/com/azure/mixedreality/authentication/JsonWebTokenTests.java deleted file mode 100644 index 260845b2b11f..000000000000 --- a/sdk/mixedreality/azure-mixedreality-authentication/src/test/java/com/azure/mixedreality/authentication/JsonWebTokenTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.mixedreality.authentication; - -import org.junit.jupiter.api.Test; - -import java.time.OffsetDateTime; - -import static org.junit.jupiter.api.Assertions.*; - -public class JsonWebTokenTests { - @Test - public void retrieveExpiration() { - // Note: The trailing "." on the end indicates an empty signature indicating that this JWT is not signed. - final String jwtValue - = "eyJhbGciOiJub25lIiwidHlwIjoiSldUIn0.eyJlbWFpbCI6IkJvYkBjb250b3NvLmNvbSIsImdpdmVuX25hbWUiOiJCb2IiLCJpc3MiOiJodHRwOi8vRGVmYXVsdC5Jc3N1ZXIuY29tIiwiYXVkIjoiaHR0cDovL0RlZmF1bHQuQXVkaWVuY2UuY29tIiwiaWF0IjoiMTYxMDgxMjI1MCIsIm5iZiI6IjE2MTA4MTI1NTAiLCJleHAiOiIxNjEwODk4NjUwIn0."; - final long expectedExpirationTimestamp = 1610898650; // 1/17/2021 3:50:50 PM UTC - - OffsetDateTime actual = JsonWebToken.retrieveExpiration(jwtValue); - - assertNotNull(actual); - - long actualTimestamp = actual.toEpochSecond(); - - assertEquals(expectedExpirationTimestamp, actualTimestamp); - } - - @Test - public void retrieveExpirationWithBadJwt() { - OffsetDateTime actual = JsonWebToken.retrieveExpiration("asdfasdfasdf"); - - assertNull(actual); - } -} diff --git a/sdk/mixedreality/azure-mixedreality-authentication/src/test/java/com/azure/mixedreality/authentication/MixedRealityAccountKeyCredentialTest.java b/sdk/mixedreality/azure-mixedreality-authentication/src/test/java/com/azure/mixedreality/authentication/MixedRealityAccountKeyCredentialTest.java deleted file mode 100644 index c68cdc355166..000000000000 --- a/sdk/mixedreality/azure-mixedreality-authentication/src/test/java/com/azure/mixedreality/authentication/MixedRealityAccountKeyCredentialTest.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.mixedreality.authentication; - -import com.azure.core.credential.AccessToken; -import com.azure.core.credential.AzureKeyCredential; -import org.junit.jupiter.api.Test; - -import java.time.OffsetDateTime; -import java.util.UUID; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; - -public class MixedRealityAccountKeyCredentialTest { - // NOT REAL: Just a new UUID. - private final UUID accountId = UUID.fromString("3ff503e0-15ef-4be9-bd99-29e6026d4bf6"); - - // NOT REAL: Base64 encoded accountId. - private final AzureKeyCredential keyCredential - = new AzureKeyCredential("M2ZmNTAzZTAtMTVlZi00YmU5LWJkOTktMjllNjAyNmQ0YmY2"); - - @Test - public void create() { - MixedRealityAccountKeyCredential credential = new MixedRealityAccountKeyCredential(accountId, keyCredential); - - assertNotNull(credential); - } - - @Test - public void getToken() { - String expectedAccessTokenValue - = "3ff503e0-15ef-4be9-bd99-29e6026d4bf6:M2ZmNTAzZTAtMTVlZi00YmU5LWJkOTktMjllNjAyNmQ0YmY2"; - OffsetDateTime expectedExpiration = OffsetDateTime.MAX; - MixedRealityAccountKeyCredential credential = new MixedRealityAccountKeyCredential(accountId, keyCredential); - - AccessToken token = credential.getToken(null).block(); - - assertNotNull(token); - assertEquals(expectedAccessTokenValue, token.getToken()); - assertEquals(expectedExpiration, token.getExpiresAt()); - } -} diff --git a/sdk/mixedreality/azure-mixedreality-authentication/src/test/java/com/azure/mixedreality/authentication/MixedRealityStsAsyncClientTests.java b/sdk/mixedreality/azure-mixedreality-authentication/src/test/java/com/azure/mixedreality/authentication/MixedRealityStsAsyncClientTests.java deleted file mode 100644 index da6840e17d96..000000000000 --- a/sdk/mixedreality/azure-mixedreality-authentication/src/test/java/com/azure/mixedreality/authentication/MixedRealityStsAsyncClientTests.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.mixedreality.authentication; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.MethodSource; -import reactor.test.StepVerifier; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; - -public class MixedRealityStsAsyncClientTests extends MixedRealityStsClientTestBase { - private static final String DISPLAY_NAME_WITH_ARGUMENTS = "{displayName} with [{arguments}]"; - private MixedRealityStsAsyncClient client; - - private void initializeClient(HttpClient httpClient) { - client = new MixedRealityStsClientBuilder().accountId(super.getAccountId()) - .accountDomain(super.getAccountDomain()) - .pipeline(super.getHttpPipeline(httpClient)) - .buildAsyncClient(); - } - - @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) - @MethodSource("getHttpClients") - public void getToken(HttpClient httpClient) { - // arrange - initializeClient(httpClient); - - // act - StepVerifier.create(this.client.getToken()).assertNext(actual -> { - // assert - assertNotNull(actual); - assertNotNull(actual.getToken()); - assertNotNull(actual.getExpiresAt()); - }).verifyComplete(); - } - - @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) - @MethodSource("getHttpClients") - public void getTokenWithResponse(HttpClient httpClient) { - // arrange - initializeClient(httpClient); - - // act - StepVerifier.create(this.client.getTokenWithResponse()).assertNext(actualResponse -> { - // assert - assertNotNull(actualResponse); - assertEquals(200, actualResponse.getStatusCode()); - - // act - AccessToken actual = actualResponse.getValue(); - - // assert - assertNotNull(actual); - assertNotNull(actual.getToken()); - assertNotNull(actual.getExpiresAt()); - }).verifyComplete(); - } -} diff --git a/sdk/mixedreality/azure-mixedreality-authentication/src/test/java/com/azure/mixedreality/authentication/MixedRealityStsClientBuilderTests.java b/sdk/mixedreality/azure-mixedreality-authentication/src/test/java/com/azure/mixedreality/authentication/MixedRealityStsClientBuilderTests.java deleted file mode 100644 index 6b4d25630e6c..000000000000 --- a/sdk/mixedreality/azure-mixedreality-authentication/src/test/java/com/azure/mixedreality/authentication/MixedRealityStsClientBuilderTests.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.mixedreality.authentication; - -import com.azure.core.credential.AzureKeyCredential; -import com.azure.core.http.policy.ExponentialBackoffOptions; -import com.azure.core.http.policy.RetryOptions; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.test.http.MockHttpResponse; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -import static org.junit.jupiter.api.Assertions.*; - -public class MixedRealityStsClientBuilderTests { - private final String accountDomain = "mixedreality.azure.com"; - private final String accountId = "00000000-0000-0000-0000-000000000000"; - private final String accountKey = "00000000-0000-0000-0000-000000000000"; - - @Test - public void buildClient() { - - MixedRealityStsClient client = new MixedRealityStsClientBuilder().accountDomain(this.accountDomain) - .accountId(this.accountId) - .credential(new AzureKeyCredential(accountKey)) - .httpClient(request -> Mono.just(new MockHttpResponse(request, 200))) - .buildClient(); - - assertNotNull(client); - } - - @Test - public void buildClientMissingAccountDomain() { - - MixedRealityStsClientBuilder builder = new MixedRealityStsClientBuilder().accountId(this.accountId) - .credential(new AzureKeyCredential(accountKey)); - - NullPointerException exception = assertThrows(NullPointerException.class, builder::buildClient); - - assertEquals("The 'accountDomain' has not been set and is required.", exception.getMessage()); - } - - @Test - public void buildClientMissingAccountId() { - - MixedRealityStsClientBuilder builder = new MixedRealityStsClientBuilder().accountDomain(this.accountDomain) - .credential(new AzureKeyCredential(accountKey)); - - NullPointerException exception = assertThrows(NullPointerException.class, builder::buildClient); - - assertEquals("The 'accountId' has not been set and is required.", exception.getMessage()); - } - - @Test - public void buildClientMissingCredential() { - - MixedRealityStsClientBuilder builder - = new MixedRealityStsClientBuilder().accountId(this.accountId).accountDomain(this.accountDomain); - - NullPointerException exception = assertThrows(NullPointerException.class, builder::buildClient); - - assertEquals("The 'credential' has not been set and is required.", exception.getMessage()); - } - - @Test - public void bothRetryOptionsAndRetryPolicySet() { - assertThrows(IllegalStateException.class, - () -> new MixedRealityStsClientBuilder().accountDomain(this.accountDomain) - .accountId(this.accountId) - .credential(new AzureKeyCredential(accountKey)) - .retryOptions(new RetryOptions(new ExponentialBackoffOptions())) - .retryPolicy(new RetryPolicy()) - .buildClient()); - } -} diff --git a/sdk/mixedreality/azure-mixedreality-authentication/src/test/java/com/azure/mixedreality/authentication/MixedRealityStsClientTestBase.java b/sdk/mixedreality/azure-mixedreality-authentication/src/test/java/com/azure/mixedreality/authentication/MixedRealityStsClientTestBase.java deleted file mode 100644 index 5b8e8e2e24f7..000000000000 --- a/sdk/mixedreality/azure-mixedreality-authentication/src/test/java/com/azure/mixedreality/authentication/MixedRealityStsClientTestBase.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.mixedreality.authentication; - -import com.azure.core.credential.AzureKeyCredential; -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.test.TestProxyTestBase; -import com.azure.core.test.models.CustomMatcher; -import com.azure.core.test.models.BodilessMatcher; -import com.azure.core.test.models.TestProxyRequestMatcher; -import com.azure.core.test.models.TestProxySanitizer; -import com.azure.core.test.models.TestProxySanitizerType; -import com.azure.core.util.Configuration; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.UUID; - -public class MixedRealityStsClientTestBase extends TestProxyTestBase { - public static final String INVALID_DUMMY_TOKEN = "eyJhbGciOiJub25lIiwidHlwIjoiSldUIn0.eyJlbWFpbCI6IkJvYkBjb250b" - + "3NvLmNvbSIsImdpdmVuX25hbWUiOiJCb2IiLCJpc3MiOiJodHRwOi8vRGVmYXVsdC5Jc3N1ZXIuY29tIiwiYXVkIjoiaHR0cDovL0RlZm" - + "F1bHQuQXVkaWVuY2UuY29tIiwiaWF0IjoiMTYwNzk3ODY4MyIsIm5iZiI6IjE2MDc5Nzg2ODMiLCJleHAiOiIxNjA3OTc4OTgzIn0."; - private final String accountDomain = Configuration.getGlobalConfiguration().get("MIXEDREALITY_ACCOUNT_DOMAIN"); - private final String accountId = Configuration.getGlobalConfiguration().get("MIXEDREALITY_ACCOUNT_ID"); - private final String accountKey = Configuration.getGlobalConfiguration().get("MIXEDREALITY_ACCOUNT_KEY"); - - // NOT REAL ACCOUNT DETAILS - private final String playbackAccountDomain = "mixedreality.azure.com"; - private final String playbackAccountId = "f5b3e69f-1e1b-46a5-a718-aea58a7a0f8e"; - private final String playbackAccountKey = "NjgzMjFkNWEtNzk3OC00Y2ViLWI4ODAtMGY0OTc1MWRhYWU5"; - - HttpPipeline getHttpPipeline(HttpClient httpClient) { - String accountId = getAccountId(); - String accountDomain = getAccountDomain(); - AzureKeyCredential keyCredential = getAccountKey(); - - TokenCredential credential = constructAccountKeyCredential(accountId, keyCredential); - String endpoint = AuthenticationEndpoint.constructFromDomain(accountDomain); - String authenticationScope = AuthenticationEndpoint.constructScope(endpoint); - - final List policies = new ArrayList<>(); - policies.add(new BearerTokenAuthenticationPolicy(credential, authenticationScope)); - - if (interceptorManager.isRecordMode() || interceptorManager.isPlaybackMode()) { - List customSanitizers = new ArrayList<>(); - customSanitizers.add( - new TestProxySanitizer("$..AccessToken", null, INVALID_DUMMY_TOKEN, TestProxySanitizerType.BODY_KEY)); - interceptorManager.addSanitizers(customSanitizers); - } - - if (interceptorManager.isRecordMode()) { - policies.add(interceptorManager.getRecordPolicy()); - } - - if (interceptorManager.isPlaybackMode()) { - List customMatchers = new ArrayList<>(); - customMatchers.add(new BodilessMatcher()); - customMatchers.add(new CustomMatcher().setExcludedHeaders(Collections.singletonList("X-MRC-CV"))); - interceptorManager.addMatchers(customMatchers); - } - - HttpPipeline pipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) - .httpClient(interceptorManager.isPlaybackMode() ? interceptorManager.getPlaybackClient() : httpClient) - .build(); - - return pipeline; - } - - String getAccountDomain() { - return interceptorManager.isPlaybackMode() ? this.playbackAccountDomain : this.accountDomain; - } - - String getAccountId() { - String accountIdValue = interceptorManager.isPlaybackMode() ? this.playbackAccountId : this.accountId; - - return accountIdValue; - } - - AzureKeyCredential getAccountKey() { - String accountKeyValue = interceptorManager.isPlaybackMode() ? this.playbackAccountKey : this.accountKey; - - return new AzureKeyCredential(accountKeyValue); - } - - static TokenCredential constructAccountKeyCredential(String accountId, AzureKeyCredential keyCredential) { - return new MixedRealityAccountKeyCredential(UUID.fromString(accountId), keyCredential); - } -} diff --git a/sdk/mixedreality/azure-mixedreality-authentication/src/test/java/com/azure/mixedreality/authentication/MixedRealityStsClientTests.java b/sdk/mixedreality/azure-mixedreality-authentication/src/test/java/com/azure/mixedreality/authentication/MixedRealityStsClientTests.java deleted file mode 100644 index 68af955a5420..000000000000 --- a/sdk/mixedreality/azure-mixedreality-authentication/src/test/java/com/azure/mixedreality/authentication/MixedRealityStsClientTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.mixedreality.authentication; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.MethodSource; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; - -public class MixedRealityStsClientTests extends MixedRealityStsClientTestBase { - private static final String DISPLAY_NAME_WITH_ARGUMENTS = "{displayName} with [{arguments}]"; - private MixedRealityStsClient client; - - private void initializeClient(HttpClient httpClient) { - client = new MixedRealityStsClientBuilder().accountId(super.getAccountId()) - .accountDomain(super.getAccountDomain()) - .pipeline(super.getHttpPipeline(httpClient)) - .buildClient(); - } - - @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) - @MethodSource("getHttpClients") - public void getToken(HttpClient httpClient) { - // arrange - initializeClient(httpClient); - - // act - AccessToken actual = this.client.getToken(); - - // assert - assertNotNull(actual); - assertNotNull(actual.getToken()); - assertNotNull(actual.getExpiresAt()); - } - - @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) - @MethodSource("getHttpClients") - public void getTokenWithResponse(HttpClient httpClient) { - // arrange - initializeClient(httpClient); - - // act - Response actualResponse = this.client.getTokenWithResponse(Context.NONE); - - // assert - assertNotNull(actualResponse); - assertEquals(200, actualResponse.getStatusCode()); - - // act - AccessToken actual = actualResponse.getValue(); - - // assert - assertNotNull(actual); - assertNotNull(actual.getToken()); - assertNotNull(actual.getExpiresAt()); - } -} diff --git a/sdk/mixedreality/azure-mixedreality-authentication/swagger/autorest.md b/sdk/mixedreality/azure-mixedreality-authentication/swagger/autorest.md deleted file mode 100644 index c8bb1e55ffcc..000000000000 --- a/sdk/mixedreality/azure-mixedreality-authentication/swagger/autorest.md +++ /dev/null @@ -1,42 +0,0 @@ -# Azure Mixed Reality Authentication Service client library for Java - -> see https://aka.ms/autorest - -This is the Autorest configuration file for Mixed Reality Authentication. - ---- -## Getting Started -To build the SDK for Mixed Reality Authentication, simply [Install Autorest](https://aka.ms/autorest) and in this folder, run: - -> `autorest` - -To see additional help and options, run: - -> `autorest --help` - -### Setup -```ps -npm install -g autorest -``` - -### Generation - -```ps -cd -autorest -``` - -## Configuration - -```yaml -use: '@autorest/java@4.1.62' -output-folder: ../ -java: true -input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/aa19725fe79aea2a9dc580f3c66f77f89cc34563/specification/mixedreality/data-plane/Microsoft.MixedReality/preview/2019-02-28-preview/mr-sts.json -title: MixedRealityStsRestClient -namespace: com.azure.mixedreality.authentication -models-subpackage: implementation.models -generate-client-as-impl: true -license-header: MICROSOFT_MIT_SMALL -sync-methods: none -``` diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/CHANGELOG.md b/sdk/mixedreality/azure-resourcemanager-mixedreality/CHANGELOG.md deleted file mode 100644 index 8a15f1bf57fd..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/CHANGELOG.md +++ /dev/null @@ -1,168 +0,0 @@ -# Release History - -## 1.1.0-beta.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - -## 1.0.1 (2026-02-09) - -### Other Changes - -- Please note, this package has been deprecated and will no longer be maintained after 2025/10/01. There are no replacement packages, as all mixed reality services are deprecated. Refer to our deprecation policy (https://aka.ms/azsdk/support-policies) for more details. - -## 1.0.0 (2024-12-23) - -- Azure Resource Manager MixedReality client library for Java. This package contains Microsoft Azure SDK for MixedReality Management SDK. Mixed Reality Client. Package tag package-2021-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). - -### Other Changes - -- Release Azure Resource Manager MixedReality client library for Java. - -## 1.0.0-beta.3 (2024-10-17) - -- Azure Resource Manager MixedReality client library for Java. This package contains Microsoft Azure SDK for MixedReality Management SDK. Mixed Reality Client. Package tag package-2021-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). - -### Features Added - -#### `models.Identity` was modified - -* `fromJson(com.azure.json.JsonReader)` was added -* `toJson(com.azure.json.JsonWriter)` was added - -#### `models.LogSpecification` was modified - -* `fromJson(com.azure.json.JsonReader)` was added -* `toJson(com.azure.json.JsonWriter)` was added - -#### `models.OperationProperties` was modified - -* `toJson(com.azure.json.JsonWriter)` was added -* `fromJson(com.azure.json.JsonReader)` was added - -#### `models.MetricSpecification` was modified - -* `toJson(com.azure.json.JsonWriter)` was added -* `fromJson(com.azure.json.JsonReader)` was added - -#### `models.ServiceSpecification` was modified - -* `fromJson(com.azure.json.JsonReader)` was added -* `toJson(com.azure.json.JsonWriter)` was added - -#### `models.SpatialAnchorsAccountPage` was modified - -* `fromJson(com.azure.json.JsonReader)` was added -* `toJson(com.azure.json.JsonWriter)` was added - -#### `models.AccountKeyRegenerateRequest` was modified - -* `toJson(com.azure.json.JsonWriter)` was added -* `fromJson(com.azure.json.JsonReader)` was added - -#### `models.OperationDisplay` was modified - -* `fromJson(com.azure.json.JsonReader)` was added -* `toJson(com.azure.json.JsonWriter)` was added - -#### `models.Sku` was modified - -* `toJson(com.azure.json.JsonWriter)` was added -* `fromJson(com.azure.json.JsonReader)` was added - -#### `models.RemoteRenderingAccountPage` was modified - -* `toJson(com.azure.json.JsonWriter)` was added -* `fromJson(com.azure.json.JsonReader)` was added - -#### `models.CheckNameAvailabilityRequest` was modified - -* `toJson(com.azure.json.JsonWriter)` was added -* `fromJson(com.azure.json.JsonReader)` was added - -#### `models.OperationPage` was modified - -* `toJson(com.azure.json.JsonWriter)` was added -* `fromJson(com.azure.json.JsonReader)` was added - -#### `models.MetricDimension` was modified - -* `fromJson(com.azure.json.JsonReader)` was added -* `toJson(com.azure.json.JsonWriter)` was added - -## 1.0.0-beta.2 (2023-01-18) - -- Azure Resource Manager MixedReality client library for Java. This package contains Microsoft Azure SDK for MixedReality Management SDK. Mixed Reality Client. Package tag package-2021-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). - -### Breaking Changes - -#### `models.RemoteRenderingAccounts` was modified - -* `deleteWithResponse(java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed - -#### `models.SpatialAnchorsAccounts` was modified - -* `deleteWithResponse(java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed - -### Features Added - -#### `models.RemoteRenderingAccounts` was modified - -* `deleteByResourceGroupWithResponse(java.lang.String,java.lang.String,com.azure.core.util.Context)` was added - -#### `models.SpatialAnchorsAccount` was modified - -* `resourceGroupName()` was added - -#### `models.MetricSpecification` was modified - -* `withFillGapWithZero(java.lang.Boolean)` was added -* `sourceMdmNamespace()` was added -* `withSupportedAggregationTypes(java.util.List)` was added -* `metricFilterPattern()` was added -* `supportedTimeGrainTypes()` was added -* `withMetricFilterPattern(java.lang.String)` was added -* `withSourceMdmAccount(java.lang.String)` was added -* `withCategory(java.lang.String)` was added -* `withEnableRegionalMdmAccount(java.lang.Boolean)` was added -* `withSourceMdmNamespace(java.lang.String)` was added -* `enableRegionalMdmAccount()` was added -* `sourceMdmAccount()` was added -* `withLockedAggregationType(java.lang.String)` was added -* `supportedAggregationTypes()` was added -* `category()` was added -* `fillGapWithZero()` was added -* `withSupportedTimeGrainTypes(java.util.List)` was added -* `lockedAggregationType()` was added - -#### `models.RemoteRenderingAccount` was modified - -* `resourceGroupName()` was added - -#### `MixedRealityManager$Configurable` was modified - -* `withRetryOptions(com.azure.core.http.policy.RetryOptions)` was added -* `withScope(java.lang.String)` was added - -#### `models.SpatialAnchorsAccounts` was modified - -* `deleteByResourceGroupWithResponse(java.lang.String,java.lang.String,com.azure.core.util.Context)` was added - -#### `MixedRealityManager` was modified - -* `authenticate(com.azure.core.http.HttpPipeline,com.azure.core.management.profile.AzureProfile)` was added - -#### `models.MetricDimension` was modified - -* `toBeExportedForShoebox()` was added -* `withToBeExportedForShoebox(java.lang.Boolean)` was added - -## 1.0.0-beta.1 (2021-04-27) - -- Azure Resource Manager MixedReality client library for Java. This package contains Microsoft Azure SDK for MixedReality Management SDK. Mixed Reality Client. Package tag package-2021-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). - diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/README.md b/sdk/mixedreality/azure-resourcemanager-mixedreality/README.md deleted file mode 100644 index 67fc4ebfe599..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/README.md +++ /dev/null @@ -1,110 +0,0 @@ -# Azure Resource Manager MixedReality client library for Java - -## Disclaimer - -Please note, this package has been deprecated and will no longer be maintained after 2025/10/01. There are no replacement packages, as all mixed reality services are deprecated. Refer to our deprecation policy (https://aka.ms/azsdk/support-policies) for more details. - -## Overview - -Azure Resource Manager MixedReality client library for Java. - -This package contains Microsoft Azure SDK for MixedReality Management SDK. Mixed Reality Client. Package tag package-2021-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). - -## We'd love to hear your feedback - -We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. - -If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. - -Thank you in advance for your collaboration. We really appreciate your time! - -## Documentation - -Various documentation is available to help you get started - -- [API reference documentation][docs] - -## Getting started - -### Prerequisites - -- [Java Development Kit (JDK)][jdk] with version 8 or above -- [Azure Subscription][azure_subscription] - -### Adding the package to your product - -[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-mixedreality;current}) -```xml - - com.azure.resourcemanager - azure-resourcemanager-mixedreality - 1.1.0-beta.1 - -``` -[//]: # ({x-version-update-end}) - -### Include the recommended packages - -Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. - -[Azure Identity][azure_identity] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation. - -### Authentication - -Microsoft Entra ID token authentication relies on the [credential class][azure_identity_credentials] from [Azure Identity][azure_identity] package. - -Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. - -Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: - -```java -AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); -TokenCredential credential = new DefaultAzureCredentialBuilder() - .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) - .build(); -MixedRealityManager manager = MixedRealityManager - .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/mixedreality/azure-resourcemanager-mixedreality/SAMPLE.md) - - -## Troubleshooting - -## Next steps - -## Contributing - -For details on contributing to this repository, see the [contributing guide][cg]. - -This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit . - -When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. - -This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact with any additional questions or comments. - - -[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS -[docs]: https://azure.github.io/azure-sdk-for-java/ -[jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/ -[azure_subscription]: https://azure.microsoft.com/free/ -[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity -[azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/identity/azure-identity#credentials -[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty -[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md -[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md -[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md -[coc]: https://opensource.microsoft.com/codeofconduct/ -[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ - - diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/SAMPLE.md b/sdk/mixedreality/azure-resourcemanager-mixedreality/SAMPLE.md deleted file mode 100644 index e74deb58cea9..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/SAMPLE.md +++ /dev/null @@ -1,533 +0,0 @@ -# Code snippets and samples - - -## Operations - -- [List](#operations_list) - -## RemoteRenderingAccounts - -- [Create](#remoterenderingaccounts_create) -- [Delete](#remoterenderingaccounts_delete) -- [GetByResourceGroup](#remoterenderingaccounts_getbyresourcegroup) -- [List](#remoterenderingaccounts_list) -- [ListByResourceGroup](#remoterenderingaccounts_listbyresourcegroup) -- [ListKeys](#remoterenderingaccounts_listkeys) -- [RegenerateKeys](#remoterenderingaccounts_regeneratekeys) -- [Update](#remoterenderingaccounts_update) - -## ResourceProvider - -- [CheckNameAvailabilityLocal](#resourceprovider_checknameavailabilitylocal) - -## SpatialAnchorsAccounts - -- [Create](#spatialanchorsaccounts_create) -- [Delete](#spatialanchorsaccounts_delete) -- [GetByResourceGroup](#spatialanchorsaccounts_getbyresourcegroup) -- [List](#spatialanchorsaccounts_list) -- [ListByResourceGroup](#spatialanchorsaccounts_listbyresourcegroup) -- [ListKeys](#spatialanchorsaccounts_listkeys) -- [RegenerateKeys](#spatialanchorsaccounts_regeneratekeys) -- [Update](#spatialanchorsaccounts_update) -### Operations_List - -```java -/** - * Samples for Operations List. - */ -public final class OperationsListSamples { - /* - * x-ms-original-file: - * specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/proxy/ - * ExposingAvailableOperations.json - */ - /** - * Sample code: List available operations. - * - * @param manager Entry point to MixedRealityManager. - */ - public static void listAvailableOperations(com.azure.resourcemanager.mixedreality.MixedRealityManager manager) { - manager.operations().list(com.azure.core.util.Context.NONE); - } -} -``` - -### RemoteRenderingAccounts_Create - -```java -import com.azure.resourcemanager.mixedreality.models.Identity; -import com.azure.resourcemanager.mixedreality.models.ResourceIdentityType; - -/** - * Samples for RemoteRenderingAccounts Create. - */ -public final class RemoteRenderingAccountsCreateSamples { - /* - * x-ms-original-file: - * specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/remote-rendering/ - * Put.json - */ - /** - * Sample code: Create remote rendering account. - * - * @param manager Entry point to MixedRealityManager. - */ - public static void - createRemoteRenderingAccount(com.azure.resourcemanager.mixedreality.MixedRealityManager manager) { - manager.remoteRenderingAccounts() - .define("MyAccount") - .withRegion("eastus2euap") - .withExistingResourceGroup("MyResourceGroup") - .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .create(); - } -} -``` - -### RemoteRenderingAccounts_Delete - -```java -/** - * Samples for RemoteRenderingAccounts Delete. - */ -public final class RemoteRenderingAccountsDeleteSamples { - /* - * x-ms-original-file: - * specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/remote-rendering/ - * Delete.json - */ - /** - * Sample code: Delete remote rendering account. - * - * @param manager Entry point to MixedRealityManager. - */ - public static void - deleteRemoteRenderingAccount(com.azure.resourcemanager.mixedreality.MixedRealityManager manager) { - manager.remoteRenderingAccounts() - .deleteByResourceGroupWithResponse("MyResourceGroup", "MyAccount", com.azure.core.util.Context.NONE); - } -} -``` - -### RemoteRenderingAccounts_GetByResourceGroup - -```java -/** - * Samples for RemoteRenderingAccounts GetByResourceGroup. - */ -public final class RemoteRenderingAccountsGetByResourceGroupSamples { - /* - * x-ms-original-file: - * specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/remote-rendering/ - * Get.json - */ - /** - * Sample code: Get remote rendering account. - * - * @param manager Entry point to MixedRealityManager. - */ - public static void getRemoteRenderingAccount(com.azure.resourcemanager.mixedreality.MixedRealityManager manager) { - manager.remoteRenderingAccounts() - .getByResourceGroupWithResponse("MyResourceGroup", "MyAccount", com.azure.core.util.Context.NONE); - } -} -``` - -### RemoteRenderingAccounts_List - -```java -/** - * Samples for RemoteRenderingAccounts List. - */ -public final class RemoteRenderingAccountsListSamples { - /* - * x-ms-original-file: - * specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/remote-rendering/ - * GetBySubscription.json - */ - /** - * Sample code: List remote rendering accounts by subscription. - * - * @param manager Entry point to MixedRealityManager. - */ - public static void - listRemoteRenderingAccountsBySubscription(com.azure.resourcemanager.mixedreality.MixedRealityManager manager) { - manager.remoteRenderingAccounts().list(com.azure.core.util.Context.NONE); - } -} -``` - -### RemoteRenderingAccounts_ListByResourceGroup - -```java -/** - * Samples for RemoteRenderingAccounts ListByResourceGroup. - */ -public final class RemoteRenderingAccountsListByResourceGroupSamples { - /* - * x-ms-original-file: - * specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/remote-rendering/ - * GetByResourceGroup.json - */ - /** - * Sample code: List remote rendering accounts by resource group. - * - * @param manager Entry point to MixedRealityManager. - */ - public static void - listRemoteRenderingAccountsByResourceGroup(com.azure.resourcemanager.mixedreality.MixedRealityManager manager) { - manager.remoteRenderingAccounts().listByResourceGroup("MyResourceGroup", com.azure.core.util.Context.NONE); - } -} -``` - -### RemoteRenderingAccounts_ListKeys - -```java -/** - * Samples for RemoteRenderingAccounts ListKeys. - */ -public final class RemoteRenderingAccountsListKeysSamples { - /* - * x-ms-original-file: - * specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/remote-rendering/ - * ListKeys.json - */ - /** - * Sample code: List remote rendering account key. - * - * @param manager Entry point to MixedRealityManager. - */ - public static void - listRemoteRenderingAccountKey(com.azure.resourcemanager.mixedreality.MixedRealityManager manager) { - manager.remoteRenderingAccounts() - .listKeysWithResponse("MyResourceGroup", "MyAccount", com.azure.core.util.Context.NONE); - } -} -``` - -### RemoteRenderingAccounts_RegenerateKeys - -```java -import com.azure.resourcemanager.mixedreality.models.AccountKeyRegenerateRequest; -import com.azure.resourcemanager.mixedreality.models.Serial; - -/** - * Samples for RemoteRenderingAccounts RegenerateKeys. - */ -public final class RemoteRenderingAccountsRegenerateKeysSamples { - /* - * x-ms-original-file: - * specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/remote-rendering/ - * RegenerateKey.json - */ - /** - * Sample code: Regenerate remote rendering account keys. - * - * @param manager Entry point to MixedRealityManager. - */ - public static void - regenerateRemoteRenderingAccountKeys(com.azure.resourcemanager.mixedreality.MixedRealityManager manager) { - manager.remoteRenderingAccounts() - .regenerateKeysWithResponse("MyResourceGroup", "MyAccount", - new AccountKeyRegenerateRequest().withSerial(Serial.ONE), com.azure.core.util.Context.NONE); - } -} -``` - -### RemoteRenderingAccounts_Update - -```java -import com.azure.resourcemanager.mixedreality.models.Identity; -import com.azure.resourcemanager.mixedreality.models.RemoteRenderingAccount; -import com.azure.resourcemanager.mixedreality.models.ResourceIdentityType; -import java.util.HashMap; -import java.util.Map; - -/** - * Samples for RemoteRenderingAccounts Update. - */ -public final class RemoteRenderingAccountsUpdateSamples { - /* - * x-ms-original-file: - * specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/remote-rendering/ - * Patch.json - */ - /** - * Sample code: Update remote rendering account. - * - * @param manager Entry point to MixedRealityManager. - */ - public static void - updateRemoteRenderingAccount(com.azure.resourcemanager.mixedreality.MixedRealityManager manager) { - RemoteRenderingAccount resource = manager.remoteRenderingAccounts() - .getByResourceGroupWithResponse("MyResourceGroup", "MyAccount", com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withTags(mapOf("hero", "romeo", "heroine", "juliet")) - .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .apply(); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} -``` - -### ResourceProvider_CheckNameAvailabilityLocal - -```java -import com.azure.resourcemanager.mixedreality.models.CheckNameAvailabilityRequest; - -/** - * Samples for ResourceProvider CheckNameAvailabilityLocal. - */ -public final class ResourceProviderCheckNameAvailabilityLocalSamples { - /* - * x-ms-original-file: - * specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/proxy/ - * CheckNameAvailabilityForLocalUniqueness.json - */ - /** - * Sample code: CheckLocalNameAvailability. - * - * @param manager Entry point to MixedRealityManager. - */ - public static void checkLocalNameAvailability(com.azure.resourcemanager.mixedreality.MixedRealityManager manager) { - manager.resourceProviders() - .checkNameAvailabilityLocalWithResponse("eastus2euap", - new CheckNameAvailabilityRequest().withName("MyAccount") - .withType("Microsoft.MixedReality/spatialAnchorsAccounts"), - com.azure.core.util.Context.NONE); - } -} -``` - -### SpatialAnchorsAccounts_Create - -```java -/** - * Samples for SpatialAnchorsAccounts Create. - */ -public final class SpatialAnchorsAccountsCreateSamples { - /* - * x-ms-original-file: - * specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/spatial-anchors/Put - * .json - */ - /** - * Sample code: Create spatial anchor account. - * - * @param manager Entry point to MixedRealityManager. - */ - public static void createSpatialAnchorAccount(com.azure.resourcemanager.mixedreality.MixedRealityManager manager) { - manager.spatialAnchorsAccounts() - .define("MyAccount") - .withRegion("eastus2euap") - .withExistingResourceGroup("MyResourceGroup") - .create(); - } -} -``` - -### SpatialAnchorsAccounts_Delete - -```java -/** - * Samples for SpatialAnchorsAccounts Delete. - */ -public final class SpatialAnchorsAccountsDeleteSamples { - /* - * x-ms-original-file: - * specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/spatial-anchors/ - * Delete.json - */ - /** - * Sample code: Delete spatial anchors account. - * - * @param manager Entry point to MixedRealityManager. - */ - public static void deleteSpatialAnchorsAccount(com.azure.resourcemanager.mixedreality.MixedRealityManager manager) { - manager.spatialAnchorsAccounts() - .deleteByResourceGroupWithResponse("MyResourceGroup", "MyAccount", com.azure.core.util.Context.NONE); - } -} -``` - -### SpatialAnchorsAccounts_GetByResourceGroup - -```java -/** - * Samples for SpatialAnchorsAccounts GetByResourceGroup. - */ -public final class SpatialAnchorsAccountsGetByResourceGroupSamples { - /* - * x-ms-original-file: - * specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/spatial-anchors/Get - * .json - */ - /** - * Sample code: Get spatial anchors account. - * - * @param manager Entry point to MixedRealityManager. - */ - public static void getSpatialAnchorsAccount(com.azure.resourcemanager.mixedreality.MixedRealityManager manager) { - manager.spatialAnchorsAccounts() - .getByResourceGroupWithResponse("MyResourceGroup", "MyAccount", com.azure.core.util.Context.NONE); - } -} -``` - -### SpatialAnchorsAccounts_List - -```java -/** - * Samples for SpatialAnchorsAccounts List. - */ -public final class SpatialAnchorsAccountsListSamples { - /* - * x-ms-original-file: - * specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/spatial-anchors/ - * GetBySubscription.json - */ - /** - * Sample code: List spatial anchors accounts by subscription. - * - * @param manager Entry point to MixedRealityManager. - */ - public static void - listSpatialAnchorsAccountsBySubscription(com.azure.resourcemanager.mixedreality.MixedRealityManager manager) { - manager.spatialAnchorsAccounts().list(com.azure.core.util.Context.NONE); - } -} -``` - -### SpatialAnchorsAccounts_ListByResourceGroup - -```java -/** - * Samples for SpatialAnchorsAccounts ListByResourceGroup. - */ -public final class SpatialAnchorsAccountsListByResourceGroupSamples { - /* - * x-ms-original-file: - * specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/spatial-anchors/ - * GetByResourceGroup.json - */ - /** - * Sample code: List spatial anchor accounts by resource group. - * - * @param manager Entry point to MixedRealityManager. - */ - public static void - listSpatialAnchorAccountsByResourceGroup(com.azure.resourcemanager.mixedreality.MixedRealityManager manager) { - manager.spatialAnchorsAccounts().listByResourceGroup("MyResourceGroup", com.azure.core.util.Context.NONE); - } -} -``` - -### SpatialAnchorsAccounts_ListKeys - -```java -/** - * Samples for SpatialAnchorsAccounts ListKeys. - */ -public final class SpatialAnchorsAccountsListKeysSamples { - /* - * x-ms-original-file: - * specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/spatial-anchors/ - * ListKeys.json - */ - /** - * Sample code: List spatial anchor account key. - * - * @param manager Entry point to MixedRealityManager. - */ - public static void listSpatialAnchorAccountKey(com.azure.resourcemanager.mixedreality.MixedRealityManager manager) { - manager.spatialAnchorsAccounts() - .listKeysWithResponse("MyResourceGroup", "MyAccount", com.azure.core.util.Context.NONE); - } -} -``` - -### SpatialAnchorsAccounts_RegenerateKeys - -```java -import com.azure.resourcemanager.mixedreality.models.AccountKeyRegenerateRequest; -import com.azure.resourcemanager.mixedreality.models.Serial; - -/** - * Samples for SpatialAnchorsAccounts RegenerateKeys. - */ -public final class SpatialAnchorsAccountsRegenerateKeysSamples { - /* - * x-ms-original-file: - * specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/spatial-anchors/ - * RegenerateKey.json - */ - /** - * Sample code: Regenerate spatial anchors account keys. - * - * @param manager Entry point to MixedRealityManager. - */ - public static void - regenerateSpatialAnchorsAccountKeys(com.azure.resourcemanager.mixedreality.MixedRealityManager manager) { - manager.spatialAnchorsAccounts() - .regenerateKeysWithResponse("MyResourceGroup", "MyAccount", - new AccountKeyRegenerateRequest().withSerial(Serial.ONE), com.azure.core.util.Context.NONE); - } -} -``` - -### SpatialAnchorsAccounts_Update - -```java -import com.azure.resourcemanager.mixedreality.models.SpatialAnchorsAccount; -import java.util.HashMap; -import java.util.Map; - -/** - * Samples for SpatialAnchorsAccounts Update. - */ -public final class SpatialAnchorsAccountsUpdateSamples { - /* - * x-ms-original-file: - * specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/spatial-anchors/ - * Patch.json - */ - /** - * Sample code: Update spatial anchors account. - * - * @param manager Entry point to MixedRealityManager. - */ - public static void updateSpatialAnchorsAccount(com.azure.resourcemanager.mixedreality.MixedRealityManager manager) { - SpatialAnchorsAccount resource = manager.spatialAnchorsAccounts() - .getByResourceGroupWithResponse("MyResourceGroup", "MyAccount", com.azure.core.util.Context.NONE) - .getValue(); - resource.update().withTags(mapOf("hero", "romeo", "heroine", "juliet")).apply(); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} -``` - diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/pom.xml b/sdk/mixedreality/azure-resourcemanager-mixedreality/pom.xml deleted file mode 100644 index 6ea07003005c..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/pom.xml +++ /dev/null @@ -1,74 +0,0 @@ - - - 4.0.0 - - com.azure - azure-client-sdk-parent - 1.7.0 - ../../parents/azure-client-sdk-parent - - - com.azure.resourcemanager - azure-resourcemanager-mixedreality - 1.1.0-beta.1 - jar - - Microsoft Azure SDK for MixedReality Management - Please note, this package has been deprecated and will no longer be maintained after 2025/10/01. There are no replacement packages, as all mixed reality services are deprecated. Refer to our deprecation policy (https://aka.ms/azsdk/support-policies) for more details. This package contains Microsoft Azure SDK for MixedReality Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Mixed Reality Client. Package tag package-2021-01. - https://github.com/Azure/azure-sdk-for-java - - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - - - - https://github.com/Azure/azure-sdk-for-java - scm:git:git@github.com:Azure/azure-sdk-for-java.git - scm:git:git@github.com:Azure/azure-sdk-for-java.git - HEAD - - - - microsoft - Microsoft - - - - UTF-8 - 0 - 0 - false - - - - com.azure - azure-core - 1.57.1 - - - com.azure - azure-core-management - 1.19.3 - - - com.azure - azure-core-test - 1.27.0-beta.14 - test - - - com.azure - azure-identity - 1.18.2 - test - - - diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/MixedRealityManager.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/MixedRealityManager.java deleted file mode 100644 index c98dfda9d20c..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/MixedRealityManager.java +++ /dev/null @@ -1,325 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality; - -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.HttpPipelinePosition; -import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.AddHeadersFromContextPolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.HttpPolicyProviders; -import com.azure.core.http.policy.RequestIdPolicy; -import com.azure.core.http.policy.RetryOptions; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Configuration; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.mixedreality.fluent.MixedRealityClient; -import com.azure.resourcemanager.mixedreality.implementation.MixedRealityClientBuilder; -import com.azure.resourcemanager.mixedreality.implementation.OperationsImpl; -import com.azure.resourcemanager.mixedreality.implementation.RemoteRenderingAccountsImpl; -import com.azure.resourcemanager.mixedreality.implementation.ResourceProvidersImpl; -import com.azure.resourcemanager.mixedreality.implementation.SpatialAnchorsAccountsImpl; -import com.azure.resourcemanager.mixedreality.models.Operations; -import com.azure.resourcemanager.mixedreality.models.RemoteRenderingAccounts; -import com.azure.resourcemanager.mixedreality.models.ResourceProviders; -import com.azure.resourcemanager.mixedreality.models.SpatialAnchorsAccounts; -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 MixedRealityManager. - * Mixed Reality Client. - */ -public final class MixedRealityManager { - private Operations operations; - - private ResourceProviders resourceProviders; - - private SpatialAnchorsAccounts spatialAnchorsAccounts; - - private RemoteRenderingAccounts remoteRenderingAccounts; - - private final MixedRealityClient clientObject; - - private MixedRealityManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { - Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); - Objects.requireNonNull(profile, "'profile' cannot be null."); - this.clientObject = new MixedRealityClientBuilder().pipeline(httpPipeline) - .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) - .subscriptionId(profile.getSubscriptionId()) - .defaultPollInterval(defaultPollInterval) - .buildClient(); - } - - /** - * Creates an instance of MixedReality service API entry point. - * - * @param credential the credential to use. - * @param profile the Azure profile for client. - * @return the MixedReality service API instance. - */ - public static MixedRealityManager 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 MixedReality service API entry point. - * - * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. - * @param profile the Azure profile for client. - * @return the MixedReality service API instance. - */ - public static MixedRealityManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { - Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); - Objects.requireNonNull(profile, "'profile' cannot be null."); - return new MixedRealityManager(httpPipeline, profile, null); - } - - /** - * Gets a Configurable instance that can be used to create MixedRealityManager with optional configuration. - * - * @return the Configurable instance allowing configurations. - */ - public static Configurable configure() { - return new MixedRealityManager.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 MixedReality service API entry point. - * - * @param credential the credential to use. - * @param profile the Azure profile for client. - * @return the MixedReality service API instance. - */ - public MixedRealityManager 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.mixedreality") - .append("/") - .append("1.0.0"); - if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { - userAgentBuilder.append(" (") - .append(Configuration.getGlobalConfiguration().get("java.version")) - .append("; ") - .append(Configuration.getGlobalConfiguration().get("os.name")) - .append("; ") - .append(Configuration.getGlobalConfiguration().get("os.version")) - .append("; auto-generated)"); - } else { - userAgentBuilder.append(" (auto-generated)"); - } - - if (scopes.isEmpty()) { - scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); - } - if (retryPolicy == null) { - if (retryOptions != null) { - retryPolicy = new RetryPolicy(retryOptions); - } else { - retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); - } - } - List policies = new ArrayList<>(); - policies.add(new UserAgentPolicy(userAgentBuilder.toString())); - policies.add(new AddHeadersFromContextPolicy()); - policies.add(new RequestIdPolicy()); - policies.addAll(this.policies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); - HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(retryPolicy); - policies.add(new AddDatePolicy()); - policies.add(new BearerTokenAuthenticationPolicy(credential, scopes.toArray(new String[0]))); - policies.addAll(this.policies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); - HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = new HttpPipelineBuilder().httpClient(httpClient) - .policies(policies.toArray(new HttpPipelinePolicy[0])) - .build(); - return new MixedRealityManager(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 ResourceProviders. - * - * @return Resource collection API of ResourceProviders. - */ - public ResourceProviders resourceProviders() { - if (this.resourceProviders == null) { - this.resourceProviders = new ResourceProvidersImpl(clientObject.getResourceProviders(), this); - } - return resourceProviders; - } - - /** - * Gets the resource collection API of SpatialAnchorsAccounts. It manages SpatialAnchorsAccount. - * - * @return Resource collection API of SpatialAnchorsAccounts. - */ - public SpatialAnchorsAccounts spatialAnchorsAccounts() { - if (this.spatialAnchorsAccounts == null) { - this.spatialAnchorsAccounts - = new SpatialAnchorsAccountsImpl(clientObject.getSpatialAnchorsAccounts(), this); - } - return spatialAnchorsAccounts; - } - - /** - * Gets the resource collection API of RemoteRenderingAccounts. It manages RemoteRenderingAccount. - * - * @return Resource collection API of RemoteRenderingAccounts. - */ - public RemoteRenderingAccounts remoteRenderingAccounts() { - if (this.remoteRenderingAccounts == null) { - this.remoteRenderingAccounts - = new RemoteRenderingAccountsImpl(clientObject.getRemoteRenderingAccounts(), this); - } - return remoteRenderingAccounts; - } - - /** - * Gets wrapped service client MixedRealityClient providing direct access to the underlying auto-generated API - * implementation, based on Azure REST API. - * - * @return Wrapped service client MixedRealityClient. - */ - public MixedRealityClient serviceClient() { - return this.clientObject; - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/fluent/MixedRealityClient.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/fluent/MixedRealityClient.java deleted file mode 100644 index b16d3ae45b2d..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/fluent/MixedRealityClient.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.fluent; - -import com.azure.core.http.HttpPipeline; -import java.time.Duration; - -/** - * The interface for MixedRealityClient class. - */ -public interface MixedRealityClient { - /** - * Gets The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). - * - * @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 ResourceProvidersClient object to access its operations. - * - * @return the ResourceProvidersClient object. - */ - ResourceProvidersClient getResourceProviders(); - - /** - * Gets the SpatialAnchorsAccountsClient object to access its operations. - * - * @return the SpatialAnchorsAccountsClient object. - */ - SpatialAnchorsAccountsClient getSpatialAnchorsAccounts(); - - /** - * Gets the RemoteRenderingAccountsClient object to access its operations. - * - * @return the RemoteRenderingAccountsClient object. - */ - RemoteRenderingAccountsClient getRemoteRenderingAccounts(); -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/fluent/OperationsClient.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/fluent/OperationsClient.java deleted file mode 100644 index 1c71fb0186d5..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/fluent/OperationsClient.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.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.mixedreality.fluent.models.OperationInner; - -/** - * An instance of this class provides access to all the operations defined in OperationsClient. - */ -public interface OperationsClient { - /** - * Exposing Available Operations. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Resource Provider operations as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Exposing Available Operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Resource Provider operations as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/fluent/RemoteRenderingAccountsClient.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/fluent/RemoteRenderingAccountsClient.java deleted file mode 100644 index 56cc4e551d50..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/fluent/RemoteRenderingAccountsClient.java +++ /dev/null @@ -1,240 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.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.mixedreality.fluent.models.AccountKeysInner; -import com.azure.resourcemanager.mixedreality.fluent.models.RemoteRenderingAccountInner; -import com.azure.resourcemanager.mixedreality.models.AccountKeyRegenerateRequest; - -/** - * An instance of this class provides access to all the operations defined in RemoteRenderingAccountsClient. - */ -public interface RemoteRenderingAccountsClient { - /** - * List Remote Rendering Accounts by Subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to get resource collection as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * List Remote Rendering Accounts by Subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to get resource collection as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * List Resources by Resource Group. - * - * @param resourceGroupName Name of an Azure resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to get resource collection as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * List Resources by Resource Group. - * - * @param resourceGroupName Name of an Azure resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to get resource collection as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Delete a Remote Rendering Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 accountName, Context context); - - /** - * Delete a Remote Rendering Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String accountName); - - /** - * Retrieve a Remote Rendering Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return remoteRenderingAccount Response along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse(String resourceGroupName, String accountName, - Context context); - - /** - * Retrieve a Remote Rendering Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return remoteRenderingAccount Response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RemoteRenderingAccountInner getByResourceGroup(String resourceGroupName, String accountName); - - /** - * Updating a Remote Rendering Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param remoteRenderingAccount Remote Rendering Account parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return remoteRenderingAccount Response along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String resourceGroupName, String accountName, - RemoteRenderingAccountInner remoteRenderingAccount, Context context); - - /** - * Updating a Remote Rendering Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param remoteRenderingAccount Remote Rendering Account parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return remoteRenderingAccount Response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RemoteRenderingAccountInner update(String resourceGroupName, String accountName, - RemoteRenderingAccountInner remoteRenderingAccount); - - /** - * Creating or Updating a Remote Rendering Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param remoteRenderingAccount Remote Rendering Account parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return remoteRenderingAccount Response along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse(String resourceGroupName, String accountName, - RemoteRenderingAccountInner remoteRenderingAccount, Context context); - - /** - * Creating or Updating a Remote Rendering Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param remoteRenderingAccount Remote Rendering Account parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return remoteRenderingAccount Response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RemoteRenderingAccountInner create(String resourceGroupName, String accountName, - RemoteRenderingAccountInner remoteRenderingAccount); - - /** - * List Both of the 2 Keys of a Remote Rendering Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return developer Keys of account along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listKeysWithResponse(String resourceGroupName, String accountName, Context context); - - /** - * List Both of the 2 Keys of a Remote Rendering Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return developer Keys of account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AccountKeysInner listKeys(String resourceGroupName, String accountName); - - /** - * Regenerate specified Key of a Remote Rendering Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param regenerate Required information for key regeneration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return developer Keys of account along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response regenerateKeysWithResponse(String resourceGroupName, String accountName, - AccountKeyRegenerateRequest regenerate, Context context); - - /** - * Regenerate specified Key of a Remote Rendering Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param regenerate Required information for key regeneration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return developer Keys of account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AccountKeysInner regenerateKeys(String resourceGroupName, String accountName, - AccountKeyRegenerateRequest regenerate); -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/fluent/ResourceProvidersClient.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/fluent/ResourceProvidersClient.java deleted file mode 100644 index 65b0c80d878f..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/fluent/ResourceProvidersClient.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.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.mixedreality.fluent.models.CheckNameAvailabilityResponseInner; -import com.azure.resourcemanager.mixedreality.models.CheckNameAvailabilityRequest; - -/** - * An instance of this class provides access to all the operations defined in ResourceProvidersClient. - */ -public interface ResourceProvidersClient { - /** - * Check Name Availability for local uniqueness. - * - * @param location The location in which uniqueness will be verified. - * @param checkNameAvailability Check Name Availability Request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return check Name Availability Response along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response checkNameAvailabilityLocalWithResponse(String location, - CheckNameAvailabilityRequest checkNameAvailability, Context context); - - /** - * Check Name Availability for local uniqueness. - * - * @param location The location in which uniqueness will be verified. - * @param checkNameAvailability Check Name Availability Request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return check Name Availability Response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CheckNameAvailabilityResponseInner checkNameAvailabilityLocal(String location, - CheckNameAvailabilityRequest checkNameAvailability); -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/fluent/SpatialAnchorsAccountsClient.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/fluent/SpatialAnchorsAccountsClient.java deleted file mode 100644 index 72c24ede38ae..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/fluent/SpatialAnchorsAccountsClient.java +++ /dev/null @@ -1,240 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.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.mixedreality.fluent.models.AccountKeysInner; -import com.azure.resourcemanager.mixedreality.fluent.models.SpatialAnchorsAccountInner; -import com.azure.resourcemanager.mixedreality.models.AccountKeyRegenerateRequest; - -/** - * An instance of this class provides access to all the operations defined in SpatialAnchorsAccountsClient. - */ -public interface SpatialAnchorsAccountsClient { - /** - * List Spatial Anchors Accounts by Subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to get resource collection as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * List Spatial Anchors Accounts by Subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to get resource collection as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * List Resources by Resource Group. - * - * @param resourceGroupName Name of an Azure resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to get resource collection as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * List Resources by Resource Group. - * - * @param resourceGroupName Name of an Azure resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to get resource collection as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Delete a Spatial Anchors Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 accountName, Context context); - - /** - * Delete a Spatial Anchors Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String accountName); - - /** - * Retrieve a Spatial Anchors Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return spatialAnchorsAccount Response along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse(String resourceGroupName, String accountName, - Context context); - - /** - * Retrieve a Spatial Anchors Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return spatialAnchorsAccount Response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SpatialAnchorsAccountInner getByResourceGroup(String resourceGroupName, String accountName); - - /** - * Updating a Spatial Anchors Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param spatialAnchorsAccount Spatial Anchors Account parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return spatialAnchorsAccount Response along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String resourceGroupName, String accountName, - SpatialAnchorsAccountInner spatialAnchorsAccount, Context context); - - /** - * Updating a Spatial Anchors Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param spatialAnchorsAccount Spatial Anchors Account parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return spatialAnchorsAccount Response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SpatialAnchorsAccountInner update(String resourceGroupName, String accountName, - SpatialAnchorsAccountInner spatialAnchorsAccount); - - /** - * Creating or Updating a Spatial Anchors Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param spatialAnchorsAccount Spatial Anchors Account parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return spatialAnchorsAccount Response along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse(String resourceGroupName, String accountName, - SpatialAnchorsAccountInner spatialAnchorsAccount, Context context); - - /** - * Creating or Updating a Spatial Anchors Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param spatialAnchorsAccount Spatial Anchors Account parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return spatialAnchorsAccount Response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SpatialAnchorsAccountInner create(String resourceGroupName, String accountName, - SpatialAnchorsAccountInner spatialAnchorsAccount); - - /** - * List Both of the 2 Keys of a Spatial Anchors Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return developer Keys of account along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listKeysWithResponse(String resourceGroupName, String accountName, Context context); - - /** - * List Both of the 2 Keys of a Spatial Anchors Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return developer Keys of account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AccountKeysInner listKeys(String resourceGroupName, String accountName); - - /** - * Regenerate specified Key of a Spatial Anchors Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param regenerate Required information for key regeneration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return developer Keys of account along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response regenerateKeysWithResponse(String resourceGroupName, String accountName, - AccountKeyRegenerateRequest regenerate, Context context); - - /** - * Regenerate specified Key of a Spatial Anchors Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param regenerate Required information for key regeneration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return developer Keys of account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AccountKeysInner regenerateKeys(String resourceGroupName, String accountName, - AccountKeyRegenerateRequest regenerate); -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/fluent/models/AccountKeysInner.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/fluent/models/AccountKeysInner.java deleted file mode 100644 index 2dc1ce132287..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/fluent/models/AccountKeysInner.java +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Developer Keys of account. - */ -@Immutable -public final class AccountKeysInner implements JsonSerializable { - /* - * value of primary key. - */ - private String primaryKey; - - /* - * value of secondary key. - */ - private String secondaryKey; - - /** - * Creates an instance of AccountKeysInner class. - */ - public AccountKeysInner() { - } - - /** - * Get the primaryKey property: value of primary key. - * - * @return the primaryKey value. - */ - public String primaryKey() { - return this.primaryKey; - } - - /** - * Get the secondaryKey property: value of secondary key. - * - * @return the secondaryKey value. - */ - public String secondaryKey() { - return this.secondaryKey; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AccountKeysInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AccountKeysInner if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the AccountKeysInner. - */ - public static AccountKeysInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AccountKeysInner deserializedAccountKeysInner = new AccountKeysInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("primaryKey".equals(fieldName)) { - deserializedAccountKeysInner.primaryKey = reader.getString(); - } else if ("secondaryKey".equals(fieldName)) { - deserializedAccountKeysInner.secondaryKey = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAccountKeysInner; - }); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/fluent/models/CheckNameAvailabilityResponseInner.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/fluent/models/CheckNameAvailabilityResponseInner.java deleted file mode 100644 index d5e67a1ea204..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/fluent/models/CheckNameAvailabilityResponseInner.java +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.mixedreality.models.NameUnavailableReason; -import java.io.IOException; - -/** - * Check Name Availability Response. - */ -@Fluent -public final class CheckNameAvailabilityResponseInner implements JsonSerializable { - /* - * if name Available - */ - private boolean nameAvailable; - - /* - * Resource Name To Verify - */ - private NameUnavailableReason reason; - - /* - * detail message - */ - private String message; - - /** - * Creates an instance of CheckNameAvailabilityResponseInner class. - */ - public CheckNameAvailabilityResponseInner() { - } - - /** - * Get the nameAvailable property: if name Available. - * - * @return the nameAvailable value. - */ - public boolean nameAvailable() { - return this.nameAvailable; - } - - /** - * Set the nameAvailable property: if name Available. - * - * @param nameAvailable the nameAvailable value to set. - * @return the CheckNameAvailabilityResponseInner object itself. - */ - public CheckNameAvailabilityResponseInner withNameAvailable(boolean nameAvailable) { - this.nameAvailable = nameAvailable; - return this; - } - - /** - * Get the reason property: Resource Name To Verify. - * - * @return the reason value. - */ - public NameUnavailableReason reason() { - return this.reason; - } - - /** - * Set the reason property: Resource Name To Verify. - * - * @param reason the reason value to set. - * @return the CheckNameAvailabilityResponseInner object itself. - */ - public CheckNameAvailabilityResponseInner withReason(NameUnavailableReason reason) { - this.reason = reason; - return this; - } - - /** - * Get the message property: detail message. - * - * @return the message value. - */ - public String message() { - return this.message; - } - - /** - * Set the message property: detail message. - * - * @param message the message value to set. - * @return the CheckNameAvailabilityResponseInner object itself. - */ - public CheckNameAvailabilityResponseInner withMessage(String message) { - this.message = message; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeBooleanField("nameAvailable", this.nameAvailable); - jsonWriter.writeStringField("reason", this.reason == null ? null : this.reason.toString()); - jsonWriter.writeStringField("message", this.message); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CheckNameAvailabilityResponseInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CheckNameAvailabilityResponseInner if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the CheckNameAvailabilityResponseInner. - */ - public static CheckNameAvailabilityResponseInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CheckNameAvailabilityResponseInner deserializedCheckNameAvailabilityResponseInner - = new CheckNameAvailabilityResponseInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("nameAvailable".equals(fieldName)) { - deserializedCheckNameAvailabilityResponseInner.nameAvailable = reader.getBoolean(); - } else if ("reason".equals(fieldName)) { - deserializedCheckNameAvailabilityResponseInner.reason - = NameUnavailableReason.fromString(reader.getString()); - } else if ("message".equals(fieldName)) { - deserializedCheckNameAvailabilityResponseInner.message = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedCheckNameAvailabilityResponseInner; - }); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/fluent/models/MixedRealityAccountProperties.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/fluent/models/MixedRealityAccountProperties.java deleted file mode 100644 index 15695c84d74d..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/fluent/models/MixedRealityAccountProperties.java +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Common Properties shared by Mixed Reality Accounts. - */ -@Fluent -public final class MixedRealityAccountProperties implements JsonSerializable { - /* - * The name of the storage account associated with this accountId - */ - private String storageAccountName; - - /* - * unique id of certain account. - */ - private String accountId; - - /* - * Correspond domain name of certain Spatial Anchors Account - */ - private String accountDomain; - - /** - * Creates an instance of MixedRealityAccountProperties class. - */ - public MixedRealityAccountProperties() { - } - - /** - * Get the storageAccountName property: The name of the storage account associated with this accountId. - * - * @return the storageAccountName value. - */ - public String storageAccountName() { - return this.storageAccountName; - } - - /** - * Set the storageAccountName property: The name of the storage account associated with this accountId. - * - * @param storageAccountName the storageAccountName value to set. - * @return the MixedRealityAccountProperties object itself. - */ - public MixedRealityAccountProperties withStorageAccountName(String storageAccountName) { - this.storageAccountName = storageAccountName; - return this; - } - - /** - * Get the accountId property: unique id of certain account. - * - * @return the accountId value. - */ - public String accountId() { - return this.accountId; - } - - /** - * Get the accountDomain property: Correspond domain name of certain Spatial Anchors Account. - * - * @return the accountDomain value. - */ - public String accountDomain() { - return this.accountDomain; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("storageAccountName", this.storageAccountName); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of MixedRealityAccountProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of MixedRealityAccountProperties if the JsonReader was pointing to an instance of it, or null - * if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the MixedRealityAccountProperties. - */ - public static MixedRealityAccountProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - MixedRealityAccountProperties deserializedMixedRealityAccountProperties - = new MixedRealityAccountProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("storageAccountName".equals(fieldName)) { - deserializedMixedRealityAccountProperties.storageAccountName = reader.getString(); - } else if ("accountId".equals(fieldName)) { - deserializedMixedRealityAccountProperties.accountId = reader.getString(); - } else if ("accountDomain".equals(fieldName)) { - deserializedMixedRealityAccountProperties.accountDomain = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedMixedRealityAccountProperties; - }); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/fluent/models/OperationInner.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/fluent/models/OperationInner.java deleted file mode 100644 index ff120f0e9f8d..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/fluent/models/OperationInner.java +++ /dev/null @@ -1,213 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.mixedreality.models.OperationDisplay; -import com.azure.resourcemanager.mixedreality.models.OperationProperties; -import java.io.IOException; - -/** - * REST API operation. - */ -@Fluent -public final class OperationInner implements JsonSerializable { - /* - * Operation name: {provider}/{resource}/{operation} - */ - private String name; - - /* - * The object that represents the operation. - */ - private OperationDisplay display; - - /* - * Whether or not this is a data plane operation - */ - private Boolean isDataAction; - - /* - * The origin - */ - private String origin; - - /* - * Properties of the operation - */ - private OperationProperties properties; - - /** - * Creates an instance of OperationInner class. - */ - public OperationInner() { - } - - /** - * Get the name property: Operation name: {provider}/{resource}/{operation}. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Operation name: {provider}/{resource}/{operation}. - * - * @param name the name value to set. - * @return the OperationInner object itself. - */ - public OperationInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the display property: The object that represents the operation. - * - * @return the display value. - */ - public OperationDisplay display() { - return this.display; - } - - /** - * Set the display property: The object that represents the operation. - * - * @param display the display value to set. - * @return the OperationInner object itself. - */ - public OperationInner withDisplay(OperationDisplay display) { - this.display = display; - return this; - } - - /** - * Get the isDataAction property: Whether or not this is a data plane operation. - * - * @return the isDataAction value. - */ - public Boolean isDataAction() { - return this.isDataAction; - } - - /** - * Set the isDataAction property: Whether or not this is a data plane operation. - * - * @param isDataAction the isDataAction value to set. - * @return the OperationInner object itself. - */ - public OperationInner withIsDataAction(Boolean isDataAction) { - this.isDataAction = isDataAction; - return this; - } - - /** - * Get the origin property: The origin. - * - * @return the origin value. - */ - public String origin() { - return this.origin; - } - - /** - * Set the origin property: The origin. - * - * @param origin the origin value to set. - * @return the OperationInner object itself. - */ - public OperationInner withOrigin(String origin) { - this.origin = origin; - return this; - } - - /** - * Get the properties property: Properties of the operation. - * - * @return the properties value. - */ - public OperationProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Properties of the operation. - * - * @param properties the properties value to set. - * @return the OperationInner object itself. - */ - public OperationInner withProperties(OperationProperties 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(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeJsonField("display", this.display); - jsonWriter.writeBooleanField("isDataAction", this.isDataAction); - jsonWriter.writeStringField("origin", this.origin); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of OperationInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of OperationInner if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the OperationInner. - */ - public static OperationInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - OperationInner deserializedOperationInner = new OperationInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - deserializedOperationInner.name = reader.getString(); - } else if ("display".equals(fieldName)) { - deserializedOperationInner.display = OperationDisplay.fromJson(reader); - } else if ("isDataAction".equals(fieldName)) { - deserializedOperationInner.isDataAction = reader.getNullable(JsonReader::getBoolean); - } else if ("origin".equals(fieldName)) { - deserializedOperationInner.origin = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedOperationInner.properties = OperationProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedOperationInner; - }); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/fluent/models/RemoteRenderingAccountInner.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/fluent/models/RemoteRenderingAccountInner.java deleted file mode 100644 index 753dacb0b582..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/fluent/models/RemoteRenderingAccountInner.java +++ /dev/null @@ -1,348 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.mixedreality.models.Identity; -import com.azure.resourcemanager.mixedreality.models.Sku; -import java.io.IOException; -import java.util.Map; - -/** - * RemoteRenderingAccount Response. - */ -@Fluent -public final class RemoteRenderingAccountInner extends Resource { - /* - * Property bag. - */ - private MixedRealityAccountProperties innerProperties; - - /* - * The identity associated with this account - */ - private Identity identity; - - /* - * The plan associated with this account - */ - private Identity plan; - - /* - * The sku associated with this account - */ - private Sku sku; - - /* - * The kind of account, if supported - */ - private Sku kind; - - /* - * System metadata for this account - */ - private SystemData systemData; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of RemoteRenderingAccountInner class. - */ - public RemoteRenderingAccountInner() { - } - - /** - * Get the innerProperties property: Property bag. - * - * @return the innerProperties value. - */ - private MixedRealityAccountProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the identity property: The identity associated with this account. - * - * @return the identity value. - */ - public Identity identity() { - return this.identity; - } - - /** - * Set the identity property: The identity associated with this account. - * - * @param identity the identity value to set. - * @return the RemoteRenderingAccountInner object itself. - */ - public RemoteRenderingAccountInner withIdentity(Identity identity) { - this.identity = identity; - return this; - } - - /** - * Get the plan property: The plan associated with this account. - * - * @return the plan value. - */ - public Identity plan() { - return this.plan; - } - - /** - * Set the plan property: The plan associated with this account. - * - * @param plan the plan value to set. - * @return the RemoteRenderingAccountInner object itself. - */ - public RemoteRenderingAccountInner withPlan(Identity plan) { - this.plan = plan; - return this; - } - - /** - * Get the sku property: The sku associated with this account. - * - * @return the sku value. - */ - public Sku sku() { - return this.sku; - } - - /** - * Set the sku property: The sku associated with this account. - * - * @param sku the sku value to set. - * @return the RemoteRenderingAccountInner object itself. - */ - public RemoteRenderingAccountInner withSku(Sku sku) { - this.sku = sku; - return this; - } - - /** - * Get the kind property: The kind of account, if supported. - * - * @return the kind value. - */ - public Sku kind() { - return this.kind; - } - - /** - * Set the kind property: The kind of account, if supported. - * - * @param kind the kind value to set. - * @return the RemoteRenderingAccountInner object itself. - */ - public RemoteRenderingAccountInner withKind(Sku kind) { - this.kind = kind; - return this; - } - - /** - * Get the systemData property: System metadata for this account. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public RemoteRenderingAccountInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public RemoteRenderingAccountInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the storageAccountName property: The name of the storage account associated with this accountId. - * - * @return the storageAccountName value. - */ - public String storageAccountName() { - return this.innerProperties() == null ? null : this.innerProperties().storageAccountName(); - } - - /** - * Set the storageAccountName property: The name of the storage account associated with this accountId. - * - * @param storageAccountName the storageAccountName value to set. - * @return the RemoteRenderingAccountInner object itself. - */ - public RemoteRenderingAccountInner withStorageAccountName(String storageAccountName) { - if (this.innerProperties() == null) { - this.innerProperties = new MixedRealityAccountProperties(); - } - this.innerProperties().withStorageAccountName(storageAccountName); - return this; - } - - /** - * Get the accountId property: unique id of certain account. - * - * @return the accountId value. - */ - public String accountId() { - return this.innerProperties() == null ? null : this.innerProperties().accountId(); - } - - /** - * Get the accountDomain property: Correspond domain name of certain Spatial Anchors Account. - * - * @return the accountDomain value. - */ - public String accountDomain() { - return this.innerProperties() == null ? null : this.innerProperties().accountDomain(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - if (identity() != null) { - identity().validate(); - } - if (plan() != null) { - plan().validate(); - } - if (sku() != null) { - sku().validate(); - } - if (kind() != null) { - kind().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", location()); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("properties", this.innerProperties); - jsonWriter.writeJsonField("identity", this.identity); - jsonWriter.writeJsonField("plan", this.plan); - jsonWriter.writeJsonField("sku", this.sku); - jsonWriter.writeJsonField("kind", this.kind); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RemoteRenderingAccountInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RemoteRenderingAccountInner if the JsonReader was pointing to an instance of it, or null - * if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the RemoteRenderingAccountInner. - */ - public static RemoteRenderingAccountInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RemoteRenderingAccountInner deserializedRemoteRenderingAccountInner = new RemoteRenderingAccountInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedRemoteRenderingAccountInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedRemoteRenderingAccountInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedRemoteRenderingAccountInner.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedRemoteRenderingAccountInner.withLocation(reader.getString()); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedRemoteRenderingAccountInner.withTags(tags); - } else if ("properties".equals(fieldName)) { - deserializedRemoteRenderingAccountInner.innerProperties - = MixedRealityAccountProperties.fromJson(reader); - } else if ("identity".equals(fieldName)) { - deserializedRemoteRenderingAccountInner.identity = Identity.fromJson(reader); - } else if ("plan".equals(fieldName)) { - deserializedRemoteRenderingAccountInner.plan = Identity.fromJson(reader); - } else if ("sku".equals(fieldName)) { - deserializedRemoteRenderingAccountInner.sku = Sku.fromJson(reader); - } else if ("kind".equals(fieldName)) { - deserializedRemoteRenderingAccountInner.kind = Sku.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedRemoteRenderingAccountInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedRemoteRenderingAccountInner; - }); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/fluent/models/SpatialAnchorsAccountInner.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/fluent/models/SpatialAnchorsAccountInner.java deleted file mode 100644 index 0fbed1a0459a..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/fluent/models/SpatialAnchorsAccountInner.java +++ /dev/null @@ -1,348 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.mixedreality.models.Identity; -import com.azure.resourcemanager.mixedreality.models.Sku; -import java.io.IOException; -import java.util.Map; - -/** - * SpatialAnchorsAccount Response. - */ -@Fluent -public final class SpatialAnchorsAccountInner extends Resource { - /* - * Property bag. - */ - private MixedRealityAccountProperties innerProperties; - - /* - * The identity associated with this account - */ - private Identity identity; - - /* - * The plan associated with this account - */ - private Identity plan; - - /* - * The sku associated with this account - */ - private Sku sku; - - /* - * The kind of account, if supported - */ - private Sku kind; - - /* - * System metadata for this account - */ - private SystemData systemData; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of SpatialAnchorsAccountInner class. - */ - public SpatialAnchorsAccountInner() { - } - - /** - * Get the innerProperties property: Property bag. - * - * @return the innerProperties value. - */ - private MixedRealityAccountProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the identity property: The identity associated with this account. - * - * @return the identity value. - */ - public Identity identity() { - return this.identity; - } - - /** - * Set the identity property: The identity associated with this account. - * - * @param identity the identity value to set. - * @return the SpatialAnchorsAccountInner object itself. - */ - public SpatialAnchorsAccountInner withIdentity(Identity identity) { - this.identity = identity; - return this; - } - - /** - * Get the plan property: The plan associated with this account. - * - * @return the plan value. - */ - public Identity plan() { - return this.plan; - } - - /** - * Set the plan property: The plan associated with this account. - * - * @param plan the plan value to set. - * @return the SpatialAnchorsAccountInner object itself. - */ - public SpatialAnchorsAccountInner withPlan(Identity plan) { - this.plan = plan; - return this; - } - - /** - * Get the sku property: The sku associated with this account. - * - * @return the sku value. - */ - public Sku sku() { - return this.sku; - } - - /** - * Set the sku property: The sku associated with this account. - * - * @param sku the sku value to set. - * @return the SpatialAnchorsAccountInner object itself. - */ - public SpatialAnchorsAccountInner withSku(Sku sku) { - this.sku = sku; - return this; - } - - /** - * Get the kind property: The kind of account, if supported. - * - * @return the kind value. - */ - public Sku kind() { - return this.kind; - } - - /** - * Set the kind property: The kind of account, if supported. - * - * @param kind the kind value to set. - * @return the SpatialAnchorsAccountInner object itself. - */ - public SpatialAnchorsAccountInner withKind(Sku kind) { - this.kind = kind; - return this; - } - - /** - * Get the systemData property: System metadata for this account. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public SpatialAnchorsAccountInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SpatialAnchorsAccountInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the storageAccountName property: The name of the storage account associated with this accountId. - * - * @return the storageAccountName value. - */ - public String storageAccountName() { - return this.innerProperties() == null ? null : this.innerProperties().storageAccountName(); - } - - /** - * Set the storageAccountName property: The name of the storage account associated with this accountId. - * - * @param storageAccountName the storageAccountName value to set. - * @return the SpatialAnchorsAccountInner object itself. - */ - public SpatialAnchorsAccountInner withStorageAccountName(String storageAccountName) { - if (this.innerProperties() == null) { - this.innerProperties = new MixedRealityAccountProperties(); - } - this.innerProperties().withStorageAccountName(storageAccountName); - return this; - } - - /** - * Get the accountId property: unique id of certain account. - * - * @return the accountId value. - */ - public String accountId() { - return this.innerProperties() == null ? null : this.innerProperties().accountId(); - } - - /** - * Get the accountDomain property: Correspond domain name of certain Spatial Anchors Account. - * - * @return the accountDomain value. - */ - public String accountDomain() { - return this.innerProperties() == null ? null : this.innerProperties().accountDomain(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - if (identity() != null) { - identity().validate(); - } - if (plan() != null) { - plan().validate(); - } - if (sku() != null) { - sku().validate(); - } - if (kind() != null) { - kind().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", location()); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("properties", this.innerProperties); - jsonWriter.writeJsonField("identity", this.identity); - jsonWriter.writeJsonField("plan", this.plan); - jsonWriter.writeJsonField("sku", this.sku); - jsonWriter.writeJsonField("kind", this.kind); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SpatialAnchorsAccountInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SpatialAnchorsAccountInner if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the SpatialAnchorsAccountInner. - */ - public static SpatialAnchorsAccountInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SpatialAnchorsAccountInner deserializedSpatialAnchorsAccountInner = new SpatialAnchorsAccountInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedSpatialAnchorsAccountInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedSpatialAnchorsAccountInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedSpatialAnchorsAccountInner.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedSpatialAnchorsAccountInner.withLocation(reader.getString()); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedSpatialAnchorsAccountInner.withTags(tags); - } else if ("properties".equals(fieldName)) { - deserializedSpatialAnchorsAccountInner.innerProperties - = MixedRealityAccountProperties.fromJson(reader); - } else if ("identity".equals(fieldName)) { - deserializedSpatialAnchorsAccountInner.identity = Identity.fromJson(reader); - } else if ("plan".equals(fieldName)) { - deserializedSpatialAnchorsAccountInner.plan = Identity.fromJson(reader); - } else if ("sku".equals(fieldName)) { - deserializedSpatialAnchorsAccountInner.sku = Sku.fromJson(reader); - } else if ("kind".equals(fieldName)) { - deserializedSpatialAnchorsAccountInner.kind = Sku.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedSpatialAnchorsAccountInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedSpatialAnchorsAccountInner; - }); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/fluent/models/package-info.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/fluent/models/package-info.java deleted file mode 100644 index d2df10e0bff6..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/fluent/models/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// 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 MixedRealityClient. - * Mixed Reality Client. - */ -package com.azure.resourcemanager.mixedreality.fluent.models; diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/fluent/package-info.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/fluent/package-info.java deleted file mode 100644 index 1719f58885c7..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/fluent/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// 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 MixedRealityClient. - * Mixed Reality Client. - */ -package com.azure.resourcemanager.mixedreality.fluent; diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/AccountKeysImpl.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/AccountKeysImpl.java deleted file mode 100644 index 9972996c31cd..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/AccountKeysImpl.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.implementation; - -import com.azure.resourcemanager.mixedreality.fluent.models.AccountKeysInner; -import com.azure.resourcemanager.mixedreality.models.AccountKeys; - -public final class AccountKeysImpl implements AccountKeys { - private AccountKeysInner innerObject; - - private final com.azure.resourcemanager.mixedreality.MixedRealityManager serviceManager; - - AccountKeysImpl(AccountKeysInner innerObject, - com.azure.resourcemanager.mixedreality.MixedRealityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String primaryKey() { - return this.innerModel().primaryKey(); - } - - public String secondaryKey() { - return this.innerModel().secondaryKey(); - } - - public AccountKeysInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.mixedreality.MixedRealityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/CheckNameAvailabilityResponseImpl.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/CheckNameAvailabilityResponseImpl.java deleted file mode 100644 index 2c70e82d3336..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/CheckNameAvailabilityResponseImpl.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.implementation; - -import com.azure.resourcemanager.mixedreality.fluent.models.CheckNameAvailabilityResponseInner; -import com.azure.resourcemanager.mixedreality.models.CheckNameAvailabilityResponse; -import com.azure.resourcemanager.mixedreality.models.NameUnavailableReason; - -public final class CheckNameAvailabilityResponseImpl implements CheckNameAvailabilityResponse { - private CheckNameAvailabilityResponseInner innerObject; - - private final com.azure.resourcemanager.mixedreality.MixedRealityManager serviceManager; - - CheckNameAvailabilityResponseImpl(CheckNameAvailabilityResponseInner innerObject, - com.azure.resourcemanager.mixedreality.MixedRealityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public boolean nameAvailable() { - return this.innerModel().nameAvailable(); - } - - public NameUnavailableReason reason() { - return this.innerModel().reason(); - } - - public String message() { - return this.innerModel().message(); - } - - public CheckNameAvailabilityResponseInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.mixedreality.MixedRealityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/MixedRealityClientBuilder.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/MixedRealityClientBuilder.java deleted file mode 100644 index 1a4d2b91fba6..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/MixedRealityClientBuilder.java +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.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 MixedRealityClientImpl type. - */ -@ServiceClientBuilder(serviceClients = { MixedRealityClientImpl.class }) -public final class MixedRealityClientBuilder { - /* - * The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) - */ - private String subscriptionId; - - /** - * Sets The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). - * - * @param subscriptionId the subscriptionId value. - * @return the MixedRealityClientBuilder. - */ - public MixedRealityClientBuilder subscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; - return this; - } - - /* - * server parameter - */ - private String endpoint; - - /** - * Sets server parameter. - * - * @param endpoint the endpoint value. - * @return the MixedRealityClientBuilder. - */ - public MixedRealityClientBuilder 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 MixedRealityClientBuilder. - */ - public MixedRealityClientBuilder 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 MixedRealityClientBuilder. - */ - public MixedRealityClientBuilder 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 MixedRealityClientBuilder. - */ - public MixedRealityClientBuilder 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 MixedRealityClientBuilder. - */ - public MixedRealityClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { - this.serializerAdapter = serializerAdapter; - return this; - } - - /** - * Builds an instance of MixedRealityClientImpl with the provided parameters. - * - * @return an instance of MixedRealityClientImpl. - */ - public MixedRealityClientImpl 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(); - MixedRealityClientImpl client = new MixedRealityClientImpl(localPipeline, localSerializerAdapter, - localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); - return client; - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/MixedRealityClientImpl.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/MixedRealityClientImpl.java deleted file mode 100644 index e67fc823cf29..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/MixedRealityClientImpl.java +++ /dev/null @@ -1,337 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.implementation; - -import com.azure.core.annotation.ServiceClient; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.Response; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.exception.ManagementError; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.management.polling.PollerFactory; -import com.azure.core.util.Context; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.AsyncPollResponse; -import com.azure.core.util.polling.LongRunningOperationStatus; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.serializer.SerializerAdapter; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.mixedreality.fluent.MixedRealityClient; -import com.azure.resourcemanager.mixedreality.fluent.OperationsClient; -import com.azure.resourcemanager.mixedreality.fluent.RemoteRenderingAccountsClient; -import com.azure.resourcemanager.mixedreality.fluent.ResourceProvidersClient; -import com.azure.resourcemanager.mixedreality.fluent.SpatialAnchorsAccountsClient; -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 MixedRealityClientImpl type. - */ -@ServiceClient(builder = MixedRealityClientBuilder.class) -public final class MixedRealityClientImpl implements MixedRealityClient { - /** - * The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). - */ - private final String subscriptionId; - - /** - * Gets The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). - * - * @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 ResourceProvidersClient object to access its operations. - */ - private final ResourceProvidersClient resourceProviders; - - /** - * Gets the ResourceProvidersClient object to access its operations. - * - * @return the ResourceProvidersClient object. - */ - public ResourceProvidersClient getResourceProviders() { - return this.resourceProviders; - } - - /** - * The SpatialAnchorsAccountsClient object to access its operations. - */ - private final SpatialAnchorsAccountsClient spatialAnchorsAccounts; - - /** - * Gets the SpatialAnchorsAccountsClient object to access its operations. - * - * @return the SpatialAnchorsAccountsClient object. - */ - public SpatialAnchorsAccountsClient getSpatialAnchorsAccounts() { - return this.spatialAnchorsAccounts; - } - - /** - * The RemoteRenderingAccountsClient object to access its operations. - */ - private final RemoteRenderingAccountsClient remoteRenderingAccounts; - - /** - * Gets the RemoteRenderingAccountsClient object to access its operations. - * - * @return the RemoteRenderingAccountsClient object. - */ - public RemoteRenderingAccountsClient getRemoteRenderingAccounts() { - return this.remoteRenderingAccounts; - } - - /** - * Initializes an instance of MixedRealityClient 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 Azure subscription ID. This is a GUID-formatted string (e.g. - * 00000000-0000-0000-0000-000000000000). - * @param endpoint server parameter. - */ - MixedRealityClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, Duration defaultPollInterval, - AzureEnvironment environment, String subscriptionId, String endpoint) { - this.httpPipeline = httpPipeline; - this.serializerAdapter = serializerAdapter; - this.defaultPollInterval = defaultPollInterval; - this.subscriptionId = subscriptionId; - this.endpoint = endpoint; - this.apiVersion = "2021-01-01"; - this.operations = new OperationsClientImpl(this); - this.resourceProviders = new ResourceProvidersClientImpl(this); - this.spatialAnchorsAccounts = new SpatialAnchorsAccountsClientImpl(this); - this.remoteRenderingAccounts = new RemoteRenderingAccountsClientImpl(this); - } - - /** - * Gets default client context. - * - * @return the default client context. - */ - public Context getContext() { - return Context.NONE; - } - - /** - * Merges default client context with provided context. - * - * @param context the context to be merged with default client context. - * @return the merged context. - */ - public Context mergeContext(Context context) { - return CoreUtils.mergeContexts(this.getContext(), context); - } - - /** - * Gets long running operation result. - * - * @param activationResponse the response of activation operation. - * @param httpPipeline the http pipeline. - * @param pollResultType type of poll result. - * @param finalResultType type of final result. - * @param context the context shared by all requests. - * @param type of poll result. - * @param type of final result. - * @return poller flux for poll result and final result. - */ - public PollerFlux, U> getLroResult(Mono>> activationResponse, - HttpPipeline httpPipeline, Type pollResultType, Type finalResultType, Context context) { - return PollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, - defaultPollInterval, activationResponse, context); - } - - /** - * Gets the final result, or an error, based on last async poll response. - * - * @param response the last async poll response. - * @param type of poll result. - * @param type of final result. - * @return the final result, or an error. - */ - public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { - if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { - String errorMessage; - ManagementError managementError = null; - HttpResponse errorResponse = null; - PollResult.Error lroError = response.getValue().getError(); - if (lroError != null) { - errorResponse = new HttpResponseImpl(lroError.getResponseStatusCode(), lroError.getResponseHeaders(), - lroError.getResponseBody()); - - errorMessage = response.getValue().getError().getMessage(); - String errorBody = response.getValue().getError().getResponseBody(); - if (errorBody != null) { - // try to deserialize error body to ManagementError - try { - managementError = this.getSerializerAdapter() - .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); - if (managementError.getCode() == null || managementError.getMessage() == null) { - managementError = null; - } - } catch (IOException | RuntimeException ioe) { - LOGGER.logThrowableAsWarning(ioe); - } - } - } else { - // fallback to default error message - errorMessage = "Long running operation failed."; - } - if (managementError == null) { - // fallback to default ManagementError - managementError = new ManagementError(response.getStatus().toString(), errorMessage); - } - return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); - } else { - return response.getFinalResult(); - } - } - - private static final class HttpResponseImpl extends HttpResponse { - private final int statusCode; - - private final byte[] responseBody; - - private final HttpHeaders httpHeaders; - - HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { - super(null); - this.statusCode = statusCode; - this.httpHeaders = httpHeaders; - this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); - } - - public int getStatusCode() { - return statusCode; - } - - public String getHeaderValue(String s) { - return httpHeaders.getValue(HttpHeaderName.fromString(s)); - } - - public HttpHeaders getHeaders() { - return httpHeaders; - } - - public Flux getBody() { - return Flux.just(ByteBuffer.wrap(responseBody)); - } - - public Mono getBodyAsByteArray() { - return Mono.just(responseBody); - } - - public Mono getBodyAsString() { - return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); - } - - public Mono getBodyAsString(Charset charset) { - return Mono.just(new String(responseBody, charset)); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(MixedRealityClientImpl.class); -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/OperationImpl.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/OperationImpl.java deleted file mode 100644 index 0052c788ffa6..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/OperationImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.implementation; - -import com.azure.resourcemanager.mixedreality.fluent.models.OperationInner; -import com.azure.resourcemanager.mixedreality.models.Operation; -import com.azure.resourcemanager.mixedreality.models.OperationDisplay; -import com.azure.resourcemanager.mixedreality.models.OperationProperties; - -public final class OperationImpl implements Operation { - private OperationInner innerObject; - - private final com.azure.resourcemanager.mixedreality.MixedRealityManager serviceManager; - - OperationImpl(OperationInner innerObject, - com.azure.resourcemanager.mixedreality.MixedRealityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String name() { - return this.innerModel().name(); - } - - public OperationDisplay display() { - return this.innerModel().display(); - } - - public Boolean isDataAction() { - return this.innerModel().isDataAction(); - } - - public String origin() { - return this.innerModel().origin(); - } - - public OperationProperties properties() { - return this.innerModel().properties(); - } - - public OperationInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.mixedreality.MixedRealityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/OperationsClientImpl.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/OperationsClientImpl.java deleted file mode 100644 index 38971f3e8d0c..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/OperationsClientImpl.java +++ /dev/null @@ -1,233 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.mixedreality.fluent.OperationsClient; -import com.azure.resourcemanager.mixedreality.fluent.models.OperationInner; -import com.azure.resourcemanager.mixedreality.models.OperationPage; -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 MixedRealityClientImpl client; - - /** - * Initializes an instance of OperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - OperationsClientImpl(MixedRealityClientImpl client) { - this.service - = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MixedRealityClientOperations to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MixedRealityClientOp") - public interface OperationsService { - @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.MixedReality/operations") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Exposing Available Operations. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Resource Provider 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())); - } - - /** - * Exposing Available Operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Resource Provider 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)); - } - - /** - * Exposing Available Operations. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Resource Provider operations as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Exposing Available Operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Resource Provider 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)); - } - - /** - * Exposing Available Operations. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Resource Provider operations as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Exposing Available Operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Resource Provider 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Resource Provider 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. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Resource Provider 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/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/OperationsImpl.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/OperationsImpl.java deleted file mode 100644 index c79a613ba20d..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/OperationsImpl.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.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.mixedreality.fluent.OperationsClient; -import com.azure.resourcemanager.mixedreality.fluent.models.OperationInner; -import com.azure.resourcemanager.mixedreality.models.Operation; -import com.azure.resourcemanager.mixedreality.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.mixedreality.MixedRealityManager serviceManager; - - public OperationsImpl(OperationsClient innerClient, - com.azure.resourcemanager.mixedreality.MixedRealityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); - } - - private OperationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.mixedreality.MixedRealityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/RemoteRenderingAccountImpl.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/RemoteRenderingAccountImpl.java deleted file mode 100644 index cb85308a5aad..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/RemoteRenderingAccountImpl.java +++ /dev/null @@ -1,234 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.mixedreality.fluent.models.RemoteRenderingAccountInner; -import com.azure.resourcemanager.mixedreality.models.AccountKeyRegenerateRequest; -import com.azure.resourcemanager.mixedreality.models.AccountKeys; -import com.azure.resourcemanager.mixedreality.models.Identity; -import com.azure.resourcemanager.mixedreality.models.RemoteRenderingAccount; -import com.azure.resourcemanager.mixedreality.models.Sku; -import java.util.Collections; -import java.util.Map; - -public final class RemoteRenderingAccountImpl - implements RemoteRenderingAccount, RemoteRenderingAccount.Definition, RemoteRenderingAccount.Update { - private RemoteRenderingAccountInner innerObject; - - private final com.azure.resourcemanager.mixedreality.MixedRealityManager 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 Identity identity() { - return this.innerModel().identity(); - } - - public Identity plan() { - return this.innerModel().plan(); - } - - public Sku sku() { - return this.innerModel().sku(); - } - - public Sku kind() { - return this.innerModel().kind(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public String storageAccountName() { - return this.innerModel().storageAccountName(); - } - - public String accountId() { - return this.innerModel().accountId(); - } - - public String accountDomain() { - return this.innerModel().accountDomain(); - } - - public Region region() { - return Region.fromName(this.regionName()); - } - - public String regionName() { - return this.location(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public RemoteRenderingAccountInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.mixedreality.MixedRealityManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String accountName; - - public RemoteRenderingAccountImpl withExistingResourceGroup(String resourceGroupName) { - this.resourceGroupName = resourceGroupName; - return this; - } - - public RemoteRenderingAccount create() { - this.innerObject = serviceManager.serviceClient() - .getRemoteRenderingAccounts() - .createWithResponse(resourceGroupName, accountName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public RemoteRenderingAccount create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getRemoteRenderingAccounts() - .createWithResponse(resourceGroupName, accountName, this.innerModel(), context) - .getValue(); - return this; - } - - RemoteRenderingAccountImpl(String name, com.azure.resourcemanager.mixedreality.MixedRealityManager serviceManager) { - this.innerObject = new RemoteRenderingAccountInner(); - this.serviceManager = serviceManager; - this.accountName = name; - } - - public RemoteRenderingAccountImpl update() { - return this; - } - - public RemoteRenderingAccount apply() { - this.innerObject = serviceManager.serviceClient() - .getRemoteRenderingAccounts() - .updateWithResponse(resourceGroupName, accountName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public RemoteRenderingAccount apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getRemoteRenderingAccounts() - .updateWithResponse(resourceGroupName, accountName, this.innerModel(), context) - .getValue(); - return this; - } - - RemoteRenderingAccountImpl(RemoteRenderingAccountInner innerObject, - com.azure.resourcemanager.mixedreality.MixedRealityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.accountName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "remoteRenderingAccounts"); - } - - public RemoteRenderingAccount refresh() { - this.innerObject = serviceManager.serviceClient() - .getRemoteRenderingAccounts() - .getByResourceGroupWithResponse(resourceGroupName, accountName, Context.NONE) - .getValue(); - return this; - } - - public RemoteRenderingAccount refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getRemoteRenderingAccounts() - .getByResourceGroupWithResponse(resourceGroupName, accountName, context) - .getValue(); - return this; - } - - public Response listKeysWithResponse(Context context) { - return serviceManager.remoteRenderingAccounts().listKeysWithResponse(resourceGroupName, accountName, context); - } - - public AccountKeys listKeys() { - return serviceManager.remoteRenderingAccounts().listKeys(resourceGroupName, accountName); - } - - public Response regenerateKeysWithResponse(AccountKeyRegenerateRequest regenerate, Context context) { - return serviceManager.remoteRenderingAccounts() - .regenerateKeysWithResponse(resourceGroupName, accountName, regenerate, context); - } - - public AccountKeys regenerateKeys(AccountKeyRegenerateRequest regenerate) { - return serviceManager.remoteRenderingAccounts().regenerateKeys(resourceGroupName, accountName, regenerate); - } - - public RemoteRenderingAccountImpl withRegion(Region location) { - this.innerModel().withLocation(location.toString()); - return this; - } - - public RemoteRenderingAccountImpl withRegion(String location) { - this.innerModel().withLocation(location); - return this; - } - - public RemoteRenderingAccountImpl withTags(Map tags) { - this.innerModel().withTags(tags); - return this; - } - - public RemoteRenderingAccountImpl withIdentity(Identity identity) { - this.innerModel().withIdentity(identity); - return this; - } - - public RemoteRenderingAccountImpl withPlan(Identity plan) { - this.innerModel().withPlan(plan); - return this; - } - - public RemoteRenderingAccountImpl withSku(Sku sku) { - this.innerModel().withSku(sku); - return this; - } - - public RemoteRenderingAccountImpl withKind(Sku kind) { - this.innerModel().withKind(kind); - return this; - } - - public RemoteRenderingAccountImpl withStorageAccountName(String storageAccountName) { - this.innerModel().withStorageAccountName(storageAccountName); - return this; - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/RemoteRenderingAccountsClientImpl.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/RemoteRenderingAccountsClientImpl.java deleted file mode 100644 index 8bcf591be6f7..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/RemoteRenderingAccountsClientImpl.java +++ /dev/null @@ -1,1275 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.mixedreality.fluent.RemoteRenderingAccountsClient; -import com.azure.resourcemanager.mixedreality.fluent.models.AccountKeysInner; -import com.azure.resourcemanager.mixedreality.fluent.models.RemoteRenderingAccountInner; -import com.azure.resourcemanager.mixedreality.models.AccountKeyRegenerateRequest; -import com.azure.resourcemanager.mixedreality.models.RemoteRenderingAccountPage; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in RemoteRenderingAccountsClient. - */ -public final class RemoteRenderingAccountsClientImpl implements RemoteRenderingAccountsClient { - /** - * The proxy service used to perform REST calls. - */ - private final RemoteRenderingAccountsService service; - - /** - * The service client containing this operation class. - */ - private final MixedRealityClientImpl client; - - /** - * Initializes an instance of RemoteRenderingAccountsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - RemoteRenderingAccountsClientImpl(MixedRealityClientImpl client) { - this.service = RestProxy.create(RemoteRenderingAccountsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MixedRealityClientRemoteRenderingAccounts to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MixedRealityClientRe") - public interface RemoteRenderingAccountsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.MixedReality/remoteRenderingAccounts") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts/{accountName}") - @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts/{accountName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts/{accountName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") RemoteRenderingAccountInner remoteRenderingAccount, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts/{accountName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") RemoteRenderingAccountInner remoteRenderingAccount, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts/{accountName}/listKeys") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listKeys(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts/{accountName}/regenerateKeys") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> regenerateKeys(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") AccountKeyRegenerateRequest regenerate, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * List Remote Rendering Accounts by Subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to get resource collection along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List Remote Rendering Accounts by Subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to get resource collection along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), accept, - context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List Remote Rendering Accounts by Subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to get resource collection as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * List Remote Rendering Accounts by Subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to get resource collection as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); - } - - /** - * List Remote Rendering Accounts by Subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to get resource collection as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * List Remote Rendering Accounts by Subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to get resource collection as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * List Resources by Resource Group. - * - * @param resourceGroupName Name of an Azure resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to get resource collection along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List Resources by Resource Group. - * - * @param resourceGroupName Name of an Azure resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to get resource collection along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List Resources by Resource Group. - * - * @param resourceGroupName Name of an Azure resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to get resource collection as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * List Resources by Resource Group. - * - * @param resourceGroupName Name of an Azure resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to get resource collection as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * List Resources by Resource Group. - * - * @param resourceGroupName Name of an Azure resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to get resource collection as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * List Resources by Resource Group. - * - * @param resourceGroupName Name of an Azure resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to get resource collection as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Delete a Remote Rendering Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and 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 (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete a Remote Rendering Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - 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 (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, this.client.getApiVersion(), accept, context); - } - - /** - * Delete a Remote Rendering Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String accountName) { - return deleteWithResponseAsync(resourceGroupName, accountName).flatMap(ignored -> Mono.empty()); - } - - /** - * Delete a Remote Rendering Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, Context context) { - return deleteWithResponseAsync(resourceGroupName, accountName, context).block(); - } - - /** - * Delete a Remote Rendering Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String accountName) { - deleteWithResponse(resourceGroupName, accountName, Context.NONE); - } - - /** - * Retrieve a Remote Rendering Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return remoteRenderingAccount Response along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String accountName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and 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 (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Retrieve a Remote Rendering Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return remoteRenderingAccount Response along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String accountName, 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 (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName 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(), resourceGroupName, - accountName, this.client.getApiVersion(), accept, context); - } - - /** - * Retrieve a Remote Rendering Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return remoteRenderingAccount Response on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync(String resourceGroupName, String accountName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, accountName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Retrieve a Remote Rendering Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return remoteRenderingAccount Response along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse(String resourceGroupName, - String accountName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, accountName, context).block(); - } - - /** - * Retrieve a Remote Rendering Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return remoteRenderingAccount Response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RemoteRenderingAccountInner getByResourceGroup(String resourceGroupName, String accountName) { - return getByResourceGroupWithResponse(resourceGroupName, accountName, Context.NONE).getValue(); - } - - /** - * Updating a Remote Rendering Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param remoteRenderingAccount Remote Rendering Account parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return remoteRenderingAccount Response along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, - String accountName, RemoteRenderingAccountInner remoteRenderingAccount) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and 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 (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (remoteRenderingAccount == null) { - return Mono.error( - new IllegalArgumentException("Parameter remoteRenderingAccount is required and cannot be null.")); - } else { - remoteRenderingAccount.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, this.client.getApiVersion(), remoteRenderingAccount, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updating a Remote Rendering Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param remoteRenderingAccount Remote Rendering Account parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return remoteRenderingAccount Response along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, - String accountName, RemoteRenderingAccountInner remoteRenderingAccount, 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 (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (remoteRenderingAccount == null) { - return Mono.error( - new IllegalArgumentException("Parameter remoteRenderingAccount is required and cannot be null.")); - } else { - remoteRenderingAccount.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, this.client.getApiVersion(), remoteRenderingAccount, accept, context); - } - - /** - * Updating a Remote Rendering Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param remoteRenderingAccount Remote Rendering Account parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return remoteRenderingAccount Response on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String accountName, - RemoteRenderingAccountInner remoteRenderingAccount) { - return updateWithResponseAsync(resourceGroupName, accountName, remoteRenderingAccount) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Updating a Remote Rendering Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param remoteRenderingAccount Remote Rendering Account parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return remoteRenderingAccount Response along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String resourceGroupName, String accountName, - RemoteRenderingAccountInner remoteRenderingAccount, Context context) { - return updateWithResponseAsync(resourceGroupName, accountName, remoteRenderingAccount, context).block(); - } - - /** - * Updating a Remote Rendering Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param remoteRenderingAccount Remote Rendering Account parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return remoteRenderingAccount Response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RemoteRenderingAccountInner update(String resourceGroupName, String accountName, - RemoteRenderingAccountInner remoteRenderingAccount) { - return updateWithResponse(resourceGroupName, accountName, remoteRenderingAccount, Context.NONE).getValue(); - } - - /** - * Creating or Updating a Remote Rendering Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param remoteRenderingAccount Remote Rendering Account parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return remoteRenderingAccount Response along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync(String resourceGroupName, - String accountName, RemoteRenderingAccountInner remoteRenderingAccount) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and 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 (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (remoteRenderingAccount == null) { - return Mono.error( - new IllegalArgumentException("Parameter remoteRenderingAccount is required and cannot be null.")); - } else { - remoteRenderingAccount.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, this.client.getApiVersion(), remoteRenderingAccount, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creating or Updating a Remote Rendering Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param remoteRenderingAccount Remote Rendering Account parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return remoteRenderingAccount Response along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync(String resourceGroupName, - String accountName, RemoteRenderingAccountInner remoteRenderingAccount, 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 (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (remoteRenderingAccount == null) { - return Mono.error( - new IllegalArgumentException("Parameter remoteRenderingAccount is required and cannot be null.")); - } else { - remoteRenderingAccount.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, this.client.getApiVersion(), remoteRenderingAccount, accept, context); - } - - /** - * Creating or Updating a Remote Rendering Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param remoteRenderingAccount Remote Rendering Account parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return remoteRenderingAccount Response on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String resourceGroupName, String accountName, - RemoteRenderingAccountInner remoteRenderingAccount) { - return createWithResponseAsync(resourceGroupName, accountName, remoteRenderingAccount) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Creating or Updating a Remote Rendering Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param remoteRenderingAccount Remote Rendering Account parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return remoteRenderingAccount Response along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse(String resourceGroupName, String accountName, - RemoteRenderingAccountInner remoteRenderingAccount, Context context) { - return createWithResponseAsync(resourceGroupName, accountName, remoteRenderingAccount, context).block(); - } - - /** - * Creating or Updating a Remote Rendering Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param remoteRenderingAccount Remote Rendering Account parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return remoteRenderingAccount Response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RemoteRenderingAccountInner create(String resourceGroupName, String accountName, - RemoteRenderingAccountInner remoteRenderingAccount) { - return createWithResponse(resourceGroupName, accountName, remoteRenderingAccount, Context.NONE).getValue(); - } - - /** - * List Both of the 2 Keys of a Remote Rendering Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return developer Keys of account along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listKeysWithResponseAsync(String resourceGroupName, String accountName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and 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 (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listKeys(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List Both of the 2 Keys of a Remote Rendering Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return developer Keys of account along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listKeysWithResponseAsync(String resourceGroupName, String accountName, - 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 (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listKeys(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, this.client.getApiVersion(), accept, context); - } - - /** - * List Both of the 2 Keys of a Remote Rendering Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return developer Keys of account on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listKeysAsync(String resourceGroupName, String accountName) { - return listKeysWithResponseAsync(resourceGroupName, accountName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * List Both of the 2 Keys of a Remote Rendering Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return developer Keys of account along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listKeysWithResponse(String resourceGroupName, String accountName, - Context context) { - return listKeysWithResponseAsync(resourceGroupName, accountName, context).block(); - } - - /** - * List Both of the 2 Keys of a Remote Rendering Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return developer Keys of account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AccountKeysInner listKeys(String resourceGroupName, String accountName) { - return listKeysWithResponse(resourceGroupName, accountName, Context.NONE).getValue(); - } - - /** - * Regenerate specified Key of a Remote Rendering Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param regenerate Required information for key regeneration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return developer Keys of account along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> regenerateKeysWithResponseAsync(String resourceGroupName, - String accountName, AccountKeyRegenerateRequest regenerate) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and 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 (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (regenerate == null) { - return Mono.error(new IllegalArgumentException("Parameter regenerate is required and cannot be null.")); - } else { - regenerate.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.regenerateKeys(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, this.client.getApiVersion(), regenerate, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Regenerate specified Key of a Remote Rendering Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param regenerate Required information for key regeneration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return developer Keys of account along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> regenerateKeysWithResponseAsync(String resourceGroupName, - String accountName, AccountKeyRegenerateRequest regenerate, 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 (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (regenerate == null) { - return Mono.error(new IllegalArgumentException("Parameter regenerate is required and cannot be null.")); - } else { - regenerate.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.regenerateKeys(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, this.client.getApiVersion(), regenerate, accept, context); - } - - /** - * Regenerate specified Key of a Remote Rendering Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param regenerate Required information for key regeneration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return developer Keys of account on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono regenerateKeysAsync(String resourceGroupName, String accountName, - AccountKeyRegenerateRequest regenerate) { - return regenerateKeysWithResponseAsync(resourceGroupName, accountName, regenerate) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Regenerate specified Key of a Remote Rendering Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param regenerate Required information for key regeneration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return developer Keys of account along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response regenerateKeysWithResponse(String resourceGroupName, String accountName, - AccountKeyRegenerateRequest regenerate, Context context) { - return regenerateKeysWithResponseAsync(resourceGroupName, accountName, regenerate, context).block(); - } - - /** - * Regenerate specified Key of a Remote Rendering Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param regenerate Required information for key regeneration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return developer Keys of account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AccountKeysInner regenerateKeys(String resourceGroupName, String accountName, - AccountKeyRegenerateRequest regenerate) { - return regenerateKeysWithResponse(resourceGroupName, accountName, regenerate, Context.NONE).getValue(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to get resource collection along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to get resource collection along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to get resource collection along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to get resource collection along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/RemoteRenderingAccountsImpl.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/RemoteRenderingAccountsImpl.java deleted file mode 100644 index 28c596d95717..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/RemoteRenderingAccountsImpl.java +++ /dev/null @@ -1,193 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.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.mixedreality.fluent.RemoteRenderingAccountsClient; -import com.azure.resourcemanager.mixedreality.fluent.models.AccountKeysInner; -import com.azure.resourcemanager.mixedreality.fluent.models.RemoteRenderingAccountInner; -import com.azure.resourcemanager.mixedreality.models.AccountKeyRegenerateRequest; -import com.azure.resourcemanager.mixedreality.models.AccountKeys; -import com.azure.resourcemanager.mixedreality.models.RemoteRenderingAccount; -import com.azure.resourcemanager.mixedreality.models.RemoteRenderingAccounts; - -public final class RemoteRenderingAccountsImpl implements RemoteRenderingAccounts { - private static final ClientLogger LOGGER = new ClientLogger(RemoteRenderingAccountsImpl.class); - - private final RemoteRenderingAccountsClient innerClient; - - private final com.azure.resourcemanager.mixedreality.MixedRealityManager serviceManager; - - public RemoteRenderingAccountsImpl(RemoteRenderingAccountsClient innerClient, - com.azure.resourcemanager.mixedreality.MixedRealityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new RemoteRenderingAccountImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new RemoteRenderingAccountImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new RemoteRenderingAccountImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - PagedIterable inner - = this.serviceClient().listByResourceGroup(resourceGroupName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new RemoteRenderingAccountImpl(inner1, this.manager())); - } - - public Response deleteByResourceGroupWithResponse(String resourceGroupName, String accountName, - Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, accountName, context); - } - - public void deleteByResourceGroup(String resourceGroupName, String accountName) { - this.serviceClient().delete(resourceGroupName, accountName); - } - - public Response getByResourceGroupWithResponse(String resourceGroupName, String accountName, - Context context) { - Response inner - = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, accountName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new RemoteRenderingAccountImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public RemoteRenderingAccount getByResourceGroup(String resourceGroupName, String accountName) { - RemoteRenderingAccountInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, accountName); - if (inner != null) { - return new RemoteRenderingAccountImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response listKeysWithResponse(String resourceGroupName, String accountName, Context context) { - Response inner - = this.serviceClient().listKeysWithResponse(resourceGroupName, accountName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AccountKeysImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public AccountKeys listKeys(String resourceGroupName, String accountName) { - AccountKeysInner inner = this.serviceClient().listKeys(resourceGroupName, accountName); - if (inner != null) { - return new AccountKeysImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response regenerateKeysWithResponse(String resourceGroupName, String accountName, - AccountKeyRegenerateRequest regenerate, Context context) { - Response inner - = this.serviceClient().regenerateKeysWithResponse(resourceGroupName, accountName, regenerate, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AccountKeysImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public AccountKeys regenerateKeys(String resourceGroupName, String accountName, - AccountKeyRegenerateRequest regenerate) { - AccountKeysInner inner = this.serviceClient().regenerateKeys(resourceGroupName, accountName, regenerate); - if (inner != null) { - return new AccountKeysImpl(inner, this.manager()); - } else { - return null; - } - } - - public RemoteRenderingAccount getById(String id) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String accountName = ResourceManagerUtils.getValueFromIdByName(id, "remoteRenderingAccounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException(String - .format("The resource ID '%s' is not valid. Missing path segment 'remoteRenderingAccounts'.", id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, accountName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String accountName = ResourceManagerUtils.getValueFromIdByName(id, "remoteRenderingAccounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException(String - .format("The resource ID '%s' is not valid. Missing path segment 'remoteRenderingAccounts'.", id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, accountName, context); - } - - public void deleteById(String id) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String accountName = ResourceManagerUtils.getValueFromIdByName(id, "remoteRenderingAccounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException(String - .format("The resource ID '%s' is not valid. Missing path segment 'remoteRenderingAccounts'.", id))); - } - this.deleteByResourceGroupWithResponse(resourceGroupName, accountName, Context.NONE); - } - - public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String accountName = ResourceManagerUtils.getValueFromIdByName(id, "remoteRenderingAccounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException(String - .format("The resource ID '%s' is not valid. Missing path segment 'remoteRenderingAccounts'.", id))); - } - return this.deleteByResourceGroupWithResponse(resourceGroupName, accountName, context); - } - - private RemoteRenderingAccountsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.mixedreality.MixedRealityManager manager() { - return this.serviceManager; - } - - public RemoteRenderingAccountImpl define(String name) { - return new RemoteRenderingAccountImpl(name, this.manager()); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/ResourceManagerUtils.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/ResourceManagerUtils.java deleted file mode 100644 index 408dedef2df1..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/ResourceManagerUtils.java +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.util.CoreUtils; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; -import java.util.function.Function; -import java.util.stream.Collectors; -import java.util.stream.Stream; -import reactor.core.publisher.Flux; - -final class ResourceManagerUtils { - private ResourceManagerUtils() { - } - - static String getValueFromIdByName(String id, String name) { - if (id == null) { - return null; - } - Iterator itr = Arrays.stream(id.split("/")).iterator(); - while (itr.hasNext()) { - String part = itr.next(); - if (part != null && !part.trim().isEmpty()) { - if (part.equalsIgnoreCase(name)) { - if (itr.hasNext()) { - return itr.next(); - } else { - return null; - } - } - } - } - return null; - } - - static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { - if (id == null || pathTemplate == null) { - return null; - } - String parameterNameParentheses = "{" + parameterName + "}"; - List idSegmentsReverted = Arrays.asList(id.split("/")); - List pathSegments = Arrays.asList(pathTemplate.split("/")); - Collections.reverse(idSegmentsReverted); - Iterator idItrReverted = idSegmentsReverted.iterator(); - int pathIndex = pathSegments.size(); - while (idItrReverted.hasNext() && pathIndex > 0) { - String idSegment = idItrReverted.next(); - String pathSegment = pathSegments.get(--pathIndex); - if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { - if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { - if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { - List segments = new ArrayList<>(); - segments.add(idSegment); - idItrReverted.forEachRemaining(segments::add); - Collections.reverse(segments); - if (!segments.isEmpty() && segments.get(0).isEmpty()) { - segments.remove(0); - } - return String.join("/", segments); - } else { - return idSegment; - } - } - } - } - return null; - } - - static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { - return new PagedIterableImpl<>(pageIterable, mapper); - } - - private static final class PagedIterableImpl extends PagedIterable { - - private final PagedIterable pagedIterable; - private final Function mapper; - private final Function, PagedResponse> pageMapper; - - private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { - super(PagedFlux.create(() -> (continuationToken, pageSize) -> Flux - .fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); - this.pagedIterable = pagedIterable; - this.mapper = mapper; - this.pageMapper = getPageMapper(mapper); - } - - private static Function, PagedResponse> getPageMapper(Function mapper) { - return page -> new PagedResponseBase(page.getRequest(), page.getStatusCode(), page.getHeaders(), - page.getElements().stream().map(mapper).collect(Collectors.toList()), page.getContinuationToken(), - null); - } - - @Override - public Stream stream() { - return pagedIterable.stream().map(mapper); - } - - @Override - public Stream> streamByPage() { - return pagedIterable.streamByPage().map(pageMapper); - } - - @Override - public Stream> streamByPage(String continuationToken) { - return pagedIterable.streamByPage(continuationToken).map(pageMapper); - } - - @Override - public Stream> streamByPage(int preferredPageSize) { - return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); - } - - @Override - public Stream> streamByPage(String continuationToken, int preferredPageSize) { - return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); - } - - @Override - public Iterator iterator() { - return new IteratorImpl<>(pagedIterable.iterator(), mapper); - } - - @Override - public Iterable> iterableByPage() { - return new IterableImpl<>(pagedIterable.iterableByPage(), pageMapper); - } - - @Override - public Iterable> iterableByPage(String continuationToken) { - return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken), pageMapper); - } - - @Override - public Iterable> iterableByPage(int preferredPageSize) { - return new IterableImpl<>(pagedIterable.iterableByPage(preferredPageSize), pageMapper); - } - - @Override - public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { - return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); - } - } - - private static final class IteratorImpl implements Iterator { - - private final Iterator iterator; - private final Function mapper; - - private IteratorImpl(Iterator iterator, Function mapper) { - this.iterator = iterator; - this.mapper = mapper; - } - - @Override - public boolean hasNext() { - return iterator.hasNext(); - } - - @Override - public S next() { - return mapper.apply(iterator.next()); - } - - @Override - public void remove() { - iterator.remove(); - } - } - - private static final class IterableImpl implements Iterable { - - private final Iterable iterable; - private final Function mapper; - - private IterableImpl(Iterable iterable, Function mapper) { - this.iterable = iterable; - this.mapper = mapper; - } - - @Override - public Iterator iterator() { - return new IteratorImpl<>(iterable.iterator(), mapper); - } - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/ResourceProvidersClientImpl.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/ResourceProvidersClientImpl.java deleted file mode 100644 index df525985dd04..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/ResourceProvidersClientImpl.java +++ /dev/null @@ -1,197 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.mixedreality.fluent.ResourceProvidersClient; -import com.azure.resourcemanager.mixedreality.fluent.models.CheckNameAvailabilityResponseInner; -import com.azure.resourcemanager.mixedreality.models.CheckNameAvailabilityRequest; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in ResourceProvidersClient. - */ -public final class ResourceProvidersClientImpl implements ResourceProvidersClient { - /** - * The proxy service used to perform REST calls. - */ - private final ResourceProvidersService service; - - /** - * The service client containing this operation class. - */ - private final MixedRealityClientImpl client; - - /** - * Initializes an instance of ResourceProvidersClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ResourceProvidersClientImpl(MixedRealityClientImpl client) { - this.service - = RestProxy.create(ResourceProvidersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MixedRealityClientResourceProviders to be used by the proxy service - * to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MixedRealityClientRe") - public interface ResourceProvidersService { - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.MixedReality/locations/{location}/checkNameAvailability") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> checkNameAvailabilityLocal( - @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("location") String location, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CheckNameAvailabilityRequest checkNameAvailability, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Check Name Availability for local uniqueness. - * - * @param location The location in which uniqueness will be verified. - * @param checkNameAvailability Check Name Availability Request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return check Name Availability Response along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> checkNameAvailabilityLocalWithResponseAsync( - String location, CheckNameAvailabilityRequest checkNameAvailability) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (checkNameAvailability == null) { - return Mono - .error(new IllegalArgumentException("Parameter checkNameAvailability is required and cannot be null.")); - } else { - checkNameAvailability.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.checkNameAvailabilityLocal(this.client.getEndpoint(), - this.client.getSubscriptionId(), location, this.client.getApiVersion(), checkNameAvailability, accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Check Name Availability for local uniqueness. - * - * @param location The location in which uniqueness will be verified. - * @param checkNameAvailability Check Name Availability Request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return check Name Availability Response along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> checkNameAvailabilityLocalWithResponseAsync( - String location, CheckNameAvailabilityRequest checkNameAvailability, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (checkNameAvailability == null) { - return Mono - .error(new IllegalArgumentException("Parameter checkNameAvailability is required and cannot be null.")); - } else { - checkNameAvailability.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.checkNameAvailabilityLocal(this.client.getEndpoint(), this.client.getSubscriptionId(), location, - this.client.getApiVersion(), checkNameAvailability, accept, context); - } - - /** - * Check Name Availability for local uniqueness. - * - * @param location The location in which uniqueness will be verified. - * @param checkNameAvailability Check Name Availability Request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return check Name Availability Response on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono checkNameAvailabilityLocalAsync(String location, - CheckNameAvailabilityRequest checkNameAvailability) { - return checkNameAvailabilityLocalWithResponseAsync(location, checkNameAvailability) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Check Name Availability for local uniqueness. - * - * @param location The location in which uniqueness will be verified. - * @param checkNameAvailability Check Name Availability Request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return check Name Availability Response along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response checkNameAvailabilityLocalWithResponse(String location, - CheckNameAvailabilityRequest checkNameAvailability, Context context) { - return checkNameAvailabilityLocalWithResponseAsync(location, checkNameAvailability, context).block(); - } - - /** - * Check Name Availability for local uniqueness. - * - * @param location The location in which uniqueness will be verified. - * @param checkNameAvailability Check Name Availability Request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return check Name Availability Response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CheckNameAvailabilityResponseInner checkNameAvailabilityLocal(String location, - CheckNameAvailabilityRequest checkNameAvailability) { - return checkNameAvailabilityLocalWithResponse(location, checkNameAvailability, Context.NONE).getValue(); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/ResourceProvidersImpl.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/ResourceProvidersImpl.java deleted file mode 100644 index e7035031a8cc..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/ResourceProvidersImpl.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.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.mixedreality.fluent.ResourceProvidersClient; -import com.azure.resourcemanager.mixedreality.fluent.models.CheckNameAvailabilityResponseInner; -import com.azure.resourcemanager.mixedreality.models.CheckNameAvailabilityRequest; -import com.azure.resourcemanager.mixedreality.models.CheckNameAvailabilityResponse; -import com.azure.resourcemanager.mixedreality.models.ResourceProviders; - -public final class ResourceProvidersImpl implements ResourceProviders { - private static final ClientLogger LOGGER = new ClientLogger(ResourceProvidersImpl.class); - - private final ResourceProvidersClient innerClient; - - private final com.azure.resourcemanager.mixedreality.MixedRealityManager serviceManager; - - public ResourceProvidersImpl(ResourceProvidersClient innerClient, - com.azure.resourcemanager.mixedreality.MixedRealityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response checkNameAvailabilityLocalWithResponse(String location, - CheckNameAvailabilityRequest checkNameAvailability, Context context) { - Response inner - = this.serviceClient().checkNameAvailabilityLocalWithResponse(location, checkNameAvailability, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new CheckNameAvailabilityResponseImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public CheckNameAvailabilityResponse checkNameAvailabilityLocal(String location, - CheckNameAvailabilityRequest checkNameAvailability) { - CheckNameAvailabilityResponseInner inner - = this.serviceClient().checkNameAvailabilityLocal(location, checkNameAvailability); - if (inner != null) { - return new CheckNameAvailabilityResponseImpl(inner, this.manager()); - } else { - return null; - } - } - - private ResourceProvidersClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.mixedreality.MixedRealityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/SpatialAnchorsAccountImpl.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/SpatialAnchorsAccountImpl.java deleted file mode 100644 index e379c366002c..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/SpatialAnchorsAccountImpl.java +++ /dev/null @@ -1,234 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.mixedreality.fluent.models.SpatialAnchorsAccountInner; -import com.azure.resourcemanager.mixedreality.models.AccountKeyRegenerateRequest; -import com.azure.resourcemanager.mixedreality.models.AccountKeys; -import com.azure.resourcemanager.mixedreality.models.Identity; -import com.azure.resourcemanager.mixedreality.models.Sku; -import com.azure.resourcemanager.mixedreality.models.SpatialAnchorsAccount; -import java.util.Collections; -import java.util.Map; - -public final class SpatialAnchorsAccountImpl - implements SpatialAnchorsAccount, SpatialAnchorsAccount.Definition, SpatialAnchorsAccount.Update { - private SpatialAnchorsAccountInner innerObject; - - private final com.azure.resourcemanager.mixedreality.MixedRealityManager 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 Identity identity() { - return this.innerModel().identity(); - } - - public Identity plan() { - return this.innerModel().plan(); - } - - public Sku sku() { - return this.innerModel().sku(); - } - - public Sku kind() { - return this.innerModel().kind(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public String storageAccountName() { - return this.innerModel().storageAccountName(); - } - - public String accountId() { - return this.innerModel().accountId(); - } - - public String accountDomain() { - return this.innerModel().accountDomain(); - } - - public Region region() { - return Region.fromName(this.regionName()); - } - - public String regionName() { - return this.location(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public SpatialAnchorsAccountInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.mixedreality.MixedRealityManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String accountName; - - public SpatialAnchorsAccountImpl withExistingResourceGroup(String resourceGroupName) { - this.resourceGroupName = resourceGroupName; - return this; - } - - public SpatialAnchorsAccount create() { - this.innerObject = serviceManager.serviceClient() - .getSpatialAnchorsAccounts() - .createWithResponse(resourceGroupName, accountName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public SpatialAnchorsAccount create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getSpatialAnchorsAccounts() - .createWithResponse(resourceGroupName, accountName, this.innerModel(), context) - .getValue(); - return this; - } - - SpatialAnchorsAccountImpl(String name, com.azure.resourcemanager.mixedreality.MixedRealityManager serviceManager) { - this.innerObject = new SpatialAnchorsAccountInner(); - this.serviceManager = serviceManager; - this.accountName = name; - } - - public SpatialAnchorsAccountImpl update() { - return this; - } - - public SpatialAnchorsAccount apply() { - this.innerObject = serviceManager.serviceClient() - .getSpatialAnchorsAccounts() - .updateWithResponse(resourceGroupName, accountName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public SpatialAnchorsAccount apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getSpatialAnchorsAccounts() - .updateWithResponse(resourceGroupName, accountName, this.innerModel(), context) - .getValue(); - return this; - } - - SpatialAnchorsAccountImpl(SpatialAnchorsAccountInner innerObject, - com.azure.resourcemanager.mixedreality.MixedRealityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.accountName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "spatialAnchorsAccounts"); - } - - public SpatialAnchorsAccount refresh() { - this.innerObject = serviceManager.serviceClient() - .getSpatialAnchorsAccounts() - .getByResourceGroupWithResponse(resourceGroupName, accountName, Context.NONE) - .getValue(); - return this; - } - - public SpatialAnchorsAccount refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getSpatialAnchorsAccounts() - .getByResourceGroupWithResponse(resourceGroupName, accountName, context) - .getValue(); - return this; - } - - public Response listKeysWithResponse(Context context) { - return serviceManager.spatialAnchorsAccounts().listKeysWithResponse(resourceGroupName, accountName, context); - } - - public AccountKeys listKeys() { - return serviceManager.spatialAnchorsAccounts().listKeys(resourceGroupName, accountName); - } - - public Response regenerateKeysWithResponse(AccountKeyRegenerateRequest regenerate, Context context) { - return serviceManager.spatialAnchorsAccounts() - .regenerateKeysWithResponse(resourceGroupName, accountName, regenerate, context); - } - - public AccountKeys regenerateKeys(AccountKeyRegenerateRequest regenerate) { - return serviceManager.spatialAnchorsAccounts().regenerateKeys(resourceGroupName, accountName, regenerate); - } - - public SpatialAnchorsAccountImpl withRegion(Region location) { - this.innerModel().withLocation(location.toString()); - return this; - } - - public SpatialAnchorsAccountImpl withRegion(String location) { - this.innerModel().withLocation(location); - return this; - } - - public SpatialAnchorsAccountImpl withTags(Map tags) { - this.innerModel().withTags(tags); - return this; - } - - public SpatialAnchorsAccountImpl withIdentity(Identity identity) { - this.innerModel().withIdentity(identity); - return this; - } - - public SpatialAnchorsAccountImpl withPlan(Identity plan) { - this.innerModel().withPlan(plan); - return this; - } - - public SpatialAnchorsAccountImpl withSku(Sku sku) { - this.innerModel().withSku(sku); - return this; - } - - public SpatialAnchorsAccountImpl withKind(Sku kind) { - this.innerModel().withKind(kind); - return this; - } - - public SpatialAnchorsAccountImpl withStorageAccountName(String storageAccountName) { - this.innerModel().withStorageAccountName(storageAccountName); - return this; - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/SpatialAnchorsAccountsClientImpl.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/SpatialAnchorsAccountsClientImpl.java deleted file mode 100644 index ead1188d2081..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/SpatialAnchorsAccountsClientImpl.java +++ /dev/null @@ -1,1275 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.mixedreality.fluent.SpatialAnchorsAccountsClient; -import com.azure.resourcemanager.mixedreality.fluent.models.AccountKeysInner; -import com.azure.resourcemanager.mixedreality.fluent.models.SpatialAnchorsAccountInner; -import com.azure.resourcemanager.mixedreality.models.AccountKeyRegenerateRequest; -import com.azure.resourcemanager.mixedreality.models.SpatialAnchorsAccountPage; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in SpatialAnchorsAccountsClient. - */ -public final class SpatialAnchorsAccountsClientImpl implements SpatialAnchorsAccountsClient { - /** - * The proxy service used to perform REST calls. - */ - private final SpatialAnchorsAccountsService service; - - /** - * The service client containing this operation class. - */ - private final MixedRealityClientImpl client; - - /** - * Initializes an instance of SpatialAnchorsAccountsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SpatialAnchorsAccountsClientImpl(MixedRealityClientImpl client) { - this.service = RestProxy.create(SpatialAnchorsAccountsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MixedRealityClientSpatialAnchorsAccounts to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MixedRealityClientSp") - public interface SpatialAnchorsAccountsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.MixedReality/spatialAnchorsAccounts") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{accountName}") - @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{accountName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{accountName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") SpatialAnchorsAccountInner spatialAnchorsAccount, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{accountName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") SpatialAnchorsAccountInner spatialAnchorsAccount, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{accountName}/listKeys") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listKeys(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{accountName}/regenerateKeys") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> regenerateKeys(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") AccountKeyRegenerateRequest regenerate, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * List Spatial Anchors Accounts by Subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to get resource collection along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List Spatial Anchors Accounts by Subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to get resource collection along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), accept, - context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List Spatial Anchors Accounts by Subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to get resource collection as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * List Spatial Anchors Accounts by Subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to get resource collection as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); - } - - /** - * List Spatial Anchors Accounts by Subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to get resource collection as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * List Spatial Anchors Accounts by Subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to get resource collection as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * List Resources by Resource Group. - * - * @param resourceGroupName Name of an Azure resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to get resource collection along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List Resources by Resource Group. - * - * @param resourceGroupName Name of an Azure resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to get resource collection along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List Resources by Resource Group. - * - * @param resourceGroupName Name of an Azure resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to get resource collection as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * List Resources by Resource Group. - * - * @param resourceGroupName Name of an Azure resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to get resource collection as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * List Resources by Resource Group. - * - * @param resourceGroupName Name of an Azure resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to get resource collection as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * List Resources by Resource Group. - * - * @param resourceGroupName Name of an Azure resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to get resource collection as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Delete a Spatial Anchors Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and 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 (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete a Spatial Anchors Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - 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 (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, this.client.getApiVersion(), accept, context); - } - - /** - * Delete a Spatial Anchors Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String accountName) { - return deleteWithResponseAsync(resourceGroupName, accountName).flatMap(ignored -> Mono.empty()); - } - - /** - * Delete a Spatial Anchors Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, Context context) { - return deleteWithResponseAsync(resourceGroupName, accountName, context).block(); - } - - /** - * Delete a Spatial Anchors Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String accountName) { - deleteWithResponse(resourceGroupName, accountName, Context.NONE); - } - - /** - * Retrieve a Spatial Anchors Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return spatialAnchorsAccount Response along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String accountName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and 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 (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Retrieve a Spatial Anchors Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return spatialAnchorsAccount Response along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String accountName, 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 (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName 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(), resourceGroupName, - accountName, this.client.getApiVersion(), accept, context); - } - - /** - * Retrieve a Spatial Anchors Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return spatialAnchorsAccount Response on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync(String resourceGroupName, String accountName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, accountName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Retrieve a Spatial Anchors Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return spatialAnchorsAccount Response along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse(String resourceGroupName, - String accountName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, accountName, context).block(); - } - - /** - * Retrieve a Spatial Anchors Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return spatialAnchorsAccount Response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SpatialAnchorsAccountInner getByResourceGroup(String resourceGroupName, String accountName) { - return getByResourceGroupWithResponse(resourceGroupName, accountName, Context.NONE).getValue(); - } - - /** - * Updating a Spatial Anchors Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param spatialAnchorsAccount Spatial Anchors Account parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return spatialAnchorsAccount Response along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, - String accountName, SpatialAnchorsAccountInner spatialAnchorsAccount) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and 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 (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (spatialAnchorsAccount == null) { - return Mono - .error(new IllegalArgumentException("Parameter spatialAnchorsAccount is required and cannot be null.")); - } else { - spatialAnchorsAccount.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, this.client.getApiVersion(), spatialAnchorsAccount, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updating a Spatial Anchors Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param spatialAnchorsAccount Spatial Anchors Account parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return spatialAnchorsAccount Response along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, - String accountName, SpatialAnchorsAccountInner spatialAnchorsAccount, 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 (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (spatialAnchorsAccount == null) { - return Mono - .error(new IllegalArgumentException("Parameter spatialAnchorsAccount is required and cannot be null.")); - } else { - spatialAnchorsAccount.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, this.client.getApiVersion(), spatialAnchorsAccount, accept, context); - } - - /** - * Updating a Spatial Anchors Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param spatialAnchorsAccount Spatial Anchors Account parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return spatialAnchorsAccount Response on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String accountName, - SpatialAnchorsAccountInner spatialAnchorsAccount) { - return updateWithResponseAsync(resourceGroupName, accountName, spatialAnchorsAccount) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Updating a Spatial Anchors Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param spatialAnchorsAccount Spatial Anchors Account parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return spatialAnchorsAccount Response along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String resourceGroupName, String accountName, - SpatialAnchorsAccountInner spatialAnchorsAccount, Context context) { - return updateWithResponseAsync(resourceGroupName, accountName, spatialAnchorsAccount, context).block(); - } - - /** - * Updating a Spatial Anchors Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param spatialAnchorsAccount Spatial Anchors Account parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return spatialAnchorsAccount Response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SpatialAnchorsAccountInner update(String resourceGroupName, String accountName, - SpatialAnchorsAccountInner spatialAnchorsAccount) { - return updateWithResponse(resourceGroupName, accountName, spatialAnchorsAccount, Context.NONE).getValue(); - } - - /** - * Creating or Updating a Spatial Anchors Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param spatialAnchorsAccount Spatial Anchors Account parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return spatialAnchorsAccount Response along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync(String resourceGroupName, - String accountName, SpatialAnchorsAccountInner spatialAnchorsAccount) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and 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 (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (spatialAnchorsAccount == null) { - return Mono - .error(new IllegalArgumentException("Parameter spatialAnchorsAccount is required and cannot be null.")); - } else { - spatialAnchorsAccount.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, this.client.getApiVersion(), spatialAnchorsAccount, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creating or Updating a Spatial Anchors Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param spatialAnchorsAccount Spatial Anchors Account parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return spatialAnchorsAccount Response along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync(String resourceGroupName, - String accountName, SpatialAnchorsAccountInner spatialAnchorsAccount, 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 (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (spatialAnchorsAccount == null) { - return Mono - .error(new IllegalArgumentException("Parameter spatialAnchorsAccount is required and cannot be null.")); - } else { - spatialAnchorsAccount.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, this.client.getApiVersion(), spatialAnchorsAccount, accept, context); - } - - /** - * Creating or Updating a Spatial Anchors Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param spatialAnchorsAccount Spatial Anchors Account parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return spatialAnchorsAccount Response on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String resourceGroupName, String accountName, - SpatialAnchorsAccountInner spatialAnchorsAccount) { - return createWithResponseAsync(resourceGroupName, accountName, spatialAnchorsAccount) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Creating or Updating a Spatial Anchors Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param spatialAnchorsAccount Spatial Anchors Account parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return spatialAnchorsAccount Response along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse(String resourceGroupName, String accountName, - SpatialAnchorsAccountInner spatialAnchorsAccount, Context context) { - return createWithResponseAsync(resourceGroupName, accountName, spatialAnchorsAccount, context).block(); - } - - /** - * Creating or Updating a Spatial Anchors Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param spatialAnchorsAccount Spatial Anchors Account parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return spatialAnchorsAccount Response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SpatialAnchorsAccountInner create(String resourceGroupName, String accountName, - SpatialAnchorsAccountInner spatialAnchorsAccount) { - return createWithResponse(resourceGroupName, accountName, spatialAnchorsAccount, Context.NONE).getValue(); - } - - /** - * List Both of the 2 Keys of a Spatial Anchors Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return developer Keys of account along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listKeysWithResponseAsync(String resourceGroupName, String accountName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and 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 (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listKeys(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List Both of the 2 Keys of a Spatial Anchors Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return developer Keys of account along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listKeysWithResponseAsync(String resourceGroupName, String accountName, - 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 (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listKeys(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, this.client.getApiVersion(), accept, context); - } - - /** - * List Both of the 2 Keys of a Spatial Anchors Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return developer Keys of account on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listKeysAsync(String resourceGroupName, String accountName) { - return listKeysWithResponseAsync(resourceGroupName, accountName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * List Both of the 2 Keys of a Spatial Anchors Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return developer Keys of account along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listKeysWithResponse(String resourceGroupName, String accountName, - Context context) { - return listKeysWithResponseAsync(resourceGroupName, accountName, context).block(); - } - - /** - * List Both of the 2 Keys of a Spatial Anchors Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return developer Keys of account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AccountKeysInner listKeys(String resourceGroupName, String accountName) { - return listKeysWithResponse(resourceGroupName, accountName, Context.NONE).getValue(); - } - - /** - * Regenerate specified Key of a Spatial Anchors Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param regenerate Required information for key regeneration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return developer Keys of account along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> regenerateKeysWithResponseAsync(String resourceGroupName, - String accountName, AccountKeyRegenerateRequest regenerate) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and 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 (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (regenerate == null) { - return Mono.error(new IllegalArgumentException("Parameter regenerate is required and cannot be null.")); - } else { - regenerate.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.regenerateKeys(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, this.client.getApiVersion(), regenerate, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Regenerate specified Key of a Spatial Anchors Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param regenerate Required information for key regeneration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return developer Keys of account along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> regenerateKeysWithResponseAsync(String resourceGroupName, - String accountName, AccountKeyRegenerateRequest regenerate, 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 (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (regenerate == null) { - return Mono.error(new IllegalArgumentException("Parameter regenerate is required and cannot be null.")); - } else { - regenerate.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.regenerateKeys(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, this.client.getApiVersion(), regenerate, accept, context); - } - - /** - * Regenerate specified Key of a Spatial Anchors Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param regenerate Required information for key regeneration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return developer Keys of account on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono regenerateKeysAsync(String resourceGroupName, String accountName, - AccountKeyRegenerateRequest regenerate) { - return regenerateKeysWithResponseAsync(resourceGroupName, accountName, regenerate) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Regenerate specified Key of a Spatial Anchors Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param regenerate Required information for key regeneration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return developer Keys of account along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response regenerateKeysWithResponse(String resourceGroupName, String accountName, - AccountKeyRegenerateRequest regenerate, Context context) { - return regenerateKeysWithResponseAsync(resourceGroupName, accountName, regenerate, context).block(); - } - - /** - * Regenerate specified Key of a Spatial Anchors Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param regenerate Required information for key regeneration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return developer Keys of account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AccountKeysInner regenerateKeys(String resourceGroupName, String accountName, - AccountKeyRegenerateRequest regenerate) { - return regenerateKeysWithResponse(resourceGroupName, accountName, regenerate, Context.NONE).getValue(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to get resource collection along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to get resource collection along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to get resource collection along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to get resource collection along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/SpatialAnchorsAccountsImpl.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/SpatialAnchorsAccountsImpl.java deleted file mode 100644 index 873b3e6ba66f..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/SpatialAnchorsAccountsImpl.java +++ /dev/null @@ -1,193 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.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.mixedreality.fluent.SpatialAnchorsAccountsClient; -import com.azure.resourcemanager.mixedreality.fluent.models.AccountKeysInner; -import com.azure.resourcemanager.mixedreality.fluent.models.SpatialAnchorsAccountInner; -import com.azure.resourcemanager.mixedreality.models.AccountKeyRegenerateRequest; -import com.azure.resourcemanager.mixedreality.models.AccountKeys; -import com.azure.resourcemanager.mixedreality.models.SpatialAnchorsAccount; -import com.azure.resourcemanager.mixedreality.models.SpatialAnchorsAccounts; - -public final class SpatialAnchorsAccountsImpl implements SpatialAnchorsAccounts { - private static final ClientLogger LOGGER = new ClientLogger(SpatialAnchorsAccountsImpl.class); - - private final SpatialAnchorsAccountsClient innerClient; - - private final com.azure.resourcemanager.mixedreality.MixedRealityManager serviceManager; - - public SpatialAnchorsAccountsImpl(SpatialAnchorsAccountsClient innerClient, - com.azure.resourcemanager.mixedreality.MixedRealityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SpatialAnchorsAccountImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SpatialAnchorsAccountImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SpatialAnchorsAccountImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - PagedIterable inner - = this.serviceClient().listByResourceGroup(resourceGroupName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SpatialAnchorsAccountImpl(inner1, this.manager())); - } - - public Response deleteByResourceGroupWithResponse(String resourceGroupName, String accountName, - Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, accountName, context); - } - - public void deleteByResourceGroup(String resourceGroupName, String accountName) { - this.serviceClient().delete(resourceGroupName, accountName); - } - - public Response getByResourceGroupWithResponse(String resourceGroupName, String accountName, - Context context) { - Response inner - = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, accountName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SpatialAnchorsAccountImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public SpatialAnchorsAccount getByResourceGroup(String resourceGroupName, String accountName) { - SpatialAnchorsAccountInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, accountName); - if (inner != null) { - return new SpatialAnchorsAccountImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response listKeysWithResponse(String resourceGroupName, String accountName, Context context) { - Response inner - = this.serviceClient().listKeysWithResponse(resourceGroupName, accountName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AccountKeysImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public AccountKeys listKeys(String resourceGroupName, String accountName) { - AccountKeysInner inner = this.serviceClient().listKeys(resourceGroupName, accountName); - if (inner != null) { - return new AccountKeysImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response regenerateKeysWithResponse(String resourceGroupName, String accountName, - AccountKeyRegenerateRequest regenerate, Context context) { - Response inner - = this.serviceClient().regenerateKeysWithResponse(resourceGroupName, accountName, regenerate, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AccountKeysImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public AccountKeys regenerateKeys(String resourceGroupName, String accountName, - AccountKeyRegenerateRequest regenerate) { - AccountKeysInner inner = this.serviceClient().regenerateKeys(resourceGroupName, accountName, regenerate); - if (inner != null) { - return new AccountKeysImpl(inner, this.manager()); - } else { - return null; - } - } - - public SpatialAnchorsAccount getById(String id) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String accountName = ResourceManagerUtils.getValueFromIdByName(id, "spatialAnchorsAccounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException(String - .format("The resource ID '%s' is not valid. Missing path segment 'spatialAnchorsAccounts'.", id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, accountName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String accountName = ResourceManagerUtils.getValueFromIdByName(id, "spatialAnchorsAccounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException(String - .format("The resource ID '%s' is not valid. Missing path segment 'spatialAnchorsAccounts'.", id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, accountName, context); - } - - public void deleteById(String id) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String accountName = ResourceManagerUtils.getValueFromIdByName(id, "spatialAnchorsAccounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException(String - .format("The resource ID '%s' is not valid. Missing path segment 'spatialAnchorsAccounts'.", id))); - } - this.deleteByResourceGroupWithResponse(resourceGroupName, accountName, Context.NONE); - } - - public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String accountName = ResourceManagerUtils.getValueFromIdByName(id, "spatialAnchorsAccounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException(String - .format("The resource ID '%s' is not valid. Missing path segment 'spatialAnchorsAccounts'.", id))); - } - return this.deleteByResourceGroupWithResponse(resourceGroupName, accountName, context); - } - - private SpatialAnchorsAccountsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.mixedreality.MixedRealityManager manager() { - return this.serviceManager; - } - - public SpatialAnchorsAccountImpl define(String name) { - return new SpatialAnchorsAccountImpl(name, this.manager()); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/package-info.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/package-info.java deleted file mode 100644 index 869263b66d56..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// 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 MixedRealityClient. - * Mixed Reality Client. - */ -package com.azure.resourcemanager.mixedreality.implementation; diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/AccountKeyRegenerateRequest.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/AccountKeyRegenerateRequest.java deleted file mode 100644 index 074a128ca424..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/AccountKeyRegenerateRequest.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Request for account key regeneration. - */ -@Fluent -public final class AccountKeyRegenerateRequest implements JsonSerializable { - /* - * serial of key to be regenerated - */ - private Serial serial; - - /** - * Creates an instance of AccountKeyRegenerateRequest class. - */ - public AccountKeyRegenerateRequest() { - } - - /** - * Get the serial property: serial of key to be regenerated. - * - * @return the serial value. - */ - public Serial serial() { - return this.serial; - } - - /** - * Set the serial property: serial of key to be regenerated. - * - * @param serial the serial value to set. - * @return the AccountKeyRegenerateRequest object itself. - */ - public AccountKeyRegenerateRequest withSerial(Serial serial) { - this.serial = serial; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeNumberField("serial", this.serial == null ? null : this.serial.toInt()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AccountKeyRegenerateRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AccountKeyRegenerateRequest if the JsonReader was pointing to an instance of it, or null - * if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the AccountKeyRegenerateRequest. - */ - public static AccountKeyRegenerateRequest fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AccountKeyRegenerateRequest deserializedAccountKeyRegenerateRequest = new AccountKeyRegenerateRequest(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("serial".equals(fieldName)) { - deserializedAccountKeyRegenerateRequest.serial = Serial.fromInt(reader.getInt()); - } else { - reader.skipChildren(); - } - } - - return deserializedAccountKeyRegenerateRequest; - }); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/AccountKeys.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/AccountKeys.java deleted file mode 100644 index b854d65bf498..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/AccountKeys.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.models; - -import com.azure.resourcemanager.mixedreality.fluent.models.AccountKeysInner; - -/** - * An immutable client-side representation of AccountKeys. - */ -public interface AccountKeys { - /** - * Gets the primaryKey property: value of primary key. - * - * @return the primaryKey value. - */ - String primaryKey(); - - /** - * Gets the secondaryKey property: value of secondary key. - * - * @return the secondaryKey value. - */ - String secondaryKey(); - - /** - * Gets the inner com.azure.resourcemanager.mixedreality.fluent.models.AccountKeysInner object. - * - * @return the inner object. - */ - AccountKeysInner innerModel(); -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/CheckNameAvailabilityRequest.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/CheckNameAvailabilityRequest.java deleted file mode 100644 index 3d6ce6352525..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/CheckNameAvailabilityRequest.java +++ /dev/null @@ -1,135 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Check Name Availability Request. - */ -@Fluent -public final class CheckNameAvailabilityRequest implements JsonSerializable { - /* - * Resource Name To Verify - */ - private String name; - - /* - * Fully qualified resource type which includes provider namespace - */ - private String type; - - /** - * Creates an instance of CheckNameAvailabilityRequest class. - */ - public CheckNameAvailabilityRequest() { - } - - /** - * Get the name property: Resource Name To Verify. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Resource Name To Verify. - * - * @param name the name value to set. - * @return the CheckNameAvailabilityRequest object itself. - */ - public CheckNameAvailabilityRequest withName(String name) { - this.name = name; - return this; - } - - /** - * Get the type property: Fully qualified resource type which includes provider namespace. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Set the type property: Fully qualified resource type which includes provider namespace. - * - * @param type the type value to set. - * @return the CheckNameAvailabilityRequest object itself. - */ - public CheckNameAvailabilityRequest withType(String 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.atError() - .log(new IllegalArgumentException( - "Missing required property name in model CheckNameAvailabilityRequest")); - } - if (type() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property type in model CheckNameAvailabilityRequest")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(CheckNameAvailabilityRequest.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeStringField("type", this.type); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CheckNameAvailabilityRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CheckNameAvailabilityRequest if the JsonReader was pointing to an instance of it, or null - * if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the CheckNameAvailabilityRequest. - */ - public static CheckNameAvailabilityRequest fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CheckNameAvailabilityRequest deserializedCheckNameAvailabilityRequest = new CheckNameAvailabilityRequest(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - deserializedCheckNameAvailabilityRequest.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedCheckNameAvailabilityRequest.type = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedCheckNameAvailabilityRequest; - }); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/CheckNameAvailabilityResponse.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/CheckNameAvailabilityResponse.java deleted file mode 100644 index 4818bb9860ce..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/CheckNameAvailabilityResponse.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.models; - -import com.azure.resourcemanager.mixedreality.fluent.models.CheckNameAvailabilityResponseInner; - -/** - * An immutable client-side representation of CheckNameAvailabilityResponse. - */ -public interface CheckNameAvailabilityResponse { - /** - * Gets the nameAvailable property: if name Available. - * - * @return the nameAvailable value. - */ - boolean nameAvailable(); - - /** - * Gets the reason property: Resource Name To Verify. - * - * @return the reason value. - */ - NameUnavailableReason reason(); - - /** - * Gets the message property: detail message. - * - * @return the message value. - */ - String message(); - - /** - * Gets the inner com.azure.resourcemanager.mixedreality.fluent.models.CheckNameAvailabilityResponseInner object. - * - * @return the inner object. - */ - CheckNameAvailabilityResponseInner innerModel(); -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/Identity.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/Identity.java deleted file mode 100644 index 109c9086e36b..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/Identity.java +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Identity for the resource. - */ -@Fluent -public final class Identity implements JsonSerializable { - /* - * The principal ID of resource identity. - */ - private String principalId; - - /* - * The tenant ID of resource. - */ - private String tenantId; - - /* - * The identity type. - */ - private ResourceIdentityType type; - - /** - * Creates an instance of Identity class. - */ - public Identity() { - } - - /** - * Get the principalId property: The principal ID of resource identity. - * - * @return the principalId value. - */ - public String principalId() { - return this.principalId; - } - - /** - * Get the tenantId property: The tenant ID of resource. - * - * @return the tenantId value. - */ - public String tenantId() { - return this.tenantId; - } - - /** - * Get the type property: The identity type. - * - * @return the type value. - */ - public ResourceIdentityType type() { - return this.type; - } - - /** - * Set the type property: The identity type. - * - * @param type the type value to set. - * @return the Identity object itself. - */ - public Identity withType(ResourceIdentityType type) { - this.type = type; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of Identity from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of Identity if the JsonReader was pointing to an instance of it, or null if it was pointing - * to JSON null. - * @throws IOException If an error occurs while reading the Identity. - */ - public static Identity fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - Identity deserializedIdentity = new Identity(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("principalId".equals(fieldName)) { - deserializedIdentity.principalId = reader.getString(); - } else if ("tenantId".equals(fieldName)) { - deserializedIdentity.tenantId = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedIdentity.type = ResourceIdentityType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedIdentity; - }); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/LogSpecification.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/LogSpecification.java deleted file mode 100644 index a06b14a5f425..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/LogSpecification.java +++ /dev/null @@ -1,149 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Specifications of the Log for Azure Monitoring. - */ -@Fluent -public final class LogSpecification implements JsonSerializable { - /* - * Name of the log - */ - private String name; - - /* - * Localized friendly display name of the log - */ - private String displayName; - - /* - * Blob duration of the log - */ - private String blobDuration; - - /** - * Creates an instance of LogSpecification class. - */ - public LogSpecification() { - } - - /** - * Get the name property: Name of the log. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of the log. - * - * @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: Localized friendly display name of the log. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: Localized friendly display name of the log. - * - * @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: Blob duration of the log. - * - * @return the blobDuration value. - */ - public String blobDuration() { - return this.blobDuration; - } - - /** - * Set the blobDuration property: Blob duration of the log. - * - * @param blobDuration the blobDuration value to set. - * @return the LogSpecification object itself. - */ - public LogSpecification withBlobDuration(String blobDuration) { - this.blobDuration = blobDuration; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeStringField("displayName", this.displayName); - jsonWriter.writeStringField("blobDuration", this.blobDuration); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of LogSpecification from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of LogSpecification if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the LogSpecification. - */ - public static LogSpecification fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - LogSpecification deserializedLogSpecification = new LogSpecification(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - deserializedLogSpecification.name = reader.getString(); - } else if ("displayName".equals(fieldName)) { - deserializedLogSpecification.displayName = reader.getString(); - } else if ("blobDuration".equals(fieldName)) { - deserializedLogSpecification.blobDuration = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedLogSpecification; - }); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/MetricDimension.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/MetricDimension.java deleted file mode 100644 index 587b44bcc989..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/MetricDimension.java +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Specifications of the Dimension of metrics. - */ -@Fluent -public final class MetricDimension implements JsonSerializable { - /* - * Name of the dimension - */ - private String name; - - /* - * Localized friendly display name of the dimension - */ - private String displayName; - - /* - * Internal name of the dimension. - */ - private String internalName; - - /* - * Whether the dimension should be included for the shoebox export scenario. - */ - private Boolean toBeExportedForShoebox; - - /** - * Creates an instance of MetricDimension class. - */ - public MetricDimension() { - } - - /** - * Get the name property: Name of the dimension. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of the dimension. - * - * @param name the name value to set. - * @return the MetricDimension object itself. - */ - public MetricDimension withName(String name) { - this.name = name; - return this; - } - - /** - * Get the displayName property: Localized friendly display name of the dimension. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: Localized friendly display name of the dimension. - * - * @param displayName the displayName value to set. - * @return the MetricDimension object itself. - */ - public MetricDimension withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the internalName property: Internal name of the dimension. - * - * @return the internalName value. - */ - public String internalName() { - return this.internalName; - } - - /** - * Set the internalName property: Internal name of the dimension. - * - * @param internalName the internalName value to set. - * @return the MetricDimension object itself. - */ - public MetricDimension withInternalName(String internalName) { - this.internalName = internalName; - return this; - } - - /** - * Get the toBeExportedForShoebox property: Whether the dimension should be included for the shoebox export - * scenario. - * - * @return the toBeExportedForShoebox value. - */ - public Boolean toBeExportedForShoebox() { - return this.toBeExportedForShoebox; - } - - /** - * Set the toBeExportedForShoebox property: Whether the dimension should be included for the shoebox export - * scenario. - * - * @param toBeExportedForShoebox the toBeExportedForShoebox value to set. - * @return the MetricDimension object itself. - */ - public MetricDimension withToBeExportedForShoebox(Boolean toBeExportedForShoebox) { - this.toBeExportedForShoebox = toBeExportedForShoebox; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeStringField("displayName", this.displayName); - jsonWriter.writeStringField("internalName", this.internalName); - jsonWriter.writeBooleanField("toBeExportedForShoebox", this.toBeExportedForShoebox); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of MetricDimension from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of MetricDimension if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the MetricDimension. - */ - public static MetricDimension fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - MetricDimension deserializedMetricDimension = new MetricDimension(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - deserializedMetricDimension.name = reader.getString(); - } else if ("displayName".equals(fieldName)) { - deserializedMetricDimension.displayName = reader.getString(); - } else if ("internalName".equals(fieldName)) { - deserializedMetricDimension.internalName = reader.getString(); - } else if ("toBeExportedForShoebox".equals(fieldName)) { - deserializedMetricDimension.toBeExportedForShoebox = reader.getNullable(JsonReader::getBoolean); - } else { - reader.skipChildren(); - } - } - - return deserializedMetricDimension; - }); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/MetricSpecification.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/MetricSpecification.java deleted file mode 100644 index bbb6cb965415..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/MetricSpecification.java +++ /dev/null @@ -1,531 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * Specifications of the Metrics for Azure Monitoring. - */ -@Fluent -public final class MetricSpecification implements JsonSerializable { - /* - * Name of the metric - */ - private String name; - - /* - * Localized friendly display name of the metric - */ - private String displayName; - - /* - * Localized friendly description of the metric - */ - private String displayDescription; - - /* - * Unit that makes sense for the metric - */ - private String unit; - - /* - * Only provide one value for this field. Valid values: Average, Minimum, Maximum, Total, Count. - */ - private String aggregationType; - - /* - * Supported aggregation types. Valid values: Average, Minimum, Maximum, Total, Count. - */ - private List supportedAggregationTypes; - - /* - * Supported time grains. Valid values: PT1M, PT5M, PT15M, PT30M, PT1H, PT6H, PT12H, P1D - */ - private List supportedTimeGrainTypes; - - /* - * Flag to indicate use of regional Mdm accounts - */ - private Boolean enableRegionalMdmAccount; - - /* - * Source mdm account - */ - private String sourceMdmAccount; - - /* - * Source mdm namespace - */ - private String sourceMdmNamespace; - - /* - * Metric filter regex pattern - */ - private String metricFilterPattern; - - /* - * Flag to determine is Zero is returned for time duration where no metric is emitted - */ - private Boolean fillGapWithZero; - - /* - * Metric category - */ - private String category; - - /* - * Internal metric name. - */ - private String internalMetricName; - - /* - * Dimensions of the metric - */ - private List dimensions; - - /* - * Locked aggregation type of the metric - */ - private String lockedAggregationType; - - /** - * Creates an instance of MetricSpecification class. - */ - public MetricSpecification() { - } - - /** - * Get the name property: Name of the metric. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of the metric. - * - * @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: Localized friendly display name of the metric. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: Localized friendly display name of the metric. - * - * @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: Localized friendly description of the metric. - * - * @return the displayDescription value. - */ - public String displayDescription() { - return this.displayDescription; - } - - /** - * Set the displayDescription property: Localized friendly description of the metric. - * - * @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: Unit that makes sense for the metric. - * - * @return the unit value. - */ - public String unit() { - return this.unit; - } - - /** - * Set the unit property: Unit that makes sense for the metric. - * - * @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: Only provide one value for this field. Valid values: Average, Minimum, Maximum, - * Total, Count. - * - * @return the aggregationType value. - */ - public String aggregationType() { - return this.aggregationType; - } - - /** - * Set the aggregationType property: Only provide one value for this field. Valid values: Average, Minimum, Maximum, - * Total, Count. - * - * @param aggregationType the aggregationType value to set. - * @return the MetricSpecification object itself. - */ - public MetricSpecification withAggregationType(String aggregationType) { - this.aggregationType = aggregationType; - return this; - } - - /** - * Get the supportedAggregationTypes property: Supported aggregation types. Valid values: Average, Minimum, Maximum, - * Total, Count. - * - * @return the supportedAggregationTypes value. - */ - public List supportedAggregationTypes() { - return this.supportedAggregationTypes; - } - - /** - * Set the supportedAggregationTypes property: Supported aggregation types. Valid values: Average, Minimum, Maximum, - * Total, Count. - * - * @param supportedAggregationTypes the supportedAggregationTypes value to set. - * @return the MetricSpecification object itself. - */ - public MetricSpecification withSupportedAggregationTypes(List supportedAggregationTypes) { - this.supportedAggregationTypes = supportedAggregationTypes; - return this; - } - - /** - * Get the supportedTimeGrainTypes property: Supported time grains. Valid values: PT1M, PT5M, PT15M, PT30M, PT1H, - * PT6H, PT12H, P1D. - * - * @return the supportedTimeGrainTypes value. - */ - public List supportedTimeGrainTypes() { - return this.supportedTimeGrainTypes; - } - - /** - * Set the supportedTimeGrainTypes property: Supported time grains. Valid values: PT1M, PT5M, PT15M, PT30M, PT1H, - * PT6H, PT12H, P1D. - * - * @param supportedTimeGrainTypes the supportedTimeGrainTypes value to set. - * @return the MetricSpecification object itself. - */ - public MetricSpecification withSupportedTimeGrainTypes(List supportedTimeGrainTypes) { - this.supportedTimeGrainTypes = supportedTimeGrainTypes; - return this; - } - - /** - * Get the enableRegionalMdmAccount property: Flag to indicate use of regional Mdm accounts. - * - * @return the enableRegionalMdmAccount value. - */ - public Boolean enableRegionalMdmAccount() { - return this.enableRegionalMdmAccount; - } - - /** - * Set the enableRegionalMdmAccount property: Flag to indicate use of regional Mdm accounts. - * - * @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: Source mdm account. - * - * @return the sourceMdmAccount value. - */ - public String sourceMdmAccount() { - return this.sourceMdmAccount; - } - - /** - * Set the sourceMdmAccount property: Source mdm account. - * - * @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: Source mdm namespace. - * - * @return the sourceMdmNamespace value. - */ - public String sourceMdmNamespace() { - return this.sourceMdmNamespace; - } - - /** - * Set the sourceMdmNamespace property: Source mdm namespace. - * - * @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: Metric filter regex pattern. - * - * @return the metricFilterPattern value. - */ - public String metricFilterPattern() { - return this.metricFilterPattern; - } - - /** - * Set the metricFilterPattern property: Metric filter regex pattern. - * - * @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: Flag to determine is Zero is returned for time duration where no metric is - * emitted. - * - * @return the fillGapWithZero value. - */ - public Boolean fillGapWithZero() { - return this.fillGapWithZero; - } - - /** - * Set the fillGapWithZero property: Flag to determine is Zero is returned for time duration where no metric is - * emitted. - * - * @param fillGapWithZero the fillGapWithZero value to set. - * @return the MetricSpecification object itself. - */ - public MetricSpecification withFillGapWithZero(Boolean fillGapWithZero) { - this.fillGapWithZero = fillGapWithZero; - return this; - } - - /** - * Get the category property: Metric category. - * - * @return the category value. - */ - public String category() { - return this.category; - } - - /** - * Set the category property: Metric category. - * - * @param category the category value to set. - * @return the MetricSpecification object itself. - */ - public MetricSpecification withCategory(String category) { - this.category = category; - return this; - } - - /** - * Get the internalMetricName property: Internal metric name. - * - * @return the internalMetricName value. - */ - public String internalMetricName() { - return this.internalMetricName; - } - - /** - * Set the internalMetricName property: Internal metric name. - * - * @param internalMetricName the internalMetricName value to set. - * @return the MetricSpecification object itself. - */ - public MetricSpecification withInternalMetricName(String internalMetricName) { - this.internalMetricName = internalMetricName; - return this; - } - - /** - * Get the dimensions property: Dimensions of the metric. - * - * @return the dimensions value. - */ - public List dimensions() { - return this.dimensions; - } - - /** - * Set the dimensions property: Dimensions of the metric. - * - * @param dimensions the dimensions value to set. - * @return the MetricSpecification object itself. - */ - public MetricSpecification withDimensions(List dimensions) { - this.dimensions = dimensions; - return this; - } - - /** - * Get the lockedAggregationType property: Locked aggregation type of the metric. - * - * @return the lockedAggregationType value. - */ - public String lockedAggregationType() { - return this.lockedAggregationType; - } - - /** - * Set the lockedAggregationType property: Locked aggregation type of the metric. - * - * @param lockedAggregationType the lockedAggregationType value to set. - * @return the MetricSpecification object itself. - */ - public MetricSpecification withLockedAggregationType(String lockedAggregationType) { - this.lockedAggregationType = lockedAggregationType; - 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()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeStringField("displayName", this.displayName); - jsonWriter.writeStringField("displayDescription", this.displayDescription); - jsonWriter.writeStringField("unit", this.unit); - jsonWriter.writeStringField("aggregationType", this.aggregationType); - jsonWriter.writeArrayField("supportedAggregationTypes", this.supportedAggregationTypes, - (writer, element) -> writer.writeString(element)); - jsonWriter.writeArrayField("supportedTimeGrainTypes", this.supportedTimeGrainTypes, - (writer, element) -> writer.writeString(element)); - jsonWriter.writeBooleanField("enableRegionalMdmAccount", this.enableRegionalMdmAccount); - jsonWriter.writeStringField("sourceMdmAccount", this.sourceMdmAccount); - jsonWriter.writeStringField("sourceMdmNamespace", this.sourceMdmNamespace); - jsonWriter.writeStringField("metricFilterPattern", this.metricFilterPattern); - jsonWriter.writeBooleanField("fillGapWithZero", this.fillGapWithZero); - jsonWriter.writeStringField("category", this.category); - jsonWriter.writeStringField("internalMetricName", this.internalMetricName); - jsonWriter.writeArrayField("dimensions", this.dimensions, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("lockedAggregationType", this.lockedAggregationType); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of MetricSpecification from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of MetricSpecification if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the MetricSpecification. - */ - public static MetricSpecification fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - MetricSpecification deserializedMetricSpecification = new MetricSpecification(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - deserializedMetricSpecification.name = reader.getString(); - } else if ("displayName".equals(fieldName)) { - deserializedMetricSpecification.displayName = reader.getString(); - } else if ("displayDescription".equals(fieldName)) { - deserializedMetricSpecification.displayDescription = reader.getString(); - } else if ("unit".equals(fieldName)) { - deserializedMetricSpecification.unit = reader.getString(); - } else if ("aggregationType".equals(fieldName)) { - deserializedMetricSpecification.aggregationType = reader.getString(); - } else if ("supportedAggregationTypes".equals(fieldName)) { - List supportedAggregationTypes = reader.readArray(reader1 -> reader1.getString()); - deserializedMetricSpecification.supportedAggregationTypes = supportedAggregationTypes; - } else if ("supportedTimeGrainTypes".equals(fieldName)) { - List supportedTimeGrainTypes = reader.readArray(reader1 -> reader1.getString()); - deserializedMetricSpecification.supportedTimeGrainTypes = supportedTimeGrainTypes; - } else if ("enableRegionalMdmAccount".equals(fieldName)) { - deserializedMetricSpecification.enableRegionalMdmAccount - = reader.getNullable(JsonReader::getBoolean); - } else if ("sourceMdmAccount".equals(fieldName)) { - deserializedMetricSpecification.sourceMdmAccount = reader.getString(); - } else if ("sourceMdmNamespace".equals(fieldName)) { - deserializedMetricSpecification.sourceMdmNamespace = reader.getString(); - } else if ("metricFilterPattern".equals(fieldName)) { - deserializedMetricSpecification.metricFilterPattern = reader.getString(); - } else if ("fillGapWithZero".equals(fieldName)) { - deserializedMetricSpecification.fillGapWithZero = reader.getNullable(JsonReader::getBoolean); - } else if ("category".equals(fieldName)) { - deserializedMetricSpecification.category = reader.getString(); - } else if ("internalMetricName".equals(fieldName)) { - deserializedMetricSpecification.internalMetricName = reader.getString(); - } else if ("dimensions".equals(fieldName)) { - List dimensions = reader.readArray(reader1 -> MetricDimension.fromJson(reader1)); - deserializedMetricSpecification.dimensions = dimensions; - } else if ("lockedAggregationType".equals(fieldName)) { - deserializedMetricSpecification.lockedAggregationType = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedMetricSpecification; - }); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/NameUnavailableReason.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/NameUnavailableReason.java deleted file mode 100644 index d41253f73d3e..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/NameUnavailableReason.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * reason of name unavailable. - */ -public final class NameUnavailableReason extends ExpandableStringEnum { - /** - * Static value Invalid for NameUnavailableReason. - */ - public static final NameUnavailableReason INVALID = fromString("Invalid"); - - /** - * Static value AlreadyExists for NameUnavailableReason. - */ - public static final NameUnavailableReason ALREADY_EXISTS = fromString("AlreadyExists"); - - /** - * Creates a new instance of NameUnavailableReason value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public NameUnavailableReason() { - } - - /** - * Creates or finds a NameUnavailableReason from its string representation. - * - * @param name a name to look for. - * @return the corresponding NameUnavailableReason. - */ - public static NameUnavailableReason fromString(String name) { - return fromString(name, NameUnavailableReason.class); - } - - /** - * Gets known NameUnavailableReason values. - * - * @return known NameUnavailableReason values. - */ - public static Collection values() { - return values(NameUnavailableReason.class); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/Operation.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/Operation.java deleted file mode 100644 index 40c4142ca53a..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/Operation.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.models; - -import com.azure.resourcemanager.mixedreality.fluent.models.OperationInner; - -/** - * An immutable client-side representation of Operation. - */ -public interface Operation { - /** - * Gets the name property: Operation name: {provider}/{resource}/{operation}. - * - * @return the name value. - */ - String name(); - - /** - * Gets the display property: The object that represents the operation. - * - * @return the display value. - */ - OperationDisplay display(); - - /** - * Gets the isDataAction property: Whether or not this is a data plane operation. - * - * @return the isDataAction value. - */ - Boolean isDataAction(); - - /** - * Gets the origin property: The origin. - * - * @return the origin value. - */ - String origin(); - - /** - * Gets the properties property: Properties of the operation. - * - * @return the properties value. - */ - OperationProperties properties(); - - /** - * Gets the inner com.azure.resourcemanager.mixedreality.fluent.models.OperationInner object. - * - * @return the inner object. - */ - OperationInner innerModel(); -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/OperationDisplay.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/OperationDisplay.java deleted file mode 100644 index 032f8e6ff519..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/OperationDisplay.java +++ /dev/null @@ -1,197 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The object that represents the operation. - */ -@Fluent -public final class OperationDisplay implements JsonSerializable { - /* - * Service provider: Microsoft.ResourceProvider - */ - private String provider; - - /* - * Resource on which the operation is performed: Profile, endpoint, etc. - */ - private String resource; - - /* - * Operation type: Read, write, delete, etc. - */ - private String operation; - - /* - * Description of operation - */ - private String description; - - /** - * Creates an instance of OperationDisplay class. - */ - public OperationDisplay() { - } - - /** - * Get the provider property: Service provider: Microsoft.ResourceProvider. - * - * @return the provider value. - */ - public String provider() { - return this.provider; - } - - /** - * Set the provider property: Service provider: Microsoft.ResourceProvider. - * - * @param provider the provider value to set. - * @return the OperationDisplay object itself. - */ - public OperationDisplay withProvider(String provider) { - this.provider = provider; - return this; - } - - /** - * Get the resource property: Resource on which the operation is performed: Profile, endpoint, etc. - * - * @return the resource value. - */ - public String resource() { - return this.resource; - } - - /** - * Set the resource property: Resource on which the operation is performed: Profile, endpoint, etc. - * - * @param resource the resource value to set. - * @return the OperationDisplay object itself. - */ - public OperationDisplay withResource(String resource) { - this.resource = resource; - return this; - } - - /** - * Get the operation property: Operation type: Read, write, delete, etc. - * - * @return the operation value. - */ - public String operation() { - return this.operation; - } - - /** - * Set the operation property: Operation type: Read, write, delete, etc. - * - * @param operation the operation value to set. - * @return the OperationDisplay object itself. - */ - public OperationDisplay withOperation(String operation) { - this.operation = operation; - return this; - } - - /** - * Get the description property: Description of operation. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: Description of operation. - * - * @param description the description value to set. - * @return the OperationDisplay object itself. - */ - public OperationDisplay withDescription(String description) { - this.description = description; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (provider() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property provider in model OperationDisplay")); - } - if (resource() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property resource in model OperationDisplay")); - } - if (operation() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property operation in model OperationDisplay")); - } - if (description() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property description in model OperationDisplay")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(OperationDisplay.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("provider", this.provider); - jsonWriter.writeStringField("resource", this.resource); - jsonWriter.writeStringField("operation", this.operation); - jsonWriter.writeStringField("description", this.description); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of OperationDisplay from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of OperationDisplay if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the OperationDisplay. - */ - public static OperationDisplay fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - OperationDisplay deserializedOperationDisplay = new OperationDisplay(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("provider".equals(fieldName)) { - deserializedOperationDisplay.provider = reader.getString(); - } else if ("resource".equals(fieldName)) { - deserializedOperationDisplay.resource = reader.getString(); - } else if ("operation".equals(fieldName)) { - deserializedOperationDisplay.operation = reader.getString(); - } else if ("description".equals(fieldName)) { - deserializedOperationDisplay.description = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedOperationDisplay; - }); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/OperationPage.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/OperationPage.java deleted file mode 100644 index bf0faabf6ade..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/OperationPage.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.mixedreality.fluent.models.OperationInner; -import java.io.IOException; -import java.util.List; - -/** - * Result of the request to list Resource Provider operations. It contains a list of operations and a URL link to get - * the next set of results. - */ -@Fluent -public final class OperationPage implements JsonSerializable { - /* - * List of operations supported by the Resource Provider. - */ - private List value; - - /* - * URL to get the next set of operation list results if there are any. - */ - private String nextLink; - - /** - * Creates an instance of OperationPage class. - */ - public OperationPage() { - } - - /** - * Get the value property: List of operations supported by the Resource Provider. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of operations supported by the Resource Provider. - * - * @param value the value value to set. - * @return the OperationPage object itself. - */ - public OperationPage 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; - } - - /** - * Set the nextLink property: URL to get the next set of operation list results if there are any. - * - * @param nextLink the nextLink value to set. - * @return the OperationPage object itself. - */ - public OperationPage withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of OperationPage from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of OperationPage if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the OperationPage. - */ - public static OperationPage fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - OperationPage deserializedOperationPage = new OperationPage(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> OperationInner.fromJson(reader1)); - deserializedOperationPage.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedOperationPage.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedOperationPage; - }); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/OperationProperties.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/OperationProperties.java deleted file mode 100644 index f71451ff9073..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/OperationProperties.java +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Operation properties. - */ -@Fluent -public final class OperationProperties implements JsonSerializable { - /* - * Service specification. - */ - private ServiceSpecification serviceSpecification; - - /** - * Creates an instance of OperationProperties class. - */ - public OperationProperties() { - } - - /** - * Get the serviceSpecification property: Service specification. - * - * @return the serviceSpecification value. - */ - public ServiceSpecification serviceSpecification() { - return this.serviceSpecification; - } - - /** - * Set the serviceSpecification property: Service specification. - * - * @param serviceSpecification the serviceSpecification value to set. - * @return the OperationProperties object itself. - */ - public OperationProperties 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(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("serviceSpecification", this.serviceSpecification); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of OperationProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of OperationProperties if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the OperationProperties. - */ - public static OperationProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - OperationProperties deserializedOperationProperties = new OperationProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("serviceSpecification".equals(fieldName)) { - deserializedOperationProperties.serviceSpecification = ServiceSpecification.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedOperationProperties; - }); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/Operations.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/Operations.java deleted file mode 100644 index fd27c0f83648..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/Operations.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** - * Resource collection API of Operations. - */ -public interface Operations { - /** - * Exposing Available Operations. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Resource Provider operations as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * Exposing Available Operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Resource Provider operations as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(Context context); -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/RemoteRenderingAccount.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/RemoteRenderingAccount.java deleted file mode 100644 index 04bbb0bb3efa..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/RemoteRenderingAccount.java +++ /dev/null @@ -1,460 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.mixedreality.fluent.models.RemoteRenderingAccountInner; -import java.util.Map; - -/** - * An immutable client-side representation of RemoteRenderingAccount. - */ -public interface RemoteRenderingAccount { - /** - * 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 identity property: The identity associated with this account. - * - * @return the identity value. - */ - Identity identity(); - - /** - * Gets the plan property: The plan associated with this account. - * - * @return the plan value. - */ - Identity plan(); - - /** - * Gets the sku property: The sku associated with this account. - * - * @return the sku value. - */ - Sku sku(); - - /** - * Gets the kind property: The kind of account, if supported. - * - * @return the kind value. - */ - Sku kind(); - - /** - * Gets the systemData property: System metadata for this account. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the storageAccountName property: The name of the storage account associated with this accountId. - * - * @return the storageAccountName value. - */ - String storageAccountName(); - - /** - * Gets the accountId property: unique id of certain account. - * - * @return the accountId value. - */ - String accountId(); - - /** - * Gets the accountDomain property: Correspond domain name of certain Spatial Anchors Account. - * - * @return the accountDomain value. - */ - String accountDomain(); - - /** - * Gets the region of the resource. - * - * @return the region of the resource. - */ - Region region(); - - /** - * Gets the name of the resource region. - * - * @return the name of the resource region. - */ - String regionName(); - - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - - /** - * Gets the inner com.azure.resourcemanager.mixedreality.fluent.models.RemoteRenderingAccountInner object. - * - * @return the inner object. - */ - RemoteRenderingAccountInner innerModel(); - - /** - * The entirety of the RemoteRenderingAccount definition. - */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, - DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { - } - - /** - * The RemoteRenderingAccount definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the RemoteRenderingAccount definition. - */ - interface Blank extends WithLocation { - } - - /** - * The stage of the RemoteRenderingAccount 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 RemoteRenderingAccount definition allowing to specify parent resource. - */ - interface WithResourceGroup { - /** - * Specifies resourceGroupName. - * - * @param resourceGroupName Name of an Azure resource group. - * @return the next definition stage. - */ - WithCreate withExistingResourceGroup(String resourceGroupName); - } - - /** - * The stage of the RemoteRenderingAccount 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.WithIdentity, DefinitionStages.WithPlan, - DefinitionStages.WithSku, DefinitionStages.WithKind, DefinitionStages.WithStorageAccountName { - /** - * Executes the create request. - * - * @return the created resource. - */ - RemoteRenderingAccount create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - RemoteRenderingAccount create(Context context); - } - - /** - * The stage of the RemoteRenderingAccount 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 RemoteRenderingAccount definition allowing to specify identity. - */ - interface WithIdentity { - /** - * Specifies the identity property: The identity associated with this account. - * - * @param identity The identity associated with this account. - * @return the next definition stage. - */ - WithCreate withIdentity(Identity identity); - } - - /** - * The stage of the RemoteRenderingAccount definition allowing to specify plan. - */ - interface WithPlan { - /** - * Specifies the plan property: The plan associated with this account. - * - * @param plan The plan associated with this account. - * @return the next definition stage. - */ - WithCreate withPlan(Identity plan); - } - - /** - * The stage of the RemoteRenderingAccount definition allowing to specify sku. - */ - interface WithSku { - /** - * Specifies the sku property: The sku associated with this account. - * - * @param sku The sku associated with this account. - * @return the next definition stage. - */ - WithCreate withSku(Sku sku); - } - - /** - * The stage of the RemoteRenderingAccount definition allowing to specify kind. - */ - interface WithKind { - /** - * Specifies the kind property: The kind of account, if supported. - * - * @param kind The kind of account, if supported. - * @return the next definition stage. - */ - WithCreate withKind(Sku kind); - } - - /** - * The stage of the RemoteRenderingAccount definition allowing to specify storageAccountName. - */ - interface WithStorageAccountName { - /** - * Specifies the storageAccountName property: The name of the storage account associated with this - * accountId. - * - * @param storageAccountName The name of the storage account associated with this accountId. - * @return the next definition stage. - */ - WithCreate withStorageAccountName(String storageAccountName); - } - } - - /** - * Begins update for the RemoteRenderingAccount resource. - * - * @return the stage of resource update. - */ - RemoteRenderingAccount.Update update(); - - /** - * The template for RemoteRenderingAccount update. - */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity, UpdateStages.WithPlan, - UpdateStages.WithSku, UpdateStages.WithKind, UpdateStages.WithStorageAccountName { - /** - * Executes the update request. - * - * @return the updated resource. - */ - RemoteRenderingAccount apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - RemoteRenderingAccount apply(Context context); - } - - /** - * The RemoteRenderingAccount update stages. - */ - interface UpdateStages { - /** - * The stage of the RemoteRenderingAccount update allowing to specify tags. - */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - Update withTags(Map tags); - } - - /** - * The stage of the RemoteRenderingAccount update allowing to specify identity. - */ - interface WithIdentity { - /** - * Specifies the identity property: The identity associated with this account. - * - * @param identity The identity associated with this account. - * @return the next definition stage. - */ - Update withIdentity(Identity identity); - } - - /** - * The stage of the RemoteRenderingAccount update allowing to specify plan. - */ - interface WithPlan { - /** - * Specifies the plan property: The plan associated with this account. - * - * @param plan The plan associated with this account. - * @return the next definition stage. - */ - Update withPlan(Identity plan); - } - - /** - * The stage of the RemoteRenderingAccount update allowing to specify sku. - */ - interface WithSku { - /** - * Specifies the sku property: The sku associated with this account. - * - * @param sku The sku associated with this account. - * @return the next definition stage. - */ - Update withSku(Sku sku); - } - - /** - * The stage of the RemoteRenderingAccount update allowing to specify kind. - */ - interface WithKind { - /** - * Specifies the kind property: The kind of account, if supported. - * - * @param kind The kind of account, if supported. - * @return the next definition stage. - */ - Update withKind(Sku kind); - } - - /** - * The stage of the RemoteRenderingAccount update allowing to specify storageAccountName. - */ - interface WithStorageAccountName { - /** - * Specifies the storageAccountName property: The name of the storage account associated with this - * accountId. - * - * @param storageAccountName The name of the storage account associated with this accountId. - * @return the next definition stage. - */ - Update withStorageAccountName(String storageAccountName); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - RemoteRenderingAccount refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - RemoteRenderingAccount refresh(Context context); - - /** - * List Both of the 2 Keys of a Remote Rendering Account. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return developer Keys of account along with {@link Response}. - */ - Response listKeysWithResponse(Context context); - - /** - * List Both of the 2 Keys of a Remote Rendering Account. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return developer Keys of account. - */ - AccountKeys listKeys(); - - /** - * Regenerate specified Key of a Remote Rendering Account. - * - * @param regenerate Required information for key regeneration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return developer Keys of account along with {@link Response}. - */ - Response regenerateKeysWithResponse(AccountKeyRegenerateRequest regenerate, Context context); - - /** - * Regenerate specified Key of a Remote Rendering Account. - * - * @param regenerate Required information for key regeneration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return developer Keys of account. - */ - AccountKeys regenerateKeys(AccountKeyRegenerateRequest regenerate); -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/RemoteRenderingAccountPage.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/RemoteRenderingAccountPage.java deleted file mode 100644 index 59f5c769358a..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/RemoteRenderingAccountPage.java +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.mixedreality.fluent.models.RemoteRenderingAccountInner; -import java.io.IOException; -import java.util.List; - -/** - * Result of the request to get resource collection. It contains a list of resources and a URL link to get the next set - * of results. - */ -@Fluent -public final class RemoteRenderingAccountPage implements JsonSerializable { - /* - * List of resources supported by the Resource Provider. - */ - private List value; - - /* - * URL to get the next set of resource list results if there are any. - */ - private String nextLink; - - /** - * Creates an instance of RemoteRenderingAccountPage class. - */ - public RemoteRenderingAccountPage() { - } - - /** - * Get the value property: List of resources supported by the Resource Provider. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of resources supported by the Resource Provider. - * - * @param value the value value to set. - * @return the RemoteRenderingAccountPage object itself. - */ - public RemoteRenderingAccountPage withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: URL to get the next set of resource list results if there are any. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: URL to get the next set of resource list results if there are any. - * - * @param nextLink the nextLink value to set. - * @return the RemoteRenderingAccountPage object itself. - */ - public RemoteRenderingAccountPage withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RemoteRenderingAccountPage from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RemoteRenderingAccountPage if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IOException If an error occurs while reading the RemoteRenderingAccountPage. - */ - public static RemoteRenderingAccountPage fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RemoteRenderingAccountPage deserializedRemoteRenderingAccountPage = new RemoteRenderingAccountPage(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> RemoteRenderingAccountInner.fromJson(reader1)); - deserializedRemoteRenderingAccountPage.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedRemoteRenderingAccountPage.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedRemoteRenderingAccountPage; - }); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/RemoteRenderingAccounts.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/RemoteRenderingAccounts.java deleted file mode 100644 index 1b356436c58b..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/RemoteRenderingAccounts.java +++ /dev/null @@ -1,213 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.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 RemoteRenderingAccounts. - */ -public interface RemoteRenderingAccounts { - /** - * List Remote Rendering Accounts by Subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to get resource collection as paginated response with {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * List Remote Rendering Accounts by Subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to get resource collection as paginated response with {@link PagedIterable}. - */ - PagedIterable list(Context context); - - /** - * List Resources by Resource Group. - * - * @param resourceGroupName Name of an Azure resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to get resource collection as paginated response with {@link PagedIterable}. - */ - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * List Resources by Resource Group. - * - * @param resourceGroupName Name of an Azure resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to get resource collection as paginated response with {@link PagedIterable}. - */ - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Delete a Remote Rendering Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 accountName, Context context); - - /** - * Delete a Remote Rendering Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteByResourceGroup(String resourceGroupName, String accountName); - - /** - * Retrieve a Remote Rendering Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return remoteRenderingAccount Response along with {@link Response}. - */ - Response getByResourceGroupWithResponse(String resourceGroupName, String accountName, - Context context); - - /** - * Retrieve a Remote Rendering Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return remoteRenderingAccount Response. - */ - RemoteRenderingAccount getByResourceGroup(String resourceGroupName, String accountName); - - /** - * List Both of the 2 Keys of a Remote Rendering Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return developer Keys of account along with {@link Response}. - */ - Response listKeysWithResponse(String resourceGroupName, String accountName, Context context); - - /** - * List Both of the 2 Keys of a Remote Rendering Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return developer Keys of account. - */ - AccountKeys listKeys(String resourceGroupName, String accountName); - - /** - * Regenerate specified Key of a Remote Rendering Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param regenerate Required information for key regeneration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return developer Keys of account along with {@link Response}. - */ - Response regenerateKeysWithResponse(String resourceGroupName, String accountName, - AccountKeyRegenerateRequest regenerate, Context context); - - /** - * Regenerate specified Key of a Remote Rendering Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param regenerate Required information for key regeneration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return developer Keys of account. - */ - AccountKeys regenerateKeys(String resourceGroupName, String accountName, AccountKeyRegenerateRequest regenerate); - - /** - * Retrieve a Remote Rendering Account. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return remoteRenderingAccount Response along with {@link Response}. - */ - RemoteRenderingAccount getById(String id); - - /** - * Retrieve a Remote Rendering Account. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return remoteRenderingAccount Response along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Delete a Remote Rendering Account. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * Delete a Remote Rendering Account. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new RemoteRenderingAccount resource. - * - * @param name resource name. - * @return the first stage of the new RemoteRenderingAccount definition. - */ - RemoteRenderingAccount.DefinitionStages.Blank define(String name); -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/ResourceIdentityType.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/ResourceIdentityType.java deleted file mode 100644 index e4d8eca642bd..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/ResourceIdentityType.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.models; - -/** - * The identity type. - */ -public enum ResourceIdentityType { - /** - * Enum value SystemAssigned. - */ - SYSTEM_ASSIGNED("SystemAssigned"); - - /** - * The actual serialized value for a ResourceIdentityType instance. - */ - private final String value; - - ResourceIdentityType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a ResourceIdentityType instance. - * - * @param value the serialized value to parse. - * @return the parsed ResourceIdentityType object, or null if unable to parse. - */ - public static ResourceIdentityType fromString(String value) { - if (value == null) { - return null; - } - ResourceIdentityType[] items = ResourceIdentityType.values(); - for (ResourceIdentityType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/ResourceProviders.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/ResourceProviders.java deleted file mode 100644 index d45686256391..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/ResourceProviders.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of ResourceProviders. - */ -public interface ResourceProviders { - /** - * Check Name Availability for local uniqueness. - * - * @param location The location in which uniqueness will be verified. - * @param checkNameAvailability Check Name Availability Request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return check Name Availability Response along with {@link Response}. - */ - Response checkNameAvailabilityLocalWithResponse(String location, - CheckNameAvailabilityRequest checkNameAvailability, Context context); - - /** - * Check Name Availability for local uniqueness. - * - * @param location The location in which uniqueness will be verified. - * @param checkNameAvailability Check Name Availability Request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return check Name Availability Response. - */ - CheckNameAvailabilityResponse checkNameAvailabilityLocal(String location, - CheckNameAvailabilityRequest checkNameAvailability); -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/Serial.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/Serial.java deleted file mode 100644 index dc4dd14f4c9b..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/Serial.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.models; - -/** - * serial of key to be regenerated. - */ -public enum Serial { - /** - * Enum value 1. - */ - ONE(1), - - /** - * Enum value 2. - */ - TWO(2); - - /** - * The actual serialized value for a Serial instance. - */ - private final int value; - - Serial(int value) { - this.value = value; - } - - /** - * Parses a serialized value to a Serial instance. - * - * @param value the serialized value to parse. - * @return the parsed Serial object, or null if unable to parse. - */ - public static Serial fromInt(int value) { - Serial[] items = Serial.values(); - for (Serial item : items) { - if (item.toInt() == value) { - return item; - } - } - return null; - } - - /** - * De-serializes the instance to int value. - * - * @return the int value. - */ - public int toInt() { - return this.value; - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/ServiceSpecification.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/ServiceSpecification.java deleted file mode 100644 index 9d870cd158a7..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/ServiceSpecification.java +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * Service specification payload. - */ -@Fluent -public final class ServiceSpecification implements JsonSerializable { - /* - * Specifications of the Log for Azure Monitoring - */ - private List logSpecifications; - - /* - * Specifications of the Metrics for Azure Monitoring - */ - private List metricSpecifications; - - /** - * Creates an instance of ServiceSpecification class. - */ - public ServiceSpecification() { - } - - /** - * Get the logSpecifications property: Specifications of the Log for Azure Monitoring. - * - * @return the logSpecifications value. - */ - public List logSpecifications() { - return this.logSpecifications; - } - - /** - * Set the logSpecifications property: Specifications of the Log for Azure Monitoring. - * - * @param logSpecifications the logSpecifications value to set. - * @return the ServiceSpecification object itself. - */ - public ServiceSpecification withLogSpecifications(List logSpecifications) { - this.logSpecifications = logSpecifications; - return this; - } - - /** - * Get the metricSpecifications property: Specifications of the Metrics for Azure Monitoring. - * - * @return the metricSpecifications value. - */ - public List metricSpecifications() { - return this.metricSpecifications; - } - - /** - * Set the metricSpecifications property: Specifications of the Metrics for Azure Monitoring. - * - * @param metricSpecifications the metricSpecifications value to set. - * @return the ServiceSpecification object itself. - */ - public ServiceSpecification withMetricSpecifications(List metricSpecifications) { - this.metricSpecifications = metricSpecifications; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (logSpecifications() != null) { - logSpecifications().forEach(e -> e.validate()); - } - if (metricSpecifications() != null) { - metricSpecifications().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("logSpecifications", this.logSpecifications, - (writer, element) -> writer.writeJson(element)); - jsonWriter.writeArrayField("metricSpecifications", this.metricSpecifications, - (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ServiceSpecification from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ServiceSpecification if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IOException If an error occurs while reading the ServiceSpecification. - */ - public static ServiceSpecification fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ServiceSpecification deserializedServiceSpecification = new ServiceSpecification(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("logSpecifications".equals(fieldName)) { - List logSpecifications - = reader.readArray(reader1 -> LogSpecification.fromJson(reader1)); - deserializedServiceSpecification.logSpecifications = logSpecifications; - } else if ("metricSpecifications".equals(fieldName)) { - List metricSpecifications - = reader.readArray(reader1 -> MetricSpecification.fromJson(reader1)); - deserializedServiceSpecification.metricSpecifications = metricSpecifications; - } else { - reader.skipChildren(); - } - } - - return deserializedServiceSpecification; - }); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/Sku.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/Sku.java deleted file mode 100644 index 901a34785e8d..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/Sku.java +++ /dev/null @@ -1,223 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The resource model definition representing SKU. - */ -@Fluent -public final class Sku implements JsonSerializable { - /* - * The name of the SKU. Ex - P3. It is typically a letter+number code - */ - private String name; - - /* - * This field is required to be implemented by the Resource Provider if the service has more than one tier, but is - * not required on a PUT. - */ - private SkuTier tier; - - /* - * The SKU size. When the name field is the combination of tier and some other value, this would be the standalone - * code. - */ - private String size; - - /* - * If the service has different generations of hardware, for the same SKU, then that can be captured here. - */ - private String family; - - /* - * If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible - * for the resource this may be omitted. - */ - private Integer capacity; - - /** - * Creates an instance of Sku class. - */ - public Sku() { - } - - /** - * Get the name property: The name of the SKU. Ex - P3. It is typically a letter+number code. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the SKU. Ex - P3. It is typically a letter+number code. - * - * @param name the name value to set. - * @return the Sku object itself. - */ - public Sku withName(String name) { - this.name = name; - return this; - } - - /** - * Get the tier property: This field is required to be implemented by the Resource Provider if the service has more - * than one tier, but is not required on a PUT. - * - * @return the tier value. - */ - public SkuTier tier() { - return this.tier; - } - - /** - * Set the tier property: This field is required to be implemented by the Resource Provider if the service has more - * than one tier, but is not required on a PUT. - * - * @param tier the tier value to set. - * @return the Sku object itself. - */ - public Sku withTier(SkuTier tier) { - this.tier = tier; - return this; - } - - /** - * Get the size property: The SKU size. When the name field is the combination of tier and some other value, this - * would be the standalone code. - * - * @return the size value. - */ - public String size() { - return this.size; - } - - /** - * Set the size property: The SKU size. When the name field is the combination of tier and some other value, this - * would be the standalone code. - * - * @param size the size value to set. - * @return the Sku object itself. - */ - public Sku withSize(String size) { - this.size = size; - return this; - } - - /** - * Get the family property: If the service has different generations of hardware, for the same SKU, then that can be - * captured here. - * - * @return the family value. - */ - public String family() { - return this.family; - } - - /** - * Set the family property: If the service has different generations of hardware, for the same SKU, then that can be - * captured here. - * - * @param family the family value to set. - * @return the Sku object itself. - */ - public Sku withFamily(String family) { - this.family = family; - return this; - } - - /** - * Get the capacity property: If the SKU supports scale out/in then the capacity integer should be included. If - * scale out/in is not possible for the resource this may be omitted. - * - * @return the capacity value. - */ - public Integer capacity() { - return this.capacity; - } - - /** - * Set the capacity property: If the SKU supports scale out/in then the capacity integer should be included. If - * scale out/in is not possible for the resource this may be omitted. - * - * @param capacity the capacity value to set. - * @return the Sku object itself. - */ - public Sku withCapacity(Integer capacity) { - this.capacity = capacity; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw LOGGER.atError().log(new IllegalArgumentException("Missing required property name in model Sku")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(Sku.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeStringField("tier", this.tier == null ? null : this.tier.toString()); - jsonWriter.writeStringField("size", this.size); - jsonWriter.writeStringField("family", this.family); - jsonWriter.writeNumberField("capacity", this.capacity); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of Sku from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of Sku if the JsonReader was pointing to an instance of it, or null if it was pointing to - * JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the Sku. - */ - public static Sku fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - Sku deserializedSku = new Sku(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - deserializedSku.name = reader.getString(); - } else if ("tier".equals(fieldName)) { - deserializedSku.tier = SkuTier.fromString(reader.getString()); - } else if ("size".equals(fieldName)) { - deserializedSku.size = reader.getString(); - } else if ("family".equals(fieldName)) { - deserializedSku.family = reader.getString(); - } else if ("capacity".equals(fieldName)) { - deserializedSku.capacity = reader.getNullable(JsonReader::getInt); - } else { - reader.skipChildren(); - } - } - - return deserializedSku; - }); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/SkuTier.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/SkuTier.java deleted file mode 100644 index 7a559b1e9d6e..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/SkuTier.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.models; - -/** - * This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not - * required on a PUT. - */ -public enum SkuTier { - /** - * Enum value Free. - */ - FREE("Free"), - - /** - * Enum value Basic. - */ - BASIC("Basic"), - - /** - * Enum value Standard. - */ - STANDARD("Standard"), - - /** - * Enum value Premium. - */ - PREMIUM("Premium"); - - /** - * The actual serialized value for a SkuTier instance. - */ - private final String value; - - SkuTier(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a SkuTier instance. - * - * @param value the serialized value to parse. - * @return the parsed SkuTier object, or null if unable to parse. - */ - public static SkuTier fromString(String value) { - if (value == null) { - return null; - } - SkuTier[] items = SkuTier.values(); - for (SkuTier item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/SpatialAnchorsAccount.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/SpatialAnchorsAccount.java deleted file mode 100644 index 1b57d3a0b121..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/SpatialAnchorsAccount.java +++ /dev/null @@ -1,460 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.mixedreality.fluent.models.SpatialAnchorsAccountInner; -import java.util.Map; - -/** - * An immutable client-side representation of SpatialAnchorsAccount. - */ -public interface SpatialAnchorsAccount { - /** - * 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 identity property: The identity associated with this account. - * - * @return the identity value. - */ - Identity identity(); - - /** - * Gets the plan property: The plan associated with this account. - * - * @return the plan value. - */ - Identity plan(); - - /** - * Gets the sku property: The sku associated with this account. - * - * @return the sku value. - */ - Sku sku(); - - /** - * Gets the kind property: The kind of account, if supported. - * - * @return the kind value. - */ - Sku kind(); - - /** - * Gets the systemData property: System metadata for this account. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the storageAccountName property: The name of the storage account associated with this accountId. - * - * @return the storageAccountName value. - */ - String storageAccountName(); - - /** - * Gets the accountId property: unique id of certain account. - * - * @return the accountId value. - */ - String accountId(); - - /** - * Gets the accountDomain property: Correspond domain name of certain Spatial Anchors Account. - * - * @return the accountDomain value. - */ - String accountDomain(); - - /** - * Gets the region of the resource. - * - * @return the region of the resource. - */ - Region region(); - - /** - * Gets the name of the resource region. - * - * @return the name of the resource region. - */ - String regionName(); - - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - - /** - * Gets the inner com.azure.resourcemanager.mixedreality.fluent.models.SpatialAnchorsAccountInner object. - * - * @return the inner object. - */ - SpatialAnchorsAccountInner innerModel(); - - /** - * The entirety of the SpatialAnchorsAccount definition. - */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, - DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { - } - - /** - * The SpatialAnchorsAccount definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the SpatialAnchorsAccount definition. - */ - interface Blank extends WithLocation { - } - - /** - * The stage of the SpatialAnchorsAccount 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 SpatialAnchorsAccount definition allowing to specify parent resource. - */ - interface WithResourceGroup { - /** - * Specifies resourceGroupName. - * - * @param resourceGroupName Name of an Azure resource group. - * @return the next definition stage. - */ - WithCreate withExistingResourceGroup(String resourceGroupName); - } - - /** - * The stage of the SpatialAnchorsAccount 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.WithIdentity, DefinitionStages.WithPlan, - DefinitionStages.WithSku, DefinitionStages.WithKind, DefinitionStages.WithStorageAccountName { - /** - * Executes the create request. - * - * @return the created resource. - */ - SpatialAnchorsAccount create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - SpatialAnchorsAccount create(Context context); - } - - /** - * The stage of the SpatialAnchorsAccount 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 SpatialAnchorsAccount definition allowing to specify identity. - */ - interface WithIdentity { - /** - * Specifies the identity property: The identity associated with this account. - * - * @param identity The identity associated with this account. - * @return the next definition stage. - */ - WithCreate withIdentity(Identity identity); - } - - /** - * The stage of the SpatialAnchorsAccount definition allowing to specify plan. - */ - interface WithPlan { - /** - * Specifies the plan property: The plan associated with this account. - * - * @param plan The plan associated with this account. - * @return the next definition stage. - */ - WithCreate withPlan(Identity plan); - } - - /** - * The stage of the SpatialAnchorsAccount definition allowing to specify sku. - */ - interface WithSku { - /** - * Specifies the sku property: The sku associated with this account. - * - * @param sku The sku associated with this account. - * @return the next definition stage. - */ - WithCreate withSku(Sku sku); - } - - /** - * The stage of the SpatialAnchorsAccount definition allowing to specify kind. - */ - interface WithKind { - /** - * Specifies the kind property: The kind of account, if supported. - * - * @param kind The kind of account, if supported. - * @return the next definition stage. - */ - WithCreate withKind(Sku kind); - } - - /** - * The stage of the SpatialAnchorsAccount definition allowing to specify storageAccountName. - */ - interface WithStorageAccountName { - /** - * Specifies the storageAccountName property: The name of the storage account associated with this - * accountId. - * - * @param storageAccountName The name of the storage account associated with this accountId. - * @return the next definition stage. - */ - WithCreate withStorageAccountName(String storageAccountName); - } - } - - /** - * Begins update for the SpatialAnchorsAccount resource. - * - * @return the stage of resource update. - */ - SpatialAnchorsAccount.Update update(); - - /** - * The template for SpatialAnchorsAccount update. - */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity, UpdateStages.WithPlan, - UpdateStages.WithSku, UpdateStages.WithKind, UpdateStages.WithStorageAccountName { - /** - * Executes the update request. - * - * @return the updated resource. - */ - SpatialAnchorsAccount apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - SpatialAnchorsAccount apply(Context context); - } - - /** - * The SpatialAnchorsAccount update stages. - */ - interface UpdateStages { - /** - * The stage of the SpatialAnchorsAccount update allowing to specify tags. - */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - Update withTags(Map tags); - } - - /** - * The stage of the SpatialAnchorsAccount update allowing to specify identity. - */ - interface WithIdentity { - /** - * Specifies the identity property: The identity associated with this account. - * - * @param identity The identity associated with this account. - * @return the next definition stage. - */ - Update withIdentity(Identity identity); - } - - /** - * The stage of the SpatialAnchorsAccount update allowing to specify plan. - */ - interface WithPlan { - /** - * Specifies the plan property: The plan associated with this account. - * - * @param plan The plan associated with this account. - * @return the next definition stage. - */ - Update withPlan(Identity plan); - } - - /** - * The stage of the SpatialAnchorsAccount update allowing to specify sku. - */ - interface WithSku { - /** - * Specifies the sku property: The sku associated with this account. - * - * @param sku The sku associated with this account. - * @return the next definition stage. - */ - Update withSku(Sku sku); - } - - /** - * The stage of the SpatialAnchorsAccount update allowing to specify kind. - */ - interface WithKind { - /** - * Specifies the kind property: The kind of account, if supported. - * - * @param kind The kind of account, if supported. - * @return the next definition stage. - */ - Update withKind(Sku kind); - } - - /** - * The stage of the SpatialAnchorsAccount update allowing to specify storageAccountName. - */ - interface WithStorageAccountName { - /** - * Specifies the storageAccountName property: The name of the storage account associated with this - * accountId. - * - * @param storageAccountName The name of the storage account associated with this accountId. - * @return the next definition stage. - */ - Update withStorageAccountName(String storageAccountName); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - SpatialAnchorsAccount refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - SpatialAnchorsAccount refresh(Context context); - - /** - * List Both of the 2 Keys of a Spatial Anchors Account. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return developer Keys of account along with {@link Response}. - */ - Response listKeysWithResponse(Context context); - - /** - * List Both of the 2 Keys of a Spatial Anchors Account. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return developer Keys of account. - */ - AccountKeys listKeys(); - - /** - * Regenerate specified Key of a Spatial Anchors Account. - * - * @param regenerate Required information for key regeneration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return developer Keys of account along with {@link Response}. - */ - Response regenerateKeysWithResponse(AccountKeyRegenerateRequest regenerate, Context context); - - /** - * Regenerate specified Key of a Spatial Anchors Account. - * - * @param regenerate Required information for key regeneration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return developer Keys of account. - */ - AccountKeys regenerateKeys(AccountKeyRegenerateRequest regenerate); -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/SpatialAnchorsAccountPage.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/SpatialAnchorsAccountPage.java deleted file mode 100644 index 0ad5f3b21177..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/SpatialAnchorsAccountPage.java +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.mixedreality.fluent.models.SpatialAnchorsAccountInner; -import java.io.IOException; -import java.util.List; - -/** - * Result of the request to get resource collection. It contains a list of resources and a URL link to get the next set - * of results. - */ -@Fluent -public final class SpatialAnchorsAccountPage implements JsonSerializable { - /* - * List of resources supported by the Resource Provider. - */ - private List value; - - /* - * URL to get the next set of resource list results if there are any. - */ - private String nextLink; - - /** - * Creates an instance of SpatialAnchorsAccountPage class. - */ - public SpatialAnchorsAccountPage() { - } - - /** - * Get the value property: List of resources supported by the Resource Provider. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of resources supported by the Resource Provider. - * - * @param value the value value to set. - * @return the SpatialAnchorsAccountPage object itself. - */ - public SpatialAnchorsAccountPage withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: URL to get the next set of resource list results if there are any. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: URL to get the next set of resource list results if there are any. - * - * @param nextLink the nextLink value to set. - * @return the SpatialAnchorsAccountPage object itself. - */ - public SpatialAnchorsAccountPage withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SpatialAnchorsAccountPage from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SpatialAnchorsAccountPage if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IOException If an error occurs while reading the SpatialAnchorsAccountPage. - */ - public static SpatialAnchorsAccountPage fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SpatialAnchorsAccountPage deserializedSpatialAnchorsAccountPage = new SpatialAnchorsAccountPage(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> SpatialAnchorsAccountInner.fromJson(reader1)); - deserializedSpatialAnchorsAccountPage.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedSpatialAnchorsAccountPage.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedSpatialAnchorsAccountPage; - }); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/SpatialAnchorsAccounts.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/SpatialAnchorsAccounts.java deleted file mode 100644 index 32d63fd34b47..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/SpatialAnchorsAccounts.java +++ /dev/null @@ -1,213 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.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 SpatialAnchorsAccounts. - */ -public interface SpatialAnchorsAccounts { - /** - * List Spatial Anchors Accounts by Subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to get resource collection as paginated response with {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * List Spatial Anchors Accounts by Subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to get resource collection as paginated response with {@link PagedIterable}. - */ - PagedIterable list(Context context); - - /** - * List Resources by Resource Group. - * - * @param resourceGroupName Name of an Azure resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to get resource collection as paginated response with {@link PagedIterable}. - */ - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * List Resources by Resource Group. - * - * @param resourceGroupName Name of an Azure resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to get resource collection as paginated response with {@link PagedIterable}. - */ - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Delete a Spatial Anchors Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 accountName, Context context); - - /** - * Delete a Spatial Anchors Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteByResourceGroup(String resourceGroupName, String accountName); - - /** - * Retrieve a Spatial Anchors Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return spatialAnchorsAccount Response along with {@link Response}. - */ - Response getByResourceGroupWithResponse(String resourceGroupName, String accountName, - Context context); - - /** - * Retrieve a Spatial Anchors Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return spatialAnchorsAccount Response. - */ - SpatialAnchorsAccount getByResourceGroup(String resourceGroupName, String accountName); - - /** - * List Both of the 2 Keys of a Spatial Anchors Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return developer Keys of account along with {@link Response}. - */ - Response listKeysWithResponse(String resourceGroupName, String accountName, Context context); - - /** - * List Both of the 2 Keys of a Spatial Anchors Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return developer Keys of account. - */ - AccountKeys listKeys(String resourceGroupName, String accountName); - - /** - * Regenerate specified Key of a Spatial Anchors Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param regenerate Required information for key regeneration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return developer Keys of account along with {@link Response}. - */ - Response regenerateKeysWithResponse(String resourceGroupName, String accountName, - AccountKeyRegenerateRequest regenerate, Context context); - - /** - * Regenerate specified Key of a Spatial Anchors Account. - * - * @param resourceGroupName Name of an Azure resource group. - * @param accountName Name of an Mixed Reality Account. - * @param regenerate Required information for key regeneration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return developer Keys of account. - */ - AccountKeys regenerateKeys(String resourceGroupName, String accountName, AccountKeyRegenerateRequest regenerate); - - /** - * Retrieve a Spatial Anchors Account. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return spatialAnchorsAccount Response along with {@link Response}. - */ - SpatialAnchorsAccount getById(String id); - - /** - * Retrieve a Spatial Anchors Account. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return spatialAnchorsAccount Response along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Delete a Spatial Anchors Account. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * Delete a Spatial Anchors Account. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new SpatialAnchorsAccount resource. - * - * @param name resource name. - * @return the first stage of the new SpatialAnchorsAccount definition. - */ - SpatialAnchorsAccount.DefinitionStages.Blank define(String name); -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/package-info.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/package-info.java deleted file mode 100644 index c60c429c6265..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// 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 MixedRealityClient. - * Mixed Reality Client. - */ -package com.azure.resourcemanager.mixedreality.models; diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/package-info.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/package-info.java deleted file mode 100644 index 5625f2421e8c..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// 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 MixedRealityClient. - * Mixed Reality Client. - */ -package com.azure.resourcemanager.mixedreality; diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/module-info.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/module-info.java deleted file mode 100644 index eed2d96f60a2..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/module-info.java +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -module com.azure.resourcemanager.mixedreality { - requires transitive com.azure.core.management; - - exports com.azure.resourcemanager.mixedreality; - exports com.azure.resourcemanager.mixedreality.fluent; - exports com.azure.resourcemanager.mixedreality.fluent.models; - exports com.azure.resourcemanager.mixedreality.models; - - opens com.azure.resourcemanager.mixedreality.fluent.models to com.azure.core; - opens com.azure.resourcemanager.mixedreality.models to com.azure.core; -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-mixedreality/proxy-config.json b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-mixedreality/proxy-config.json deleted file mode 100644 index a0abd14869af..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-mixedreality/proxy-config.json +++ /dev/null @@ -1 +0,0 @@ -[["com.azure.resourcemanager.mixedreality.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.mixedreality.implementation.RemoteRenderingAccountsClientImpl$RemoteRenderingAccountsService"],["com.azure.resourcemanager.mixedreality.implementation.ResourceProvidersClientImpl$ResourceProvidersService"],["com.azure.resourcemanager.mixedreality.implementation.SpatialAnchorsAccountsClientImpl$SpatialAnchorsAccountsService"]] \ No newline at end of file diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-mixedreality/reflect-config.json b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-mixedreality/reflect-config.json deleted file mode 100644 index 0637a088a01e..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-mixedreality/reflect-config.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/OperationsListSamples.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/OperationsListSamples.java deleted file mode 100644 index e54f0909eaaf..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/OperationsListSamples.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -/** - * Samples for Operations List. - */ -public final class OperationsListSamples { - /* - * x-ms-original-file: - * specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/proxy/ - * ExposingAvailableOperations.json - */ - /** - * Sample code: List available operations. - * - * @param manager Entry point to MixedRealityManager. - */ - public static void listAvailableOperations(com.azure.resourcemanager.mixedreality.MixedRealityManager manager) { - manager.operations().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsCreateSamples.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsCreateSamples.java deleted file mode 100644 index a453f791e57b..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsCreateSamples.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.resourcemanager.mixedreality.models.Identity; -import com.azure.resourcemanager.mixedreality.models.ResourceIdentityType; - -/** - * Samples for RemoteRenderingAccounts Create. - */ -public final class RemoteRenderingAccountsCreateSamples { - /* - * x-ms-original-file: - * specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/remote-rendering/ - * Put.json - */ - /** - * Sample code: Create remote rendering account. - * - * @param manager Entry point to MixedRealityManager. - */ - public static void - createRemoteRenderingAccount(com.azure.resourcemanager.mixedreality.MixedRealityManager manager) { - manager.remoteRenderingAccounts() - .define("MyAccount") - .withRegion("eastus2euap") - .withExistingResourceGroup("MyResourceGroup") - .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .create(); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsDeleteSamples.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsDeleteSamples.java deleted file mode 100644 index 7914ea74f634..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsDeleteSamples.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -/** - * Samples for RemoteRenderingAccounts Delete. - */ -public final class RemoteRenderingAccountsDeleteSamples { - /* - * x-ms-original-file: - * specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/remote-rendering/ - * Delete.json - */ - /** - * Sample code: Delete remote rendering account. - * - * @param manager Entry point to MixedRealityManager. - */ - public static void - deleteRemoteRenderingAccount(com.azure.resourcemanager.mixedreality.MixedRealityManager manager) { - manager.remoteRenderingAccounts() - .deleteByResourceGroupWithResponse("MyResourceGroup", "MyAccount", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsGetByResourceGroupSamples.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsGetByResourceGroupSamples.java deleted file mode 100644 index 4bba52271e4f..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsGetByResourceGroupSamples.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -/** - * Samples for RemoteRenderingAccounts GetByResourceGroup. - */ -public final class RemoteRenderingAccountsGetByResourceGroupSamples { - /* - * x-ms-original-file: - * specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/remote-rendering/ - * Get.json - */ - /** - * Sample code: Get remote rendering account. - * - * @param manager Entry point to MixedRealityManager. - */ - public static void getRemoteRenderingAccount(com.azure.resourcemanager.mixedreality.MixedRealityManager manager) { - manager.remoteRenderingAccounts() - .getByResourceGroupWithResponse("MyResourceGroup", "MyAccount", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsListByResourceGroupSamples.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsListByResourceGroupSamples.java deleted file mode 100644 index 0d819b5922c5..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsListByResourceGroupSamples.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -/** - * Samples for RemoteRenderingAccounts ListByResourceGroup. - */ -public final class RemoteRenderingAccountsListByResourceGroupSamples { - /* - * x-ms-original-file: - * specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/remote-rendering/ - * GetByResourceGroup.json - */ - /** - * Sample code: List remote rendering accounts by resource group. - * - * @param manager Entry point to MixedRealityManager. - */ - public static void - listRemoteRenderingAccountsByResourceGroup(com.azure.resourcemanager.mixedreality.MixedRealityManager manager) { - manager.remoteRenderingAccounts().listByResourceGroup("MyResourceGroup", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsListKeysSamples.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsListKeysSamples.java deleted file mode 100644 index 3c5f8082b5f1..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsListKeysSamples.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -/** - * Samples for RemoteRenderingAccounts ListKeys. - */ -public final class RemoteRenderingAccountsListKeysSamples { - /* - * x-ms-original-file: - * specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/remote-rendering/ - * ListKeys.json - */ - /** - * Sample code: List remote rendering account key. - * - * @param manager Entry point to MixedRealityManager. - */ - public static void - listRemoteRenderingAccountKey(com.azure.resourcemanager.mixedreality.MixedRealityManager manager) { - manager.remoteRenderingAccounts() - .listKeysWithResponse("MyResourceGroup", "MyAccount", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsListSamples.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsListSamples.java deleted file mode 100644 index 4ce5fb1dc232..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsListSamples.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -/** - * Samples for RemoteRenderingAccounts List. - */ -public final class RemoteRenderingAccountsListSamples { - /* - * x-ms-original-file: - * specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/remote-rendering/ - * GetBySubscription.json - */ - /** - * Sample code: List remote rendering accounts by subscription. - * - * @param manager Entry point to MixedRealityManager. - */ - public static void - listRemoteRenderingAccountsBySubscription(com.azure.resourcemanager.mixedreality.MixedRealityManager manager) { - manager.remoteRenderingAccounts().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsRegenerateKeysSamples.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsRegenerateKeysSamples.java deleted file mode 100644 index 4b2d542f07e1..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsRegenerateKeysSamples.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.resourcemanager.mixedreality.models.AccountKeyRegenerateRequest; -import com.azure.resourcemanager.mixedreality.models.Serial; - -/** - * Samples for RemoteRenderingAccounts RegenerateKeys. - */ -public final class RemoteRenderingAccountsRegenerateKeysSamples { - /* - * x-ms-original-file: - * specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/remote-rendering/ - * RegenerateKey.json - */ - /** - * Sample code: Regenerate remote rendering account keys. - * - * @param manager Entry point to MixedRealityManager. - */ - public static void - regenerateRemoteRenderingAccountKeys(com.azure.resourcemanager.mixedreality.MixedRealityManager manager) { - manager.remoteRenderingAccounts() - .regenerateKeysWithResponse("MyResourceGroup", "MyAccount", - new AccountKeyRegenerateRequest().withSerial(Serial.ONE), com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsUpdateSamples.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsUpdateSamples.java deleted file mode 100644 index 939639182efd..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsUpdateSamples.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.resourcemanager.mixedreality.models.Identity; -import com.azure.resourcemanager.mixedreality.models.RemoteRenderingAccount; -import com.azure.resourcemanager.mixedreality.models.ResourceIdentityType; -import java.util.HashMap; -import java.util.Map; - -/** - * Samples for RemoteRenderingAccounts Update. - */ -public final class RemoteRenderingAccountsUpdateSamples { - /* - * x-ms-original-file: - * specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/remote-rendering/ - * Patch.json - */ - /** - * Sample code: Update remote rendering account. - * - * @param manager Entry point to MixedRealityManager. - */ - public static void - updateRemoteRenderingAccount(com.azure.resourcemanager.mixedreality.MixedRealityManager manager) { - RemoteRenderingAccount resource = manager.remoteRenderingAccounts() - .getByResourceGroupWithResponse("MyResourceGroup", "MyAccount", com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withTags(mapOf("hero", "romeo", "heroine", "juliet")) - .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .apply(); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/ResourceProviderCheckNameAvailabilityLocalSamples.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/ResourceProviderCheckNameAvailabilityLocalSamples.java deleted file mode 100644 index a7173e115f6f..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/ResourceProviderCheckNameAvailabilityLocalSamples.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.resourcemanager.mixedreality.models.CheckNameAvailabilityRequest; - -/** - * Samples for ResourceProvider CheckNameAvailabilityLocal. - */ -public final class ResourceProviderCheckNameAvailabilityLocalSamples { - /* - * x-ms-original-file: - * specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/proxy/ - * CheckNameAvailabilityForLocalUniqueness.json - */ - /** - * Sample code: CheckLocalNameAvailability. - * - * @param manager Entry point to MixedRealityManager. - */ - public static void checkLocalNameAvailability(com.azure.resourcemanager.mixedreality.MixedRealityManager manager) { - manager.resourceProviders() - .checkNameAvailabilityLocalWithResponse("eastus2euap", - new CheckNameAvailabilityRequest().withName("MyAccount") - .withType("Microsoft.MixedReality/spatialAnchorsAccounts"), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsCreateSamples.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsCreateSamples.java deleted file mode 100644 index cb3fa010d267..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsCreateSamples.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -/** - * Samples for SpatialAnchorsAccounts Create. - */ -public final class SpatialAnchorsAccountsCreateSamples { - /* - * x-ms-original-file: - * specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/spatial-anchors/Put - * .json - */ - /** - * Sample code: Create spatial anchor account. - * - * @param manager Entry point to MixedRealityManager. - */ - public static void createSpatialAnchorAccount(com.azure.resourcemanager.mixedreality.MixedRealityManager manager) { - manager.spatialAnchorsAccounts() - .define("MyAccount") - .withRegion("eastus2euap") - .withExistingResourceGroup("MyResourceGroup") - .create(); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsDeleteSamples.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsDeleteSamples.java deleted file mode 100644 index e85d9dfed957..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsDeleteSamples.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -/** - * Samples for SpatialAnchorsAccounts Delete. - */ -public final class SpatialAnchorsAccountsDeleteSamples { - /* - * x-ms-original-file: - * specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/spatial-anchors/ - * Delete.json - */ - /** - * Sample code: Delete spatial anchors account. - * - * @param manager Entry point to MixedRealityManager. - */ - public static void deleteSpatialAnchorsAccount(com.azure.resourcemanager.mixedreality.MixedRealityManager manager) { - manager.spatialAnchorsAccounts() - .deleteByResourceGroupWithResponse("MyResourceGroup", "MyAccount", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsGetByResourceGroupSamples.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsGetByResourceGroupSamples.java deleted file mode 100644 index 14b203a96c91..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsGetByResourceGroupSamples.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -/** - * Samples for SpatialAnchorsAccounts GetByResourceGroup. - */ -public final class SpatialAnchorsAccountsGetByResourceGroupSamples { - /* - * x-ms-original-file: - * specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/spatial-anchors/Get - * .json - */ - /** - * Sample code: Get spatial anchors account. - * - * @param manager Entry point to MixedRealityManager. - */ - public static void getSpatialAnchorsAccount(com.azure.resourcemanager.mixedreality.MixedRealityManager manager) { - manager.spatialAnchorsAccounts() - .getByResourceGroupWithResponse("MyResourceGroup", "MyAccount", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsListByResourceGroupSamples.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsListByResourceGroupSamples.java deleted file mode 100644 index f78a7fe93fe9..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsListByResourceGroupSamples.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -/** - * Samples for SpatialAnchorsAccounts ListByResourceGroup. - */ -public final class SpatialAnchorsAccountsListByResourceGroupSamples { - /* - * x-ms-original-file: - * specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/spatial-anchors/ - * GetByResourceGroup.json - */ - /** - * Sample code: List spatial anchor accounts by resource group. - * - * @param manager Entry point to MixedRealityManager. - */ - public static void - listSpatialAnchorAccountsByResourceGroup(com.azure.resourcemanager.mixedreality.MixedRealityManager manager) { - manager.spatialAnchorsAccounts().listByResourceGroup("MyResourceGroup", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsListKeysSamples.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsListKeysSamples.java deleted file mode 100644 index 469def12f57a..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsListKeysSamples.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -/** - * Samples for SpatialAnchorsAccounts ListKeys. - */ -public final class SpatialAnchorsAccountsListKeysSamples { - /* - * x-ms-original-file: - * specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/spatial-anchors/ - * ListKeys.json - */ - /** - * Sample code: List spatial anchor account key. - * - * @param manager Entry point to MixedRealityManager. - */ - public static void listSpatialAnchorAccountKey(com.azure.resourcemanager.mixedreality.MixedRealityManager manager) { - manager.spatialAnchorsAccounts() - .listKeysWithResponse("MyResourceGroup", "MyAccount", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsListSamples.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsListSamples.java deleted file mode 100644 index 3e827bd6c111..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsListSamples.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -/** - * Samples for SpatialAnchorsAccounts List. - */ -public final class SpatialAnchorsAccountsListSamples { - /* - * x-ms-original-file: - * specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/spatial-anchors/ - * GetBySubscription.json - */ - /** - * Sample code: List spatial anchors accounts by subscription. - * - * @param manager Entry point to MixedRealityManager. - */ - public static void - listSpatialAnchorsAccountsBySubscription(com.azure.resourcemanager.mixedreality.MixedRealityManager manager) { - manager.spatialAnchorsAccounts().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsRegenerateKeysSamples.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsRegenerateKeysSamples.java deleted file mode 100644 index 81200fcfce8a..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsRegenerateKeysSamples.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.resourcemanager.mixedreality.models.AccountKeyRegenerateRequest; -import com.azure.resourcemanager.mixedreality.models.Serial; - -/** - * Samples for SpatialAnchorsAccounts RegenerateKeys. - */ -public final class SpatialAnchorsAccountsRegenerateKeysSamples { - /* - * x-ms-original-file: - * specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/spatial-anchors/ - * RegenerateKey.json - */ - /** - * Sample code: Regenerate spatial anchors account keys. - * - * @param manager Entry point to MixedRealityManager. - */ - public static void - regenerateSpatialAnchorsAccountKeys(com.azure.resourcemanager.mixedreality.MixedRealityManager manager) { - manager.spatialAnchorsAccounts() - .regenerateKeysWithResponse("MyResourceGroup", "MyAccount", - new AccountKeyRegenerateRequest().withSerial(Serial.ONE), com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsUpdateSamples.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsUpdateSamples.java deleted file mode 100644 index 757e083228c9..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsUpdateSamples.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.resourcemanager.mixedreality.models.SpatialAnchorsAccount; -import java.util.HashMap; -import java.util.Map; - -/** - * Samples for SpatialAnchorsAccounts Update. - */ -public final class SpatialAnchorsAccountsUpdateSamples { - /* - * x-ms-original-file: - * specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/spatial-anchors/ - * Patch.json - */ - /** - * Sample code: Update spatial anchors account. - * - * @param manager Entry point to MixedRealityManager. - */ - public static void updateSpatialAnchorsAccount(com.azure.resourcemanager.mixedreality.MixedRealityManager manager) { - SpatialAnchorsAccount resource = manager.spatialAnchorsAccounts() - .getByResourceGroupWithResponse("MyResourceGroup", "MyAccount", com.azure.core.util.Context.NONE) - .getValue(); - resource.update().withTags(mapOf("hero", "romeo", "heroine", "juliet")).apply(); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/AccountKeyRegenerateRequestTests.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/AccountKeyRegenerateRequestTests.java deleted file mode 100644 index 49c4e56f5c01..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/AccountKeyRegenerateRequestTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mixedreality.models.AccountKeyRegenerateRequest; -import com.azure.resourcemanager.mixedreality.models.Serial; -import org.junit.jupiter.api.Assertions; - -public final class AccountKeyRegenerateRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AccountKeyRegenerateRequest model - = BinaryData.fromString("{\"serial\":2}").toObject(AccountKeyRegenerateRequest.class); - Assertions.assertEquals(Serial.TWO, model.serial()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AccountKeyRegenerateRequest model = new AccountKeyRegenerateRequest().withSerial(Serial.TWO); - model = BinaryData.fromObject(model).toObject(AccountKeyRegenerateRequest.class); - Assertions.assertEquals(Serial.TWO, model.serial()); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/CheckNameAvailabilityRequestTests.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/CheckNameAvailabilityRequestTests.java deleted file mode 100644 index b070f177d49d..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/CheckNameAvailabilityRequestTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mixedreality.models.CheckNameAvailabilityRequest; -import org.junit.jupiter.api.Assertions; - -public final class CheckNameAvailabilityRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CheckNameAvailabilityRequest model = BinaryData.fromString("{\"name\":\"eic\",\"type\":\"twnpzaoqvuhrhcf\"}") - .toObject(CheckNameAvailabilityRequest.class); - Assertions.assertEquals("eic", model.name()); - Assertions.assertEquals("twnpzaoqvuhrhcf", model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CheckNameAvailabilityRequest model - = new CheckNameAvailabilityRequest().withName("eic").withType("twnpzaoqvuhrhcf"); - model = BinaryData.fromObject(model).toObject(CheckNameAvailabilityRequest.class); - Assertions.assertEquals("eic", model.name()); - Assertions.assertEquals("twnpzaoqvuhrhcf", model.type()); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/CheckNameAvailabilityResponseInnerTests.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/CheckNameAvailabilityResponseInnerTests.java deleted file mode 100644 index a12e55d9050d..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/CheckNameAvailabilityResponseInnerTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mixedreality.fluent.models.CheckNameAvailabilityResponseInner; -import com.azure.resourcemanager.mixedreality.models.NameUnavailableReason; -import org.junit.jupiter.api.Assertions; - -public final class CheckNameAvailabilityResponseInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CheckNameAvailabilityResponseInner model - = BinaryData.fromString("{\"nameAvailable\":true,\"reason\":\"Invalid\",\"message\":\"glmjth\"}") - .toObject(CheckNameAvailabilityResponseInner.class); - Assertions.assertEquals(true, model.nameAvailable()); - Assertions.assertEquals(NameUnavailableReason.INVALID, model.reason()); - Assertions.assertEquals("glmjth", model.message()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CheckNameAvailabilityResponseInner model = new CheckNameAvailabilityResponseInner().withNameAvailable(true) - .withReason(NameUnavailableReason.INVALID) - .withMessage("glmjth"); - model = BinaryData.fromObject(model).toObject(CheckNameAvailabilityResponseInner.class); - Assertions.assertEquals(true, model.nameAvailable()); - Assertions.assertEquals(NameUnavailableReason.INVALID, model.reason()); - Assertions.assertEquals("glmjth", model.message()); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/IdentityTests.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/IdentityTests.java deleted file mode 100644 index f8aea8e64ee2..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/IdentityTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mixedreality.models.Identity; -import com.azure.resourcemanager.mixedreality.models.ResourceIdentityType; -import org.junit.jupiter.api.Assertions; - -public final class IdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Identity model = BinaryData - .fromString("{\"principalId\":\"jpkcattpng\",\"tenantId\":\"rcczsqpjhvmd\",\"type\":\"SystemAssigned\"}") - .toObject(Identity.class); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Identity model = new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED); - model = BinaryData.fromObject(model).toObject(Identity.class); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.type()); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/LogSpecificationTests.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/LogSpecificationTests.java deleted file mode 100644 index 5f255b8e898e..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/LogSpecificationTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mixedreality.models.LogSpecification; -import org.junit.jupiter.api.Assertions; - -public final class LogSpecificationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LogSpecification model = BinaryData - .fromString("{\"name\":\"iachbo\",\"displayName\":\"flnrosfqpteehzz\",\"blobDuration\":\"pyqr\"}") - .toObject(LogSpecification.class); - Assertions.assertEquals("iachbo", model.name()); - Assertions.assertEquals("flnrosfqpteehzz", model.displayName()); - Assertions.assertEquals("pyqr", model.blobDuration()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LogSpecification model - = new LogSpecification().withName("iachbo").withDisplayName("flnrosfqpteehzz").withBlobDuration("pyqr"); - model = BinaryData.fromObject(model).toObject(LogSpecification.class); - Assertions.assertEquals("iachbo", model.name()); - Assertions.assertEquals("flnrosfqpteehzz", model.displayName()); - Assertions.assertEquals("pyqr", model.blobDuration()); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/MetricDimensionTests.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/MetricDimensionTests.java deleted file mode 100644 index 8fbb8fdc0275..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/MetricDimensionTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mixedreality.models.MetricDimension; -import org.junit.jupiter.api.Assertions; - -public final class MetricDimensionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MetricDimension model = BinaryData.fromString( - "{\"name\":\"hvpmoue\",\"displayName\":\"dzxibqeojnxqbzvd\",\"internalName\":\"t\",\"toBeExportedForShoebox\":true}") - .toObject(MetricDimension.class); - Assertions.assertEquals("hvpmoue", model.name()); - Assertions.assertEquals("dzxibqeojnxqbzvd", model.displayName()); - Assertions.assertEquals("t", model.internalName()); - Assertions.assertEquals(true, model.toBeExportedForShoebox()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MetricDimension model = new MetricDimension().withName("hvpmoue") - .withDisplayName("dzxibqeojnxqbzvd") - .withInternalName("t") - .withToBeExportedForShoebox(true); - model = BinaryData.fromObject(model).toObject(MetricDimension.class); - Assertions.assertEquals("hvpmoue", model.name()); - Assertions.assertEquals("dzxibqeojnxqbzvd", model.displayName()); - Assertions.assertEquals("t", model.internalName()); - Assertions.assertEquals(true, model.toBeExportedForShoebox()); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/MetricSpecificationTests.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/MetricSpecificationTests.java deleted file mode 100644 index d9483b43f4d3..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/MetricSpecificationTests.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mixedreality.models.MetricDimension; -import com.azure.resourcemanager.mixedreality.models.MetricSpecification; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class MetricSpecificationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MetricSpecification model = BinaryData.fromString( - "{\"name\":\"z\",\"displayName\":\"pvswjdkirso\",\"displayDescription\":\"qxhcrmn\",\"unit\":\"jtckwhdso\",\"aggregationType\":\"iy\",\"supportedAggregationTypes\":[\"xsqwpgrjbznorc\",\"xv\",\"nb\"],\"supportedTimeGrainTypes\":[\"abnmocpcyshu\",\"zafb\"],\"enableRegionalMdmAccount\":false,\"sourceMdmAccount\":\"pbtoqcjmkl\",\"sourceMdmNamespace\":\"vbqid\",\"metricFilterPattern\":\"ajzyul\",\"fillGapWithZero\":false,\"category\":\"jkrlkhbzhfepg\",\"internalMetricName\":\"qex\",\"dimensions\":[{\"name\":\"xscpaierhhbc\",\"displayName\":\"l\",\"internalName\":\"majtjaod\",\"toBeExportedForShoebox\":true},{\"name\":\"bdxkqpxokaj\",\"displayName\":\"npime\",\"internalName\":\"stxgc\",\"toBeExportedForShoebox\":false},{\"name\":\"maajrmvdjwzrlo\",\"displayName\":\"clwhijcoejctbz\",\"internalName\":\"s\",\"toBeExportedForShoebox\":false},{\"name\":\"bkbfkgukdkex\",\"displayName\":\"pofm\",\"internalName\":\"x\",\"toBeExportedForShoebox\":false}],\"lockedAggregationType\":\"gddtocj\"}") - .toObject(MetricSpecification.class); - Assertions.assertEquals("z", model.name()); - Assertions.assertEquals("pvswjdkirso", model.displayName()); - Assertions.assertEquals("qxhcrmn", model.displayDescription()); - Assertions.assertEquals("jtckwhdso", model.unit()); - Assertions.assertEquals("iy", model.aggregationType()); - Assertions.assertEquals("xsqwpgrjbznorc", model.supportedAggregationTypes().get(0)); - Assertions.assertEquals("abnmocpcyshu", model.supportedTimeGrainTypes().get(0)); - Assertions.assertEquals(false, model.enableRegionalMdmAccount()); - Assertions.assertEquals("pbtoqcjmkl", model.sourceMdmAccount()); - Assertions.assertEquals("vbqid", model.sourceMdmNamespace()); - Assertions.assertEquals("ajzyul", model.metricFilterPattern()); - Assertions.assertEquals(false, model.fillGapWithZero()); - Assertions.assertEquals("jkrlkhbzhfepg", model.category()); - Assertions.assertEquals("qex", model.internalMetricName()); - Assertions.assertEquals("xscpaierhhbc", model.dimensions().get(0).name()); - Assertions.assertEquals("l", model.dimensions().get(0).displayName()); - Assertions.assertEquals("majtjaod", model.dimensions().get(0).internalName()); - Assertions.assertEquals(true, model.dimensions().get(0).toBeExportedForShoebox()); - Assertions.assertEquals("gddtocj", model.lockedAggregationType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MetricSpecification model = new MetricSpecification().withName("z") - .withDisplayName("pvswjdkirso") - .withDisplayDescription("qxhcrmn") - .withUnit("jtckwhdso") - .withAggregationType("iy") - .withSupportedAggregationTypes(Arrays.asList("xsqwpgrjbznorc", "xv", "nb")) - .withSupportedTimeGrainTypes(Arrays.asList("abnmocpcyshu", "zafb")) - .withEnableRegionalMdmAccount(false) - .withSourceMdmAccount("pbtoqcjmkl") - .withSourceMdmNamespace("vbqid") - .withMetricFilterPattern("ajzyul") - .withFillGapWithZero(false) - .withCategory("jkrlkhbzhfepg") - .withInternalMetricName("qex") - .withDimensions(Arrays.asList( - new MetricDimension().withName("xscpaierhhbc") - .withDisplayName("l") - .withInternalName("majtjaod") - .withToBeExportedForShoebox(true), - new MetricDimension().withName("bdxkqpxokaj") - .withDisplayName("npime") - .withInternalName("stxgc") - .withToBeExportedForShoebox(false), - new MetricDimension().withName("maajrmvdjwzrlo") - .withDisplayName("clwhijcoejctbz") - .withInternalName("s") - .withToBeExportedForShoebox(false), - new MetricDimension().withName("bkbfkgukdkex") - .withDisplayName("pofm") - .withInternalName("x") - .withToBeExportedForShoebox(false))) - .withLockedAggregationType("gddtocj"); - model = BinaryData.fromObject(model).toObject(MetricSpecification.class); - Assertions.assertEquals("z", model.name()); - Assertions.assertEquals("pvswjdkirso", model.displayName()); - Assertions.assertEquals("qxhcrmn", model.displayDescription()); - Assertions.assertEquals("jtckwhdso", model.unit()); - Assertions.assertEquals("iy", model.aggregationType()); - Assertions.assertEquals("xsqwpgrjbznorc", model.supportedAggregationTypes().get(0)); - Assertions.assertEquals("abnmocpcyshu", model.supportedTimeGrainTypes().get(0)); - Assertions.assertEquals(false, model.enableRegionalMdmAccount()); - Assertions.assertEquals("pbtoqcjmkl", model.sourceMdmAccount()); - Assertions.assertEquals("vbqid", model.sourceMdmNamespace()); - Assertions.assertEquals("ajzyul", model.metricFilterPattern()); - Assertions.assertEquals(false, model.fillGapWithZero()); - Assertions.assertEquals("jkrlkhbzhfepg", model.category()); - Assertions.assertEquals("qex", model.internalMetricName()); - Assertions.assertEquals("xscpaierhhbc", model.dimensions().get(0).name()); - Assertions.assertEquals("l", model.dimensions().get(0).displayName()); - Assertions.assertEquals("majtjaod", model.dimensions().get(0).internalName()); - Assertions.assertEquals(true, model.dimensions().get(0).toBeExportedForShoebox()); - Assertions.assertEquals("gddtocj", model.lockedAggregationType()); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/MixedRealityAccountPropertiesTests.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/MixedRealityAccountPropertiesTests.java deleted file mode 100644 index f9a6e8539494..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/MixedRealityAccountPropertiesTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mixedreality.fluent.models.MixedRealityAccountProperties; -import org.junit.jupiter.api.Assertions; - -public final class MixedRealityAccountPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MixedRealityAccountProperties model = BinaryData - .fromString("{\"storageAccountName\":\"c\",\"accountId\":\"efovgmk\",\"accountDomain\":\"leyyvx\"}") - .toObject(MixedRealityAccountProperties.class); - Assertions.assertEquals("c", model.storageAccountName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MixedRealityAccountProperties model = new MixedRealityAccountProperties().withStorageAccountName("c"); - model = BinaryData.fromObject(model).toObject(MixedRealityAccountProperties.class); - Assertions.assertEquals("c", model.storageAccountName()); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/OperationDisplayTests.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/OperationDisplayTests.java deleted file mode 100644 index ab2303a447ef..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/OperationDisplayTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mixedreality.models.OperationDisplay; -import org.junit.jupiter.api.Assertions; - -public final class OperationDisplayTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationDisplay model = BinaryData.fromString( - "{\"provider\":\"npmqnjaqwixjspro\",\"resource\":\"vcputegj\",\"operation\":\"wmfdatscmdvpjhul\",\"description\":\"uuvmkjozkrwfnd\"}") - .toObject(OperationDisplay.class); - Assertions.assertEquals("npmqnjaqwixjspro", model.provider()); - Assertions.assertEquals("vcputegj", model.resource()); - Assertions.assertEquals("wmfdatscmdvpjhul", model.operation()); - Assertions.assertEquals("uuvmkjozkrwfnd", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDisplay model = new OperationDisplay().withProvider("npmqnjaqwixjspro") - .withResource("vcputegj") - .withOperation("wmfdatscmdvpjhul") - .withDescription("uuvmkjozkrwfnd"); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - Assertions.assertEquals("npmqnjaqwixjspro", model.provider()); - Assertions.assertEquals("vcputegj", model.resource()); - Assertions.assertEquals("wmfdatscmdvpjhul", model.operation()); - Assertions.assertEquals("uuvmkjozkrwfnd", model.description()); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/OperationInnerTests.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/OperationInnerTests.java deleted file mode 100644 index edd736d3c1ae..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/OperationInnerTests.java +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mixedreality.fluent.models.OperationInner; -import com.azure.resourcemanager.mixedreality.models.LogSpecification; -import com.azure.resourcemanager.mixedreality.models.MetricDimension; -import com.azure.resourcemanager.mixedreality.models.MetricSpecification; -import com.azure.resourcemanager.mixedreality.models.OperationDisplay; -import com.azure.resourcemanager.mixedreality.models.OperationProperties; -import com.azure.resourcemanager.mixedreality.models.ServiceSpecification; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class OperationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationInner model = BinaryData.fromString( - "{\"name\":\"flusarhmof\",\"display\":{\"provider\":\"hs\",\"resource\":\"yurkdtmlxhekuksj\",\"operation\":\"xukcdmpar\",\"description\":\"ryuanzwuxzdxtay\"},\"isDataAction\":true,\"origin\":\"whfpmrqobmtu\",\"properties\":{\"serviceSpecification\":{\"logSpecifications\":[{\"name\":\"tihfx\",\"displayName\":\"jbpzvgnwzsymg\",\"blobDuration\":\"uf\"},{\"name\":\"zk\",\"displayName\":\"dbihanufhfcbj\",\"blobDuration\":\"a\"}],\"metricSpecifications\":[{\"name\":\"xqhabi\",\"displayName\":\"ikxwc\",\"displayDescription\":\"yscnpqxu\",\"unit\":\"vyq\",\"aggregationType\":\"wby\",\"supportedAggregationTypes\":[\"xvd\"],\"supportedTimeGrainTypes\":[\"grtfwvu\",\"xgaudccs\",\"h\"],\"enableRegionalMdmAccount\":true,\"sourceMdmAccount\":\"yejhk\",\"sourceMdmNamespace\":\"htnapczwlokjyem\",\"metricFilterPattern\":\"vnipjox\",\"fillGapWithZero\":false,\"category\":\"hgejspodma\",\"internalMetricName\":\"zyde\",\"dimensions\":[{},{},{},{}],\"lockedAggregationType\":\"yahux\"}]}}}") - .toObject(OperationInner.class); - Assertions.assertEquals("flusarhmof", model.name()); - Assertions.assertEquals("hs", model.display().provider()); - Assertions.assertEquals("yurkdtmlxhekuksj", model.display().resource()); - Assertions.assertEquals("xukcdmpar", model.display().operation()); - Assertions.assertEquals("ryuanzwuxzdxtay", model.display().description()); - Assertions.assertEquals(true, model.isDataAction()); - Assertions.assertEquals("whfpmrqobmtu", model.origin()); - Assertions.assertEquals("tihfx", model.properties().serviceSpecification().logSpecifications().get(0).name()); - Assertions.assertEquals("jbpzvgnwzsymg", - model.properties().serviceSpecification().logSpecifications().get(0).displayName()); - Assertions.assertEquals("uf", - model.properties().serviceSpecification().logSpecifications().get(0).blobDuration()); - Assertions.assertEquals("xqhabi", - model.properties().serviceSpecification().metricSpecifications().get(0).name()); - Assertions.assertEquals("ikxwc", - model.properties().serviceSpecification().metricSpecifications().get(0).displayName()); - Assertions.assertEquals("yscnpqxu", - model.properties().serviceSpecification().metricSpecifications().get(0).displayDescription()); - Assertions.assertEquals("vyq", model.properties().serviceSpecification().metricSpecifications().get(0).unit()); - Assertions.assertEquals("wby", - model.properties().serviceSpecification().metricSpecifications().get(0).aggregationType()); - Assertions.assertEquals("xvd", - model.properties().serviceSpecification().metricSpecifications().get(0).supportedAggregationTypes().get(0)); - Assertions.assertEquals("grtfwvu", - model.properties().serviceSpecification().metricSpecifications().get(0).supportedTimeGrainTypes().get(0)); - Assertions.assertEquals(true, - model.properties().serviceSpecification().metricSpecifications().get(0).enableRegionalMdmAccount()); - Assertions.assertEquals("yejhk", - model.properties().serviceSpecification().metricSpecifications().get(0).sourceMdmAccount()); - Assertions.assertEquals("htnapczwlokjyem", - model.properties().serviceSpecification().metricSpecifications().get(0).sourceMdmNamespace()); - Assertions.assertEquals("vnipjox", - model.properties().serviceSpecification().metricSpecifications().get(0).metricFilterPattern()); - Assertions.assertEquals(false, - model.properties().serviceSpecification().metricSpecifications().get(0).fillGapWithZero()); - Assertions.assertEquals("hgejspodma", - model.properties().serviceSpecification().metricSpecifications().get(0).category()); - Assertions.assertEquals("zyde", - model.properties().serviceSpecification().metricSpecifications().get(0).internalMetricName()); - Assertions.assertEquals("yahux", - model.properties().serviceSpecification().metricSpecifications().get(0).lockedAggregationType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationInner model = new OperationInner().withName("flusarhmof") - .withDisplay(new OperationDisplay().withProvider("hs") - .withResource("yurkdtmlxhekuksj") - .withOperation("xukcdmpar") - .withDescription("ryuanzwuxzdxtay")) - .withIsDataAction(true) - .withOrigin("whfpmrqobmtu") - .withProperties(new OperationProperties().withServiceSpecification(new ServiceSpecification() - .withLogSpecifications(Arrays.asList( - new LogSpecification().withName("tihfx").withDisplayName("jbpzvgnwzsymg").withBlobDuration("uf"), - new LogSpecification().withName("zk").withDisplayName("dbihanufhfcbj").withBlobDuration("a"))) - .withMetricSpecifications(Arrays.asList(new MetricSpecification().withName("xqhabi") - .withDisplayName("ikxwc") - .withDisplayDescription("yscnpqxu") - .withUnit("vyq") - .withAggregationType("wby") - .withSupportedAggregationTypes(Arrays.asList("xvd")) - .withSupportedTimeGrainTypes(Arrays.asList("grtfwvu", "xgaudccs", "h")) - .withEnableRegionalMdmAccount(true) - .withSourceMdmAccount("yejhk") - .withSourceMdmNamespace("htnapczwlokjyem") - .withMetricFilterPattern("vnipjox") - .withFillGapWithZero(false) - .withCategory("hgejspodma") - .withInternalMetricName("zyde") - .withDimensions(Arrays.asList(new MetricDimension(), new MetricDimension(), new MetricDimension(), - new MetricDimension())) - .withLockedAggregationType("yahux"))))); - model = BinaryData.fromObject(model).toObject(OperationInner.class); - Assertions.assertEquals("flusarhmof", model.name()); - Assertions.assertEquals("hs", model.display().provider()); - Assertions.assertEquals("yurkdtmlxhekuksj", model.display().resource()); - Assertions.assertEquals("xukcdmpar", model.display().operation()); - Assertions.assertEquals("ryuanzwuxzdxtay", model.display().description()); - Assertions.assertEquals(true, model.isDataAction()); - Assertions.assertEquals("whfpmrqobmtu", model.origin()); - Assertions.assertEquals("tihfx", model.properties().serviceSpecification().logSpecifications().get(0).name()); - Assertions.assertEquals("jbpzvgnwzsymg", - model.properties().serviceSpecification().logSpecifications().get(0).displayName()); - Assertions.assertEquals("uf", - model.properties().serviceSpecification().logSpecifications().get(0).blobDuration()); - Assertions.assertEquals("xqhabi", - model.properties().serviceSpecification().metricSpecifications().get(0).name()); - Assertions.assertEquals("ikxwc", - model.properties().serviceSpecification().metricSpecifications().get(0).displayName()); - Assertions.assertEquals("yscnpqxu", - model.properties().serviceSpecification().metricSpecifications().get(0).displayDescription()); - Assertions.assertEquals("vyq", model.properties().serviceSpecification().metricSpecifications().get(0).unit()); - Assertions.assertEquals("wby", - model.properties().serviceSpecification().metricSpecifications().get(0).aggregationType()); - Assertions.assertEquals("xvd", - model.properties().serviceSpecification().metricSpecifications().get(0).supportedAggregationTypes().get(0)); - Assertions.assertEquals("grtfwvu", - model.properties().serviceSpecification().metricSpecifications().get(0).supportedTimeGrainTypes().get(0)); - Assertions.assertEquals(true, - model.properties().serviceSpecification().metricSpecifications().get(0).enableRegionalMdmAccount()); - Assertions.assertEquals("yejhk", - model.properties().serviceSpecification().metricSpecifications().get(0).sourceMdmAccount()); - Assertions.assertEquals("htnapczwlokjyem", - model.properties().serviceSpecification().metricSpecifications().get(0).sourceMdmNamespace()); - Assertions.assertEquals("vnipjox", - model.properties().serviceSpecification().metricSpecifications().get(0).metricFilterPattern()); - Assertions.assertEquals(false, - model.properties().serviceSpecification().metricSpecifications().get(0).fillGapWithZero()); - Assertions.assertEquals("hgejspodma", - model.properties().serviceSpecification().metricSpecifications().get(0).category()); - Assertions.assertEquals("zyde", - model.properties().serviceSpecification().metricSpecifications().get(0).internalMetricName()); - Assertions.assertEquals("yahux", - model.properties().serviceSpecification().metricSpecifications().get(0).lockedAggregationType()); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/OperationPageTests.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/OperationPageTests.java deleted file mode 100644 index de29624caf76..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/OperationPageTests.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mixedreality.fluent.models.OperationInner; -import com.azure.resourcemanager.mixedreality.models.LogSpecification; -import com.azure.resourcemanager.mixedreality.models.MetricSpecification; -import com.azure.resourcemanager.mixedreality.models.OperationDisplay; -import com.azure.resourcemanager.mixedreality.models.OperationPage; -import com.azure.resourcemanager.mixedreality.models.OperationProperties; -import com.azure.resourcemanager.mixedreality.models.ServiceSpecification; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class OperationPageTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationPage model = BinaryData.fromString( - "{\"value\":[{\"name\":\"quvgjxpybczme\",\"display\":{\"provider\":\"tzopbsphrupidgsy\",\"resource\":\"bejhphoycmsxa\",\"operation\":\"bhdxbm\",\"description\":\"qioqjzehtbmu\"},\"isDataAction\":false,\"origin\":\"noi\",\"properties\":{\"serviceSpecification\":{\"logSpecifications\":[{},{}],\"metricSpecifications\":[{},{},{}]}}},{\"name\":\"qsoqijgkd\",\"display\":{\"provider\":\"pazlobcufpdz\",\"resource\":\"rbt\",\"operation\":\"qqjnqgl\",\"description\":\"qgn\"},\"isDataAction\":true,\"origin\":\"ojywifsqesa\",\"properties\":{\"serviceSpecification\":{\"logSpecifications\":[{},{}],\"metricSpecifications\":[{}]}}},{\"name\":\"lhjxr\",\"display\":{\"provider\":\"kwm\",\"resource\":\"vktsizntocipao\",\"operation\":\"ajpsquc\",\"description\":\"poyfdkfogkn\"},\"isDataAction\":false,\"origin\":\"fjddeqs\",\"properties\":{\"serviceSpecification\":{\"logSpecifications\":[{},{}],\"metricSpecifications\":[{}]}}}],\"nextLink\":\"wreitj\"}") - .toObject(OperationPage.class); - Assertions.assertEquals("quvgjxpybczme", model.value().get(0).name()); - Assertions.assertEquals("tzopbsphrupidgsy", model.value().get(0).display().provider()); - Assertions.assertEquals("bejhphoycmsxa", model.value().get(0).display().resource()); - Assertions.assertEquals("bhdxbm", model.value().get(0).display().operation()); - Assertions.assertEquals("qioqjzehtbmu", model.value().get(0).display().description()); - Assertions.assertEquals(false, model.value().get(0).isDataAction()); - Assertions.assertEquals("noi", model.value().get(0).origin()); - Assertions.assertEquals("wreitj", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationPage model = new OperationPage().withValue(Arrays.asList( - new OperationInner().withName("quvgjxpybczme") - .withDisplay(new OperationDisplay().withProvider("tzopbsphrupidgsy") - .withResource("bejhphoycmsxa") - .withOperation("bhdxbm") - .withDescription("qioqjzehtbmu")) - .withIsDataAction(false) - .withOrigin("noi") - .withProperties(new OperationProperties().withServiceSpecification(new ServiceSpecification() - .withLogSpecifications(Arrays.asList(new LogSpecification(), new LogSpecification())) - .withMetricSpecifications(Arrays.asList(new MetricSpecification(), new MetricSpecification(), - new MetricSpecification())))), - new OperationInner().withName("qsoqijgkd") - .withDisplay(new OperationDisplay().withProvider("pazlobcufpdz") - .withResource("rbt") - .withOperation("qqjnqgl") - .withDescription("qgn")) - .withIsDataAction(true) - .withOrigin("ojywifsqesa") - .withProperties(new OperationProperties().withServiceSpecification(new ServiceSpecification() - .withLogSpecifications(Arrays.asList(new LogSpecification(), new LogSpecification())) - .withMetricSpecifications(Arrays.asList(new MetricSpecification())))), - new OperationInner().withName("lhjxr") - .withDisplay(new OperationDisplay().withProvider("kwm") - .withResource("vktsizntocipao") - .withOperation("ajpsquc") - .withDescription("poyfdkfogkn")) - .withIsDataAction(false) - .withOrigin("fjddeqs") - .withProperties(new OperationProperties().withServiceSpecification(new ServiceSpecification() - .withLogSpecifications(Arrays.asList(new LogSpecification(), new LogSpecification())) - .withMetricSpecifications(Arrays.asList(new MetricSpecification())))))) - .withNextLink("wreitj"); - model = BinaryData.fromObject(model).toObject(OperationPage.class); - Assertions.assertEquals("quvgjxpybczme", model.value().get(0).name()); - Assertions.assertEquals("tzopbsphrupidgsy", model.value().get(0).display().provider()); - Assertions.assertEquals("bejhphoycmsxa", model.value().get(0).display().resource()); - Assertions.assertEquals("bhdxbm", model.value().get(0).display().operation()); - Assertions.assertEquals("qioqjzehtbmu", model.value().get(0).display().description()); - Assertions.assertEquals(false, model.value().get(0).isDataAction()); - Assertions.assertEquals("noi", model.value().get(0).origin()); - Assertions.assertEquals("wreitj", model.nextLink()); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/OperationPropertiesTests.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/OperationPropertiesTests.java deleted file mode 100644 index 2bde668a0235..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/OperationPropertiesTests.java +++ /dev/null @@ -1,159 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mixedreality.models.LogSpecification; -import com.azure.resourcemanager.mixedreality.models.MetricDimension; -import com.azure.resourcemanager.mixedreality.models.MetricSpecification; -import com.azure.resourcemanager.mixedreality.models.OperationProperties; -import com.azure.resourcemanager.mixedreality.models.ServiceSpecification; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class OperationPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationProperties model = BinaryData.fromString( - "{\"serviceSpecification\":{\"logSpecifications\":[{\"name\":\"slwejdpvw\",\"displayName\":\"oqpsoa\",\"blobDuration\":\"tazak\"},{\"name\":\"lahbcryff\",\"displayName\":\"dosyg\",\"blobDuration\":\"paojakhmsbzjh\"}],\"metricSpecifications\":[{\"name\":\"vdphlxaolthqtr\",\"displayName\":\"jbp\",\"displayDescription\":\"fsinzgvfcjrwzoxx\",\"unit\":\"felluwfzitonpe\",\"aggregationType\":\"pjkjlxofpdv\",\"supportedAggregationTypes\":[\"xxypininmay\",\"uybbkpodep\",\"oginuvamiheognar\",\"zxtheotusivyevcc\"],\"supportedTimeGrainTypes\":[\"hn\",\"un\"],\"enableRegionalMdmAccount\":true,\"sourceMdmAccount\":\"zrnf\",\"sourceMdmNamespace\":\"xgispemvtzfkufu\",\"metricFilterPattern\":\"jofxqe\",\"fillGapWithZero\":false,\"category\":\"e\",\"internalMetricName\":\"hqjbasvmsmj\",\"dimensions\":[{\"name\":\"gsntnbybkzgcwr\",\"displayName\":\"lxxwrljdouskc\",\"internalName\":\"kocrcjdkwtnhx\",\"toBeExportedForShoebox\":true},{\"name\":\"iksqr\",\"displayName\":\"ssainqpjwnzll\",\"internalName\":\"mppeebvmgxs\",\"toBeExportedForShoebox\":true},{\"name\":\"qduujitcjczdz\",\"displayName\":\"ndhkrw\",\"internalName\":\"appd\",\"toBeExportedForShoebox\":true},{\"name\":\"vwrwj\",\"displayName\":\"usnhutje\",\"internalName\":\"mrldhu\",\"toBeExportedForShoebox\":false}],\"lockedAggregationType\":\"datqxhocdgeabl\"},{\"name\":\"huticndvkao\",\"displayName\":\"yiftyhxhuro\",\"displayDescription\":\"tyxolniwpwc\",\"unit\":\"jfkgiawxk\",\"aggregationType\":\"ypl\",\"supportedAggregationTypes\":[\"basyy\",\"nddhsgcbacph\"],\"supportedTimeGrainTypes\":[\"ot\"],\"enableRegionalMdmAccount\":false,\"sourceMdmAccount\":\"oulzndlikwyq\",\"sourceMdmNamespace\":\"fgibmadgakeq\",\"metricFilterPattern\":\"xybz\",\"fillGapWithZero\":false,\"category\":\"qytbciq\",\"internalMetricName\":\"uflmm\",\"dimensions\":[{\"name\":\"modmglougpb\",\"displayName\":\"tmut\",\"internalName\":\"qktapspwgcuert\",\"toBeExportedForShoebox\":false}],\"lockedAggregationType\":\"o\"}]}}") - .toObject(OperationProperties.class); - Assertions.assertEquals("slwejdpvw", model.serviceSpecification().logSpecifications().get(0).name()); - Assertions.assertEquals("oqpsoa", model.serviceSpecification().logSpecifications().get(0).displayName()); - Assertions.assertEquals("tazak", model.serviceSpecification().logSpecifications().get(0).blobDuration()); - Assertions.assertEquals("vdphlxaolthqtr", model.serviceSpecification().metricSpecifications().get(0).name()); - Assertions.assertEquals("jbp", model.serviceSpecification().metricSpecifications().get(0).displayName()); - Assertions.assertEquals("fsinzgvfcjrwzoxx", - model.serviceSpecification().metricSpecifications().get(0).displayDescription()); - Assertions.assertEquals("felluwfzitonpe", model.serviceSpecification().metricSpecifications().get(0).unit()); - Assertions.assertEquals("pjkjlxofpdv", - model.serviceSpecification().metricSpecifications().get(0).aggregationType()); - Assertions.assertEquals("xxypininmay", - model.serviceSpecification().metricSpecifications().get(0).supportedAggregationTypes().get(0)); - Assertions.assertEquals("hn", - model.serviceSpecification().metricSpecifications().get(0).supportedTimeGrainTypes().get(0)); - Assertions.assertEquals(true, - model.serviceSpecification().metricSpecifications().get(0).enableRegionalMdmAccount()); - Assertions.assertEquals("zrnf", model.serviceSpecification().metricSpecifications().get(0).sourceMdmAccount()); - Assertions.assertEquals("xgispemvtzfkufu", - model.serviceSpecification().metricSpecifications().get(0).sourceMdmNamespace()); - Assertions.assertEquals("jofxqe", - model.serviceSpecification().metricSpecifications().get(0).metricFilterPattern()); - Assertions.assertEquals(false, model.serviceSpecification().metricSpecifications().get(0).fillGapWithZero()); - Assertions.assertEquals("e", model.serviceSpecification().metricSpecifications().get(0).category()); - Assertions.assertEquals("hqjbasvmsmj", - model.serviceSpecification().metricSpecifications().get(0).internalMetricName()); - Assertions.assertEquals("gsntnbybkzgcwr", - model.serviceSpecification().metricSpecifications().get(0).dimensions().get(0).name()); - Assertions.assertEquals("lxxwrljdouskc", - model.serviceSpecification().metricSpecifications().get(0).dimensions().get(0).displayName()); - Assertions.assertEquals("kocrcjdkwtnhx", - model.serviceSpecification().metricSpecifications().get(0).dimensions().get(0).internalName()); - Assertions.assertEquals(true, - model.serviceSpecification().metricSpecifications().get(0).dimensions().get(0).toBeExportedForShoebox()); - Assertions.assertEquals("datqxhocdgeabl", - model.serviceSpecification().metricSpecifications().get(0).lockedAggregationType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationProperties model = new OperationProperties().withServiceSpecification(new ServiceSpecification() - .withLogSpecifications(Arrays - .asList( - new LogSpecification().withName("slwejdpvw").withDisplayName("oqpsoa").withBlobDuration("tazak"), - new LogSpecification() - .withName("lahbcryff") - .withDisplayName("dosyg") - .withBlobDuration("paojakhmsbzjh"))) - .withMetricSpecifications(Arrays.asList( - new MetricSpecification().withName("vdphlxaolthqtr") - .withDisplayName("jbp") - .withDisplayDescription("fsinzgvfcjrwzoxx") - .withUnit("felluwfzitonpe") - .withAggregationType("pjkjlxofpdv") - .withSupportedAggregationTypes( - Arrays.asList("xxypininmay", "uybbkpodep", "oginuvamiheognar", "zxtheotusivyevcc")) - .withSupportedTimeGrainTypes(Arrays.asList("hn", "un")) - .withEnableRegionalMdmAccount(true) - .withSourceMdmAccount("zrnf") - .withSourceMdmNamespace("xgispemvtzfkufu") - .withMetricFilterPattern("jofxqe") - .withFillGapWithZero(false) - .withCategory("e") - .withInternalMetricName("hqjbasvmsmj") - .withDimensions(Arrays.asList( - new MetricDimension().withName("gsntnbybkzgcwr") - .withDisplayName("lxxwrljdouskc") - .withInternalName("kocrcjdkwtnhx") - .withToBeExportedForShoebox(true), - new MetricDimension().withName("iksqr") - .withDisplayName("ssainqpjwnzll") - .withInternalName("mppeebvmgxs") - .withToBeExportedForShoebox(true), - new MetricDimension().withName("qduujitcjczdz") - .withDisplayName("ndhkrw") - .withInternalName("appd") - .withToBeExportedForShoebox(true), - new MetricDimension().withName("vwrwj") - .withDisplayName("usnhutje") - .withInternalName("mrldhu") - .withToBeExportedForShoebox(false))) - .withLockedAggregationType("datqxhocdgeabl"), - new MetricSpecification().withName("huticndvkao") - .withDisplayName("yiftyhxhuro") - .withDisplayDescription("tyxolniwpwc") - .withUnit("jfkgiawxk") - .withAggregationType("ypl") - .withSupportedAggregationTypes(Arrays.asList("basyy", "nddhsgcbacph")) - .withSupportedTimeGrainTypes(Arrays.asList("ot")) - .withEnableRegionalMdmAccount(false) - .withSourceMdmAccount("oulzndlikwyq") - .withSourceMdmNamespace("fgibmadgakeq") - .withMetricFilterPattern("xybz") - .withFillGapWithZero(false) - .withCategory("qytbciq") - .withInternalMetricName("uflmm") - .withDimensions(Arrays.asList(new MetricDimension().withName("modmglougpb") - .withDisplayName("tmut") - .withInternalName("qktapspwgcuert") - .withToBeExportedForShoebox(false))) - .withLockedAggregationType("o")))); - model = BinaryData.fromObject(model).toObject(OperationProperties.class); - Assertions.assertEquals("slwejdpvw", model.serviceSpecification().logSpecifications().get(0).name()); - Assertions.assertEquals("oqpsoa", model.serviceSpecification().logSpecifications().get(0).displayName()); - Assertions.assertEquals("tazak", model.serviceSpecification().logSpecifications().get(0).blobDuration()); - Assertions.assertEquals("vdphlxaolthqtr", model.serviceSpecification().metricSpecifications().get(0).name()); - Assertions.assertEquals("jbp", model.serviceSpecification().metricSpecifications().get(0).displayName()); - Assertions.assertEquals("fsinzgvfcjrwzoxx", - model.serviceSpecification().metricSpecifications().get(0).displayDescription()); - Assertions.assertEquals("felluwfzitonpe", model.serviceSpecification().metricSpecifications().get(0).unit()); - Assertions.assertEquals("pjkjlxofpdv", - model.serviceSpecification().metricSpecifications().get(0).aggregationType()); - Assertions.assertEquals("xxypininmay", - model.serviceSpecification().metricSpecifications().get(0).supportedAggregationTypes().get(0)); - Assertions.assertEquals("hn", - model.serviceSpecification().metricSpecifications().get(0).supportedTimeGrainTypes().get(0)); - Assertions.assertEquals(true, - model.serviceSpecification().metricSpecifications().get(0).enableRegionalMdmAccount()); - Assertions.assertEquals("zrnf", model.serviceSpecification().metricSpecifications().get(0).sourceMdmAccount()); - Assertions.assertEquals("xgispemvtzfkufu", - model.serviceSpecification().metricSpecifications().get(0).sourceMdmNamespace()); - Assertions.assertEquals("jofxqe", - model.serviceSpecification().metricSpecifications().get(0).metricFilterPattern()); - Assertions.assertEquals(false, model.serviceSpecification().metricSpecifications().get(0).fillGapWithZero()); - Assertions.assertEquals("e", model.serviceSpecification().metricSpecifications().get(0).category()); - Assertions.assertEquals("hqjbasvmsmj", - model.serviceSpecification().metricSpecifications().get(0).internalMetricName()); - Assertions.assertEquals("gsntnbybkzgcwr", - model.serviceSpecification().metricSpecifications().get(0).dimensions().get(0).name()); - Assertions.assertEquals("lxxwrljdouskc", - model.serviceSpecification().metricSpecifications().get(0).dimensions().get(0).displayName()); - Assertions.assertEquals("kocrcjdkwtnhx", - model.serviceSpecification().metricSpecifications().get(0).dimensions().get(0).internalName()); - Assertions.assertEquals(true, - model.serviceSpecification().metricSpecifications().get(0).dimensions().get(0).toBeExportedForShoebox()); - Assertions.assertEquals("datqxhocdgeabl", - model.serviceSpecification().metricSpecifications().get(0).lockedAggregationType()); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/OperationsListMockTests.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/OperationsListMockTests.java deleted file mode 100644 index 0a40ba76fe3c..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/OperationsListMockTests.java +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.mixedreality.MixedRealityManager; -import com.azure.resourcemanager.mixedreality.models.Operation; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class OperationsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"name\":\"d\",\"display\":{\"provider\":\"avxbniwdjswztsdb\",\"resource\":\"gnxytxhpzxbz\",\"operation\":\"fzab\",\"description\":\"lcuhxwtctyqiklb\"},\"isDataAction\":false,\"origin\":\"lwzbhvgyugu\",\"properties\":{\"serviceSpecification\":{\"logSpecifications\":[{\"name\":\"ss\",\"displayName\":\"ukkfplgmgs\",\"blobDuration\":\"kjz\"},{\"name\":\"es\",\"displayName\":\"vlopwiyighx\",\"blobDuration\":\"dwzbaiue\"},{\"name\":\"a\",\"displayName\":\"nyqupedeojnabck\",\"blobDuration\":\"mtxpsiebtfh\"}],\"metricSpecifications\":[{\"name\":\"apskrdqm\",\"displayName\":\"jdhtldwkyzxu\",\"displayDescription\":\"kn\",\"unit\":\"scwsv\",\"aggregationType\":\"otogtwrupqs\",\"supportedAggregationTypes\":[\"micykvceoveilo\"],\"supportedTimeGrainTypes\":[\"tyfjfcnjbkcnxdhb\"],\"enableRegionalMdmAccount\":true,\"sourceMdmAccount\":\"h\",\"sourceMdmNamespace\":\"pnvjtoqnermclf\",\"metricFilterPattern\":\"phoxus\",\"fillGapWithZero\":false,\"category\":\"bgyepsbj\",\"internalMetricName\":\"zq\",\"dimensions\":[{},{},{},{}],\"lockedAggregationType\":\"wpmueefj\"}]}}}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MixedRealityManager manager = MixedRealityManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("d", response.iterator().next().name()); - Assertions.assertEquals("avxbniwdjswztsdb", response.iterator().next().display().provider()); - Assertions.assertEquals("gnxytxhpzxbz", response.iterator().next().display().resource()); - Assertions.assertEquals("fzab", response.iterator().next().display().operation()); - Assertions.assertEquals("lcuhxwtctyqiklb", response.iterator().next().display().description()); - Assertions.assertEquals(false, response.iterator().next().isDataAction()); - Assertions.assertEquals("lwzbhvgyugu", response.iterator().next().origin()); - Assertions.assertEquals("ss", - response.iterator().next().properties().serviceSpecification().logSpecifications().get(0).name()); - Assertions.assertEquals("ukkfplgmgs", - response.iterator().next().properties().serviceSpecification().logSpecifications().get(0).displayName()); - Assertions.assertEquals("kjz", - response.iterator().next().properties().serviceSpecification().logSpecifications().get(0).blobDuration()); - Assertions.assertEquals("apskrdqm", - response.iterator().next().properties().serviceSpecification().metricSpecifications().get(0).name()); - Assertions.assertEquals("jdhtldwkyzxu", - response.iterator().next().properties().serviceSpecification().metricSpecifications().get(0).displayName()); - Assertions.assertEquals("kn", - response.iterator() - .next() - .properties() - .serviceSpecification() - .metricSpecifications() - .get(0) - .displayDescription()); - Assertions.assertEquals("scwsv", - response.iterator().next().properties().serviceSpecification().metricSpecifications().get(0).unit()); - Assertions.assertEquals("otogtwrupqs", - response.iterator() - .next() - .properties() - .serviceSpecification() - .metricSpecifications() - .get(0) - .aggregationType()); - Assertions.assertEquals("micykvceoveilo", - response.iterator() - .next() - .properties() - .serviceSpecification() - .metricSpecifications() - .get(0) - .supportedAggregationTypes() - .get(0)); - Assertions.assertEquals("tyfjfcnjbkcnxdhb", - response.iterator() - .next() - .properties() - .serviceSpecification() - .metricSpecifications() - .get(0) - .supportedTimeGrainTypes() - .get(0)); - Assertions.assertEquals(true, - response.iterator() - .next() - .properties() - .serviceSpecification() - .metricSpecifications() - .get(0) - .enableRegionalMdmAccount()); - Assertions.assertEquals("h", - response.iterator() - .next() - .properties() - .serviceSpecification() - .metricSpecifications() - .get(0) - .sourceMdmAccount()); - Assertions.assertEquals("pnvjtoqnermclf", - response.iterator() - .next() - .properties() - .serviceSpecification() - .metricSpecifications() - .get(0) - .sourceMdmNamespace()); - Assertions.assertEquals("phoxus", - response.iterator() - .next() - .properties() - .serviceSpecification() - .metricSpecifications() - .get(0) - .metricFilterPattern()); - Assertions.assertEquals(false, - response.iterator() - .next() - .properties() - .serviceSpecification() - .metricSpecifications() - .get(0) - .fillGapWithZero()); - Assertions.assertEquals("bgyepsbj", - response.iterator().next().properties().serviceSpecification().metricSpecifications().get(0).category()); - Assertions.assertEquals("zq", - response.iterator() - .next() - .properties() - .serviceSpecification() - .metricSpecifications() - .get(0) - .internalMetricName()); - Assertions.assertEquals("wpmueefj", - response.iterator() - .next() - .properties() - .serviceSpecification() - .metricSpecifications() - .get(0) - .lockedAggregationType()); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountInnerTests.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountInnerTests.java deleted file mode 100644 index 46518c38f974..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountInnerTests.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mixedreality.fluent.models.RemoteRenderingAccountInner; -import com.azure.resourcemanager.mixedreality.models.Identity; -import com.azure.resourcemanager.mixedreality.models.ResourceIdentityType; -import com.azure.resourcemanager.mixedreality.models.Sku; -import com.azure.resourcemanager.mixedreality.models.SkuTier; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class RemoteRenderingAccountInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RemoteRenderingAccountInner model = BinaryData.fromString( - "{\"properties\":{\"storageAccountName\":\"jyoxgvclt\",\"accountId\":\"sncghkjeszz\",\"accountDomain\":\"ijhtxf\"},\"identity\":{\"principalId\":\"bfs\",\"tenantId\":\"nehmpvecx\",\"type\":\"SystemAssigned\"},\"plan\":{\"principalId\":\"fqkkr\",\"tenantId\":\"pukgriwflzlfb\",\"type\":\"SystemAssigned\"},\"sku\":{\"name\":\"zycispn\",\"tier\":\"Basic\",\"size\":\"mgkbrpyydhibn\",\"family\":\"qkpikadrgvtqagnb\",\"capacity\":855671205},\"kind\":{\"name\":\"ijggmebfsiar\",\"tier\":\"Standard\",\"size\":\"cvpnazzmhjrunmpx\",\"family\":\"dbhrbnlankxm\",\"capacity\":266718281},\"location\":\"bhenbtkcxywnyt\",\"tags\":{\"qidybyx\":\"yn\",\"aaxdbabphlwrq\":\"zfcl\",\"hsucoc\":\"fkts\",\"ckzywbiexzfeyue\":\"nyyazttbtwwrqpue\"},\"id\":\"xibxujwbhqwalm\",\"name\":\"zyoxaepdkzjan\",\"type\":\"ux\"}") - .toObject(RemoteRenderingAccountInner.class); - Assertions.assertEquals("bhenbtkcxywnyt", model.location()); - Assertions.assertEquals("yn", model.tags().get("qidybyx")); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.identity().type()); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.plan().type()); - Assertions.assertEquals("zycispn", model.sku().name()); - Assertions.assertEquals(SkuTier.BASIC, model.sku().tier()); - Assertions.assertEquals("mgkbrpyydhibn", model.sku().size()); - Assertions.assertEquals("qkpikadrgvtqagnb", model.sku().family()); - Assertions.assertEquals(855671205, model.sku().capacity()); - Assertions.assertEquals("ijggmebfsiar", model.kind().name()); - Assertions.assertEquals(SkuTier.STANDARD, model.kind().tier()); - Assertions.assertEquals("cvpnazzmhjrunmpx", model.kind().size()); - Assertions.assertEquals("dbhrbnlankxm", model.kind().family()); - Assertions.assertEquals(266718281, model.kind().capacity()); - Assertions.assertEquals("jyoxgvclt", model.storageAccountName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RemoteRenderingAccountInner model = new RemoteRenderingAccountInner().withLocation("bhenbtkcxywnyt") - .withTags(mapOf("qidybyx", "yn", "aaxdbabphlwrq", "zfcl", "hsucoc", "fkts", "ckzywbiexzfeyue", - "nyyazttbtwwrqpue")) - .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .withPlan(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .withSku(new Sku().withName("zycispn") - .withTier(SkuTier.BASIC) - .withSize("mgkbrpyydhibn") - .withFamily("qkpikadrgvtqagnb") - .withCapacity(855671205)) - .withKind(new Sku().withName("ijggmebfsiar") - .withTier(SkuTier.STANDARD) - .withSize("cvpnazzmhjrunmpx") - .withFamily("dbhrbnlankxm") - .withCapacity(266718281)) - .withStorageAccountName("jyoxgvclt"); - model = BinaryData.fromObject(model).toObject(RemoteRenderingAccountInner.class); - Assertions.assertEquals("bhenbtkcxywnyt", model.location()); - Assertions.assertEquals("yn", model.tags().get("qidybyx")); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.identity().type()); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.plan().type()); - Assertions.assertEquals("zycispn", model.sku().name()); - Assertions.assertEquals(SkuTier.BASIC, model.sku().tier()); - Assertions.assertEquals("mgkbrpyydhibn", model.sku().size()); - Assertions.assertEquals("qkpikadrgvtqagnb", model.sku().family()); - Assertions.assertEquals(855671205, model.sku().capacity()); - Assertions.assertEquals("ijggmebfsiar", model.kind().name()); - Assertions.assertEquals(SkuTier.STANDARD, model.kind().tier()); - Assertions.assertEquals("cvpnazzmhjrunmpx", model.kind().size()); - Assertions.assertEquals("dbhrbnlankxm", model.kind().family()); - Assertions.assertEquals(266718281, model.kind().capacity()); - Assertions.assertEquals("jyoxgvclt", model.storageAccountName()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountPageTests.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountPageTests.java deleted file mode 100644 index 9b559186f586..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountPageTests.java +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mixedreality.fluent.models.RemoteRenderingAccountInner; -import com.azure.resourcemanager.mixedreality.models.Identity; -import com.azure.resourcemanager.mixedreality.models.RemoteRenderingAccountPage; -import com.azure.resourcemanager.mixedreality.models.ResourceIdentityType; -import com.azure.resourcemanager.mixedreality.models.Sku; -import com.azure.resourcemanager.mixedreality.models.SkuTier; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class RemoteRenderingAccountPageTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RemoteRenderingAccountPage model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"storageAccountName\":\"yzydagfuaxbezyi\",\"accountId\":\"kktwhrdxw\",\"accountDomain\":\"wqsmbsur\"},\"identity\":{\"principalId\":\"moryocfsfksym\",\"tenantId\":\"ys\",\"type\":\"SystemAssigned\"},\"plan\":{\"principalId\":\"xhqyudxorrqnb\",\"tenantId\":\"czvyifq\",\"type\":\"SystemAssigned\"},\"sku\":{\"name\":\"vjsllrmvvdfw\",\"tier\":\"Premium\",\"size\":\"n\",\"family\":\"lexxbczwtru\",\"capacity\":223654021},\"kind\":{\"name\":\"bq\",\"tier\":\"Premium\",\"size\":\"vmyokacspkwl\",\"family\":\"dobpxjmflbvvn\",\"capacity\":1044580515},\"location\":\"cciw\",\"tags\":{\"foskghsauuimj\":\"uqkhrsajiwku\"},\"id\":\"vxieduugidyj\",\"name\":\"rfbyaosvexcso\",\"type\":\"pclhocohslk\"},{\"properties\":{\"storageAccountName\":\"eggzfb\",\"accountId\":\"fmvfaxkffeiit\",\"accountDomain\":\"vmezy\"},\"identity\":{\"principalId\":\"xmzsbbzogg\",\"tenantId\":\"rxwburv\",\"type\":\"SystemAssigned\"},\"plan\":{\"principalId\":\"spyd\",\"tenantId\":\"koen\",\"type\":\"SystemAssigned\"},\"sku\":{\"name\":\"nvudwtiukb\",\"tier\":\"Standard\",\"size\":\"kpoc\",\"family\":\"azyxoegukg\",\"capacity\":642461794},\"kind\":{\"name\":\"ucgygevqz\",\"tier\":\"Free\",\"size\":\"mrbpizcdrqj\",\"family\":\"pyd\",\"capacity\":1305817330},\"location\":\"xdeoejzic\",\"tags\":{\"bkh\":\"sjttgzfbish\"},\"id\":\"jdeyeamdpha\",\"name\":\"alpbuxwgipwhon\",\"type\":\"wkgshwa\"},{\"properties\":{\"storageAccountName\":\"xzbinjeputt\",\"accountId\":\"ywnuzoq\",\"accountDomain\":\"iyqzrnk\"},\"identity\":{\"principalId\":\"yx\",\"tenantId\":\"hzls\",\"type\":\"SystemAssigned\"},\"plan\":{\"principalId\":\"qqn\",\"tenantId\":\"lryav\",\"type\":\"SystemAssigned\"},\"sku\":{\"name\":\"unmmq\",\"tier\":\"Free\",\"size\":\"zko\",\"family\":\"cukoklyaxuconu\",\"capacity\":447504444},\"kind\":{\"name\":\"kbeype\",\"tier\":\"Standard\",\"size\":\"mwvvjektcxsenhw\",\"family\":\"s\",\"capacity\":1160903159},\"location\":\"pwvlqdq\",\"tags\":{\"fcivfsnkym\":\"qylihkaetckt\",\"jf\":\"ctq\",\"fuwutttxf\":\"ebrjcxe\"},\"id\":\"jrbirphxepcyv\",\"name\":\"hfnljkyq\",\"type\":\"j\"}],\"nextLink\":\"ujqgidok\"}") - .toObject(RemoteRenderingAccountPage.class); - Assertions.assertEquals("cciw", model.value().get(0).location()); - Assertions.assertEquals("uqkhrsajiwku", model.value().get(0).tags().get("foskghsauuimj")); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.value().get(0).identity().type()); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.value().get(0).plan().type()); - Assertions.assertEquals("vjsllrmvvdfw", model.value().get(0).sku().name()); - Assertions.assertEquals(SkuTier.PREMIUM, model.value().get(0).sku().tier()); - Assertions.assertEquals("n", model.value().get(0).sku().size()); - Assertions.assertEquals("lexxbczwtru", model.value().get(0).sku().family()); - Assertions.assertEquals(223654021, model.value().get(0).sku().capacity()); - Assertions.assertEquals("bq", model.value().get(0).kind().name()); - Assertions.assertEquals(SkuTier.PREMIUM, model.value().get(0).kind().tier()); - Assertions.assertEquals("vmyokacspkwl", model.value().get(0).kind().size()); - Assertions.assertEquals("dobpxjmflbvvn", model.value().get(0).kind().family()); - Assertions.assertEquals(1044580515, model.value().get(0).kind().capacity()); - Assertions.assertEquals("yzydagfuaxbezyi", model.value().get(0).storageAccountName()); - Assertions.assertEquals("ujqgidok", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RemoteRenderingAccountPage model = new RemoteRenderingAccountPage().withValue(Arrays.asList( - new RemoteRenderingAccountInner().withLocation("cciw") - .withTags(mapOf("foskghsauuimj", "uqkhrsajiwku")) - .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .withPlan(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .withSku(new Sku().withName("vjsllrmvvdfw") - .withTier(SkuTier.PREMIUM) - .withSize("n") - .withFamily("lexxbczwtru") - .withCapacity(223654021)) - .withKind(new Sku().withName("bq") - .withTier(SkuTier.PREMIUM) - .withSize("vmyokacspkwl") - .withFamily("dobpxjmflbvvn") - .withCapacity(1044580515)) - .withStorageAccountName("yzydagfuaxbezyi"), - new RemoteRenderingAccountInner().withLocation("xdeoejzic") - .withTags(mapOf("bkh", "sjttgzfbish")) - .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .withPlan(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .withSku(new Sku().withName("nvudwtiukb") - .withTier(SkuTier.STANDARD) - .withSize("kpoc") - .withFamily("azyxoegukg") - .withCapacity(642461794)) - .withKind(new Sku().withName("ucgygevqz") - .withTier(SkuTier.FREE) - .withSize("mrbpizcdrqj") - .withFamily("pyd") - .withCapacity(1305817330)) - .withStorageAccountName("eggzfb"), - new RemoteRenderingAccountInner().withLocation("pwvlqdq") - .withTags(mapOf("fcivfsnkym", "qylihkaetckt", "jf", "ctq", "fuwutttxf", "ebrjcxe")) - .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .withPlan(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .withSku(new Sku().withName("unmmq") - .withTier(SkuTier.FREE) - .withSize("zko") - .withFamily("cukoklyaxuconu") - .withCapacity(447504444)) - .withKind(new Sku().withName("kbeype") - .withTier(SkuTier.STANDARD) - .withSize("mwvvjektcxsenhw") - .withFamily("s") - .withCapacity(1160903159)) - .withStorageAccountName("xzbinjeputt"))) - .withNextLink("ujqgidok"); - model = BinaryData.fromObject(model).toObject(RemoteRenderingAccountPage.class); - Assertions.assertEquals("cciw", model.value().get(0).location()); - Assertions.assertEquals("uqkhrsajiwku", model.value().get(0).tags().get("foskghsauuimj")); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.value().get(0).identity().type()); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.value().get(0).plan().type()); - Assertions.assertEquals("vjsllrmvvdfw", model.value().get(0).sku().name()); - Assertions.assertEquals(SkuTier.PREMIUM, model.value().get(0).sku().tier()); - Assertions.assertEquals("n", model.value().get(0).sku().size()); - Assertions.assertEquals("lexxbczwtru", model.value().get(0).sku().family()); - Assertions.assertEquals(223654021, model.value().get(0).sku().capacity()); - Assertions.assertEquals("bq", model.value().get(0).kind().name()); - Assertions.assertEquals(SkuTier.PREMIUM, model.value().get(0).kind().tier()); - Assertions.assertEquals("vmyokacspkwl", model.value().get(0).kind().size()); - Assertions.assertEquals("dobpxjmflbvvn", model.value().get(0).kind().family()); - Assertions.assertEquals(1044580515, model.value().get(0).kind().capacity()); - Assertions.assertEquals("yzydagfuaxbezyi", model.value().get(0).storageAccountName()); - Assertions.assertEquals("ujqgidok", model.nextLink()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsCreateWithResponseMockTests.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsCreateWithResponseMockTests.java deleted file mode 100644 index fbe3b8a07809..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsCreateWithResponseMockTests.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.mixedreality.MixedRealityManager; -import com.azure.resourcemanager.mixedreality.models.Identity; -import com.azure.resourcemanager.mixedreality.models.RemoteRenderingAccount; -import com.azure.resourcemanager.mixedreality.models.ResourceIdentityType; -import com.azure.resourcemanager.mixedreality.models.Sku; -import com.azure.resourcemanager.mixedreality.models.SkuTier; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class RemoteRenderingAccountsCreateWithResponseMockTests { - @Test - public void testCreateWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"storageAccountName\":\"lyc\",\"accountId\":\"uhpkxkgymar\",\"accountDomain\":\"n\"},\"identity\":{\"principalId\":\"qugjhkycube\",\"tenantId\":\"gssofwq\",\"type\":\"SystemAssigned\"},\"plan\":{\"principalId\":\"krmnjijpxacqqud\",\"tenantId\":\"byxbaaabjy\",\"type\":\"SystemAssigned\"},\"sku\":{\"name\":\"fimrzrtuzqogse\",\"tier\":\"Standard\",\"size\":\"fdnw\",\"family\":\"mewzsyyc\",\"capacity\":1576556557},\"kind\":{\"name\":\"oibjudpfrxtrthz\",\"tier\":\"Free\",\"size\":\"dwkqbrq\",\"family\":\"paxh\",\"capacity\":1580176854},\"location\":\"livpdt\",\"tags\":{\"d\":\"q\"},\"id\":\"oaxoruzfgsqu\",\"name\":\"fxrxxle\",\"type\":\"tramxjez\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MixedRealityManager manager = MixedRealityManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - RemoteRenderingAccount response = manager.remoteRenderingAccounts() - .define("edndr") - .withRegion("l") - .withExistingResourceGroup("hyrnxxmu") - .withTags(mapOf("ag", "v", "cktqumiekkezzi", "rvimjwosytxitcsk", "bdunygaeqid", "hlyfjhdgqgg", "a", - "qfatpxllrxcyjm")) - .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .withPlan(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .withSku(new Sku().withName("eyfkzikfja") - .withTier(SkuTier.STANDARD) - .withSize("ivx") - .withFamily("zel") - .withCapacity(1240770029)) - .withKind(new Sku().withName("elsfeaen") - .withTier(SkuTier.PREMIUM) - .withSize("atklddxbjhwuaa") - .withFamily("zjosp") - .withCapacity(1616817744)) - .withStorageAccountName("tkwqqtchealm") - .create(); - - Assertions.assertEquals("livpdt", response.location()); - Assertions.assertEquals("q", response.tags().get("d")); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, response.identity().type()); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, response.plan().type()); - Assertions.assertEquals("fimrzrtuzqogse", response.sku().name()); - Assertions.assertEquals(SkuTier.STANDARD, response.sku().tier()); - Assertions.assertEquals("fdnw", response.sku().size()); - Assertions.assertEquals("mewzsyyc", response.sku().family()); - Assertions.assertEquals(1576556557, response.sku().capacity()); - Assertions.assertEquals("oibjudpfrxtrthz", response.kind().name()); - Assertions.assertEquals(SkuTier.FREE, response.kind().tier()); - Assertions.assertEquals("dwkqbrq", response.kind().size()); - Assertions.assertEquals("paxh", response.kind().family()); - Assertions.assertEquals(1580176854, response.kind().capacity()); - Assertions.assertEquals("lyc", response.storageAccountName()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsDeleteByResourceGroupWithResponseMockTests.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsDeleteByResourceGroupWithResponseMockTests.java deleted file mode 100644 index a01326542477..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsDeleteByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.mixedreality.MixedRealityManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class RemoteRenderingAccountsDeleteByResourceGroupWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MixedRealityManager manager = MixedRealityManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.remoteRenderingAccounts() - .deleteByResourceGroupWithResponse("koymkcd", "h", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsGetByResourceGroupWithResponseMockTests.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index 6f06b83b1145..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsGetByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.mixedreality.MixedRealityManager; -import com.azure.resourcemanager.mixedreality.models.RemoteRenderingAccount; -import com.azure.resourcemanager.mixedreality.models.ResourceIdentityType; -import com.azure.resourcemanager.mixedreality.models.SkuTier; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class RemoteRenderingAccountsGetByResourceGroupWithResponseMockTests { - @Test - public void testGetByResourceGroupWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"storageAccountName\":\"ywsuwsy\",\"accountId\":\"ndsytgadg\",\"accountDomain\":\"aeaeneqnzarrw\"},\"identity\":{\"principalId\":\"uijfqk\",\"tenantId\":\"e\",\"type\":\"SystemAssigned\"},\"plan\":{\"principalId\":\"pubjibw\",\"tenantId\":\"f\",\"type\":\"SystemAssigned\"},\"sku\":{\"name\":\"kvpuvksgplsaknyn\",\"tier\":\"Free\",\"size\":\"ljphuopxodl\",\"family\":\"ynt\",\"capacity\":863114887},\"kind\":{\"name\":\"hleosjsw\",\"tier\":\"Premium\",\"size\":\"lyzrpzbchckqqzqi\",\"family\":\"iysui\",\"capacity\":2121235922},\"location\":\"ked\",\"tags\":{\"pyy\":\"rwyhqmibzyhwitsm\",\"mwzn\":\"pcdpumnz\",\"rgjhxb\":\"abikns\"},\"id\":\"dtlwwrlkd\",\"name\":\"tncvokot\",\"type\":\"lxdy\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MixedRealityManager manager = MixedRealityManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - RemoteRenderingAccount response = manager.remoteRenderingAccounts() - .getByResourceGroupWithResponse("pkkpw", "reqnovvqfov", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("ked", response.location()); - Assertions.assertEquals("rwyhqmibzyhwitsm", response.tags().get("pyy")); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, response.identity().type()); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, response.plan().type()); - Assertions.assertEquals("kvpuvksgplsaknyn", response.sku().name()); - Assertions.assertEquals(SkuTier.FREE, response.sku().tier()); - Assertions.assertEquals("ljphuopxodl", response.sku().size()); - Assertions.assertEquals("ynt", response.sku().family()); - Assertions.assertEquals(863114887, response.sku().capacity()); - Assertions.assertEquals("hleosjsw", response.kind().name()); - Assertions.assertEquals(SkuTier.PREMIUM, response.kind().tier()); - Assertions.assertEquals("lyzrpzbchckqqzqi", response.kind().size()); - Assertions.assertEquals("iysui", response.kind().family()); - Assertions.assertEquals(2121235922, response.kind().capacity()); - Assertions.assertEquals("ywsuwsy", response.storageAccountName()); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsListByResourceGroupMockTests.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsListByResourceGroupMockTests.java deleted file mode 100644 index 860ea4336c97..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsListByResourceGroupMockTests.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.mixedreality.MixedRealityManager; -import com.azure.resourcemanager.mixedreality.models.RemoteRenderingAccount; -import com.azure.resourcemanager.mixedreality.models.ResourceIdentityType; -import com.azure.resourcemanager.mixedreality.models.SkuTier; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class RemoteRenderingAccountsListByResourceGroupMockTests { - @Test - public void testListByResourceGroup() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"storageAccountName\":\"sluicpdggkzz\",\"accountId\":\"mbmpaxmodfvuefy\",\"accountDomain\":\"bpfvm\"},\"identity\":{\"principalId\":\"rfouyftaakcpw\",\"tenantId\":\"zvqtmnubexkp\",\"type\":\"SystemAssigned\"},\"plan\":{\"principalId\":\"ndjmquxvyp\",\"tenantId\":\"gkopkwhojvpajqgx\",\"type\":\"SystemAssigned\"},\"sku\":{\"name\":\"cmbqfqvmk\",\"tier\":\"Free\",\"size\":\"apvhelxprgly\",\"family\":\"dd\",\"capacity\":1454263457},\"kind\":{\"name\":\"cuejrjxgci\",\"tier\":\"Free\",\"size\":\"hos\",\"family\":\"dqrhzoymib\",\"capacity\":1056733583},\"location\":\"ibahwflus\",\"tags\":{\"expbtg\":\"mhrkwofyyvoqacp\",\"nwashrtd\":\"wbwo\",\"ulpiuj\":\"kcnqxwbpo\",\"obyu\":\"aasipqi\"},\"id\":\"erpqlpqwcciuqg\",\"name\":\"dbutauvfbtkuwhh\",\"type\":\"hykojoxafnndlpic\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MixedRealityManager manager = MixedRealityManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.remoteRenderingAccounts().listByResourceGroup("rpkhjwn", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("ibahwflus", response.iterator().next().location()); - Assertions.assertEquals("mhrkwofyyvoqacp", response.iterator().next().tags().get("expbtg")); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, response.iterator().next().identity().type()); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, response.iterator().next().plan().type()); - Assertions.assertEquals("cmbqfqvmk", response.iterator().next().sku().name()); - Assertions.assertEquals(SkuTier.FREE, response.iterator().next().sku().tier()); - Assertions.assertEquals("apvhelxprgly", response.iterator().next().sku().size()); - Assertions.assertEquals("dd", response.iterator().next().sku().family()); - Assertions.assertEquals(1454263457, response.iterator().next().sku().capacity()); - Assertions.assertEquals("cuejrjxgci", response.iterator().next().kind().name()); - Assertions.assertEquals(SkuTier.FREE, response.iterator().next().kind().tier()); - Assertions.assertEquals("hos", response.iterator().next().kind().size()); - Assertions.assertEquals("dqrhzoymib", response.iterator().next().kind().family()); - Assertions.assertEquals(1056733583, response.iterator().next().kind().capacity()); - Assertions.assertEquals("sluicpdggkzz", response.iterator().next().storageAccountName()); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsListMockTests.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsListMockTests.java deleted file mode 100644 index 5320bda9894e..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsListMockTests.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.mixedreality.MixedRealityManager; -import com.azure.resourcemanager.mixedreality.models.RemoteRenderingAccount; -import com.azure.resourcemanager.mixedreality.models.ResourceIdentityType; -import com.azure.resourcemanager.mixedreality.models.SkuTier; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class RemoteRenderingAccountsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"storageAccountName\":\"mubyynt\",\"accountId\":\"rbqtkoie\",\"accountDomain\":\"eotg\"},\"identity\":{\"principalId\":\"ltmuwlauwzizx\",\"tenantId\":\"pgcjefuzmuvp\",\"type\":\"SystemAssigned\"},\"plan\":{\"principalId\":\"morppxebmnzbtbh\",\"tenantId\":\"glkfg\",\"type\":\"SystemAssigned\"},\"sku\":{\"name\":\"euel\",\"tier\":\"Free\",\"size\":\"dyhtozfikdowwquu\",\"family\":\"zx\",\"capacity\":1297043875},\"kind\":{\"name\":\"thhqzonosggbh\",\"tier\":\"Premium\",\"size\":\"wdsjnkalju\",\"family\":\"iswac\",\"capacity\":916120827},\"location\":\"k\",\"tags\":{\"ppfufl\":\"wkfvhqcrailvp\",\"gafcnihgwqapnedg\":\"wdmhdlxyjrxs\",\"cvdrhvoodsot\":\"bcvkcvqvpkeq\"},\"id\":\"obzdopcjwvnhdl\",\"name\":\"wmgxcxrsl\",\"type\":\"mutwuoe\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MixedRealityManager manager = MixedRealityManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.remoteRenderingAccounts().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("k", response.iterator().next().location()); - Assertions.assertEquals("wkfvhqcrailvp", response.iterator().next().tags().get("ppfufl")); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, response.iterator().next().identity().type()); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, response.iterator().next().plan().type()); - Assertions.assertEquals("euel", response.iterator().next().sku().name()); - Assertions.assertEquals(SkuTier.FREE, response.iterator().next().sku().tier()); - Assertions.assertEquals("dyhtozfikdowwquu", response.iterator().next().sku().size()); - Assertions.assertEquals("zx", response.iterator().next().sku().family()); - Assertions.assertEquals(1297043875, response.iterator().next().sku().capacity()); - Assertions.assertEquals("thhqzonosggbh", response.iterator().next().kind().name()); - Assertions.assertEquals(SkuTier.PREMIUM, response.iterator().next().kind().tier()); - Assertions.assertEquals("wdsjnkalju", response.iterator().next().kind().size()); - Assertions.assertEquals("iswac", response.iterator().next().kind().family()); - Assertions.assertEquals(916120827, response.iterator().next().kind().capacity()); - Assertions.assertEquals("mubyynt", response.iterator().next().storageAccountName()); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/ResourceProvidersCheckNameAvailabilityLocalWithResponseMockTests.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/ResourceProvidersCheckNameAvailabilityLocalWithResponseMockTests.java deleted file mode 100644 index 919216aa4fdf..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/ResourceProvidersCheckNameAvailabilityLocalWithResponseMockTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.mixedreality.MixedRealityManager; -import com.azure.resourcemanager.mixedreality.models.CheckNameAvailabilityRequest; -import com.azure.resourcemanager.mixedreality.models.CheckNameAvailabilityResponse; -import com.azure.resourcemanager.mixedreality.models.NameUnavailableReason; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ResourceProvidersCheckNameAvailabilityLocalWithResponseMockTests { - @Test - public void testCheckNameAvailabilityLocalWithResponse() throws Exception { - String responseStr = "{\"nameAvailable\":false,\"reason\":\"Invalid\",\"message\":\"g\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MixedRealityManager manager = MixedRealityManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CheckNameAvailabilityResponse response = manager.resourceProviders() - .checkNameAvailabilityLocalWithResponse("wfqkquj", - new CheckNameAvailabilityRequest().withName("dsuyonobgla").withType("cq"), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(false, response.nameAvailable()); - Assertions.assertEquals(NameUnavailableReason.INVALID, response.reason()); - Assertions.assertEquals("g", response.message()); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/ServiceSpecificationTests.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/ServiceSpecificationTests.java deleted file mode 100644 index 49ced9616e91..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/ServiceSpecificationTests.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mixedreality.models.LogSpecification; -import com.azure.resourcemanager.mixedreality.models.MetricDimension; -import com.azure.resourcemanager.mixedreality.models.MetricSpecification; -import com.azure.resourcemanager.mixedreality.models.ServiceSpecification; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ServiceSpecificationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServiceSpecification model = BinaryData.fromString( - "{\"logSpecifications\":[{\"name\":\"hbmdgbbjfdd\",\"displayName\":\"bmbexppbhtqqro\",\"blobDuration\":\"p\"}],\"metricSpecifications\":[{\"name\":\"lgbquxig\",\"displayName\":\"jgzjaoyfhrtx\",\"displayDescription\":\"n\",\"unit\":\"kujysvlejuvfq\",\"aggregationType\":\"rlyxwjkcprbnw\",\"supportedAggregationTypes\":[\"jvtbvpyss\",\"dnrujqguhmuouqfp\"],\"supportedTimeGrainTypes\":[\"wbnguitnwui\"],\"enableRegionalMdmAccount\":false,\"sourceMdmAccount\":\"x\",\"sourceMdmNamespace\":\"izuckyfihrfidfvz\",\"metricFilterPattern\":\"zuhtymwisdkfthwx\",\"fillGapWithZero\":false,\"category\":\"i\",\"internalMetricName\":\"opvkmijcm\",\"dimensions\":[{\"name\":\"ufufsrp\",\"displayName\":\"zidnsezcxtbzsgfy\",\"internalName\":\"sne\",\"toBeExportedForShoebox\":true}],\"lockedAggregationType\":\"z\"}]}") - .toObject(ServiceSpecification.class); - Assertions.assertEquals("hbmdgbbjfdd", model.logSpecifications().get(0).name()); - Assertions.assertEquals("bmbexppbhtqqro", model.logSpecifications().get(0).displayName()); - Assertions.assertEquals("p", model.logSpecifications().get(0).blobDuration()); - Assertions.assertEquals("lgbquxig", model.metricSpecifications().get(0).name()); - Assertions.assertEquals("jgzjaoyfhrtx", model.metricSpecifications().get(0).displayName()); - Assertions.assertEquals("n", model.metricSpecifications().get(0).displayDescription()); - Assertions.assertEquals("kujysvlejuvfq", model.metricSpecifications().get(0).unit()); - Assertions.assertEquals("rlyxwjkcprbnw", model.metricSpecifications().get(0).aggregationType()); - Assertions.assertEquals("jvtbvpyss", model.metricSpecifications().get(0).supportedAggregationTypes().get(0)); - Assertions.assertEquals("wbnguitnwui", model.metricSpecifications().get(0).supportedTimeGrainTypes().get(0)); - Assertions.assertEquals(false, model.metricSpecifications().get(0).enableRegionalMdmAccount()); - Assertions.assertEquals("x", model.metricSpecifications().get(0).sourceMdmAccount()); - Assertions.assertEquals("izuckyfihrfidfvz", model.metricSpecifications().get(0).sourceMdmNamespace()); - Assertions.assertEquals("zuhtymwisdkfthwx", model.metricSpecifications().get(0).metricFilterPattern()); - Assertions.assertEquals(false, model.metricSpecifications().get(0).fillGapWithZero()); - Assertions.assertEquals("i", model.metricSpecifications().get(0).category()); - Assertions.assertEquals("opvkmijcm", model.metricSpecifications().get(0).internalMetricName()); - Assertions.assertEquals("ufufsrp", model.metricSpecifications().get(0).dimensions().get(0).name()); - Assertions.assertEquals("zidnsezcxtbzsgfy", - model.metricSpecifications().get(0).dimensions().get(0).displayName()); - Assertions.assertEquals("sne", model.metricSpecifications().get(0).dimensions().get(0).internalName()); - Assertions.assertEquals(true, model.metricSpecifications().get(0).dimensions().get(0).toBeExportedForShoebox()); - Assertions.assertEquals("z", model.metricSpecifications().get(0).lockedAggregationType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServiceSpecification model = new ServiceSpecification() - .withLogSpecifications(Arrays.asList( - new LogSpecification().withName("hbmdgbbjfdd").withDisplayName("bmbexppbhtqqro").withBlobDuration("p"))) - .withMetricSpecifications(Arrays.asList(new MetricSpecification().withName("lgbquxig") - .withDisplayName("jgzjaoyfhrtx") - .withDisplayDescription("n") - .withUnit("kujysvlejuvfq") - .withAggregationType("rlyxwjkcprbnw") - .withSupportedAggregationTypes(Arrays.asList("jvtbvpyss", "dnrujqguhmuouqfp")) - .withSupportedTimeGrainTypes(Arrays.asList("wbnguitnwui")) - .withEnableRegionalMdmAccount(false) - .withSourceMdmAccount("x") - .withSourceMdmNamespace("izuckyfihrfidfvz") - .withMetricFilterPattern("zuhtymwisdkfthwx") - .withFillGapWithZero(false) - .withCategory("i") - .withInternalMetricName("opvkmijcm") - .withDimensions(Arrays.asList(new MetricDimension().withName("ufufsrp") - .withDisplayName("zidnsezcxtbzsgfy") - .withInternalName("sne") - .withToBeExportedForShoebox(true))) - .withLockedAggregationType("z"))); - model = BinaryData.fromObject(model).toObject(ServiceSpecification.class); - Assertions.assertEquals("hbmdgbbjfdd", model.logSpecifications().get(0).name()); - Assertions.assertEquals("bmbexppbhtqqro", model.logSpecifications().get(0).displayName()); - Assertions.assertEquals("p", model.logSpecifications().get(0).blobDuration()); - Assertions.assertEquals("lgbquxig", model.metricSpecifications().get(0).name()); - Assertions.assertEquals("jgzjaoyfhrtx", model.metricSpecifications().get(0).displayName()); - Assertions.assertEquals("n", model.metricSpecifications().get(0).displayDescription()); - Assertions.assertEquals("kujysvlejuvfq", model.metricSpecifications().get(0).unit()); - Assertions.assertEquals("rlyxwjkcprbnw", model.metricSpecifications().get(0).aggregationType()); - Assertions.assertEquals("jvtbvpyss", model.metricSpecifications().get(0).supportedAggregationTypes().get(0)); - Assertions.assertEquals("wbnguitnwui", model.metricSpecifications().get(0).supportedTimeGrainTypes().get(0)); - Assertions.assertEquals(false, model.metricSpecifications().get(0).enableRegionalMdmAccount()); - Assertions.assertEquals("x", model.metricSpecifications().get(0).sourceMdmAccount()); - Assertions.assertEquals("izuckyfihrfidfvz", model.metricSpecifications().get(0).sourceMdmNamespace()); - Assertions.assertEquals("zuhtymwisdkfthwx", model.metricSpecifications().get(0).metricFilterPattern()); - Assertions.assertEquals(false, model.metricSpecifications().get(0).fillGapWithZero()); - Assertions.assertEquals("i", model.metricSpecifications().get(0).category()); - Assertions.assertEquals("opvkmijcm", model.metricSpecifications().get(0).internalMetricName()); - Assertions.assertEquals("ufufsrp", model.metricSpecifications().get(0).dimensions().get(0).name()); - Assertions.assertEquals("zidnsezcxtbzsgfy", - model.metricSpecifications().get(0).dimensions().get(0).displayName()); - Assertions.assertEquals("sne", model.metricSpecifications().get(0).dimensions().get(0).internalName()); - Assertions.assertEquals(true, model.metricSpecifications().get(0).dimensions().get(0).toBeExportedForShoebox()); - Assertions.assertEquals("z", model.metricSpecifications().get(0).lockedAggregationType()); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/SkuTests.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/SkuTests.java deleted file mode 100644 index c34fc5b44fb4..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/SkuTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mixedreality.models.Sku; -import com.azure.resourcemanager.mixedreality.models.SkuTier; -import org.junit.jupiter.api.Assertions; - -public final class SkuTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Sku model = BinaryData.fromString( - "{\"name\":\"nysounqe\",\"tier\":\"Free\",\"size\":\"ae\",\"family\":\"fhyhltrpmopjmcma\",\"capacity\":860799201}") - .toObject(Sku.class); - Assertions.assertEquals("nysounqe", model.name()); - Assertions.assertEquals(SkuTier.FREE, model.tier()); - Assertions.assertEquals("ae", model.size()); - Assertions.assertEquals("fhyhltrpmopjmcma", model.family()); - Assertions.assertEquals(860799201, model.capacity()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Sku model = new Sku().withName("nysounqe") - .withTier(SkuTier.FREE) - .withSize("ae") - .withFamily("fhyhltrpmopjmcma") - .withCapacity(860799201); - model = BinaryData.fromObject(model).toObject(Sku.class); - Assertions.assertEquals("nysounqe", model.name()); - Assertions.assertEquals(SkuTier.FREE, model.tier()); - Assertions.assertEquals("ae", model.size()); - Assertions.assertEquals("fhyhltrpmopjmcma", model.family()); - Assertions.assertEquals(860799201, model.capacity()); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountInnerTests.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountInnerTests.java deleted file mode 100644 index 4c5c5613e13b..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountInnerTests.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mixedreality.fluent.models.SpatialAnchorsAccountInner; -import com.azure.resourcemanager.mixedreality.models.Identity; -import com.azure.resourcemanager.mixedreality.models.ResourceIdentityType; -import com.azure.resourcemanager.mixedreality.models.Sku; -import com.azure.resourcemanager.mixedreality.models.SkuTier; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class SpatialAnchorsAccountInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SpatialAnchorsAccountInner model = BinaryData.fromString( - "{\"properties\":{\"storageAccountName\":\"llnwsubi\",\"accountId\":\"jampmngnzscxaqw\",\"accountDomain\":\"chcbonqvpkvlrxnj\"},\"identity\":{\"principalId\":\"eipheoflokeyy\",\"tenantId\":\"nj\",\"type\":\"SystemAssigned\"},\"plan\":{\"principalId\":\"grhpdjpju\",\"tenantId\":\"sxazjpq\",\"type\":\"SystemAssigned\"},\"sku\":{\"name\":\"alhbx\",\"tier\":\"Free\",\"size\":\"jzzvdud\",\"family\":\"dslfhotwmcy\",\"capacity\":1581858778},\"kind\":{\"name\":\"bjnpg\",\"tier\":\"Premium\",\"size\":\"adehxnltyfsopp\",\"family\":\"uesnzwdejbavo\",\"capacity\":669466066},\"location\":\"mohctb\",\"tags\":{\"w\":\"dwxdndnv\",\"lazjdyggdtjixhbk\":\"ujjugwdkcglh\",\"fwhybcibvy\":\"ofqweykhmenevfye\",\"ynnaam\":\"dcsi\"},\"id\":\"ectehf\",\"name\":\"qsc\",\"type\":\"eypvhezrkg\"}") - .toObject(SpatialAnchorsAccountInner.class); - Assertions.assertEquals("mohctb", model.location()); - Assertions.assertEquals("dwxdndnv", model.tags().get("w")); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.identity().type()); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.plan().type()); - Assertions.assertEquals("alhbx", model.sku().name()); - Assertions.assertEquals(SkuTier.FREE, model.sku().tier()); - Assertions.assertEquals("jzzvdud", model.sku().size()); - Assertions.assertEquals("dslfhotwmcy", model.sku().family()); - Assertions.assertEquals(1581858778, model.sku().capacity()); - Assertions.assertEquals("bjnpg", model.kind().name()); - Assertions.assertEquals(SkuTier.PREMIUM, model.kind().tier()); - Assertions.assertEquals("adehxnltyfsopp", model.kind().size()); - Assertions.assertEquals("uesnzwdejbavo", model.kind().family()); - Assertions.assertEquals(669466066, model.kind().capacity()); - Assertions.assertEquals("llnwsubi", model.storageAccountName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SpatialAnchorsAccountInner model = new SpatialAnchorsAccountInner().withLocation("mohctb") - .withTags(mapOf("w", "dwxdndnv", "lazjdyggdtjixhbk", "ujjugwdkcglh", "fwhybcibvy", "ofqweykhmenevfye", - "ynnaam", "dcsi")) - .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .withPlan(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .withSku(new Sku().withName("alhbx") - .withTier(SkuTier.FREE) - .withSize("jzzvdud") - .withFamily("dslfhotwmcy") - .withCapacity(1581858778)) - .withKind(new Sku().withName("bjnpg") - .withTier(SkuTier.PREMIUM) - .withSize("adehxnltyfsopp") - .withFamily("uesnzwdejbavo") - .withCapacity(669466066)) - .withStorageAccountName("llnwsubi"); - model = BinaryData.fromObject(model).toObject(SpatialAnchorsAccountInner.class); - Assertions.assertEquals("mohctb", model.location()); - Assertions.assertEquals("dwxdndnv", model.tags().get("w")); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.identity().type()); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.plan().type()); - Assertions.assertEquals("alhbx", model.sku().name()); - Assertions.assertEquals(SkuTier.FREE, model.sku().tier()); - Assertions.assertEquals("jzzvdud", model.sku().size()); - Assertions.assertEquals("dslfhotwmcy", model.sku().family()); - Assertions.assertEquals(1581858778, model.sku().capacity()); - Assertions.assertEquals("bjnpg", model.kind().name()); - Assertions.assertEquals(SkuTier.PREMIUM, model.kind().tier()); - Assertions.assertEquals("adehxnltyfsopp", model.kind().size()); - Assertions.assertEquals("uesnzwdejbavo", model.kind().family()); - Assertions.assertEquals(669466066, model.kind().capacity()); - Assertions.assertEquals("llnwsubi", model.storageAccountName()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountPageTests.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountPageTests.java deleted file mode 100644 index c90501361cb3..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountPageTests.java +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mixedreality.fluent.models.SpatialAnchorsAccountInner; -import com.azure.resourcemanager.mixedreality.models.Identity; -import com.azure.resourcemanager.mixedreality.models.ResourceIdentityType; -import com.azure.resourcemanager.mixedreality.models.Sku; -import com.azure.resourcemanager.mixedreality.models.SkuTier; -import com.azure.resourcemanager.mixedreality.models.SpatialAnchorsAccountPage; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class SpatialAnchorsAccountPageTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SpatialAnchorsAccountPage model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"storageAccountName\":\"yeicxmqciwqvhk\",\"accountId\":\"xuigdtopbobj\",\"accountDomain\":\"hm\"},\"identity\":{\"principalId\":\"a\",\"tenantId\":\"uhrzayvvt\",\"type\":\"SystemAssigned\"},\"plan\":{\"principalId\":\"giotkftutqxlngx\",\"tenantId\":\"fgugnxkrxdqmid\",\"type\":\"SystemAssigned\"},\"sku\":{\"name\":\"rvqdra\",\"tier\":\"Basic\",\"size\":\"big\",\"family\":\"oqfbowskanyk\",\"capacity\":1440760803},\"kind\":{\"name\":\"u\",\"tier\":\"Basic\",\"size\":\"qyw\",\"family\":\"drvyn\",\"capacity\":19075135},\"location\":\"phrcgyncoc\",\"tags\":{\"coofsxlzev\":\"fvm\",\"abcypmivk\":\"bmqj\"},\"id\":\"lzu\",\"name\":\"ccfwnfnbacfion\",\"type\":\"ebxetqgtzxdp\"}],\"nextLink\":\"bqqwxrj\"}") - .toObject(SpatialAnchorsAccountPage.class); - Assertions.assertEquals("phrcgyncoc", model.value().get(0).location()); - Assertions.assertEquals("fvm", model.value().get(0).tags().get("coofsxlzev")); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.value().get(0).identity().type()); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.value().get(0).plan().type()); - Assertions.assertEquals("rvqdra", model.value().get(0).sku().name()); - Assertions.assertEquals(SkuTier.BASIC, model.value().get(0).sku().tier()); - Assertions.assertEquals("big", model.value().get(0).sku().size()); - Assertions.assertEquals("oqfbowskanyk", model.value().get(0).sku().family()); - Assertions.assertEquals(1440760803, model.value().get(0).sku().capacity()); - Assertions.assertEquals("u", model.value().get(0).kind().name()); - Assertions.assertEquals(SkuTier.BASIC, model.value().get(0).kind().tier()); - Assertions.assertEquals("qyw", model.value().get(0).kind().size()); - Assertions.assertEquals("drvyn", model.value().get(0).kind().family()); - Assertions.assertEquals(19075135, model.value().get(0).kind().capacity()); - Assertions.assertEquals("yeicxmqciwqvhk", model.value().get(0).storageAccountName()); - Assertions.assertEquals("bqqwxrj", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SpatialAnchorsAccountPage model = new SpatialAnchorsAccountPage() - .withValue(Arrays.asList(new SpatialAnchorsAccountInner().withLocation("phrcgyncoc") - .withTags(mapOf("coofsxlzev", "fvm", "abcypmivk", "bmqj")) - .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .withPlan(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .withSku(new Sku().withName("rvqdra") - .withTier(SkuTier.BASIC) - .withSize("big") - .withFamily("oqfbowskanyk") - .withCapacity(1440760803)) - .withKind(new Sku().withName("u") - .withTier(SkuTier.BASIC) - .withSize("qyw") - .withFamily("drvyn") - .withCapacity(19075135)) - .withStorageAccountName("yeicxmqciwqvhk"))) - .withNextLink("bqqwxrj"); - model = BinaryData.fromObject(model).toObject(SpatialAnchorsAccountPage.class); - Assertions.assertEquals("phrcgyncoc", model.value().get(0).location()); - Assertions.assertEquals("fvm", model.value().get(0).tags().get("coofsxlzev")); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.value().get(0).identity().type()); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.value().get(0).plan().type()); - Assertions.assertEquals("rvqdra", model.value().get(0).sku().name()); - Assertions.assertEquals(SkuTier.BASIC, model.value().get(0).sku().tier()); - Assertions.assertEquals("big", model.value().get(0).sku().size()); - Assertions.assertEquals("oqfbowskanyk", model.value().get(0).sku().family()); - Assertions.assertEquals(1440760803, model.value().get(0).sku().capacity()); - Assertions.assertEquals("u", model.value().get(0).kind().name()); - Assertions.assertEquals(SkuTier.BASIC, model.value().get(0).kind().tier()); - Assertions.assertEquals("qyw", model.value().get(0).kind().size()); - Assertions.assertEquals("drvyn", model.value().get(0).kind().family()); - Assertions.assertEquals(19075135, model.value().get(0).kind().capacity()); - Assertions.assertEquals("yeicxmqciwqvhk", model.value().get(0).storageAccountName()); - Assertions.assertEquals("bqqwxrj", model.nextLink()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsCreateWithResponseMockTests.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsCreateWithResponseMockTests.java deleted file mode 100644 index 67b5e5a0d7d7..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsCreateWithResponseMockTests.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.mixedreality.MixedRealityManager; -import com.azure.resourcemanager.mixedreality.models.Identity; -import com.azure.resourcemanager.mixedreality.models.ResourceIdentityType; -import com.azure.resourcemanager.mixedreality.models.Sku; -import com.azure.resourcemanager.mixedreality.models.SkuTier; -import com.azure.resourcemanager.mixedreality.models.SpatialAnchorsAccount; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SpatialAnchorsAccountsCreateWithResponseMockTests { - @Test - public void testCreateWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"storageAccountName\":\"lkthu\",\"accountId\":\"qolbgyc\",\"accountDomain\":\"iertgccymvaolp\"},\"identity\":{\"principalId\":\"qlfmmdnbb\",\"tenantId\":\"zpswiydmc\",\"type\":\"SystemAssigned\"},\"plan\":{\"principalId\":\"xssadbzmnvdf\",\"tenantId\":\"ud\",\"type\":\"SystemAssigned\"},\"sku\":{\"name\":\"xzb\",\"tier\":\"Standard\",\"size\":\"ylpstdbhhxsrzdz\",\"family\":\"erscdntne\",\"capacity\":1072156994},\"kind\":{\"name\":\"jmygtdsslswtmwer\",\"tier\":\"Free\",\"size\":\"pyqs\",\"family\":\"wab\",\"capacity\":334511461},\"location\":\"hhszh\",\"tags\":{\"nkww\":\"lvwiwubmwmbesl\",\"flcxoga\":\"pp\",\"mkqzeqqkdltfzxmh\":\"konzmnsik\",\"gureodkwobdag\":\"v\"},\"id\":\"tibqdxbxwakb\",\"name\":\"gqxndlkzgxhuripl\",\"type\":\"podxunkb\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MixedRealityManager manager = MixedRealityManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SpatialAnchorsAccount response = manager.spatialAnchorsAccounts() - .define("mjh") - .withRegion("ssotftpv") - .withExistingResourceGroup("rmfqjhhkxbpvj") - .withTags( - mapOf("aruoujmkcjhwqyt", "exilzznfqqnvwpmq", "bnw", "r", "enq", "ewgdrjervn", "ndoygmifthnzdnd", "eh")) - .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .withPlan(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .withSku(new Sku().withName("blytk") - .withTier(SkuTier.FREE) - .withSize("ewwwfbkrvrnsv") - .withFamily("q") - .withCapacity(925506689)) - .withKind(new Sku().withName("crsbfovasr") - .withTier(SkuTier.FREE) - .withSize("bhsqfsubcgjbirxb") - .withFamily("bsrfbj") - .withCapacity(837542479)) - .withStorageAccountName("yngudivk") - .create(); - - Assertions.assertEquals("hhszh", response.location()); - Assertions.assertEquals("lvwiwubmwmbesl", response.tags().get("nkww")); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, response.identity().type()); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, response.plan().type()); - Assertions.assertEquals("xzb", response.sku().name()); - Assertions.assertEquals(SkuTier.STANDARD, response.sku().tier()); - Assertions.assertEquals("ylpstdbhhxsrzdz", response.sku().size()); - Assertions.assertEquals("erscdntne", response.sku().family()); - Assertions.assertEquals(1072156994, response.sku().capacity()); - Assertions.assertEquals("jmygtdsslswtmwer", response.kind().name()); - Assertions.assertEquals(SkuTier.FREE, response.kind().tier()); - Assertions.assertEquals("pyqs", response.kind().size()); - Assertions.assertEquals("wab", response.kind().family()); - Assertions.assertEquals(334511461, response.kind().capacity()); - Assertions.assertEquals("lkthu", response.storageAccountName()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsDeleteByResourceGroupWithResponseMockTests.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsDeleteByResourceGroupWithResponseMockTests.java deleted file mode 100644 index fe857410b40f..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsDeleteByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.mixedreality.MixedRealityManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SpatialAnchorsAccountsDeleteByResourceGroupWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MixedRealityManager manager = MixedRealityManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.spatialAnchorsAccounts() - .deleteByResourceGroupWithResponse("bexrmcq", "bycnojvkn", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsGetByResourceGroupWithResponseMockTests.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index 29263b4653ab..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsGetByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.mixedreality.MixedRealityManager; -import com.azure.resourcemanager.mixedreality.models.ResourceIdentityType; -import com.azure.resourcemanager.mixedreality.models.SkuTier; -import com.azure.resourcemanager.mixedreality.models.SpatialAnchorsAccount; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SpatialAnchorsAccountsGetByResourceGroupWithResponseMockTests { - @Test - public void testGetByResourceGroupWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"storageAccountName\":\"pvgqzcjrvxdjzlm\",\"accountId\":\"xkvugfhzov\",\"accountDomain\":\"jvzunluthnnp\"},\"identity\":{\"principalId\":\"i\",\"tenantId\":\"ilpjzuaejxdult\",\"type\":\"SystemAssigned\"},\"plan\":{\"principalId\":\"tdzumveekgpw\",\"tenantId\":\"uh\",\"type\":\"SystemAssigned\"},\"sku\":{\"name\":\"sjyofdx\",\"tier\":\"Free\",\"size\":\"dttouwaboekqvkel\",\"family\":\"mvb\",\"capacity\":1393240700},\"kind\":{\"name\":\"sflhhca\",\"tier\":\"Free\",\"size\":\"ixisxyawjoy\",\"family\":\"cslyjpk\",\"capacity\":888543440},\"location\":\"yexz\",\"tags\":{\"lhbnxkna\":\"ixhnrztf\",\"pnapnyiropuh\":\"aulppggd\",\"git\":\"igvpgylg\"},\"id\":\"medjvcslynqwwncw\",\"name\":\"zhxgktrmgucn\",\"type\":\"pkteo\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MixedRealityManager manager = MixedRealityManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SpatialAnchorsAccount response = manager.spatialAnchorsAccounts() - .getByResourceGroupWithResponse("e", "qsgzvahapj", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("yexz", response.location()); - Assertions.assertEquals("ixhnrztf", response.tags().get("lhbnxkna")); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, response.identity().type()); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, response.plan().type()); - Assertions.assertEquals("sjyofdx", response.sku().name()); - Assertions.assertEquals(SkuTier.FREE, response.sku().tier()); - Assertions.assertEquals("dttouwaboekqvkel", response.sku().size()); - Assertions.assertEquals("mvb", response.sku().family()); - Assertions.assertEquals(1393240700, response.sku().capacity()); - Assertions.assertEquals("sflhhca", response.kind().name()); - Assertions.assertEquals(SkuTier.FREE, response.kind().tier()); - Assertions.assertEquals("ixisxyawjoy", response.kind().size()); - Assertions.assertEquals("cslyjpk", response.kind().family()); - Assertions.assertEquals(888543440, response.kind().capacity()); - Assertions.assertEquals("pvgqzcjrvxdjzlm", response.storageAccountName()); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsListByResourceGroupMockTests.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsListByResourceGroupMockTests.java deleted file mode 100644 index cb12f49dcd62..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsListByResourceGroupMockTests.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.mixedreality.MixedRealityManager; -import com.azure.resourcemanager.mixedreality.models.ResourceIdentityType; -import com.azure.resourcemanager.mixedreality.models.SkuTier; -import com.azure.resourcemanager.mixedreality.models.SpatialAnchorsAccount; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SpatialAnchorsAccountsListByResourceGroupMockTests { - @Test - public void testListByResourceGroup() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"storageAccountName\":\"wmcdytdxwi\",\"accountId\":\"nrjawgqwg\",\"accountDomain\":\"ni\"},\"identity\":{\"principalId\":\"fbkp\",\"tenantId\":\"gklwn\",\"type\":\"SystemAssigned\"},\"plan\":{\"principalId\":\"auwhvylwzbtdhx\",\"tenantId\":\"znbmpowuwprzq\",\"type\":\"SystemAssigned\"},\"sku\":{\"name\":\"alupjm\",\"tier\":\"Standard\",\"size\":\"obbc\",\"family\":\"s\",\"capacity\":1626950587},\"kind\":{\"name\":\"iplrbpbewtghfgb\",\"tier\":\"Free\",\"size\":\"xzvlvqhjkbegib\",\"family\":\"mxiebw\",\"capacity\":2134442960},\"location\":\"ayqcgw\",\"tags\":{\"zg\":\"j\",\"txon\":\"yzm\"},\"id\":\"mtsavjcbpwxqp\",\"name\":\"rknftguvriuhprwm\",\"type\":\"yvxqtayriwwroy\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MixedRealityManager manager = MixedRealityManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.spatialAnchorsAccounts().listByResourceGroup("hzceuojgjrwjue", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("ayqcgw", response.iterator().next().location()); - Assertions.assertEquals("j", response.iterator().next().tags().get("zg")); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, response.iterator().next().identity().type()); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, response.iterator().next().plan().type()); - Assertions.assertEquals("alupjm", response.iterator().next().sku().name()); - Assertions.assertEquals(SkuTier.STANDARD, response.iterator().next().sku().tier()); - Assertions.assertEquals("obbc", response.iterator().next().sku().size()); - Assertions.assertEquals("s", response.iterator().next().sku().family()); - Assertions.assertEquals(1626950587, response.iterator().next().sku().capacity()); - Assertions.assertEquals("iplrbpbewtghfgb", response.iterator().next().kind().name()); - Assertions.assertEquals(SkuTier.FREE, response.iterator().next().kind().tier()); - Assertions.assertEquals("xzvlvqhjkbegib", response.iterator().next().kind().size()); - Assertions.assertEquals("mxiebw", response.iterator().next().kind().family()); - Assertions.assertEquals(2134442960, response.iterator().next().kind().capacity()); - Assertions.assertEquals("wmcdytdxwi", response.iterator().next().storageAccountName()); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsListMockTests.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsListMockTests.java deleted file mode 100644 index 05be26e86d40..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsListMockTests.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.mixedreality.MixedRealityManager; -import com.azure.resourcemanager.mixedreality.models.ResourceIdentityType; -import com.azure.resourcemanager.mixedreality.models.SkuTier; -import com.azure.resourcemanager.mixedreality.models.SpatialAnchorsAccount; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SpatialAnchorsAccountsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"storageAccountName\":\"xy\",\"accountId\":\"moyrxvwfudwpz\",\"accountDomain\":\"xhdzhlrqjbhckf\"},\"identity\":{\"principalId\":\"rxsbkyvp\",\"tenantId\":\"anuzbpzkafkuw\",\"type\":\"SystemAssigned\"},\"plan\":{\"principalId\":\"bmehh\",\"tenantId\":\"yvjusrtslhsp\",\"type\":\"SystemAssigned\"},\"sku\":{\"name\":\"maofmxagkv\",\"tier\":\"Basic\",\"size\":\"mqkrhahvljuahaqu\",\"family\":\"dhmdua\",\"capacity\":595850477},\"kind\":{\"name\":\"qpv\",\"tier\":\"Premium\",\"size\":\"ws\",\"family\":\"r\",\"capacity\":1259983494},\"location\":\"vgomz\",\"tags\":{\"ali\":\"isgwbnbbeldawkz\",\"hashsfwxosow\":\"urqhaka\"},\"id\":\"xcug\",\"name\":\"cjooxdjebwpucwwf\",\"type\":\"ovbvmeueciv\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MixedRealityManager manager = MixedRealityManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.spatialAnchorsAccounts().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("vgomz", response.iterator().next().location()); - Assertions.assertEquals("isgwbnbbeldawkz", response.iterator().next().tags().get("ali")); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, response.iterator().next().identity().type()); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, response.iterator().next().plan().type()); - Assertions.assertEquals("maofmxagkv", response.iterator().next().sku().name()); - Assertions.assertEquals(SkuTier.BASIC, response.iterator().next().sku().tier()); - Assertions.assertEquals("mqkrhahvljuahaqu", response.iterator().next().sku().size()); - Assertions.assertEquals("dhmdua", response.iterator().next().sku().family()); - Assertions.assertEquals(595850477, response.iterator().next().sku().capacity()); - Assertions.assertEquals("qpv", response.iterator().next().kind().name()); - Assertions.assertEquals(SkuTier.PREMIUM, response.iterator().next().kind().tier()); - Assertions.assertEquals("ws", response.iterator().next().kind().size()); - Assertions.assertEquals("r", response.iterator().next().kind().family()); - Assertions.assertEquals(1259983494, response.iterator().next().kind().capacity()); - Assertions.assertEquals("xy", response.iterator().next().storageAccountName()); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker deleted file mode 100644 index 1f0955d450f0..000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker +++ /dev/null @@ -1 +0,0 @@ -mock-maker-inline diff --git a/sdk/mixedreality/ci.yml b/sdk/mixedreality/ci.yml deleted file mode 100644 index dfdbfeb5c1b8..000000000000 --- a/sdk/mixedreality/ci.yml +++ /dev/null @@ -1,58 +0,0 @@ -# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. - -trigger: - branches: - include: - - main - - hotfix/* - - release/* - paths: - include: - - sdk/mixedreality/ci.yml - - sdk/mixedreality/azure-mixedreality-authentication/ - - sdk/mixedreality/azure-resourcemanager-mixedreality/ - exclude: - - sdk/mixedreality/pom.xml - - sdk/mixedreality/azure-mixedreality-authentication/pom.xml - - sdk/mixedreality/azure-resourcemanager-mixedreality/pom.xml - -pr: - branches: - include: - - main - - feature/* - - hotfix/* - - release/* - paths: - include: - - sdk/mixedreality/ci.yml - - sdk/mixedreality/azure-mixedreality-authentication/ - - sdk/mixedreality/azure-resourcemanager-mixedreality/ - exclude: - - sdk/mixedreality/pom.xml - - sdk/mixedreality/azure-mixedreality-authentication/pom.xml - - sdk/mixedreality/azure-resourcemanager-mixedreality/pom.xml - -parameters: -- name: release_azuremixedrealityauthentication - displayName: 'azure-mixedreality-authentication' - type: boolean - default: true -- name: release_azureresourcemanagermixedreality - displayName: 'azure-resourcemanager-mixedreality' - type: boolean - default: false - -extends: - template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml - parameters: - ServiceDirectory: mixedreality - Artifacts: - - name: azure-mixedreality-authentication - groupId: com.azure - safeName: azuremixedrealityauthentication - releaseInBatch: ${{ parameters.release_azuremixedrealityauthentication }} - - name: azure-resourcemanager-mixedreality - groupId: com.azure.resourcemanager - safeName: azureresourcemanagermixedreality - releaseInBatch: ${{ parameters.release_azureresourcemanagermixedreality }} diff --git a/sdk/mixedreality/pom.xml b/sdk/mixedreality/pom.xml deleted file mode 100644 index fb13bfabd275..000000000000 --- a/sdk/mixedreality/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - com.azure - azure-mixedreality-services - pom - 1.0.0 - - azure-mixedreality-authentication - azure-resourcemanager-mixedreality - - diff --git a/sdk/mixedreality/test-resources.json b/sdk/mixedreality/test-resources.json deleted file mode 100644 index 940b76188402..000000000000 --- a/sdk/mixedreality/test-resources.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "baseName": { - "type": "string", - "defaultValue": "[resourceGroup().name]", - "metadata": { - "description": "The base resource name." - } - }, - "tenantId": { - "type": "string", - "defaultValue": "72f988bf-86f1-41af-91ab-2d7cd011db47", - "metadata": { - "description": "The tenant ID to which the application and resources belong." - } - }, - "location": { - "type": "string", - "defaultValue": "[resourceGroup().location]", - "metadata": { - "description": "The location of the resource. By default, this is the same as the resource group." - } - } - }, - "variables": { - "arrApiVersion": "2021-03-01-preview", - "arrAccountName": "[concat(parameters('baseName'), '-arr-account')]" - }, - "resources": [ - { - "type": "Microsoft.MixedReality/remoteRenderingAccounts", - "name": "[variables('arrAccountName')]", - "apiVersion": "[variables('arrApiVersion')]", - "location": "[parameters('location')]", - "properties": {}, - "identity": { "type": "systemAssigned" } - } - ], - "outputs": { - "MIXEDREALITY_ACCOUNT_ID": { - "type": "string", - "value": "[reference(variables('arrAccountName')).accountId]" - }, - "MIXEDREALITY_ACCOUNT_DOMAIN": { - "type": "string", - "value": "[reference(variables('arrAccountName')).accountDomain]" - }, - "MIXEDREALITY_ACCOUNT_KEY": { - "type": "string", - "value": "[listKeys(resourceId('Microsoft.MixedReality/remoteRenderingAccounts', variables('arrAccountName')), variables('arrApiVersion')).primaryKey]" - } - } -} diff --git a/sdk/mixedreality/tests.yml b/sdk/mixedreality/tests.yml deleted file mode 100644 index 043dbfa9ecdd..000000000000 --- a/sdk/mixedreality/tests.yml +++ /dev/null @@ -1,11 +0,0 @@ -trigger: none - -extends: - template: /eng/pipelines/templates/stages/archetype-sdk-tests.yml - parameters: - ServiceDirectory: mixedreality - Location: eastus2 - Artifacts: - - name: azure-mixedreality-authentication - groupId: com.azure - safeName: azuremixedrealityauthentication diff --git a/sdk/resourcemanager/docs/SINGLE_SERVICE_PACKAGES.md b/sdk/resourcemanager/docs/SINGLE_SERVICE_PACKAGES.md index bc2cef431fe5..9920739bcaa5 100644 --- a/sdk/resourcemanager/docs/SINGLE_SERVICE_PACKAGES.md +++ b/sdk/resourcemanager/docs/SINGLE_SERVICE_PACKAGES.md @@ -1528,17 +1528,6 @@ service * [1.0.0-beta.1](https://repo1.maven.org/maven2/com/azure/resourcemanager/azure-resourcemanager-migrationdiscoverysap/1.0.0-beta.1) -
-

- mixedreality - -* [package-2021-01](https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mixedreality/resource-manager#tag-package-2021-01) - * [1.0.0](https://repo1.maven.org/maven2/com/azure/resourcemanager/azure-resourcemanager-mixedreality/1.0.0) - * [1.0.0-beta.3](https://repo1.maven.org/maven2/com/azure/resourcemanager/azure-resourcemanager-mixedreality/1.0.0-beta.3) - * [1.0.0-beta.2](https://repo1.maven.org/maven2/com/azure/resourcemanager/azure-resourcemanager-mixedreality/1.0.0-beta.2) - * [1.0.0-beta.1](https://repo1.maven.org/maven2/com/azure/resourcemanager/azure-resourcemanager-mixedreality/1.0.0-beta.1) -
-
mobilenetwork