From e73e71abe30b85cdc01968c4415b45af39f0b1b9 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 24 Jan 2022 15:57:52 +0000 Subject: [PATCH] CodeGen from PR 17473 in Azure/azure-rest-api-specs Merge 2d4f389fb3cbc41adac09daf62ceef367456aaad into f754278746b8040dc2d04409a9d007e9e1eba9ca --- eng/versioning/version_client.txt | 1 + pom.xml | 1 + .../CHANGELOG.md | 5 + .../README.md | 102 ++++ .../SAMPLE.md | 172 ++++++ .../pom.xml | 55 ++ .../AzureactivedirectoryManager.java | 267 +++++++++ .../fluent/Azureactivedirectory.java | 60 ++ .../DiagnosticSettingsCategoriesClient.java | 36 ++ .../DiagnosticSettingsOperationsClient.java | 114 ++++ .../fluent/OperationsClient.java | 36 ++ .../fluent/models/DiagnosticSettings.java | 201 +++++++ .../models/DiagnosticSettingsCategory.java | 51 ++ ...ttingsCategoryResourceCollectionInner.java | 56 ++ ...nosticSettingsResourceCollectionInner.java | 54 ++ .../DiagnosticSettingsResourceInner.java | 195 +++++++ .../OperationsDiscoveryCollectionInner.java | 55 ++ .../fluent/models/package-info.java | 6 + .../fluent/package-info.java | 6 + .../AzureactivedirectoryBuilder.java | 129 +++++ .../AzureactivedirectoryImpl.java | 306 ++++++++++ ...iagnosticSettingsCategoriesClientImpl.java | 161 ++++++ .../DiagnosticSettingsCategoriesImpl.java | 61 ++ ...ettingsCategoryResourceCollectionImpl.java | 42 ++ ...iagnosticSettingsOperationsClientImpl.java | 528 ++++++++++++++++++ .../DiagnosticSettingsOperationsImpl.java | 116 ++++ ...gnosticSettingsResourceCollectionImpl.java | 48 ++ .../DiagnosticSettingsResourceImpl.java | 73 +++ .../implementation/OperationsClientImpl.java | 158 ++++++ .../OperationsDiscoveryCollectionImpl.java | 41 ++ .../implementation/OperationsImpl.java | 60 ++ .../implementation/Utils.java | 204 +++++++ .../implementation/package-info.java | 6 + .../azureactivedirectory/models/Category.java | 34 ++ .../models/CategoryType.java | 31 + .../models/DiagnosticSettingsCategories.java | 31 + .../DiagnosticSettingsCategoryResource.java | 68 +++ ...ticSettingsCategoryResourceCollection.java | 27 + .../models/DiagnosticSettingsOperations.java | 103 ++++ .../models/DiagnosticSettingsResource.java | 87 +++ .../DiagnosticSettingsResourceCollection.java | 26 + .../azureactivedirectory/models/Display.java | 205 +++++++ .../models/LogSettings.java | 109 ++++ .../models/Operations.java | 31 + .../models/OperationsDiscovery.java | 194 +++++++ .../models/OperationsDiscoveryCollection.java | 26 + .../models/ProxyOnlyResource.java | 24 + .../models/RetentionPolicy.java | 79 +++ .../models/package-info.java | 6 + .../azureactivedirectory/package-info.java | 6 + .../src/main/java/module-info.java | 19 + ...DiagnosticSettingsCategoryListSamples.java | 23 + ...ettingsOperationCreateOrUpdateSamples.java | 46 ++ ...gnosticSettingsOperationDeleteSamples.java | 23 + ...DiagnosticSettingsOperationGetSamples.java | 23 + ...iagnosticSettingsOperationListSamples.java | 23 + .../generated/OperationsListSamples.java | 23 + sdk/azureactivedirectory/ci.yml | 39 ++ sdk/azureactivedirectory/pom.xml | 53 ++ 59 files changed, 4765 insertions(+) create mode 100644 sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/CHANGELOG.md create mode 100644 sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/README.md create mode 100644 sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/SAMPLE.md create mode 100644 sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/pom.xml create mode 100644 sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/AzureactivedirectoryManager.java create mode 100644 sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/Azureactivedirectory.java create mode 100644 sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/DiagnosticSettingsCategoriesClient.java create mode 100644 sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/DiagnosticSettingsOperationsClient.java create mode 100644 sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/OperationsClient.java create mode 100644 sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/models/DiagnosticSettings.java create mode 100644 sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/models/DiagnosticSettingsCategory.java create mode 100644 sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/models/DiagnosticSettingsCategoryResourceCollectionInner.java create mode 100644 sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/models/DiagnosticSettingsResourceCollectionInner.java create mode 100644 sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/models/DiagnosticSettingsResourceInner.java create mode 100644 sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/models/OperationsDiscoveryCollectionInner.java create mode 100644 sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/models/package-info.java create mode 100644 sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/package-info.java create mode 100644 sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/AzureactivedirectoryBuilder.java create mode 100644 sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/AzureactivedirectoryImpl.java create mode 100644 sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/DiagnosticSettingsCategoriesClientImpl.java create mode 100644 sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/DiagnosticSettingsCategoriesImpl.java create mode 100644 sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/DiagnosticSettingsCategoryResourceCollectionImpl.java create mode 100644 sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/DiagnosticSettingsOperationsClientImpl.java create mode 100644 sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/DiagnosticSettingsOperationsImpl.java create mode 100644 sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/DiagnosticSettingsResourceCollectionImpl.java create mode 100644 sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/DiagnosticSettingsResourceImpl.java create mode 100644 sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/OperationsClientImpl.java create mode 100644 sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/OperationsDiscoveryCollectionImpl.java create mode 100644 sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/OperationsImpl.java create mode 100644 sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/Utils.java create mode 100644 sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/package-info.java create mode 100644 sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/Category.java create mode 100644 sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/CategoryType.java create mode 100644 sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/DiagnosticSettingsCategories.java create mode 100644 sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/DiagnosticSettingsCategoryResource.java create mode 100644 sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/DiagnosticSettingsCategoryResourceCollection.java create mode 100644 sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/DiagnosticSettingsOperations.java create mode 100644 sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/DiagnosticSettingsResource.java create mode 100644 sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/DiagnosticSettingsResourceCollection.java create mode 100644 sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/Display.java create mode 100644 sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/LogSettings.java create mode 100644 sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/Operations.java create mode 100644 sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/OperationsDiscovery.java create mode 100644 sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/OperationsDiscoveryCollection.java create mode 100644 sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/ProxyOnlyResource.java create mode 100644 sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/RetentionPolicy.java create mode 100644 sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/package-info.java create mode 100644 sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/package-info.java create mode 100644 sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/module-info.java create mode 100644 sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/samples/java/com/azure/resourcemanager/azureactivedirectory/generated/DiagnosticSettingsCategoryListSamples.java create mode 100644 sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/samples/java/com/azure/resourcemanager/azureactivedirectory/generated/DiagnosticSettingsOperationCreateOrUpdateSamples.java create mode 100644 sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/samples/java/com/azure/resourcemanager/azureactivedirectory/generated/DiagnosticSettingsOperationDeleteSamples.java create mode 100644 sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/samples/java/com/azure/resourcemanager/azureactivedirectory/generated/DiagnosticSettingsOperationGetSamples.java create mode 100644 sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/samples/java/com/azure/resourcemanager/azureactivedirectory/generated/DiagnosticSettingsOperationListSamples.java create mode 100644 sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/samples/java/com/azure/resourcemanager/azureactivedirectory/generated/OperationsListSamples.java create mode 100644 sdk/azureactivedirectory/ci.yml create mode 100644 sdk/azureactivedirectory/pom.xml diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 44d0afaab9042..5a1866d58c231 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -334,6 +334,7 @@ com.azure.resourcemanager:azure-resourcemanager-loadtestservice;1.0.0-beta.1;1.0 com.azure.resourcemanager:azure-resourcemanager-automanage;1.0.0-beta.1;1.0.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-edgeorder;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-securityinsights;1.0.0-beta.1;1.0.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-azureactivedirectory;1.0.0-beta.1;1.0.0-beta.1 com.azure.tools:azure-sdk-archetype;1.0.0;1.0.0 # Unreleased dependencies: Copy the entry from above, prepend "unreleased_" and remove the current diff --git a/pom.xml b/pom.xml index 24a6e66997ada..babffb2a139cb 100644 --- a/pom.xml +++ b/pom.xml @@ -723,6 +723,7 @@ sdk/automanage sdk/automation sdk/avs + sdk/azureactivedirectory sdk/azurearcdata sdk/azurestack sdk/azurestackhci diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/CHANGELOG.md b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/CHANGELOG.md new file mode 100644 index 0000000000000..521ee1f6259dd --- /dev/null +++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2022-01-24) + +- Azure Resource Manager Azureactivedirectory client library for Java. This package contains Microsoft Azure SDK for Azureactivedirectory Management SDK. Azure Active Directory Client. Package tag package-preview-2017-04. 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/azureactivedirectory/azure-resourcemanager-azureactivedirectory/README.md b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/README.md new file mode 100644 index 0000000000000..c2bef9383a82a --- /dev/null +++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/README.md @@ -0,0 +1,102 @@ +# Azure Resource Manager Azureactivedirectory client library for Java + +Azure Resource Manager Azureactivedirectory client library for Java. + +This package contains Microsoft Azure SDK for Azureactivedirectory Management SDK. Azure Active Directory Client. Package tag package-preview-2017-04. 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-azureactivedirectory;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-azureactivedirectory + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Include the recommended packages + +Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. + +[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. + +### Authentication + +By default, Azure Active Directory token authentication depends on correct configure of following environment variables. + +- `AZURE_CLIENT_ID` for Azure client ID. +- `AZURE_TENANT_ID` for Azure tenant ID. +- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. + +In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. + +With above configuration, `azure` client can be authenticated by following code: + +```java +AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +AzureactivedirectoryManager manager = AzureactivedirectoryManager + .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/azureactivedirectory/azure-resourcemanager-azureactivedirectory/SAMPLE.md) + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). + +1. Fork it +1. Create your feature branch (`git checkout -b my-new-feature`) +1. Commit your changes (`git commit -am 'Add some feature'`) +1. Push to the branch (`git push origin my-new-feature`) +1. Create new Pull Request + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/SAMPLE.md b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/SAMPLE.md new file mode 100644 index 0000000000000..b115772484f93 --- /dev/null +++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/SAMPLE.md @@ -0,0 +1,172 @@ +# Code snippets and samples + + +## DiagnosticSettingsCategory + +- [List](#diagnosticsettingscategory_list) + +## DiagnosticSettingsOperation + +- [CreateOrUpdate](#diagnosticsettingsoperation_createorupdate) +- [Delete](#diagnosticsettingsoperation_delete) +- [Get](#diagnosticsettingsoperation_get) +- [List](#diagnosticsettingsoperation_list) + +## Operations + +- [List](#operations_list) +### DiagnosticSettingsCategory_List + +```java +import com.azure.core.util.Context; + +/** Samples for DiagnosticSettingsCategory List. */ +public final class DiagnosticSettingsCategoryListSamples { + /* + * x-ms-original-file: specification/azureactivedirectory/resource-manager/Microsoft.Aadiam/preview/2017-04-01-preview/examples/listDiagnosticSettingsCategories.json + */ + /** + * Sample code: Gets the diagnostic setting categories. + * + * @param manager Entry point to AzureactivedirectoryManager. + */ + public static void getsTheDiagnosticSettingCategories( + com.azure.resourcemanager.azureactivedirectory.AzureactivedirectoryManager manager) { + manager.diagnosticSettingsCategories().listWithResponse(Context.NONE); + } +} +``` + +### DiagnosticSettingsOperation_CreateOrUpdate + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.azureactivedirectory.fluent.models.DiagnosticSettingsResourceInner; +import com.azure.resourcemanager.azureactivedirectory.models.Category; +import com.azure.resourcemanager.azureactivedirectory.models.LogSettings; +import com.azure.resourcemanager.azureactivedirectory.models.RetentionPolicy; +import java.util.Arrays; + +/** Samples for DiagnosticSettingsOperation CreateOrUpdate. */ +public final class DiagnosticSettingsOperationCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/azureactivedirectory/resource-manager/Microsoft.Aadiam/preview/2017-04-01-preview/examples/createOrUpdateDiagnosticSetting.json + */ + /** + * Sample code: BatchAccountDelete. + * + * @param manager Entry point to AzureactivedirectoryManager. + */ + public static void batchAccountDelete( + com.azure.resourcemanager.azureactivedirectory.AzureactivedirectoryManager manager) { + manager + .diagnosticSettingsOperations() + .createOrUpdateWithResponse( + "mysetting", + new DiagnosticSettingsResourceInner() + .withStorageAccountId( + "/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/apptest/providers/Microsoft.Storage/storageAccounts/appteststorage1") + .withWorkspaceId("") + .withEventHubAuthorizationRuleId( + "/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourceGroups/montest/providers/microsoft.eventhub/namespaces/mynamespace/eventhubs/myeventhub/authorizationrules/myrule") + .withEventHubName("myeventhub") + .withLogs( + Arrays + .asList( + new LogSettings() + .withCategory(Category.AUDIT_LOGS) + .withEnabled(true) + .withRetentionPolicy(new RetentionPolicy().withEnabled(false).withDays(0)))), + Context.NONE); + } +} +``` + +### DiagnosticSettingsOperation_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for DiagnosticSettingsOperation Delete. */ +public final class DiagnosticSettingsOperationDeleteSamples { + /* + * x-ms-original-file: specification/azureactivedirectory/resource-manager/Microsoft.Aadiam/preview/2017-04-01-preview/examples/deleteDiagnosticSetting.json + */ + /** + * Sample code: Deletes the diagnostic setting. + * + * @param manager Entry point to AzureactivedirectoryManager. + */ + public static void deletesTheDiagnosticSetting( + com.azure.resourcemanager.azureactivedirectory.AzureactivedirectoryManager manager) { + manager.diagnosticSettingsOperations().deleteWithResponse("mysetting", Context.NONE); + } +} +``` + +### DiagnosticSettingsOperation_Get + +```java +import com.azure.core.util.Context; + +/** Samples for DiagnosticSettingsOperation Get. */ +public final class DiagnosticSettingsOperationGetSamples { + /* + * x-ms-original-file: specification/azureactivedirectory/resource-manager/Microsoft.Aadiam/preview/2017-04-01-preview/examples/getDiagnosticSetting.json + */ + /** + * Sample code: Gets the diagnostic setting. + * + * @param manager Entry point to AzureactivedirectoryManager. + */ + public static void getsTheDiagnosticSetting( + com.azure.resourcemanager.azureactivedirectory.AzureactivedirectoryManager manager) { + manager.diagnosticSettingsOperations().getWithResponse("mysetting", Context.NONE); + } +} +``` + +### DiagnosticSettingsOperation_List + +```java +import com.azure.core.util.Context; + +/** Samples for DiagnosticSettingsOperation List. */ +public final class DiagnosticSettingsOperationListSamples { + /* + * x-ms-original-file: specification/azureactivedirectory/resource-manager/Microsoft.Aadiam/preview/2017-04-01-preview/examples/listDiagnosticSettings.json + */ + /** + * Sample code: Gets the diagnostic settings. + * + * @param manager Entry point to AzureactivedirectoryManager. + */ + public static void getsTheDiagnosticSettings( + com.azure.resourcemanager.azureactivedirectory.AzureactivedirectoryManager manager) { + manager.diagnosticSettingsOperations().listWithResponse(Context.NONE); + } +} +``` + +### Operations_List + +```java +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/azureactivedirectory/resource-manager/Microsoft.Aadiam/preview/2017-04-01-preview/examples/listOperations.json + */ + /** + * Sample code: Gets the operations. + * + * @param manager Entry point to AzureactivedirectoryManager. + */ + public static void getsTheOperations( + com.azure.resourcemanager.azureactivedirectory.AzureactivedirectoryManager manager) { + manager.operations().listWithResponse(Context.NONE); + } +} +``` + diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/pom.xml b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/pom.xml new file mode 100644 index 0000000000000..5666d4ead7aaf --- /dev/null +++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/pom.xml @@ -0,0 +1,55 @@ + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-azureactivedirectory + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for Azureactivedirectory Management + This package contains Microsoft Azure SDK for Azureactivedirectory Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Active Directory Client. Package tag package-preview-2017-04. + 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 + true + + + + com.azure + azure-core + 1.24.1 + + + com.azure + azure-core-management + 1.5.1 + + + diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/AzureactivedirectoryManager.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/AzureactivedirectoryManager.java new file mode 100644 index 0000000000000..5dd2e479d1a5e --- /dev/null +++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/AzureactivedirectoryManager.java @@ -0,0 +1,267 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azureactivedirectory; + +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.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azureactivedirectory.fluent.Azureactivedirectory; +import com.azure.resourcemanager.azureactivedirectory.implementation.AzureactivedirectoryBuilder; +import com.azure.resourcemanager.azureactivedirectory.implementation.DiagnosticSettingsCategoriesImpl; +import com.azure.resourcemanager.azureactivedirectory.implementation.DiagnosticSettingsOperationsImpl; +import com.azure.resourcemanager.azureactivedirectory.implementation.OperationsImpl; +import com.azure.resourcemanager.azureactivedirectory.models.DiagnosticSettingsCategories; +import com.azure.resourcemanager.azureactivedirectory.models.DiagnosticSettingsOperations; +import com.azure.resourcemanager.azureactivedirectory.models.Operations; +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 AzureactivedirectoryManager. Azure Active Directory Client. */ +public final class AzureactivedirectoryManager { + private Operations operations; + + private DiagnosticSettingsOperations diagnosticSettingsOperations; + + private DiagnosticSettingsCategories diagnosticSettingsCategories; + + private final Azureactivedirectory clientObject; + + private AzureactivedirectoryManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new AzureactivedirectoryBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of Azureactivedirectory service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Azureactivedirectory service API instance. + */ + public static AzureactivedirectoryManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Gets a Configurable instance that can be used to create AzureactivedirectoryManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new AzureactivedirectoryManager.Configurable(); + } + + /** The Configurable allowing configurations to be set. */ + public static final class Configurable { + private final ClientLogger logger = new ClientLogger(Configurable.class); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); + private RetryPolicy retryPolicy; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of Azureactivedirectory service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Azureactivedirectory service API instance. + */ + public AzureactivedirectoryManager 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.azureactivedirectory") + .append("/") + .append("1.0.0-beta.1"); + if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { + userAgentBuilder + .append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } + if (retryPolicy == null) { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new RequestIdPolicy()); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new AzureactivedirectoryManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** @return Resource collection API of Operations. */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** @return Resource collection API of DiagnosticSettingsOperations. */ + public DiagnosticSettingsOperations diagnosticSettingsOperations() { + if (this.diagnosticSettingsOperations == null) { + this.diagnosticSettingsOperations = + new DiagnosticSettingsOperationsImpl(clientObject.getDiagnosticSettingsOperations(), this); + } + return diagnosticSettingsOperations; + } + + /** @return Resource collection API of DiagnosticSettingsCategories. */ + public DiagnosticSettingsCategories diagnosticSettingsCategories() { + if (this.diagnosticSettingsCategories == null) { + this.diagnosticSettingsCategories = + new DiagnosticSettingsCategoriesImpl(clientObject.getDiagnosticSettingsCategories(), this); + } + return diagnosticSettingsCategories; + } + + /** + * @return Wrapped service client Azureactivedirectory providing direct access to the underlying auto-generated API + * implementation, based on Azure REST API. + */ + public Azureactivedirectory serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/Azureactivedirectory.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/Azureactivedirectory.java new file mode 100644 index 0000000000000..1bdad71ea8bb2 --- /dev/null +++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/Azureactivedirectory.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azureactivedirectory.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for Azureactivedirectory class. */ +public interface Azureactivedirectory { + /** + * 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 DiagnosticSettingsOperationsClient object to access its operations. + * + * @return the DiagnosticSettingsOperationsClient object. + */ + DiagnosticSettingsOperationsClient getDiagnosticSettingsOperations(); + + /** + * Gets the DiagnosticSettingsCategoriesClient object to access its operations. + * + * @return the DiagnosticSettingsCategoriesClient object. + */ + DiagnosticSettingsCategoriesClient getDiagnosticSettingsCategories(); +} diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/DiagnosticSettingsCategoriesClient.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/DiagnosticSettingsCategoriesClient.java new file mode 100644 index 0000000000000..6a7b691074ba5 --- /dev/null +++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/DiagnosticSettingsCategoriesClient.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azureactivedirectory.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.azureactivedirectory.fluent.models.DiagnosticSettingsCategoryResourceCollectionInner; + +/** An instance of this class provides access to all the operations defined in DiagnosticSettingsCategoriesClient. */ +public interface DiagnosticSettingsCategoriesClient { + /** + * Lists the diagnostic settings categories for AadIam. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a collection of diagnostic setting category resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DiagnosticSettingsCategoryResourceCollectionInner list(); + + /** + * Lists the diagnostic settings categories for AadIam. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a collection of diagnostic setting category resources along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse(Context context); +} diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/DiagnosticSettingsOperationsClient.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/DiagnosticSettingsOperationsClient.java new file mode 100644 index 0000000000000..8bbe47efea939 --- /dev/null +++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/DiagnosticSettingsOperationsClient.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azureactivedirectory.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.azureactivedirectory.fluent.models.DiagnosticSettingsResourceCollectionInner; +import com.azure.resourcemanager.azureactivedirectory.fluent.models.DiagnosticSettingsResourceInner; + +/** An instance of this class provides access to all the operations defined in DiagnosticSettingsOperationsClient. */ +public interface DiagnosticSettingsOperationsClient { + /** + * Gets the active diagnostic settings list for AadIam. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the active diagnostic settings list for AadIam. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DiagnosticSettingsResourceCollectionInner list(); + + /** + * Gets the active diagnostic settings list for AadIam. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the active diagnostic settings list for AadIam along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse(Context context); + + /** + * Gets the active diagnostic setting for AadIam. + * + * @param name The name of the diagnostic setting. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the active diagnostic setting for AadIam. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DiagnosticSettingsResourceInner get(String name); + + /** + * Gets the active diagnostic setting for AadIam. + * + * @param name The name of the diagnostic setting. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the active diagnostic setting for AadIam along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String name, Context context); + + /** + * Creates or updates diagnostic settings for AadIam. + * + * @param name The name of the diagnostic setting. + * @param parameters Parameters supplied to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the diagnostic setting resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DiagnosticSettingsResourceInner createOrUpdate(String name, DiagnosticSettingsResourceInner parameters); + + /** + * Creates or updates diagnostic settings for AadIam. + * + * @param name The name of the diagnostic setting. + * @param parameters Parameters supplied to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the diagnostic setting resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String name, DiagnosticSettingsResourceInner parameters, Context context); + + /** + * Deletes existing diagnostic setting for AadIam. + * + * @param name The name of the diagnostic setting. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 name); + + /** + * Deletes existing diagnostic setting for AadIam. + * + * @param name The name of the diagnostic setting. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 name, Context context); +} diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/OperationsClient.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/OperationsClient.java new file mode 100644 index 0000000000000..cdaa6df1ef54e --- /dev/null +++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/OperationsClient.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azureactivedirectory.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.azureactivedirectory.fluent.models.OperationsDiscoveryCollectionInner; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public interface OperationsClient { + /** + * Operation to return the list of 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 collection of ClientDiscovery details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationsDiscoveryCollectionInner list(); + + /** + * Operation to return the list of 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 collection of ClientDiscovery details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse(Context context); +} diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/models/DiagnosticSettings.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/models/DiagnosticSettings.java new file mode 100644 index 0000000000000..bc0e762e41ed8 --- /dev/null +++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/models/DiagnosticSettings.java @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azureactivedirectory.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azureactivedirectory.models.LogSettings; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The diagnostic settings. */ +@Fluent +public final class DiagnosticSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DiagnosticSettings.class); + + /* + * The resource ID of the storage account to which you would like to send + * Diagnostic Logs. + */ + @JsonProperty(value = "storageAccountId") + private String storageAccountId; + + /* + * The service bus rule Id of the diagnostic setting. This is here to + * maintain backwards compatibility. + */ + @JsonProperty(value = "serviceBusRuleId") + private String serviceBusRuleId; + + /* + * The workspace ID (resource ID of a Log Analytics workspace) for a Log + * Analytics workspace to which you would like to send Diagnostic Logs. + * Example: + * /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2 + */ + @JsonProperty(value = "workspaceId") + private String workspaceId; + + /* + * The resource Id for the event hub authorization rule. + */ + @JsonProperty(value = "eventHubAuthorizationRuleId") + private String eventHubAuthorizationRuleId; + + /* + * The name of the event hub. If none is specified, the default event hub + * will be selected. + */ + @JsonProperty(value = "eventHubName") + private String eventHubName; + + /* + * The list of logs settings. + */ + @JsonProperty(value = "logs") + private List logs; + + /** + * Get the storageAccountId property: The resource ID of the storage account to which you would like to send + * Diagnostic Logs. + * + * @return the storageAccountId value. + */ + public String storageAccountId() { + return this.storageAccountId; + } + + /** + * Set the storageAccountId property: The resource ID of the storage account to which you would like to send + * Diagnostic Logs. + * + * @param storageAccountId the storageAccountId value to set. + * @return the DiagnosticSettings object itself. + */ + public DiagnosticSettings withStorageAccountId(String storageAccountId) { + this.storageAccountId = storageAccountId; + return this; + } + + /** + * Get the serviceBusRuleId property: The service bus rule Id of the diagnostic setting. This is here to maintain + * backwards compatibility. + * + * @return the serviceBusRuleId value. + */ + public String serviceBusRuleId() { + return this.serviceBusRuleId; + } + + /** + * Set the serviceBusRuleId property: The service bus rule Id of the diagnostic setting. This is here to maintain + * backwards compatibility. + * + * @param serviceBusRuleId the serviceBusRuleId value to set. + * @return the DiagnosticSettings object itself. + */ + public DiagnosticSettings withServiceBusRuleId(String serviceBusRuleId) { + this.serviceBusRuleId = serviceBusRuleId; + return this; + } + + /** + * Get the workspaceId property: The workspace ID (resource ID of a Log Analytics workspace) for a Log Analytics + * workspace to which you would like to send Diagnostic Logs. Example: + * /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2. + * + * @return the workspaceId value. + */ + public String workspaceId() { + return this.workspaceId; + } + + /** + * Set the workspaceId property: The workspace ID (resource ID of a Log Analytics workspace) for a Log Analytics + * workspace to which you would like to send Diagnostic Logs. Example: + * /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2. + * + * @param workspaceId the workspaceId value to set. + * @return the DiagnosticSettings object itself. + */ + public DiagnosticSettings withWorkspaceId(String workspaceId) { + this.workspaceId = workspaceId; + return this; + } + + /** + * Get the eventHubAuthorizationRuleId property: The resource Id for the event hub authorization rule. + * + * @return the eventHubAuthorizationRuleId value. + */ + public String eventHubAuthorizationRuleId() { + return this.eventHubAuthorizationRuleId; + } + + /** + * Set the eventHubAuthorizationRuleId property: The resource Id for the event hub authorization rule. + * + * @param eventHubAuthorizationRuleId the eventHubAuthorizationRuleId value to set. + * @return the DiagnosticSettings object itself. + */ + public DiagnosticSettings withEventHubAuthorizationRuleId(String eventHubAuthorizationRuleId) { + this.eventHubAuthorizationRuleId = eventHubAuthorizationRuleId; + return this; + } + + /** + * Get the eventHubName property: The name of the event hub. If none is specified, the default event hub will be + * selected. + * + * @return the eventHubName value. + */ + public String eventHubName() { + return this.eventHubName; + } + + /** + * Set the eventHubName property: The name of the event hub. If none is specified, the default event hub will be + * selected. + * + * @param eventHubName the eventHubName value to set. + * @return the DiagnosticSettings object itself. + */ + public DiagnosticSettings withEventHubName(String eventHubName) { + this.eventHubName = eventHubName; + return this; + } + + /** + * Get the logs property: The list of logs settings. + * + * @return the logs value. + */ + public List logs() { + return this.logs; + } + + /** + * Set the logs property: The list of logs settings. + * + * @param logs the logs value to set. + * @return the DiagnosticSettings object itself. + */ + public DiagnosticSettings withLogs(List logs) { + this.logs = logs; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (logs() != null) { + logs().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/models/DiagnosticSettingsCategory.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/models/DiagnosticSettingsCategory.java new file mode 100644 index 0000000000000..6aa19f971aa3a --- /dev/null +++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/models/DiagnosticSettingsCategory.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azureactivedirectory.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azureactivedirectory.models.CategoryType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The diagnostic settings Category. */ +@Fluent +public final class DiagnosticSettingsCategory { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DiagnosticSettingsCategory.class); + + /* + * The type of the diagnostic settings category. + */ + @JsonProperty(value = "categoryType") + private CategoryType categoryType; + + /** + * Get the categoryType property: The type of the diagnostic settings category. + * + * @return the categoryType value. + */ + public CategoryType categoryType() { + return this.categoryType; + } + + /** + * Set the categoryType property: The type of the diagnostic settings category. + * + * @param categoryType the categoryType value to set. + * @return the DiagnosticSettingsCategory object itself. + */ + public DiagnosticSettingsCategory withCategoryType(CategoryType categoryType) { + this.categoryType = categoryType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/models/DiagnosticSettingsCategoryResourceCollectionInner.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/models/DiagnosticSettingsCategoryResourceCollectionInner.java new file mode 100644 index 0000000000000..e8cbe6f89809b --- /dev/null +++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/models/DiagnosticSettingsCategoryResourceCollectionInner.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azureactivedirectory.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azureactivedirectory.models.DiagnosticSettingsCategoryResource; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Represents a collection of diagnostic setting category resources. */ +@Fluent +public final class DiagnosticSettingsCategoryResourceCollectionInner { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(DiagnosticSettingsCategoryResourceCollectionInner.class); + + /* + * The collection of diagnostic settings category resources. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: The collection of diagnostic settings category resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The collection of diagnostic settings category resources. + * + * @param value the value value to set. + * @return the DiagnosticSettingsCategoryResourceCollectionInner object itself. + */ + public DiagnosticSettingsCategoryResourceCollectionInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/models/DiagnosticSettingsResourceCollectionInner.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/models/DiagnosticSettingsResourceCollectionInner.java new file mode 100644 index 0000000000000..4c1ad6f30f8a2 --- /dev/null +++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/models/DiagnosticSettingsResourceCollectionInner.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azureactivedirectory.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Represents a collection of alert rule resources. */ +@Fluent +public final class DiagnosticSettingsResourceCollectionInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DiagnosticSettingsResourceCollectionInner.class); + + /* + * The collection of diagnostic settings resources. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: The collection of diagnostic settings resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The collection of diagnostic settings resources. + * + * @param value the value value to set. + * @return the DiagnosticSettingsResourceCollectionInner object itself. + */ + public DiagnosticSettingsResourceCollectionInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/models/DiagnosticSettingsResourceInner.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/models/DiagnosticSettingsResourceInner.java new file mode 100644 index 0000000000000..d8eaf83d72f61 --- /dev/null +++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/models/DiagnosticSettingsResourceInner.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azureactivedirectory.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azureactivedirectory.models.LogSettings; +import com.azure.resourcemanager.azureactivedirectory.models.ProxyOnlyResource; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The diagnostic setting resource. */ +@Fluent +public final class DiagnosticSettingsResourceInner extends ProxyOnlyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DiagnosticSettingsResourceInner.class); + + /* + * Properties of a Diagnostic Settings Resource. + */ + @JsonProperty(value = "properties") + private DiagnosticSettings innerProperties; + + /** + * Get the innerProperties property: Properties of a Diagnostic Settings Resource. + * + * @return the innerProperties value. + */ + private DiagnosticSettings innerProperties() { + return this.innerProperties; + } + + /** + * Get the storageAccountId property: The resource ID of the storage account to which you would like to send + * Diagnostic Logs. + * + * @return the storageAccountId value. + */ + public String storageAccountId() { + return this.innerProperties() == null ? null : this.innerProperties().storageAccountId(); + } + + /** + * Set the storageAccountId property: The resource ID of the storage account to which you would like to send + * Diagnostic Logs. + * + * @param storageAccountId the storageAccountId value to set. + * @return the DiagnosticSettingsResourceInner object itself. + */ + public DiagnosticSettingsResourceInner withStorageAccountId(String storageAccountId) { + if (this.innerProperties() == null) { + this.innerProperties = new DiagnosticSettings(); + } + this.innerProperties().withStorageAccountId(storageAccountId); + return this; + } + + /** + * Get the serviceBusRuleId property: The service bus rule Id of the diagnostic setting. This is here to maintain + * backwards compatibility. + * + * @return the serviceBusRuleId value. + */ + public String serviceBusRuleId() { + return this.innerProperties() == null ? null : this.innerProperties().serviceBusRuleId(); + } + + /** + * Set the serviceBusRuleId property: The service bus rule Id of the diagnostic setting. This is here to maintain + * backwards compatibility. + * + * @param serviceBusRuleId the serviceBusRuleId value to set. + * @return the DiagnosticSettingsResourceInner object itself. + */ + public DiagnosticSettingsResourceInner withServiceBusRuleId(String serviceBusRuleId) { + if (this.innerProperties() == null) { + this.innerProperties = new DiagnosticSettings(); + } + this.innerProperties().withServiceBusRuleId(serviceBusRuleId); + return this; + } + + /** + * Get the workspaceId property: The workspace ID (resource ID of a Log Analytics workspace) for a Log Analytics + * workspace to which you would like to send Diagnostic Logs. Example: + * /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2. + * + * @return the workspaceId value. + */ + public String workspaceId() { + return this.innerProperties() == null ? null : this.innerProperties().workspaceId(); + } + + /** + * Set the workspaceId property: The workspace ID (resource ID of a Log Analytics workspace) for a Log Analytics + * workspace to which you would like to send Diagnostic Logs. Example: + * /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2. + * + * @param workspaceId the workspaceId value to set. + * @return the DiagnosticSettingsResourceInner object itself. + */ + public DiagnosticSettingsResourceInner withWorkspaceId(String workspaceId) { + if (this.innerProperties() == null) { + this.innerProperties = new DiagnosticSettings(); + } + this.innerProperties().withWorkspaceId(workspaceId); + return this; + } + + /** + * Get the eventHubAuthorizationRuleId property: The resource Id for the event hub authorization rule. + * + * @return the eventHubAuthorizationRuleId value. + */ + public String eventHubAuthorizationRuleId() { + return this.innerProperties() == null ? null : this.innerProperties().eventHubAuthorizationRuleId(); + } + + /** + * Set the eventHubAuthorizationRuleId property: The resource Id for the event hub authorization rule. + * + * @param eventHubAuthorizationRuleId the eventHubAuthorizationRuleId value to set. + * @return the DiagnosticSettingsResourceInner object itself. + */ + public DiagnosticSettingsResourceInner withEventHubAuthorizationRuleId(String eventHubAuthorizationRuleId) { + if (this.innerProperties() == null) { + this.innerProperties = new DiagnosticSettings(); + } + this.innerProperties().withEventHubAuthorizationRuleId(eventHubAuthorizationRuleId); + return this; + } + + /** + * Get the eventHubName property: The name of the event hub. If none is specified, the default event hub will be + * selected. + * + * @return the eventHubName value. + */ + public String eventHubName() { + return this.innerProperties() == null ? null : this.innerProperties().eventHubName(); + } + + /** + * Set the eventHubName property: The name of the event hub. If none is specified, the default event hub will be + * selected. + * + * @param eventHubName the eventHubName value to set. + * @return the DiagnosticSettingsResourceInner object itself. + */ + public DiagnosticSettingsResourceInner withEventHubName(String eventHubName) { + if (this.innerProperties() == null) { + this.innerProperties = new DiagnosticSettings(); + } + this.innerProperties().withEventHubName(eventHubName); + return this; + } + + /** + * Get the logs property: The list of logs settings. + * + * @return the logs value. + */ + public List logs() { + return this.innerProperties() == null ? null : this.innerProperties().logs(); + } + + /** + * Set the logs property: The list of logs settings. + * + * @param logs the logs value to set. + * @return the DiagnosticSettingsResourceInner object itself. + */ + public DiagnosticSettingsResourceInner withLogs(List logs) { + if (this.innerProperties() == null) { + this.innerProperties = new DiagnosticSettings(); + } + this.innerProperties().withLogs(logs); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/models/OperationsDiscoveryCollectionInner.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/models/OperationsDiscoveryCollectionInner.java new file mode 100644 index 0000000000000..735753b319cc8 --- /dev/null +++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/models/OperationsDiscoveryCollectionInner.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azureactivedirectory.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azureactivedirectory.models.OperationsDiscovery; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Collection of ClientDiscovery details. */ +@Fluent +public final class OperationsDiscoveryCollectionInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsDiscoveryCollectionInner.class); + + /* + * The ClientDiscovery details. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: The ClientDiscovery details. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The ClientDiscovery details. + * + * @param value the value value to set. + * @return the OperationsDiscoveryCollectionInner object itself. + */ + public OperationsDiscoveryCollectionInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/models/package-info.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/models/package-info.java new file mode 100644 index 0000000000000..d86814317af6a --- /dev/null +++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the inner data models for Azureactivedirectory. Azure Active Directory Client. */ +package com.azure.resourcemanager.azureactivedirectory.fluent.models; diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/package-info.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/package-info.java new file mode 100644 index 0000000000000..cbd53c6a16aed --- /dev/null +++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the service clients for Azureactivedirectory. Azure Active Directory Client. */ +package com.azure.resourcemanager.azureactivedirectory.fluent; diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/AzureactivedirectoryBuilder.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/AzureactivedirectoryBuilder.java new file mode 100644 index 0000000000000..ea5b599ab60d3 --- /dev/null +++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/AzureactivedirectoryBuilder.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azureactivedirectory.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.CookiePolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** A builder for creating a new instance of the AzureactivedirectoryImpl type. */ +@ServiceClientBuilder(serviceClients = {AzureactivedirectoryImpl.class}) +public final class AzureactivedirectoryBuilder { + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the AzureactivedirectoryBuilder. + */ + public AzureactivedirectoryBuilder 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 AzureactivedirectoryBuilder. + */ + public AzureactivedirectoryBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the AzureactivedirectoryBuilder. + */ + public AzureactivedirectoryBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the AzureactivedirectoryBuilder. + */ + public AzureactivedirectoryBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the AzureactivedirectoryBuilder. + */ + public AzureactivedirectoryBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of AzureactivedirectoryImpl with the provided parameters. + * + * @return an instance of AzureactivedirectoryImpl. + */ + public AzureactivedirectoryImpl buildClient() { + if (endpoint == null) { + this.endpoint = "https://management.azure.com"; + } + if (environment == null) { + this.environment = AzureEnvironment.AZURE; + } + if (defaultPollInterval == null) { + this.defaultPollInterval = Duration.ofSeconds(30); + } + if (pipeline == null) { + this.pipeline = + new HttpPipelineBuilder() + .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) + .build(); + } + if (serializerAdapter == null) { + this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); + } + AzureactivedirectoryImpl client = + new AzureactivedirectoryImpl(pipeline, serializerAdapter, defaultPollInterval, environment, endpoint); + return client; + } +} diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/AzureactivedirectoryImpl.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/AzureactivedirectoryImpl.java new file mode 100644 index 0000000000000..9b272374e9044 --- /dev/null +++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/AzureactivedirectoryImpl.java @@ -0,0 +1,306 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azureactivedirectory.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.azureactivedirectory.fluent.Azureactivedirectory; +import com.azure.resourcemanager.azureactivedirectory.fluent.DiagnosticSettingsCategoriesClient; +import com.azure.resourcemanager.azureactivedirectory.fluent.DiagnosticSettingsOperationsClient; +import com.azure.resourcemanager.azureactivedirectory.fluent.OperationsClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import java.util.Map; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the AzureactivedirectoryImpl type. */ +@ServiceClient(builder = AzureactivedirectoryBuilder.class) +public final class AzureactivedirectoryImpl implements Azureactivedirectory { + private final ClientLogger logger = new ClientLogger(AzureactivedirectoryImpl.class); + + /** 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 DiagnosticSettingsOperationsClient object to access its operations. */ + private final DiagnosticSettingsOperationsClient diagnosticSettingsOperations; + + /** + * Gets the DiagnosticSettingsOperationsClient object to access its operations. + * + * @return the DiagnosticSettingsOperationsClient object. + */ + public DiagnosticSettingsOperationsClient getDiagnosticSettingsOperations() { + return this.diagnosticSettingsOperations; + } + + /** The DiagnosticSettingsCategoriesClient object to access its operations. */ + private final DiagnosticSettingsCategoriesClient diagnosticSettingsCategories; + + /** + * Gets the DiagnosticSettingsCategoriesClient object to access its operations. + * + * @return the DiagnosticSettingsCategoriesClient object. + */ + public DiagnosticSettingsCategoriesClient getDiagnosticSettingsCategories() { + return this.diagnosticSettingsCategories; + } + + /** + * Initializes an instance of Azureactivedirectory 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 endpoint server parameter. + */ + AzureactivedirectoryImpl( + HttpPipeline httpPipeline, + SerializerAdapter serializerAdapter, + Duration defaultPollInterval, + AzureEnvironment environment, + String endpoint) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.endpoint = endpoint; + this.apiVersion = "2017-04-01-preview"; + this.operations = new OperationsClientImpl(this); + this.diagnosticSettingsOperations = new DiagnosticSettingsOperationsClientImpl(this); + this.diagnosticSettingsCategories = new DiagnosticSettingsCategoriesClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + for (Map.Entry entry : this.getContext().getValues().entrySet()) { + context = context.addData(entry.getKey(), entry.getValue()); + } + return context; + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult( + Mono>> activationResponse, + HttpPipeline httpPipeline, + Type pollResultType, + Type finalResultType, + Context context) { + return PollerFactory + .create( + serializerAdapter, + httpPipeline, + pollResultType, + finalResultType, + defaultPollInterval, + activationResponse, + context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = + new HttpResponseImpl( + lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = + this + .getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + logger.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(s); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } +} diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/DiagnosticSettingsCategoriesClientImpl.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/DiagnosticSettingsCategoriesClientImpl.java new file mode 100644 index 0000000000000..f3d636a4f4e05 --- /dev/null +++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/DiagnosticSettingsCategoriesClientImpl.java @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azureactivedirectory.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.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azureactivedirectory.fluent.DiagnosticSettingsCategoriesClient; +import com.azure.resourcemanager.azureactivedirectory.fluent.models.DiagnosticSettingsCategoryResourceCollectionInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in DiagnosticSettingsCategoriesClient. */ +public final class DiagnosticSettingsCategoriesClientImpl implements DiagnosticSettingsCategoriesClient { + private final ClientLogger logger = new ClientLogger(DiagnosticSettingsCategoriesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final DiagnosticSettingsCategoriesService service; + + /** The service client containing this operation class. */ + private final AzureactivedirectoryImpl client; + + /** + * Initializes an instance of DiagnosticSettingsCategoriesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DiagnosticSettingsCategoriesClientImpl(AzureactivedirectoryImpl client) { + this.service = + RestProxy + .create( + DiagnosticSettingsCategoriesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureactivedirectoryDiagnosticSettingsCategories to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "Azureactivedirectory") + private interface DiagnosticSettingsCategoriesService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/microsoft.aadiam/diagnosticSettingsCategories") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists the diagnostic settings categories for AadIam. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a collection of diagnostic setting category resources along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync() { + 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)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the diagnostic settings categories for AadIam. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a collection of diagnostic setting category resources along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync(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); + } + + /** + * Lists the diagnostic settings categories for AadIam. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a collection of diagnostic setting category resources on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync() { + return listWithResponseAsync() + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Lists the diagnostic settings categories for AadIam. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a collection of diagnostic setting category resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DiagnosticSettingsCategoryResourceCollectionInner list() { + return listAsync().block(); + } + + /** + * Lists the diagnostic settings categories for AadIam. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a collection of diagnostic setting category resources along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse(Context context) { + return listWithResponseAsync(context).block(); + } +} diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/DiagnosticSettingsCategoriesImpl.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/DiagnosticSettingsCategoriesImpl.java new file mode 100644 index 0000000000000..916a7aa44cb3f --- /dev/null +++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/DiagnosticSettingsCategoriesImpl.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azureactivedirectory.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.azureactivedirectory.fluent.DiagnosticSettingsCategoriesClient; +import com.azure.resourcemanager.azureactivedirectory.fluent.models.DiagnosticSettingsCategoryResourceCollectionInner; +import com.azure.resourcemanager.azureactivedirectory.models.DiagnosticSettingsCategories; +import com.azure.resourcemanager.azureactivedirectory.models.DiagnosticSettingsCategoryResourceCollection; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class DiagnosticSettingsCategoriesImpl implements DiagnosticSettingsCategories { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DiagnosticSettingsCategoriesImpl.class); + + private final DiagnosticSettingsCategoriesClient innerClient; + + private final com.azure.resourcemanager.azureactivedirectory.AzureactivedirectoryManager serviceManager; + + public DiagnosticSettingsCategoriesImpl( + DiagnosticSettingsCategoriesClient innerClient, + com.azure.resourcemanager.azureactivedirectory.AzureactivedirectoryManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public DiagnosticSettingsCategoryResourceCollection list() { + DiagnosticSettingsCategoryResourceCollectionInner inner = this.serviceClient().list(); + if (inner != null) { + return new DiagnosticSettingsCategoryResourceCollectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listWithResponse(Context context) { + Response inner = + this.serviceClient().listWithResponse(context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DiagnosticSettingsCategoryResourceCollectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private DiagnosticSettingsCategoriesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.azureactivedirectory.AzureactivedirectoryManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/DiagnosticSettingsCategoryResourceCollectionImpl.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/DiagnosticSettingsCategoryResourceCollectionImpl.java new file mode 100644 index 0000000000000..643a8a3611a94 --- /dev/null +++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/DiagnosticSettingsCategoryResourceCollectionImpl.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azureactivedirectory.implementation; + +import com.azure.resourcemanager.azureactivedirectory.fluent.models.DiagnosticSettingsCategoryResourceCollectionInner; +import com.azure.resourcemanager.azureactivedirectory.models.DiagnosticSettingsCategoryResource; +import com.azure.resourcemanager.azureactivedirectory.models.DiagnosticSettingsCategoryResourceCollection; +import java.util.Collections; +import java.util.List; + +public final class DiagnosticSettingsCategoryResourceCollectionImpl + implements DiagnosticSettingsCategoryResourceCollection { + private DiagnosticSettingsCategoryResourceCollectionInner innerObject; + + private final com.azure.resourcemanager.azureactivedirectory.AzureactivedirectoryManager serviceManager; + + DiagnosticSettingsCategoryResourceCollectionImpl( + DiagnosticSettingsCategoryResourceCollectionInner innerObject, + com.azure.resourcemanager.azureactivedirectory.AzureactivedirectoryManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public DiagnosticSettingsCategoryResourceCollectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azureactivedirectory.AzureactivedirectoryManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/DiagnosticSettingsOperationsClientImpl.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/DiagnosticSettingsOperationsClientImpl.java new file mode 100644 index 0000000000000..179a77e3339ae --- /dev/null +++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/DiagnosticSettingsOperationsClientImpl.java @@ -0,0 +1,528 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azureactivedirectory.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azureactivedirectory.fluent.DiagnosticSettingsOperationsClient; +import com.azure.resourcemanager.azureactivedirectory.fluent.models.DiagnosticSettingsResourceCollectionInner; +import com.azure.resourcemanager.azureactivedirectory.fluent.models.DiagnosticSettingsResourceInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in DiagnosticSettingsOperationsClient. */ +public final class DiagnosticSettingsOperationsClientImpl implements DiagnosticSettingsOperationsClient { + private final ClientLogger logger = new ClientLogger(DiagnosticSettingsOperationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final DiagnosticSettingsOperationsService service; + + /** The service client containing this operation class. */ + private final AzureactivedirectoryImpl client; + + /** + * Initializes an instance of DiagnosticSettingsOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DiagnosticSettingsOperationsClientImpl(AzureactivedirectoryImpl client) { + this.service = + RestProxy + .create( + DiagnosticSettingsOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureactivedirectoryDiagnosticSettingsOperations to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "Azureactivedirectory") + private interface DiagnosticSettingsOperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/microsoft.aadiam/diagnosticSettings") + @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("/providers/microsoft.aadiam/diagnosticSettings/{name}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("name") String name, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put("/providers/microsoft.aadiam/diagnosticSettings/{name}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("name") String name, + @BodyParam("application/json") DiagnosticSettingsResourceInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete("/providers/microsoft.aadiam/diagnosticSettings/{name}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("name") String name, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the active diagnostic settings list for AadIam. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the active diagnostic settings list for AadIam along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync() { + 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)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the active diagnostic settings list for AadIam. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the active diagnostic settings list for AadIam along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync(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); + } + + /** + * Gets the active diagnostic settings list for AadIam. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the active diagnostic settings list for AadIam on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync() { + return listWithResponseAsync() + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the active diagnostic settings list for AadIam. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the active diagnostic settings list for AadIam. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DiagnosticSettingsResourceCollectionInner list() { + return listAsync().block(); + } + + /** + * Gets the active diagnostic settings list for AadIam. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the active diagnostic settings list for AadIam along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse(Context context) { + return listWithResponseAsync(context).block(); + } + + /** + * Gets the active diagnostic setting for AadIam. + * + * @param name The name of the diagnostic setting. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the active diagnostic setting for AadIam along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String name) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the active diagnostic setting for AadIam. + * + * @param name The name of the diagnostic setting. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the active diagnostic setting for AadIam along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), name, accept, context); + } + + /** + * Gets the active diagnostic setting for AadIam. + * + * @param name The name of the diagnostic setting. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the active diagnostic setting for AadIam on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String name) { + return getWithResponseAsync(name) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the active diagnostic setting for AadIam. + * + * @param name The name of the diagnostic setting. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the active diagnostic setting for AadIam. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DiagnosticSettingsResourceInner get(String name) { + return getAsync(name).block(); + } + + /** + * Gets the active diagnostic setting for AadIam. + * + * @param name The name of the diagnostic setting. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the active diagnostic setting for AadIam along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String name, Context context) { + return getWithResponseAsync(name, context).block(); + } + + /** + * Creates or updates diagnostic settings for AadIam. + * + * @param name The name of the diagnostic setting. + * @param parameters Parameters supplied to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the diagnostic setting resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String name, DiagnosticSettingsResourceInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), this.client.getApiVersion(), name, parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates diagnostic settings for AadIam. + * + * @param name The name of the diagnostic setting. + * @param parameters Parameters supplied to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the diagnostic setting resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String name, DiagnosticSettingsResourceInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), name, parameters, accept, context); + } + + /** + * Creates or updates diagnostic settings for AadIam. + * + * @param name The name of the diagnostic setting. + * @param parameters Parameters supplied to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the diagnostic setting resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String name, DiagnosticSettingsResourceInner parameters) { + return createOrUpdateWithResponseAsync(name, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates diagnostic settings for AadIam. + * + * @param name The name of the diagnostic setting. + * @param parameters Parameters supplied to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the diagnostic setting resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DiagnosticSettingsResourceInner createOrUpdate(String name, DiagnosticSettingsResourceInner parameters) { + return createOrUpdateAsync(name, parameters).block(); + } + + /** + * Creates or updates diagnostic settings for AadIam. + * + * @param name The name of the diagnostic setting. + * @param parameters Parameters supplied to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the diagnostic setting resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String name, DiagnosticSettingsResourceInner parameters, Context context) { + return createOrUpdateWithResponseAsync(name, parameters, context).block(); + } + + /** + * Deletes existing diagnostic setting for AadIam. + * + * @param name The name of the diagnostic setting. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 name) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service.delete(this.client.getEndpoint(), this.client.getApiVersion(), name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes existing diagnostic setting for AadIam. + * + * @param name The name of the diagnostic setting. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), name, accept, context); + } + + /** + * Deletes existing diagnostic setting for AadIam. + * + * @param name The name of the diagnostic setting. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 name) { + return deleteWithResponseAsync(name).flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes existing diagnostic setting for AadIam. + * + * @param name The name of the diagnostic setting. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 name) { + deleteAsync(name).block(); + } + + /** + * Deletes existing diagnostic setting for AadIam. + * + * @param name The name of the diagnostic setting. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 name, Context context) { + return deleteWithResponseAsync(name, context).block(); + } +} diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/DiagnosticSettingsOperationsImpl.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/DiagnosticSettingsOperationsImpl.java new file mode 100644 index 0000000000000..7d60273cbdca4 --- /dev/null +++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/DiagnosticSettingsOperationsImpl.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azureactivedirectory.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.azureactivedirectory.fluent.DiagnosticSettingsOperationsClient; +import com.azure.resourcemanager.azureactivedirectory.fluent.models.DiagnosticSettingsResourceCollectionInner; +import com.azure.resourcemanager.azureactivedirectory.fluent.models.DiagnosticSettingsResourceInner; +import com.azure.resourcemanager.azureactivedirectory.models.DiagnosticSettingsOperations; +import com.azure.resourcemanager.azureactivedirectory.models.DiagnosticSettingsResource; +import com.azure.resourcemanager.azureactivedirectory.models.DiagnosticSettingsResourceCollection; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class DiagnosticSettingsOperationsImpl implements DiagnosticSettingsOperations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DiagnosticSettingsOperationsImpl.class); + + private final DiagnosticSettingsOperationsClient innerClient; + + private final com.azure.resourcemanager.azureactivedirectory.AzureactivedirectoryManager serviceManager; + + public DiagnosticSettingsOperationsImpl( + DiagnosticSettingsOperationsClient innerClient, + com.azure.resourcemanager.azureactivedirectory.AzureactivedirectoryManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public DiagnosticSettingsResourceCollection list() { + DiagnosticSettingsResourceCollectionInner inner = this.serviceClient().list(); + if (inner != null) { + return new DiagnosticSettingsResourceCollectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listWithResponse(Context context) { + Response inner = this.serviceClient().listWithResponse(context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DiagnosticSettingsResourceCollectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DiagnosticSettingsResource get(String name) { + DiagnosticSettingsResourceInner inner = this.serviceClient().get(name); + if (inner != null) { + return new DiagnosticSettingsResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse(String name, Context context) { + Response inner = this.serviceClient().getWithResponse(name, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DiagnosticSettingsResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DiagnosticSettingsResource createOrUpdate(String name, DiagnosticSettingsResourceInner parameters) { + DiagnosticSettingsResourceInner inner = this.serviceClient().createOrUpdate(name, parameters); + if (inner != null) { + return new DiagnosticSettingsResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createOrUpdateWithResponse( + String name, DiagnosticSettingsResourceInner parameters, Context context) { + Response inner = + this.serviceClient().createOrUpdateWithResponse(name, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DiagnosticSettingsResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String name) { + this.serviceClient().delete(name); + } + + public Response deleteWithResponse(String name, Context context) { + return this.serviceClient().deleteWithResponse(name, context); + } + + private DiagnosticSettingsOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.azureactivedirectory.AzureactivedirectoryManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/DiagnosticSettingsResourceCollectionImpl.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/DiagnosticSettingsResourceCollectionImpl.java new file mode 100644 index 0000000000000..b041f8403dc34 --- /dev/null +++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/DiagnosticSettingsResourceCollectionImpl.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azureactivedirectory.implementation; + +import com.azure.resourcemanager.azureactivedirectory.fluent.models.DiagnosticSettingsResourceCollectionInner; +import com.azure.resourcemanager.azureactivedirectory.fluent.models.DiagnosticSettingsResourceInner; +import com.azure.resourcemanager.azureactivedirectory.models.DiagnosticSettingsResource; +import com.azure.resourcemanager.azureactivedirectory.models.DiagnosticSettingsResourceCollection; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class DiagnosticSettingsResourceCollectionImpl implements DiagnosticSettingsResourceCollection { + private DiagnosticSettingsResourceCollectionInner innerObject; + + private final com.azure.resourcemanager.azureactivedirectory.AzureactivedirectoryManager serviceManager; + + DiagnosticSettingsResourceCollectionImpl( + DiagnosticSettingsResourceCollectionInner innerObject, + com.azure.resourcemanager.azureactivedirectory.AzureactivedirectoryManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new DiagnosticSettingsResourceImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public DiagnosticSettingsResourceCollectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azureactivedirectory.AzureactivedirectoryManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/DiagnosticSettingsResourceImpl.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/DiagnosticSettingsResourceImpl.java new file mode 100644 index 0000000000000..7063294ba3c7c --- /dev/null +++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/DiagnosticSettingsResourceImpl.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azureactivedirectory.implementation; + +import com.azure.resourcemanager.azureactivedirectory.fluent.models.DiagnosticSettingsResourceInner; +import com.azure.resourcemanager.azureactivedirectory.models.DiagnosticSettingsResource; +import com.azure.resourcemanager.azureactivedirectory.models.LogSettings; +import java.util.Collections; +import java.util.List; + +public final class DiagnosticSettingsResourceImpl implements DiagnosticSettingsResource { + private DiagnosticSettingsResourceInner innerObject; + + private final com.azure.resourcemanager.azureactivedirectory.AzureactivedirectoryManager serviceManager; + + DiagnosticSettingsResourceImpl( + DiagnosticSettingsResourceInner innerObject, + com.azure.resourcemanager.azureactivedirectory.AzureactivedirectoryManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String storageAccountId() { + return this.innerModel().storageAccountId(); + } + + public String serviceBusRuleId() { + return this.innerModel().serviceBusRuleId(); + } + + public String workspaceId() { + return this.innerModel().workspaceId(); + } + + public String eventHubAuthorizationRuleId() { + return this.innerModel().eventHubAuthorizationRuleId(); + } + + public String eventHubName() { + return this.innerModel().eventHubName(); + } + + public List logs() { + List inner = this.innerModel().logs(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public DiagnosticSettingsResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azureactivedirectory.AzureactivedirectoryManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/OperationsClientImpl.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/OperationsClientImpl.java new file mode 100644 index 0000000000000..89f537cc16467 --- /dev/null +++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/OperationsClientImpl.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azureactivedirectory.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.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azureactivedirectory.fluent.OperationsClient; +import com.azure.resourcemanager.azureactivedirectory.fluent.models.OperationsDiscoveryCollectionInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public final class OperationsClientImpl implements OperationsClient { + private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final OperationsService service; + + /** The service client containing this operation class. */ + private final AzureactivedirectoryImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(AzureactivedirectoryImpl client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureactivedirectoryOperations to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "Azureactivedirectory") + private interface OperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/microsoft.aadiam/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Operation to return the list of 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 collection of ClientDiscovery details along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync() { + 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)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Operation to return the list of 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 collection of ClientDiscovery details along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync(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); + } + + /** + * Operation to return the list of 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 collection of ClientDiscovery details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync() { + return listWithResponseAsync() + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Operation to return the list of 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 collection of ClientDiscovery details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationsDiscoveryCollectionInner list() { + return listAsync().block(); + } + + /** + * Operation to return the list of 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 collection of ClientDiscovery details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse(Context context) { + return listWithResponseAsync(context).block(); + } +} diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/OperationsDiscoveryCollectionImpl.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/OperationsDiscoveryCollectionImpl.java new file mode 100644 index 0000000000000..ecb1ec4844d9b --- /dev/null +++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/OperationsDiscoveryCollectionImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azureactivedirectory.implementation; + +import com.azure.resourcemanager.azureactivedirectory.fluent.models.OperationsDiscoveryCollectionInner; +import com.azure.resourcemanager.azureactivedirectory.models.OperationsDiscovery; +import com.azure.resourcemanager.azureactivedirectory.models.OperationsDiscoveryCollection; +import java.util.Collections; +import java.util.List; + +public final class OperationsDiscoveryCollectionImpl implements OperationsDiscoveryCollection { + private OperationsDiscoveryCollectionInner innerObject; + + private final com.azure.resourcemanager.azureactivedirectory.AzureactivedirectoryManager serviceManager; + + OperationsDiscoveryCollectionImpl( + OperationsDiscoveryCollectionInner innerObject, + com.azure.resourcemanager.azureactivedirectory.AzureactivedirectoryManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public OperationsDiscoveryCollectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azureactivedirectory.AzureactivedirectoryManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/OperationsImpl.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..2cb297c06b97c --- /dev/null +++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/OperationsImpl.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azureactivedirectory.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.azureactivedirectory.fluent.OperationsClient; +import com.azure.resourcemanager.azureactivedirectory.fluent.models.OperationsDiscoveryCollectionInner; +import com.azure.resourcemanager.azureactivedirectory.models.Operations; +import com.azure.resourcemanager.azureactivedirectory.models.OperationsDiscoveryCollection; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class OperationsImpl implements Operations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final com.azure.resourcemanager.azureactivedirectory.AzureactivedirectoryManager serviceManager; + + public OperationsImpl( + OperationsClient innerClient, + com.azure.resourcemanager.azureactivedirectory.AzureactivedirectoryManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public OperationsDiscoveryCollection list() { + OperationsDiscoveryCollectionInner inner = this.serviceClient().list(); + if (inner != null) { + return new OperationsDiscoveryCollectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listWithResponse(Context context) { + Response inner = this.serviceClient().listWithResponse(context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new OperationsDiscoveryCollectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.azureactivedirectory.AzureactivedirectoryManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/Utils.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/Utils.java new file mode 100644 index 0000000000000..7247a0b743ac9 --- /dev/null +++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/Utils.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azureactivedirectory.implementation; + +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.util.CoreUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import reactor.core.publisher.Flux; + +final class Utils { + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterator itr = Arrays.stream(id.split("/")).iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null) { + return null; + } + String parameterNameParentheses = "{" + parameterName + "}"; + List idSegmentsReverted = Arrays.asList(id.split("/")); + List pathSegments = Arrays.asList(pathTemplate.split("/")); + Collections.reverse(idSegmentsReverted); + Iterator idItrReverted = idSegmentsReverted.iterator(); + int pathIndex = pathSegments.size(); + while (idItrReverted.hasNext() && pathIndex > 0) { + String idSegment = idItrReverted.next(); + String pathSegment = pathSegments.get(--pathIndex); + if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { + if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { + if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { + List segments = new ArrayList<>(); + segments.add(idSegment); + idItrReverted.forEachRemaining(segments::add); + Collections.reverse(segments); + if (segments.size() > 0 && segments.get(0).isEmpty()) { + segments.remove(0); + } + return String.join("/", segments); + } else { + return idSegment; + } + } + } + } + return null; + } + + static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { + return new PagedIterableImpl(pageIterable, mapper); + } + + private static final class PagedIterableImpl extends PagedIterable { + + private final PagedIterable pagedIterable; + private final Function mapper; + private final Function, PagedResponse> pageMapper; + + private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { + super( + PagedFlux + .create( + () -> + (continuationToken, pageSize) -> + Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + this.pagedIterable = pagedIterable; + this.mapper = mapper; + this.pageMapper = getPageMapper(mapper); + } + + private static Function, PagedResponse> getPageMapper(Function mapper) { + return page -> + new PagedResponseBase( + page.getRequest(), + page.getStatusCode(), + page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), + page.getContinuationToken(), + null); + } + + @Override + public Stream stream() { + return pagedIterable.stream().map(mapper); + } + + @Override + public Stream> streamByPage() { + return pagedIterable.streamByPage().map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken) { + return pagedIterable.streamByPage(continuationToken).map(pageMapper); + } + + @Override + public Stream> streamByPage(int preferredPageSize) { + return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken, int preferredPageSize) { + return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + } + + @Override + public Iterator iterator() { + return new IteratorImpl(pagedIterable.iterator(), mapper); + } + + @Override + public Iterable> iterableByPage() { + return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + } + } + + private static final class IteratorImpl implements Iterator { + + private final Iterator iterator; + private final Function mapper; + + private IteratorImpl(Iterator iterator, Function mapper) { + this.iterator = iterator; + this.mapper = mapper; + } + + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public S next() { + return mapper.apply(iterator.next()); + } + + @Override + public void remove() { + iterator.remove(); + } + } + + private static final class IterableImpl implements Iterable { + + private final Iterable iterable; + private final Function mapper; + + private IterableImpl(Iterable iterable, Function mapper) { + this.iterable = iterable; + this.mapper = mapper; + } + + @Override + public Iterator iterator() { + return new IteratorImpl(iterable.iterator(), mapper); + } + } +} diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/package-info.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/package-info.java new file mode 100644 index 0000000000000..6c2522b4870fc --- /dev/null +++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the implementations for Azureactivedirectory. Azure Active Directory Client. */ +package com.azure.resourcemanager.azureactivedirectory.implementation; diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/Category.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/Category.java new file mode 100644 index 0000000000000..d21665dbedf0b --- /dev/null +++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/Category.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azureactivedirectory.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Category. */ +public final class Category extends ExpandableStringEnum { + /** Static value AuditLogs for Category. */ + public static final Category AUDIT_LOGS = fromString("AuditLogs"); + + /** Static value SignInLogs for Category. */ + public static final Category SIGN_IN_LOGS = fromString("SignInLogs"); + + /** + * Creates or finds a Category from its string representation. + * + * @param name a name to look for. + * @return the corresponding Category. + */ + @JsonCreator + public static Category fromString(String name) { + return fromString(name, Category.class); + } + + /** @return known Category values. */ + public static Collection values() { + return values(Category.class); + } +} diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/CategoryType.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/CategoryType.java new file mode 100644 index 0000000000000..503bc083c6ac9 --- /dev/null +++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/CategoryType.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azureactivedirectory.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for CategoryType. */ +public final class CategoryType extends ExpandableStringEnum { + /** Static value Logs for CategoryType. */ + public static final CategoryType LOGS = fromString("Logs"); + + /** + * Creates or finds a CategoryType from its string representation. + * + * @param name a name to look for. + * @return the corresponding CategoryType. + */ + @JsonCreator + public static CategoryType fromString(String name) { + return fromString(name, CategoryType.class); + } + + /** @return known CategoryType values. */ + public static Collection values() { + return values(CategoryType.class); + } +} diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/DiagnosticSettingsCategories.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/DiagnosticSettingsCategories.java new file mode 100644 index 0000000000000..6bf9796bc3532 --- /dev/null +++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/DiagnosticSettingsCategories.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azureactivedirectory.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of DiagnosticSettingsCategories. */ +public interface DiagnosticSettingsCategories { + /** + * Lists the diagnostic settings categories for AadIam. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a collection of diagnostic setting category resources. + */ + DiagnosticSettingsCategoryResourceCollection list(); + + /** + * Lists the diagnostic settings categories for AadIam. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a collection of diagnostic setting category resources along with {@link Response}. + */ + Response listWithResponse(Context context); +} diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/DiagnosticSettingsCategoryResource.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/DiagnosticSettingsCategoryResource.java new file mode 100644 index 0000000000000..4222aa640a3c8 --- /dev/null +++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/DiagnosticSettingsCategoryResource.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azureactivedirectory.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azureactivedirectory.fluent.models.DiagnosticSettingsCategory; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The diagnostic settings category resource. */ +@Fluent +public final class DiagnosticSettingsCategoryResource extends ProxyOnlyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DiagnosticSettingsCategoryResource.class); + + /* + * The properties of a Diagnostic Settings Category. + */ + @JsonProperty(value = "properties") + private DiagnosticSettingsCategory innerProperties; + + /** + * Get the innerProperties property: The properties of a Diagnostic Settings Category. + * + * @return the innerProperties value. + */ + private DiagnosticSettingsCategory innerProperties() { + return this.innerProperties; + } + + /** + * Get the categoryType property: The type of the diagnostic settings category. + * + * @return the categoryType value. + */ + public CategoryType categoryType() { + return this.innerProperties() == null ? null : this.innerProperties().categoryType(); + } + + /** + * Set the categoryType property: The type of the diagnostic settings category. + * + * @param categoryType the categoryType value to set. + * @return the DiagnosticSettingsCategoryResource object itself. + */ + public DiagnosticSettingsCategoryResource withCategoryType(CategoryType categoryType) { + if (this.innerProperties() == null) { + this.innerProperties = new DiagnosticSettingsCategory(); + } + this.innerProperties().withCategoryType(categoryType); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/DiagnosticSettingsCategoryResourceCollection.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/DiagnosticSettingsCategoryResourceCollection.java new file mode 100644 index 0000000000000..db934d6fd3efb --- /dev/null +++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/DiagnosticSettingsCategoryResourceCollection.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azureactivedirectory.models; + +import com.azure.resourcemanager.azureactivedirectory.fluent.models.DiagnosticSettingsCategoryResourceCollectionInner; +import java.util.List; + +/** An immutable client-side representation of DiagnosticSettingsCategoryResourceCollection. */ +public interface DiagnosticSettingsCategoryResourceCollection { + /** + * Gets the value property: The collection of diagnostic settings category resources. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner + * com.azure.resourcemanager.azureactivedirectory.fluent.models.DiagnosticSettingsCategoryResourceCollectionInner + * object. + * + * @return the inner object. + */ + DiagnosticSettingsCategoryResourceCollectionInner innerModel(); +} diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/DiagnosticSettingsOperations.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/DiagnosticSettingsOperations.java new file mode 100644 index 0000000000000..ff6e652df4034 --- /dev/null +++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/DiagnosticSettingsOperations.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azureactivedirectory.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azureactivedirectory.fluent.models.DiagnosticSettingsResourceInner; + +/** Resource collection API of DiagnosticSettingsOperations. */ +public interface DiagnosticSettingsOperations { + /** + * Gets the active diagnostic settings list for AadIam. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the active diagnostic settings list for AadIam. + */ + DiagnosticSettingsResourceCollection list(); + + /** + * Gets the active diagnostic settings list for AadIam. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the active diagnostic settings list for AadIam along with {@link Response}. + */ + Response listWithResponse(Context context); + + /** + * Gets the active diagnostic setting for AadIam. + * + * @param name The name of the diagnostic setting. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the active diagnostic setting for AadIam. + */ + DiagnosticSettingsResource get(String name); + + /** + * Gets the active diagnostic setting for AadIam. + * + * @param name The name of the diagnostic setting. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the active diagnostic setting for AadIam along with {@link Response}. + */ + Response getWithResponse(String name, Context context); + + /** + * Creates or updates diagnostic settings for AadIam. + * + * @param name The name of the diagnostic setting. + * @param parameters Parameters supplied to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the diagnostic setting resource. + */ + DiagnosticSettingsResource createOrUpdate(String name, DiagnosticSettingsResourceInner parameters); + + /** + * Creates or updates diagnostic settings for AadIam. + * + * @param name The name of the diagnostic setting. + * @param parameters Parameters supplied to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the diagnostic setting resource along with {@link Response}. + */ + Response createOrUpdateWithResponse( + String name, DiagnosticSettingsResourceInner parameters, Context context); + + /** + * Deletes existing diagnostic setting for AadIam. + * + * @param name The name of the diagnostic setting. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String name); + + /** + * Deletes existing diagnostic setting for AadIam. + * + * @param name The name of the diagnostic setting. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteWithResponse(String name, Context context); +} diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/DiagnosticSettingsResource.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/DiagnosticSettingsResource.java new file mode 100644 index 0000000000000..88bfef58c65ef --- /dev/null +++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/DiagnosticSettingsResource.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azureactivedirectory.models; + +import com.azure.resourcemanager.azureactivedirectory.fluent.models.DiagnosticSettingsResourceInner; +import java.util.List; + +/** An immutable client-side representation of DiagnosticSettingsResource. */ +public interface DiagnosticSettingsResource { + /** + * 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 storageAccountId property: The resource ID of the storage account to which you would like to send + * Diagnostic Logs. + * + * @return the storageAccountId value. + */ + String storageAccountId(); + + /** + * Gets the serviceBusRuleId property: The service bus rule Id of the diagnostic setting. This is here to maintain + * backwards compatibility. + * + * @return the serviceBusRuleId value. + */ + String serviceBusRuleId(); + + /** + * Gets the workspaceId property: The workspace ID (resource ID of a Log Analytics workspace) for a Log Analytics + * workspace to which you would like to send Diagnostic Logs. Example: + * /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2. + * + * @return the workspaceId value. + */ + String workspaceId(); + + /** + * Gets the eventHubAuthorizationRuleId property: The resource Id for the event hub authorization rule. + * + * @return the eventHubAuthorizationRuleId value. + */ + String eventHubAuthorizationRuleId(); + + /** + * Gets the eventHubName property: The name of the event hub. If none is specified, the default event hub will be + * selected. + * + * @return the eventHubName value. + */ + String eventHubName(); + + /** + * Gets the logs property: The list of logs settings. + * + * @return the logs value. + */ + List logs(); + + /** + * Gets the inner com.azure.resourcemanager.azureactivedirectory.fluent.models.DiagnosticSettingsResourceInner + * object. + * + * @return the inner object. + */ + DiagnosticSettingsResourceInner innerModel(); +} diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/DiagnosticSettingsResourceCollection.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/DiagnosticSettingsResourceCollection.java new file mode 100644 index 0000000000000..c429d024ce86e --- /dev/null +++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/DiagnosticSettingsResourceCollection.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azureactivedirectory.models; + +import com.azure.resourcemanager.azureactivedirectory.fluent.models.DiagnosticSettingsResourceCollectionInner; +import java.util.List; + +/** An immutable client-side representation of DiagnosticSettingsResourceCollection. */ +public interface DiagnosticSettingsResourceCollection { + /** + * Gets the value property: The collection of diagnostic settings resources. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner + * com.azure.resourcemanager.azureactivedirectory.fluent.models.DiagnosticSettingsResourceCollectionInner object. + * + * @return the inner object. + */ + DiagnosticSettingsResourceCollectionInner innerModel(); +} diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/Display.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/Display.java new file mode 100644 index 0000000000000..8d4e53746b258 --- /dev/null +++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/Display.java @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azureactivedirectory.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains the localized display information for this particular operation / action. These value will be used by + * several clients for (1) custom role definitions for RBAC; (2) complex query filters for the event service; and (3) + * audit history / records for management operations. + */ +@Fluent +public final class Display { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Display.class); + + /* + * The publisher. The localized friendly form of the resource publisher + * name. + */ + @JsonProperty(value = "publisher") + private String publisher; + + /* + * The provider. The localized friendly form of the resource provider name + * – it is expected to also include the publisher/company responsible. It + * should use Title Casing and begin with "Microsoft" for 1st party + * services. e.g. "Microsoft Monitoring Insights" or "Microsoft Compute." + */ + @JsonProperty(value = "provider") + private String provider; + + /* + * The resource. The localized friendly form of the resource related to + * this action/operation – it should match the public documentation for the + * resource provider. It should use Title Casing. This value should be + * unique for a particular URL type (e.g. nested types should *not* reuse + * their parent’s display.resource field). e.g. "Virtual Machines" or + * "Scheduler Job Collections", or "Virtual Machine VM Sizes" or "Scheduler + * Jobs" + */ + @JsonProperty(value = "resource") + private String resource; + + /* + * The operation. The localized friendly name for the operation, as it + * should be shown to the user. It should be concise (to fit in drop downs) + * but clear (i.e. self-documenting). It should use Title Casing. + * Prescriptive guidance: Read Create or Update Delete 'ActionName' + */ + @JsonProperty(value = "operation") + private String operation; + + /* + * The description. The localized friendly description for the operation, + * as it should be shown to the user. It should be thorough, yet concise – + * it will be used in tool tips and detailed views. Prescriptive guidance + * for namespaces: Read any 'display.provider' resource Create or Update + * any 'display.provider' resource Delete any 'display.provider' resource + * Perform any other action on any 'display.provider' resource Prescriptive + * guidance for namespaces: Read any 'display.resource' Create or Update + * any 'display.resource' Delete any 'display.resource' 'ActionName' any + * 'display.resources' + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the publisher property: The publisher. The localized friendly form of the resource publisher name. + * + * @return the publisher value. + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the publisher property: The publisher. The localized friendly form of the resource publisher name. + * + * @param publisher the publisher value to set. + * @return the Display object itself. + */ + public Display withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get the provider property: The provider. The localized friendly form of the resource provider name – it is + * expected to also include the publisher/company responsible. It should use Title Casing and begin with "Microsoft" + * for 1st party services. e.g. "Microsoft Monitoring Insights" or "Microsoft Compute.". + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider property: The provider. The localized friendly form of the resource provider name – it is + * expected to also include the publisher/company responsible. It should use Title Casing and begin with "Microsoft" + * for 1st party services. e.g. "Microsoft Monitoring Insights" or "Microsoft Compute.". + * + * @param provider the provider value to set. + * @return the Display object itself. + */ + public Display withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the resource property: The resource. The localized friendly form of the resource related to this + * action/operation – it should match the public documentation for the resource provider. It should use Title + * Casing. This value should be unique for a particular URL type (e.g. nested types should *not* reuse their + * parent’s display.resource field). e.g. "Virtual Machines" or "Scheduler Job Collections", or "Virtual Machine VM + * Sizes" or "Scheduler Jobs". + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource property: The resource. The localized friendly form of the resource related to this + * action/operation – it should match the public documentation for the resource provider. It should use Title + * Casing. This value should be unique for a particular URL type (e.g. nested types should *not* reuse their + * parent’s display.resource field). e.g. "Virtual Machines" or "Scheduler Job Collections", or "Virtual Machine VM + * Sizes" or "Scheduler Jobs". + * + * @param resource the resource value to set. + * @return the Display object itself. + */ + public Display withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the operation property: The operation. The localized friendly name for the operation, as it should be shown + * to the user. It should be concise (to fit in drop downs) but clear (i.e. self-documenting). It should use Title + * Casing. Prescriptive guidance: Read Create or Update Delete 'ActionName'. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation property: The operation. The localized friendly name for the operation, as it should be shown + * to the user. It should be concise (to fit in drop downs) but clear (i.e. self-documenting). It should use Title + * Casing. Prescriptive guidance: Read Create or Update Delete 'ActionName'. + * + * @param operation the operation value to set. + * @return the Display object itself. + */ + public Display withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the description property: The description. The localized friendly description for the operation, as it should + * be shown to the user. It should be thorough, yet concise – it will be used in tool tips and detailed views. + * Prescriptive guidance for namespaces: Read any 'display.provider' resource Create or Update any + * 'display.provider' resource Delete any 'display.provider' resource Perform any other action on any + * 'display.provider' resource Prescriptive guidance for namespaces: Read any 'display.resource' Create or Update + * any 'display.resource' Delete any 'display.resource' 'ActionName' any 'display.resources'. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description. The localized friendly description for the operation, as it should + * be shown to the user. It should be thorough, yet concise – it will be used in tool tips and detailed views. + * Prescriptive guidance for namespaces: Read any 'display.provider' resource Create or Update any + * 'display.provider' resource Delete any 'display.provider' resource Perform any other action on any + * 'display.provider' resource Prescriptive guidance for namespaces: Read any 'display.resource' Create or Update + * any 'display.resource' Delete any 'display.resource' 'ActionName' any 'display.resources'. + * + * @param description the description value to set. + * @return the Display object itself. + */ + public Display withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/LogSettings.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/LogSettings.java new file mode 100644 index 0000000000000..7bfcd04710aad --- /dev/null +++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/LogSettings.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azureactivedirectory.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Part of MultiTenantDiagnosticSettings. Specifies the settings for a particular log. */ +@Fluent +public final class LogSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LogSettings.class); + + /* + * Name of a Diagnostic Log category for a resource type this setting is + * applied to. To obtain the list of Diagnostic Log categories for a + * resource, first perform a GET diagnostic settings operation. + */ + @JsonProperty(value = "category") + private Category category; + + /* + * A value indicating whether this log is enabled. + */ + @JsonProperty(value = "enabled", required = true) + private boolean enabled; + + /* + * The retention policy for this log. + */ + @JsonProperty(value = "retentionPolicy") + private RetentionPolicy retentionPolicy; + + /** + * Get the category property: Name of a Diagnostic Log category for a resource type this setting is applied to. To + * obtain the list of Diagnostic Log categories for a resource, first perform a GET diagnostic settings operation. + * + * @return the category value. + */ + public Category category() { + return this.category; + } + + /** + * Set the category property: Name of a Diagnostic Log category for a resource type this setting is applied to. To + * obtain the list of Diagnostic Log categories for a resource, first perform a GET diagnostic settings operation. + * + * @param category the category value to set. + * @return the LogSettings object itself. + */ + public LogSettings withCategory(Category category) { + this.category = category; + return this; + } + + /** + * Get the enabled property: A value indicating whether this log is enabled. + * + * @return the enabled value. + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: A value indicating whether this log is enabled. + * + * @param enabled the enabled value to set. + * @return the LogSettings object itself. + */ + public LogSettings withEnabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the retentionPolicy property: The retention policy for this log. + * + * @return the retentionPolicy value. + */ + public RetentionPolicy retentionPolicy() { + return this.retentionPolicy; + } + + /** + * Set the retentionPolicy property: The retention policy for this log. + * + * @param retentionPolicy the retentionPolicy value to set. + * @return the LogSettings object itself. + */ + public LogSettings withRetentionPolicy(RetentionPolicy retentionPolicy) { + this.retentionPolicy = retentionPolicy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (retentionPolicy() != null) { + retentionPolicy().validate(); + } + } +} diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/Operations.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/Operations.java new file mode 100644 index 0000000000000..d45e0fd350d02 --- /dev/null +++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/Operations.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azureactivedirectory.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Operations. */ +public interface Operations { + /** + * Operation to return the list of 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 collection of ClientDiscovery details. + */ + OperationsDiscoveryCollection list(); + + /** + * Operation to return the list of 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 collection of ClientDiscovery details along with {@link Response}. + */ + Response listWithResponse(Context context); +} diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/OperationsDiscovery.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/OperationsDiscovery.java new file mode 100644 index 0000000000000..f0471b3426805 --- /dev/null +++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/OperationsDiscovery.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azureactivedirectory.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Operations discovery class. */ +@Fluent +public final class OperationsDiscovery { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsDiscovery.class); + + /* + * Name of the API. The name of the operation being performed on this + * particular object. It should match the action name that appears in RBAC + * / the event service. Examples of operations include: * + * Microsoft.Compute/virtualMachine/capture/action * + * Microsoft.Compute/virtualMachine/restart/action * + * Microsoft.Compute/virtualMachine/write * + * Microsoft.Compute/virtualMachine/read * + * Microsoft.Compute/virtualMachine/delete Each action should include, in + * order: (1) Resource Provider Namespace (2) Type hierarchy for which the + * action applies (e.g. server/databases for a SQL Azure database) (3) + * Read, Write, Action or Delete indicating which type applies. If it is a + * PUT/PATCH on a collection or named value, Write should be used. If it is + * a GET, Read should be used. If it is a DELETE, Delete should be used. If + * it is a POST, Action should be used. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Indicates whether the operation applies to data-plane. Set the value to + * true for data-plane operations and false for ARM/control-plane + * operations. + */ + @JsonProperty(value = "isDataAction") + private Boolean isDataAction; + + /* + * Object type + */ + @JsonProperty(value = "display") + private Display display; + + /* + * Origin. The intended executor of the operation; governs the display of + * the operation in the RBAC UX and the audit logs UX. Default value is + * "user,system" + */ + @JsonProperty(value = "origin") + private String origin; + + /* + * Properties. Reserved for future use. + */ + @JsonProperty(value = "properties") + private Object properties; + + /** + * Get the name property: Name of the API. The name of the operation being performed on this particular object. It + * should match the action name that appears in RBAC / the event service. Examples of operations include: * + * Microsoft.Compute/virtualMachine/capture/action * Microsoft.Compute/virtualMachine/restart/action * + * Microsoft.Compute/virtualMachine/write * Microsoft.Compute/virtualMachine/read * + * Microsoft.Compute/virtualMachine/delete Each action should include, in order: (1) Resource Provider Namespace (2) + * Type hierarchy for which the action applies (e.g. server/databases for a SQL Azure database) (3) Read, Write, + * Action or Delete indicating which type applies. If it is a PUT/PATCH on a collection or named value, Write should + * be used. If it is a GET, Read should be used. If it is a DELETE, Delete should be used. If it is a POST, Action + * should be used. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the API. The name of the operation being performed on this particular object. It + * should match the action name that appears in RBAC / the event service. Examples of operations include: * + * Microsoft.Compute/virtualMachine/capture/action * Microsoft.Compute/virtualMachine/restart/action * + * Microsoft.Compute/virtualMachine/write * Microsoft.Compute/virtualMachine/read * + * Microsoft.Compute/virtualMachine/delete Each action should include, in order: (1) Resource Provider Namespace (2) + * Type hierarchy for which the action applies (e.g. server/databases for a SQL Azure database) (3) Read, Write, + * Action or Delete indicating which type applies. If it is a PUT/PATCH on a collection or named value, Write should + * be used. If it is a GET, Read should be used. If it is a DELETE, Delete should be used. If it is a POST, Action + * should be used. + * + * @param name the name value to set. + * @return the OperationsDiscovery object itself. + */ + public OperationsDiscovery withName(String name) { + this.name = name; + return this; + } + + /** + * Get the isDataAction property: Indicates whether the operation applies to data-plane. Set the value to true for + * data-plane operations and false for ARM/control-plane operations. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Set the isDataAction property: Indicates whether the operation applies to data-plane. Set the value to true for + * data-plane operations and false for ARM/control-plane operations. + * + * @param isDataAction the isDataAction value to set. + * @return the OperationsDiscovery object itself. + */ + public OperationsDiscovery withIsDataAction(Boolean isDataAction) { + this.isDataAction = isDataAction; + return this; + } + + /** + * Get the display property: Object type. + * + * @return the display value. + */ + public Display display() { + return this.display; + } + + /** + * Set the display property: Object type. + * + * @param display the display value to set. + * @return the OperationsDiscovery object itself. + */ + public OperationsDiscovery withDisplay(Display display) { + this.display = display; + return this; + } + + /** + * Get the origin property: Origin. The intended executor of the operation; governs the display of the operation in + * the RBAC UX and the audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + public String origin() { + return this.origin; + } + + /** + * Set the origin property: Origin. The intended executor of the operation; governs the display of the operation in + * the RBAC UX and the audit logs UX. Default value is "user,system". + * + * @param origin the origin value to set. + * @return the OperationsDiscovery object itself. + */ + public OperationsDiscovery withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Get the properties property: Properties. Reserved for future use. + * + * @return the properties value. + */ + public Object properties() { + return this.properties; + } + + /** + * Set the properties property: Properties. Reserved for future use. + * + * @param properties the properties value to set. + * @return the OperationsDiscovery object itself. + */ + public OperationsDiscovery withProperties(Object properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + } +} diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/OperationsDiscoveryCollection.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/OperationsDiscoveryCollection.java new file mode 100644 index 0000000000000..d8f0757327805 --- /dev/null +++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/OperationsDiscoveryCollection.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azureactivedirectory.models; + +import com.azure.resourcemanager.azureactivedirectory.fluent.models.OperationsDiscoveryCollectionInner; +import java.util.List; + +/** An immutable client-side representation of OperationsDiscoveryCollection. */ +public interface OperationsDiscoveryCollection { + /** + * Gets the value property: The ClientDiscovery details. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.azureactivedirectory.fluent.models.OperationsDiscoveryCollectionInner + * object. + * + * @return the inner object. + */ + OperationsDiscoveryCollectionInner innerModel(); +} diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/ProxyOnlyResource.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/ProxyOnlyResource.java new file mode 100644 index 0000000000000..501e523a66593 --- /dev/null +++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/ProxyOnlyResource.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azureactivedirectory.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** A proxy only azure resource object. */ +@Immutable +public class ProxyOnlyResource extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProxyOnlyResource.class); + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/RetentionPolicy.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/RetentionPolicy.java new file mode 100644 index 0000000000000..c543ea9daad59 --- /dev/null +++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/RetentionPolicy.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azureactivedirectory.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Specifies the retention policy for the log. */ +@Fluent +public final class RetentionPolicy { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RetentionPolicy.class); + + /* + * A value indicating whether the retention policy is enabled. + */ + @JsonProperty(value = "enabled", required = true) + private boolean enabled; + + /* + * The number of days for the retention in days. A value of 0 will retain + * the events indefinitely. + */ + @JsonProperty(value = "days", required = true) + private int days; + + /** + * Get the enabled property: A value indicating whether the retention policy is enabled. + * + * @return the enabled value. + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: A value indicating whether the retention policy is enabled. + * + * @param enabled the enabled value to set. + * @return the RetentionPolicy object itself. + */ + public RetentionPolicy withEnabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the days property: The number of days for the retention in days. A value of 0 will retain the events + * indefinitely. + * + * @return the days value. + */ + public int days() { + return this.days; + } + + /** + * Set the days property: The number of days for the retention in days. A value of 0 will retain the events + * indefinitely. + * + * @param days the days value to set. + * @return the RetentionPolicy object itself. + */ + public RetentionPolicy withDays(int days) { + this.days = days; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/package-info.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/package-info.java new file mode 100644 index 0000000000000..21bc4b180ef22 --- /dev/null +++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the data models for Azureactivedirectory. Azure Active Directory Client. */ +package com.azure.resourcemanager.azureactivedirectory.models; diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/package-info.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/package-info.java new file mode 100644 index 0000000000000..2a2ad5b659b21 --- /dev/null +++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the classes for Azureactivedirectory. Azure Active Directory Client. */ +package com.azure.resourcemanager.azureactivedirectory; diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/module-info.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/module-info.java new file mode 100644 index 0000000000000..1b61e3544dd6c --- /dev/null +++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/module-info.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +module com.azure.resourcemanager.azureactivedirectory { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.azureactivedirectory; + exports com.azure.resourcemanager.azureactivedirectory.fluent; + exports com.azure.resourcemanager.azureactivedirectory.fluent.models; + exports com.azure.resourcemanager.azureactivedirectory.models; + + opens com.azure.resourcemanager.azureactivedirectory.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.azureactivedirectory.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/samples/java/com/azure/resourcemanager/azureactivedirectory/generated/DiagnosticSettingsCategoryListSamples.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/samples/java/com/azure/resourcemanager/azureactivedirectory/generated/DiagnosticSettingsCategoryListSamples.java new file mode 100644 index 0000000000000..f6524fe26a44d --- /dev/null +++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/samples/java/com/azure/resourcemanager/azureactivedirectory/generated/DiagnosticSettingsCategoryListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azureactivedirectory.generated; + +import com.azure.core.util.Context; + +/** Samples for DiagnosticSettingsCategory List. */ +public final class DiagnosticSettingsCategoryListSamples { + /* + * x-ms-original-file: specification/azureactivedirectory/resource-manager/Microsoft.Aadiam/preview/2017-04-01-preview/examples/listDiagnosticSettingsCategories.json + */ + /** + * Sample code: Gets the diagnostic setting categories. + * + * @param manager Entry point to AzureactivedirectoryManager. + */ + public static void getsTheDiagnosticSettingCategories( + com.azure.resourcemanager.azureactivedirectory.AzureactivedirectoryManager manager) { + manager.diagnosticSettingsCategories().listWithResponse(Context.NONE); + } +} diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/samples/java/com/azure/resourcemanager/azureactivedirectory/generated/DiagnosticSettingsOperationCreateOrUpdateSamples.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/samples/java/com/azure/resourcemanager/azureactivedirectory/generated/DiagnosticSettingsOperationCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..5c68f3824b56e --- /dev/null +++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/samples/java/com/azure/resourcemanager/azureactivedirectory/generated/DiagnosticSettingsOperationCreateOrUpdateSamples.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azureactivedirectory.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.azureactivedirectory.fluent.models.DiagnosticSettingsResourceInner; +import com.azure.resourcemanager.azureactivedirectory.models.Category; +import com.azure.resourcemanager.azureactivedirectory.models.LogSettings; +import com.azure.resourcemanager.azureactivedirectory.models.RetentionPolicy; +import java.util.Arrays; + +/** Samples for DiagnosticSettingsOperation CreateOrUpdate. */ +public final class DiagnosticSettingsOperationCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/azureactivedirectory/resource-manager/Microsoft.Aadiam/preview/2017-04-01-preview/examples/createOrUpdateDiagnosticSetting.json + */ + /** + * Sample code: BatchAccountDelete. + * + * @param manager Entry point to AzureactivedirectoryManager. + */ + public static void batchAccountDelete( + com.azure.resourcemanager.azureactivedirectory.AzureactivedirectoryManager manager) { + manager + .diagnosticSettingsOperations() + .createOrUpdateWithResponse( + "mysetting", + new DiagnosticSettingsResourceInner() + .withStorageAccountId( + "/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/apptest/providers/Microsoft.Storage/storageAccounts/appteststorage1") + .withWorkspaceId("") + .withEventHubAuthorizationRuleId( + "/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourceGroups/montest/providers/microsoft.eventhub/namespaces/mynamespace/eventhubs/myeventhub/authorizationrules/myrule") + .withEventHubName("myeventhub") + .withLogs( + Arrays + .asList( + new LogSettings() + .withCategory(Category.AUDIT_LOGS) + .withEnabled(true) + .withRetentionPolicy(new RetentionPolicy().withEnabled(false).withDays(0)))), + Context.NONE); + } +} diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/samples/java/com/azure/resourcemanager/azureactivedirectory/generated/DiagnosticSettingsOperationDeleteSamples.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/samples/java/com/azure/resourcemanager/azureactivedirectory/generated/DiagnosticSettingsOperationDeleteSamples.java new file mode 100644 index 0000000000000..ff13b866c9b36 --- /dev/null +++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/samples/java/com/azure/resourcemanager/azureactivedirectory/generated/DiagnosticSettingsOperationDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azureactivedirectory.generated; + +import com.azure.core.util.Context; + +/** Samples for DiagnosticSettingsOperation Delete. */ +public final class DiagnosticSettingsOperationDeleteSamples { + /* + * x-ms-original-file: specification/azureactivedirectory/resource-manager/Microsoft.Aadiam/preview/2017-04-01-preview/examples/deleteDiagnosticSetting.json + */ + /** + * Sample code: Deletes the diagnostic setting. + * + * @param manager Entry point to AzureactivedirectoryManager. + */ + public static void deletesTheDiagnosticSetting( + com.azure.resourcemanager.azureactivedirectory.AzureactivedirectoryManager manager) { + manager.diagnosticSettingsOperations().deleteWithResponse("mysetting", Context.NONE); + } +} diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/samples/java/com/azure/resourcemanager/azureactivedirectory/generated/DiagnosticSettingsOperationGetSamples.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/samples/java/com/azure/resourcemanager/azureactivedirectory/generated/DiagnosticSettingsOperationGetSamples.java new file mode 100644 index 0000000000000..bde3f5d5f03f1 --- /dev/null +++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/samples/java/com/azure/resourcemanager/azureactivedirectory/generated/DiagnosticSettingsOperationGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azureactivedirectory.generated; + +import com.azure.core.util.Context; + +/** Samples for DiagnosticSettingsOperation Get. */ +public final class DiagnosticSettingsOperationGetSamples { + /* + * x-ms-original-file: specification/azureactivedirectory/resource-manager/Microsoft.Aadiam/preview/2017-04-01-preview/examples/getDiagnosticSetting.json + */ + /** + * Sample code: Gets the diagnostic setting. + * + * @param manager Entry point to AzureactivedirectoryManager. + */ + public static void getsTheDiagnosticSetting( + com.azure.resourcemanager.azureactivedirectory.AzureactivedirectoryManager manager) { + manager.diagnosticSettingsOperations().getWithResponse("mysetting", Context.NONE); + } +} diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/samples/java/com/azure/resourcemanager/azureactivedirectory/generated/DiagnosticSettingsOperationListSamples.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/samples/java/com/azure/resourcemanager/azureactivedirectory/generated/DiagnosticSettingsOperationListSamples.java new file mode 100644 index 0000000000000..95b0aa5e192a5 --- /dev/null +++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/samples/java/com/azure/resourcemanager/azureactivedirectory/generated/DiagnosticSettingsOperationListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azureactivedirectory.generated; + +import com.azure.core.util.Context; + +/** Samples for DiagnosticSettingsOperation List. */ +public final class DiagnosticSettingsOperationListSamples { + /* + * x-ms-original-file: specification/azureactivedirectory/resource-manager/Microsoft.Aadiam/preview/2017-04-01-preview/examples/listDiagnosticSettings.json + */ + /** + * Sample code: Gets the diagnostic settings. + * + * @param manager Entry point to AzureactivedirectoryManager. + */ + public static void getsTheDiagnosticSettings( + com.azure.resourcemanager.azureactivedirectory.AzureactivedirectoryManager manager) { + manager.diagnosticSettingsOperations().listWithResponse(Context.NONE); + } +} diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/samples/java/com/azure/resourcemanager/azureactivedirectory/generated/OperationsListSamples.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/samples/java/com/azure/resourcemanager/azureactivedirectory/generated/OperationsListSamples.java new file mode 100644 index 0000000000000..bef760451f05a --- /dev/null +++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/samples/java/com/azure/resourcemanager/azureactivedirectory/generated/OperationsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azureactivedirectory.generated; + +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/azureactivedirectory/resource-manager/Microsoft.Aadiam/preview/2017-04-01-preview/examples/listOperations.json + */ + /** + * Sample code: Gets the operations. + * + * @param manager Entry point to AzureactivedirectoryManager. + */ + public static void getsTheOperations( + com.azure.resourcemanager.azureactivedirectory.AzureactivedirectoryManager manager) { + manager.operations().listWithResponse(Context.NONE); + } +} diff --git a/sdk/azureactivedirectory/ci.yml b/sdk/azureactivedirectory/ci.yml new file mode 100644 index 0000000000000..fbdbe6a5d644d --- /dev/null +++ b/sdk/azureactivedirectory/ci.yml @@ -0,0 +1,39 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/azureactivedirectory/ci.yml + - sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/ + exclude: + - sdk/azureactivedirectory/pom.xml + - sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/azureactivedirectory/ci.yml + - sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/ + exclude: + - sdk/azureactivedirectory/pom.xml + - sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/pom.xml + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: azureactivedirectory + Artifacts: + - name: azure-resourcemanager-azureactivedirectory + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerazureactivedirectory diff --git a/sdk/azureactivedirectory/pom.xml b/sdk/azureactivedirectory/pom.xml new file mode 100644 index 0000000000000..b2b7df26d9bf4 --- /dev/null +++ b/sdk/azureactivedirectory/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + com.azure + azure-azureactivedirectory-service + pom + 1.0.0 + + + + coverage + + + + + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + report-aggregate + verify + + report-aggregate + + + ${project.reporting.outputDirectory}/test-coverage + + + + + + + + + default + + true + + + azure-resourcemanager-azureactivedirectory + + + +