From ded757488242078adb9dfde2aac8e233b9169478 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 18 May 2023 09:45:39 +0000 Subject: [PATCH] CodeGen from PR 24037 in Azure/azure-rest-api-specs [Hub Generated] Publish private branch 'dev-dns-Microsoft.Network-2023-07-01-preview' (#24037) * Intermediate Commit - Added DnssecConfigs resource type * Add RelativeRecordSetNameParameter to remove duplicate configs * Add RecordTypeParameter to remove duplicate configs * Revert "Add RecordTypeParameter to remove duplicate configs" This reverts commit f97bd65a09ee611d77c9c6080ecc4cac2c296a01. * Add Definitions for new record types * Add placeholders for tests * Add examples for dnssecconfigs * Reference Patch examples for DS, TLSA and NAPTR * Add delete api examples for ds, naptr and tlsa recordsets * Add examples for NAPTR recordset * Add examples for DS and TLSA recordset * Add 2023-07-preview version for dns in Autorest configs * Fix API version in examples * Address comments * Fix Lint errors * Fix model validation * Fix model validation and delete privatedns examples * Fix UNREFERENCED_JSON_FILE * Fix SpellCheck * Fix MissingTypeObject * Fix Validations * Fix XmsIdentifierValidation * Fix PathForNestedResource and PathForNestedResource * Fix PageableOperation and LroLocationHeader * Remove systemData from Dnssec * Fix RequiredReadOnlySystemData * Fix XmsParameterLocation * Fix XmsIdentifierValidation * Fix ParametersOrder * Fix PathForNestedResource * Fix indentation * Check * Fix XmsLongRunningOperationOptions TopLevelResourcesListBySubscription OperationsAPIImplementation * Fix nextlink for list dnssecconfigs * Fix ParameterNotUsingCommonTypes * Fix some validations * Fix * Refactor RecordTypeParameter * Revert resource type references from common-types * Suppress ResourceMustReferenceCommonTypes and LroErrorContent * Suppress GetCollectionOnlyHasValueAndNextLink * None * Use new suppression format * Suppress OperationsAPIImplementation and GetCollectionOnlyHasValueAndNextLink without where condition * Fix descriptions * Fix AvoidAdditionalProperties * None * Address comments * Add DNSKEY and DDDS in custom-words list * Address comments * Address comments * Improve suppression docs * Change Dns to DNS in description * False commit to kick git CI --------- Co-authored-by: Vatsalya Chauhan --- eng/versioning/version_client.txt | 1 + pom.xml | 1 + .../CHANGELOG.md | 5 + .../README.md | 105 + .../SAMPLE.md | 1589 +++++++++++++ .../pom.xml | 61 + .../dns/generated/DnsManager.java | 330 +++ .../generated/fluent/DnsManagementClient.java | 74 + .../fluent/DnsResourceReferencesClient.java | 41 + .../generated/fluent/DnssecConfigsClient.java | 193 ++ .../generated/fluent/RecordSetsClient.java | 296 +++ .../dns/generated/fluent/ZonesClient.java | 222 ++ ...DnsResourceReferenceRequestProperties.java | 54 + .../DnsResourceReferenceResultInner.java | 71 + .../DnsResourceReferenceResultProperties.java | 62 + .../fluent/models/DnssecConfigInner.java | 105 + .../fluent/models/DnssecProperties.java | 59 + .../fluent/models/RecordSetInner.java | 471 ++++ .../fluent/models/RecordSetProperties.java | 527 +++++ .../generated/fluent/models/ZoneInner.java | 226 ++ .../fluent/models/ZoneProperties.java | 198 ++ .../generated/fluent/models/package-info.java | 6 + .../dns/generated/fluent/package-info.java | 6 + .../DnsManagementClientBuilder.java | 144 ++ .../DnsManagementClientImpl.java | 332 +++ .../DnsResourceReferenceResultImpl.java | 41 + .../DnsResourceReferencesClientImpl.java | 201 ++ .../DnsResourceReferencesImpl.java | 61 + .../implementation/DnssecConfigImpl.java | 64 + .../DnssecConfigsClientImpl.java | 1151 ++++++++++ .../implementation/DnssecConfigsImpl.java | 98 + .../implementation/RecordSetImpl.java | 192 ++ .../implementation/RecordSetsClientImpl.java | 2033 +++++++++++++++++ .../implementation/RecordSetsImpl.java | 214 ++ .../dns/generated/implementation/Utils.java | 204 ++ .../generated/implementation/ZoneImpl.java | 288 +++ .../implementation/ZonesClientImpl.java | 1471 ++++++++++++ .../generated/implementation/ZonesImpl.java | 168 ++ .../implementation/package-info.java | 6 + .../dns/generated/models/ARecord.java | 50 + .../dns/generated/models/AaaaRecord.java | 50 + .../dns/generated/models/CaaRecord.java | 102 + .../dns/generated/models/CnameRecord.java | 50 + .../models/DelegationSignerInfo.java | 72 + .../dns/generated/models/Digest.java | 79 + .../models/DnsResourceReference.java | 78 + .../models/DnsResourceReferenceRequest.java | 70 + .../models/DnsResourceReferenceResult.java | 26 + .../models/DnsResourceReferences.java | 35 + .../dns/generated/models/DnssecConfig.java | 68 + .../models/DnssecConfigListResult.java | 70 + .../dns/generated/models/DnssecConfigs.java | 117 + .../dns/generated/models/DsRecord.java | 112 + .../dns/generated/models/MxRecord.java | 76 + .../dns/generated/models/NaptrRecord.java | 212 ++ .../dns/generated/models/NsRecord.java | 50 + .../dns/generated/models/PtrRecord.java | 50 + .../dns/generated/models/RecordSet.java | 174 ++ .../generated/models/RecordSetListResult.java | 70 + .../dns/generated/models/RecordSets.java | 279 +++ .../dns/generated/models/RecordType.java | 84 + .../dns/generated/models/SigningKey.java | 121 + .../dns/generated/models/SoaRecord.java | 208 ++ .../dns/generated/models/SrvRecord.java | 128 ++ .../dns/generated/models/TlsaRecord.java | 137 ++ .../dns/generated/models/TxtRecord.java | 51 + .../dns/generated/models/Zone.java | 365 +++ .../dns/generated/models/ZoneListResult.java | 70 + .../dns/generated/models/ZoneType.java | 51 + .../dns/generated/models/ZoneUpdate.java | 53 + .../dns/generated/models/Zones.java | 161 ++ .../dns/generated/models/package-info.java | 6 + .../dns/generated/package-info.java | 6 + .../src/main/java/module-info.java | 19 + ...eReferenceGetByTargetResourcesSamples.java | 34 + .../DnssecConfigsCreateOrUpdateSamples.java | 20 + .../generated/DnssecConfigsDeleteSamples.java | 20 + .../generated/DnssecConfigsGetSamples.java | 20 + .../DnssecConfigsListByDnsZoneSamples.java | 20 + .../RecordSetsCreateOrUpdateSamples.java | 432 ++++ .../generated/RecordSetsDeleteSamples.java | 179 ++ .../generated/RecordSetsGetSamples.java | 188 ++ .../RecordSetsListAllByDnsZoneSamples.java | 20 + .../RecordSetsListByDnsZoneSamples.java | 20 + .../RecordSetsListByTypeSamples.java | 168 ++ .../generated/RecordSetsUpdateSamples.java | 297 +++ .../generated/ZonesCreateOrUpdateSamples.java | 40 + .../generated/ZonesDeleteSamples.java | 20 + .../ZonesGetByResourceGroupSamples.java | 20 + .../ZonesListByResourceGroupSamples.java | 20 + .../generated/generated/ZonesListSamples.java | 20 + .../generated/ZonesUpdateSamples.java | 37 + sdk/dns/ci.yml | 47 + sdk/dns/pom.xml | 15 + 94 files changed, 16358 insertions(+) create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/CHANGELOG.md create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/README.md create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/SAMPLE.md create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/pom.xml create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/DnsManager.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/fluent/DnsManagementClient.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/fluent/DnsResourceReferencesClient.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/fluent/DnssecConfigsClient.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/fluent/RecordSetsClient.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/fluent/ZonesClient.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/fluent/models/DnsResourceReferenceRequestProperties.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/fluent/models/DnsResourceReferenceResultInner.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/fluent/models/DnsResourceReferenceResultProperties.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/fluent/models/DnssecConfigInner.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/fluent/models/DnssecProperties.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/fluent/models/RecordSetInner.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/fluent/models/RecordSetProperties.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/fluent/models/ZoneInner.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/fluent/models/ZoneProperties.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/fluent/models/package-info.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/fluent/package-info.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/implementation/DnsManagementClientBuilder.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/implementation/DnsManagementClientImpl.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/implementation/DnsResourceReferenceResultImpl.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/implementation/DnsResourceReferencesClientImpl.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/implementation/DnsResourceReferencesImpl.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/implementation/DnssecConfigImpl.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/implementation/DnssecConfigsClientImpl.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/implementation/DnssecConfigsImpl.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/implementation/RecordSetImpl.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/implementation/RecordSetsClientImpl.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/implementation/RecordSetsImpl.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/implementation/Utils.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/implementation/ZoneImpl.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/implementation/ZonesClientImpl.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/implementation/ZonesImpl.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/implementation/package-info.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/ARecord.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/AaaaRecord.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/CaaRecord.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/CnameRecord.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/DelegationSignerInfo.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/Digest.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/DnsResourceReference.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/DnsResourceReferenceRequest.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/DnsResourceReferenceResult.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/DnsResourceReferences.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/DnssecConfig.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/DnssecConfigListResult.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/DnssecConfigs.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/DsRecord.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/MxRecord.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/NaptrRecord.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/NsRecord.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/PtrRecord.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/RecordSet.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/RecordSetListResult.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/RecordSets.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/RecordType.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/SigningKey.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/SoaRecord.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/SrvRecord.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/TlsaRecord.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/TxtRecord.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/Zone.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/ZoneListResult.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/ZoneType.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/ZoneUpdate.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/Zones.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/package-info.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/package-info.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/main/java/module-info.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/DnsResourceReferenceGetByTargetResourcesSamples.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/DnssecConfigsCreateOrUpdateSamples.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/DnssecConfigsDeleteSamples.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/DnssecConfigsGetSamples.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/DnssecConfigsListByDnsZoneSamples.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/RecordSetsCreateOrUpdateSamples.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/RecordSetsDeleteSamples.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/RecordSetsGetSamples.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/RecordSetsListAllByDnsZoneSamples.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/RecordSetsListByDnsZoneSamples.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/RecordSetsListByTypeSamples.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/RecordSetsUpdateSamples.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/ZonesCreateOrUpdateSamples.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/ZonesDeleteSamples.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/ZonesGetByResourceGroupSamples.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/ZonesListByResourceGroupSamples.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/ZonesListSamples.java create mode 100644 sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/ZonesUpdateSamples.java create mode 100644 sdk/dns/ci.yml create mode 100644 sdk/dns/pom.xml diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 8db19ef920c9a..e6e21ee6a28ee 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -411,6 +411,7 @@ com.azure.resourcemanager:azure-resourcemanager-newrelicobservability;1.0.0;1.1. com.azure.resourcemanager:azure-resourcemanager-qumulo;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-selfhelp;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-networkcloud;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-dns-generated;1.0.0-beta.1;1.0.0-beta.1 com.azure.tools:azure-sdk-archetype;1.0.0;1.2.0-beta.1 com.azure.tools:azure-sdk-build-tool;1.0.0-beta.1;1.0.0-beta.2 diff --git a/pom.xml b/pom.xml index 155183f74cd99..7861cda759b8c 100644 --- a/pom.xml +++ b/pom.xml @@ -70,6 +70,7 @@ sdk/devspaces sdk/devtestlabs sdk/digitaltwins + sdk/dns sdk/dnsresolver sdk/dynatrace sdk/edgeorder diff --git a/sdk/dns/azure-resourcemanager-dns-generated/CHANGELOG.md b/sdk/dns/azure-resourcemanager-dns-generated/CHANGELOG.md new file mode 100644 index 0000000000000..405f16ca5fefc --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2023-05-18) + +- Azure Resource Manager Dns client library for Java. This package contains Microsoft Azure SDK for Dns Management SDK. The DNS Management Client. Package tag package-2023-07-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). diff --git a/sdk/dns/azure-resourcemanager-dns-generated/README.md b/sdk/dns/azure-resourcemanager-dns-generated/README.md new file mode 100644 index 0000000000000..d712da15f86de --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/README.md @@ -0,0 +1,105 @@ +# Azure Resource Manager Dns client library for Java + +Azure Resource Manager Dns client library for Java. + +This package contains Microsoft Azure SDK for Dns Management SDK. The DNS Management Client. Package tag package-2023-07-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +## We'd love to hear your feedback + +We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. + +If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. + +Thank you in advance for your collaboration. We really appreciate your time! + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-dns-generated;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-dns-generated + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Include the recommended packages + +Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. + +[Azure Identity][azure_identity] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation. + +### Authentication + +By default, Azure Active Directory token authentication depends on correct configuration of the following environment variables. + +- `AZURE_CLIENT_ID` for Azure client ID. +- `AZURE_TENANT_ID` for Azure tenant ID. +- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. + +In addition, Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. + +With above configuration, `azure` client can be authenticated using the following code: + +```java +AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +DnsManager manager = DnsManager + .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/dns/azure-resourcemanager-dns-generated/SAMPLE.md) + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide][cg]. + +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact with any additional questions or comments. + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md +[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/dns/azure-resourcemanager-dns-generated/SAMPLE.md b/sdk/dns/azure-resourcemanager-dns-generated/SAMPLE.md new file mode 100644 index 0000000000000..84e1ccbaff0d0 --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/SAMPLE.md @@ -0,0 +1,1589 @@ +# Code snippets and samples + + +## DnsResourceReference + +- [GetByTargetResources](#dnsresourcereference_getbytargetresources) + +## DnssecConfigs + +- [CreateOrUpdate](#dnssecconfigs_createorupdate) +- [Delete](#dnssecconfigs_delete) +- [Get](#dnssecconfigs_get) +- [ListByDnsZone](#dnssecconfigs_listbydnszone) + +## RecordSets + +- [CreateOrUpdate](#recordsets_createorupdate) +- [Delete](#recordsets_delete) +- [Get](#recordsets_get) +- [ListAllByDnsZone](#recordsets_listallbydnszone) +- [ListByDnsZone](#recordsets_listbydnszone) +- [ListByType](#recordsets_listbytype) +- [Update](#recordsets_update) + +## Zones + +- [CreateOrUpdate](#zones_createorupdate) +- [Delete](#zones_delete) +- [GetByResourceGroup](#zones_getbyresourcegroup) +- [List](#zones_list) +- [ListByResourceGroup](#zones_listbyresourcegroup) +- [Update](#zones_update) +### DnsResourceReference_GetByTargetResources + +```java +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.dns.generated.models.DnsResourceReferenceRequest; +import java.util.Arrays; + +/** Samples for DnsResourceReference GetByTargetResources. */ +public final class DnsResourceReferenceGetByTargetResourcesSamples { + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetDnsResourceReference.json + */ + /** + * Sample code: Get DNS resource reference. + * + * @param manager Entry point to DnsManager. + */ + public static void getDNSResourceReference(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .dnsResourceReferences() + .getByTargetResourcesWithResponse( + new DnsResourceReferenceRequest() + .withTargetResources( + Arrays + .asList( + new SubResource() + .withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/trafficManagerProfiles/testpp2"))), + com.azure.core.util.Context.NONE); + } +} +``` + +### DnssecConfigs_CreateOrUpdate + +```java +/** Samples for DnssecConfigs CreateOrUpdate. */ +public final class DnssecConfigsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateDnssecConfig.json + */ + /** + * Sample code: Create DnssecConfig. + * + * @param manager Entry point to DnsManager. + */ + public static void createDnssecConfig(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager.dnssecConfigs().createOrUpdate("rg1", "zone1", null, null, com.azure.core.util.Context.NONE); + } +} +``` + +### DnssecConfigs_Delete + +```java +/** Samples for DnssecConfigs Delete. */ +public final class DnssecConfigsDeleteSamples { + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteDnssecConfig.json + */ + /** + * Sample code: Delete DnssecConfig. + * + * @param manager Entry point to DnsManager. + */ + public static void deleteDnssecConfig(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager.dnssecConfigs().delete("rg1", "zone1", null, com.azure.core.util.Context.NONE); + } +} +``` + +### DnssecConfigs_Get + +```java +/** Samples for DnssecConfigs Get. */ +public final class DnssecConfigsGetSamples { + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetDnssecConfig.json + */ + /** + * Sample code: Get DnssecConfig. + * + * @param manager Entry point to DnsManager. + */ + public static void getDnssecConfig(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager.dnssecConfigs().getWithResponse("rg1", "zone1", com.azure.core.util.Context.NONE); + } +} +``` + +### DnssecConfigs_ListByDnsZone + +```java +/** Samples for DnssecConfigs ListByDnsZone. */ +public final class DnssecConfigsListByDnsZoneSamples { + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListDnssecConfigsByZone.json + */ + /** + * Sample code: List DnssecConfigs. + * + * @param manager Entry point to DnsManager. + */ + public static void listDnssecConfigs(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager.dnssecConfigs().listByDnsZone("rg1", "zone1", com.azure.core.util.Context.NONE); + } +} +``` + +### RecordSets_CreateOrUpdate + +```java +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.dns.generated.fluent.models.RecordSetInner; +import com.azure.resourcemanager.dns.generated.models.ARecord; +import com.azure.resourcemanager.dns.generated.models.AaaaRecord; +import com.azure.resourcemanager.dns.generated.models.CaaRecord; +import com.azure.resourcemanager.dns.generated.models.CnameRecord; +import com.azure.resourcemanager.dns.generated.models.Digest; +import com.azure.resourcemanager.dns.generated.models.DsRecord; +import com.azure.resourcemanager.dns.generated.models.MxRecord; +import com.azure.resourcemanager.dns.generated.models.NaptrRecord; +import com.azure.resourcemanager.dns.generated.models.NsRecord; +import com.azure.resourcemanager.dns.generated.models.PtrRecord; +import com.azure.resourcemanager.dns.generated.models.RecordType; +import com.azure.resourcemanager.dns.generated.models.SoaRecord; +import com.azure.resourcemanager.dns.generated.models.SrvRecord; +import com.azure.resourcemanager.dns.generated.models.TlsaRecord; +import com.azure.resourcemanager.dns.generated.models.TxtRecord; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for RecordSets CreateOrUpdate. */ +public final class RecordSetsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateSRVRecordset.json + */ + /** + * Sample code: Create SRV recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void createSRVRecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .createOrUpdateWithResponse( + "rg1", + "zone1", + "record1", + RecordType.SRV, + new RecordSetInner() + .withMetadata(mapOf("key1", "value1")) + .withTtl(3600L) + .withSrvRecords( + Arrays + .asList( + new SrvRecord().withPriority(0).withWeight(10).withPort(80).withTarget("contoso.com"))), + null, + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateCNAMERecordset.json + */ + /** + * Sample code: Create CNAME recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void createCNAMERecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .createOrUpdateWithResponse( + "rg1", + "zone1", + "record1", + RecordType.CNAME, + new RecordSetInner() + .withMetadata(mapOf("key1", "value1")) + .withTtl(3600L) + .withCnameRecord(new CnameRecord().withCname("contoso.com")), + null, + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateAAAARecordset.json + */ + /** + * Sample code: Create AAAA recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void createAAAARecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .createOrUpdateWithResponse( + "rg1", + "zone1", + "record1", + RecordType.AAAA, + new RecordSetInner() + .withMetadata(mapOf("key1", "value1")) + .withTtl(3600L) + .withAaaaRecords(Arrays.asList(new AaaaRecord().withIpv6Address("::1"))), + null, + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateDSRecordset.json + */ + /** + * Sample code: Create DS recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void createDSRecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .createOrUpdateWithResponse( + "rg1", + "zone1", + "record1", + RecordType.DS, + new RecordSetInner() + .withMetadata(mapOf("key1", "value1")) + .withTtl(3600L) + .withDsRecords( + Arrays + .asList( + new DsRecord() + .withKeyTag(60485) + .withAlgorithm(5) + .withDigest( + new Digest() + .withAlgorithmType(1) + .withValue("2BB183AF5F22588179A53B0A98631FAD1A292118")))), + null, + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateNAPTRRecordset.json + */ + /** + * Sample code: Create NAPTR recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void createNAPTRRecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .createOrUpdateWithResponse( + "rg1", + "zone1", + "record1", + RecordType.NAPTR, + new RecordSetInner() + .withMetadata(mapOf("key1", "value1")) + .withTtl(3600L) + .withNaptrRecords( + Arrays + .asList( + new NaptrRecord() + .withOrder(100) + .withPreference(10) + .withFlags("U") + .withServices("E2U+sip") + .withRegexp("!^.*$!sip:user@example.com!") + .withReplacement(""))), + null, + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateNSRecordset.json + */ + /** + * Sample code: Create NS recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void createNSRecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .createOrUpdateWithResponse( + "rg1", + "zone1", + "record1", + RecordType.NS, + new RecordSetInner() + .withMetadata(mapOf("key1", "value1")) + .withTtl(3600L) + .withNsRecords(Arrays.asList(new NsRecord().withNsdname("ns1.contoso.com"))), + null, + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateARecordsetAlias.json + */ + /** + * Sample code: Create A recordset with alias target resource. + * + * @param manager Entry point to DnsManager. + */ + public static void createARecordsetWithAliasTargetResource( + com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .createOrUpdateWithResponse( + "rg1", + "zone1", + "record1", + RecordType.A, + new RecordSetInner() + .withMetadata(mapOf("key1", "value1")) + .withTtl(3600L) + .withTargetResource( + new SubResource() + .withId( + "/subscriptions/726f8cd6-6459-4db4-8e6d-2cd2716904e2/resourceGroups/test/providers/Microsoft.Network/trafficManagerProfiles/testpp2")), + null, + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateARecordset.json + */ + /** + * Sample code: Create A recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void createARecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .createOrUpdateWithResponse( + "rg1", + "zone1", + "record1", + RecordType.A, + new RecordSetInner() + .withMetadata(mapOf("key1", "value1")) + .withTtl(3600L) + .withARecords(Arrays.asList(new ARecord().withIpv4Address("127.0.0.1"))), + null, + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateTLSARecordset.json + */ + /** + * Sample code: Create TLSA recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void createTLSARecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .createOrUpdateWithResponse( + "rg1", + "zone1", + "record1", + RecordType.TLSA, + new RecordSetInner() + .withMetadata(mapOf("key1", "value1")) + .withTtl(3600L) + .withTlsaRecords( + Arrays + .asList( + new TlsaRecord() + .withUsage(3) + .withSelector(1) + .withMatchingType(1) + .withCertAssociationData( + "6EC8A4B7F511454D84DCC055213B8D195E8ADA751FE14300AFE32D54B162438B"))), + null, + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateTXTRecordset.json + */ + /** + * Sample code: Create TXT recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void createTXTRecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .createOrUpdateWithResponse( + "rg1", + "zone1", + "record1", + RecordType.TXT, + new RecordSetInner() + .withMetadata(mapOf("key1", "value1")) + .withTtl(3600L) + .withTxtRecords(Arrays.asList(new TxtRecord().withValue(Arrays.asList("string1", "string2")))), + null, + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateCaaRecordset.json + */ + /** + * Sample code: Create CAA recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void createCAARecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .createOrUpdateWithResponse( + "rg1", + "zone1", + "record1", + RecordType.CAA, + new RecordSetInner() + .withMetadata(mapOf("key1", "value1")) + .withTtl(3600L) + .withCaaRecords( + Arrays.asList(new CaaRecord().withFlags(0).withTag("issue").withValue("ca.contoso.com"))), + null, + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdatePTRRecordset.json + */ + /** + * Sample code: Create PTR recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void createPTRRecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .createOrUpdateWithResponse( + "rg1", + "0.0.127.in-addr.arpa", + "1", + RecordType.PTR, + new RecordSetInner() + .withMetadata(mapOf("key1", "value1")) + .withTtl(3600L) + .withPtrRecords(Arrays.asList(new PtrRecord().withPtrdname("localhost"))), + null, + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateMXRecordset.json + */ + /** + * Sample code: Create MX recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void createMXRecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .createOrUpdateWithResponse( + "rg1", + "zone1", + "record1", + RecordType.MX, + new RecordSetInner() + .withMetadata(mapOf("key1", "value1")) + .withTtl(3600L) + .withMxRecords(Arrays.asList(new MxRecord().withPreference(0).withExchange("mail.contoso.com"))), + null, + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateSOARecordset.json + */ + /** + * Sample code: Create SOA recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void createSOARecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .createOrUpdateWithResponse( + "rg1", + "zone1", + "@", + RecordType.SOA, + new RecordSetInner() + .withMetadata(mapOf("key1", "value1")) + .withTtl(3600L) + .withSoaRecord( + new SoaRecord() + .withHost("ns1.contoso.com") + .withEmail("hostmaster.contoso.com") + .withSerialNumber(1L) + .withRefreshTime(3600L) + .withRetryTime(300L) + .withExpireTime(2419200L) + .withMinimumTtl(300L)), + null, + null, + com.azure.core.util.Context.NONE); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### RecordSets_Delete + +```java +import com.azure.resourcemanager.dns.generated.models.RecordType; + +/** Samples for RecordSets Delete. */ +public final class RecordSetsDeleteSamples { + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteNAPTRRecordset.json + */ + /** + * Sample code: Delete NAPTR recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void deleteNAPTRRecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .deleteWithResponse("rg1", "zone1", "record1", RecordType.NAPTR, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteARecordset.json + */ + /** + * Sample code: Delete A recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void deleteARecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .deleteWithResponse("rg1", "zone1", "record1", RecordType.A, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteAAAARecordset.json + */ + /** + * Sample code: Delete AAAA recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void deleteAAAARecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .deleteWithResponse("rg1", "zone1", "record1", RecordType.AAAA, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteTXTRecordset.json + */ + /** + * Sample code: Delete TXT recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void deleteTXTRecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .deleteWithResponse("rg1", "zone1", "record1", RecordType.TXT, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteDSRecordset.json + */ + /** + * Sample code: Delete DS recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void deleteDSRecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .deleteWithResponse("rg1", "zone1", "record1", RecordType.DS, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteTLSARecordset.json + */ + /** + * Sample code: Delete TLSA recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void deleteTLSARecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .deleteWithResponse("rg1", "zone1", "record1", RecordType.TLSA, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeletePTRRecordset.json + */ + /** + * Sample code: Delete PTR recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void deletePTRRecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .deleteWithResponse( + "rg1", "0.0.127.in-addr.arpa", "1", RecordType.PTR, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteSRVRecordset.json + */ + /** + * Sample code: Delete SRV recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void deleteSRVRecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .deleteWithResponse("rg1", "zone1", "record1", RecordType.SRV, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteMXRecordset.json + */ + /** + * Sample code: Delete MX recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void deleteMXRecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .deleteWithResponse("rg1", "zone1", "record1", RecordType.MX, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteCaaRecordset.json + */ + /** + * Sample code: Delete CAA recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void deleteCAARecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .deleteWithResponse("rg1", "zone1", "record1", RecordType.CAA, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteNSRecordset.json + */ + /** + * Sample code: Delete NS recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void deleteNSRecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .deleteWithResponse("rg1", "zone1", "record1", RecordType.NS, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteCNAMERecordset.json + */ + /** + * Sample code: Delete CNAME recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void deleteCNAMERecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .deleteWithResponse("rg1", "zone1", "record1", RecordType.CNAME, null, com.azure.core.util.Context.NONE); + } +} +``` + +### RecordSets_Get + +```java +import com.azure.resourcemanager.dns.generated.models.RecordType; + +/** Samples for RecordSets Get. */ +public final class RecordSetsGetSamples { + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetCaaRecordset.json + */ + /** + * Sample code: Get CAA recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void getCAARecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .getWithResponse("rg1", "zone1", "record1", RecordType.CAA, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetPTRRecordset.json + */ + /** + * Sample code: Get PTR recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void getPTRRecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .getWithResponse("rg1", "0.0.127.in-addr.arpa", "1", RecordType.PTR, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetDSRecordset.json + */ + /** + * Sample code: Get DS recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void getDSRecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .getWithResponse("rg1", "zone1", "record1", RecordType.DS, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetARecordset.json + */ + /** + * Sample code: Get A recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void getARecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager.recordSets().getWithResponse("rg1", "zone1", "record1", RecordType.A, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetNAPTRRecordset.json + */ + /** + * Sample code: Get NAPTR recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void getNAPTRRecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .getWithResponse("rg1", "zone1", "record1", RecordType.NAPTR, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetNSRecordset.json + */ + /** + * Sample code: Get NS recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void getNSRecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .getWithResponse("rg1", "zone1", "record1", RecordType.NS, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetAAAARecordset.json + */ + /** + * Sample code: Get AAAA recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void getAAAARecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .getWithResponse("rg1", "zone1", "record1", RecordType.AAAA, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetSRVRecordset.json + */ + /** + * Sample code: Get SRV recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void getSRVRecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .getWithResponse("rg1", "zone1", "record1", RecordType.SRV, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetCNAMERecordset.json + */ + /** + * Sample code: Get CNAME recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void getCNAMERecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .getWithResponse("rg1", "zone1", "record1", RecordType.CNAME, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetTXTRecordset.json + */ + /** + * Sample code: Get TXT recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void getTXTRecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .getWithResponse("rg1", "zone1", "record1", RecordType.TXT, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetTLSARecordset.json + */ + /** + * Sample code: Get TLSA recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void getTLSARecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .getWithResponse("rg1", "zone1", "record1", RecordType.TLSA, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetMXRecordset.json + */ + /** + * Sample code: Get MX recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void getMXRecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .getWithResponse("rg1", "zone1", "record1", RecordType.MX, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetSOARecordset.json + */ + /** + * Sample code: Get SOA recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void getSOARecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager.recordSets().getWithResponse("rg1", "zone1", "@", RecordType.SOA, com.azure.core.util.Context.NONE); + } +} +``` + +### RecordSets_ListAllByDnsZone + +```java +/** Samples for RecordSets ListAllByDnsZone. */ +public final class RecordSetsListAllByDnsZoneSamples { + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListRecordSetsByZone.json + */ + /** + * Sample code: List all recordsets by zone. + * + * @param manager Entry point to DnsManager. + */ + public static void listAllRecordsetsByZone(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager.recordSets().listAllByDnsZone("rg1", "zone1", null, null, com.azure.core.util.Context.NONE); + } +} +``` + +### RecordSets_ListByDnsZone + +```java +/** Samples for RecordSets ListByDnsZone. */ +public final class RecordSetsListByDnsZoneSamples { + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListRecordSetsByZone.json + */ + /** + * Sample code: List recordsets by zone. + * + * @param manager Entry point to DnsManager. + */ + public static void listRecordsetsByZone(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager.recordSets().listByDnsZone("rg1", "zone1", null, null, com.azure.core.util.Context.NONE); + } +} +``` + +### RecordSets_ListByType + +```java +import com.azure.resourcemanager.dns.generated.models.RecordType; + +/** Samples for RecordSets ListByType. */ +public final class RecordSetsListByTypeSamples { + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListAAAARecordset.json + */ + /** + * Sample code: List AAAA recordsets. + * + * @param manager Entry point to DnsManager. + */ + public static void listAAAARecordsets(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager.recordSets().listByType("rg1", "zone1", RecordType.AAAA, null, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListMXRecordset.json + */ + /** + * Sample code: List MX recordsets. + * + * @param manager Entry point to DnsManager. + */ + public static void listMXRecordsets(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager.recordSets().listByType("rg1", "zone1", RecordType.MX, null, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListNSRecordset.json + */ + /** + * Sample code: List NS recordsets. + * + * @param manager Entry point to DnsManager. + */ + public static void listNSRecordsets(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager.recordSets().listByType("rg1", "zone1", RecordType.NS, null, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListCNAMERecordset.json + */ + /** + * Sample code: List CNAME recordsets. + * + * @param manager Entry point to DnsManager. + */ + public static void listCNAMERecordsets(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager.recordSets().listByType("rg1", "zone1", RecordType.CNAME, null, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListDSRecordset.json + */ + /** + * Sample code: List DS recordsets. + * + * @param manager Entry point to DnsManager. + */ + public static void listDSRecordsets(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager.recordSets().listByType("rg1", "zone1", RecordType.DS, null, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListSRVRecordset.json + */ + /** + * Sample code: List SRV recordsets. + * + * @param manager Entry point to DnsManager. + */ + public static void listSRVRecordsets(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager.recordSets().listByType("rg1", "zone1", RecordType.SRV, null, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListPTRRecordset.json + */ + /** + * Sample code: List PTR recordsets. + * + * @param manager Entry point to DnsManager. + */ + public static void listPTRRecordsets(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .listByType("rg1", "0.0.127.in-addr.arpa", RecordType.PTR, null, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListTLSARecordset.json + */ + /** + * Sample code: List TLSA recordsets. + * + * @param manager Entry point to DnsManager. + */ + public static void listTLSARecordsets(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager.recordSets().listByType("rg1", "zone1", RecordType.TLSA, null, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListARecordset.json + */ + /** + * Sample code: List A recordsets. + * + * @param manager Entry point to DnsManager. + */ + public static void listARecordsets(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager.recordSets().listByType("rg1", "zone1", RecordType.A, null, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListSOARecordset.json + */ + /** + * Sample code: List SOA recordsets. + * + * @param manager Entry point to DnsManager. + */ + public static void listSOARecordsets(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager.recordSets().listByType("rg1", "zone1", RecordType.SOA, null, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListCaaRecordset.json + */ + /** + * Sample code: List CAA recordsets. + * + * @param manager Entry point to DnsManager. + */ + public static void listCAARecordsets(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager.recordSets().listByType("rg1", "zone1", RecordType.CAA, null, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListNAPTRRecordset.json + */ + /** + * Sample code: List NAPTR recordsets. + * + * @param manager Entry point to DnsManager. + */ + public static void listNAPTRRecordsets(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager.recordSets().listByType("rg1", "zone1", RecordType.NAPTR, null, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListTXTRecordset.json + */ + /** + * Sample code: List TXT recordsets. + * + * @param manager Entry point to DnsManager. + */ + public static void listTXTRecordsets(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager.recordSets().listByType("rg1", "zone1", RecordType.TXT, null, null, com.azure.core.util.Context.NONE); + } +} +``` + +### RecordSets_Update + +```java +import com.azure.resourcemanager.dns.generated.fluent.models.RecordSetInner; +import com.azure.resourcemanager.dns.generated.models.RecordType; +import java.util.HashMap; +import java.util.Map; + +/** Samples for RecordSets Update. */ +public final class RecordSetsUpdateSamples { + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchMXRecordset.json + */ + /** + * Sample code: Patch MX recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void patchMXRecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .updateWithResponse( + "rg1", + "zone1", + "record1", + RecordType.MX, + new RecordSetInner().withMetadata(mapOf("key2", "value2")), + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchNSRecordset.json + */ + /** + * Sample code: Patch NS recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void patchNSRecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .updateWithResponse( + "rg1", + "zone1", + "record1", + RecordType.NS, + new RecordSetInner().withMetadata(mapOf("key2", "value2")), + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchPTRRecordset.json + */ + /** + * Sample code: Patch PTR recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void patchPTRRecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .updateWithResponse( + "rg1", + "0.0.127.in-addr.arpa", + "1", + RecordType.PTR, + new RecordSetInner().withMetadata(mapOf("key2", "value2")), + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchDSRecordset.json + */ + /** + * Sample code: Patch DS recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void patchDSRecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .updateWithResponse( + "rg1", + "zone1", + "record1", + RecordType.DS, + new RecordSetInner().withMetadata(mapOf("key2", "value2")), + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchARecordset.json + */ + /** + * Sample code: Patch A recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void patchARecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .updateWithResponse( + "rg1", + "zone1", + "record1", + RecordType.A, + new RecordSetInner().withMetadata(mapOf("key2", "value2")), + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchTXTRecordset.json + */ + /** + * Sample code: Patch TXT recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void patchTXTRecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .updateWithResponse( + "rg1", + "zone1", + "record1", + RecordType.TXT, + new RecordSetInner().withMetadata(mapOf("key2", "value2")), + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchAAAARecordset.json + */ + /** + * Sample code: Patch AAAA recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void patchAAAARecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .updateWithResponse( + "rg1", + "zone1", + "record1", + RecordType.AAAA, + new RecordSetInner().withMetadata(mapOf("key2", "value2")), + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchSRVRecordset.json + */ + /** + * Sample code: Patch SRV recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void patchSRVRecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .updateWithResponse( + "rg1", + "zone1", + "record1", + RecordType.SRV, + new RecordSetInner().withMetadata(mapOf("key2", "value2")), + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchSOARecordset.json + */ + /** + * Sample code: Patch SOA recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void patchSOARecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .updateWithResponse( + "rg1", + "zone1", + "@", + RecordType.SOA, + new RecordSetInner().withMetadata(mapOf("key2", "value2")), + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchTLSARecordset.json + */ + /** + * Sample code: Patch TLSA recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void patchTLSARecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .updateWithResponse( + "rg1", + "zone1", + "record1", + RecordType.TLSA, + new RecordSetInner().withMetadata(mapOf("key2", "value2")), + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchCaaRecordset.json + */ + /** + * Sample code: Patch CAA recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void patchCAARecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .updateWithResponse( + "rg1", + "zone1", + "record1", + RecordType.CAA, + new RecordSetInner().withMetadata(mapOf("key2", "value2")), + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchCNAMERecordset.json + */ + /** + * Sample code: Patch CNAME recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void patchCNAMERecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .updateWithResponse( + "rg1", + "zone1", + "record1", + RecordType.CNAME, + new RecordSetInner().withMetadata(mapOf("key2", "value2")), + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchNAPTRRecordset.json + */ + /** + * Sample code: Patch NAPTR recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void patchNAPTRRecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .updateWithResponse( + "rg1", + "zone1", + "record1", + RecordType.NAPTR, + new RecordSetInner().withMetadata(mapOf("key2", "value2")), + null, + com.azure.core.util.Context.NONE); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Zones_CreateOrUpdate + +```java +import java.util.HashMap; +import java.util.Map; + +/** Samples for Zones CreateOrUpdate. */ +public final class ZonesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateZone.json + */ + /** + * Sample code: Create zone. + * + * @param manager Entry point to DnsManager. + */ + public static void createZone(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .zones() + .define("zone1") + .withRegion("Global") + .withExistingResourceGroup("rg1") + .withTags(mapOf("key1", "value1")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Zones_Delete + +```java +/** Samples for Zones Delete. */ +public final class ZonesDeleteSamples { + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteZone.json + */ + /** + * Sample code: Delete zone. + * + * @param manager Entry point to DnsManager. + */ + public static void deleteZone(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager.zones().delete("rg1", "zone1", null, com.azure.core.util.Context.NONE); + } +} +``` + +### Zones_GetByResourceGroup + +```java +/** Samples for Zones GetByResourceGroup. */ +public final class ZonesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetZone.json + */ + /** + * Sample code: Get zone. + * + * @param manager Entry point to DnsManager. + */ + public static void getZone(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager.zones().getByResourceGroupWithResponse("rg1", "zone1", com.azure.core.util.Context.NONE); + } +} +``` + +### Zones_List + +```java +/** Samples for Zones List. */ +public final class ZonesListSamples { + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListZonesBySubscription.json + */ + /** + * Sample code: List zones by subscription. + * + * @param manager Entry point to DnsManager. + */ + public static void listZonesBySubscription(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager.zones().list(null, com.azure.core.util.Context.NONE); + } +} +``` + +### Zones_ListByResourceGroup + +```java +/** Samples for Zones ListByResourceGroup. */ +public final class ZonesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListZonesByResourceGroup.json + */ + /** + * Sample code: List zones by resource group. + * + * @param manager Entry point to DnsManager. + */ + public static void listZonesByResourceGroup(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager.zones().listByResourceGroup("rg1", null, com.azure.core.util.Context.NONE); + } +} +``` + +### Zones_Update + +```java +import com.azure.resourcemanager.dns.generated.models.Zone; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Zones Update. */ +public final class ZonesUpdateSamples { + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchZone.json + */ + /** + * Sample code: Patch zone. + * + * @param manager Entry point to DnsManager. + */ + public static void patchZone(com.azure.resourcemanager.dns.generated.DnsManager manager) { + Zone resource = + manager.zones().getByResourceGroupWithResponse("rg1", "zone1", com.azure.core.util.Context.NONE).getValue(); + resource.update().withTags(mapOf("key2", "value2")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + diff --git a/sdk/dns/azure-resourcemanager-dns-generated/pom.xml b/sdk/dns/azure-resourcemanager-dns-generated/pom.xml new file mode 100644 index 0000000000000..09433cc543ac7 --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/pom.xml @@ -0,0 +1,61 @@ + + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-dns-generated + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for Dns Management + This package contains Microsoft Azure SDK for Dns Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The DNS Management Client. Package tag package-2023-07-preview. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + 0 + 0 + + + + com.azure + azure-core + 1.39.0 + + + com.azure + azure-core-management + 1.11.1 + + + diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/DnsManager.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/DnsManager.java new file mode 100644 index 0000000000000..eb541f2fe810f --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/DnsManager.java @@ -0,0 +1,330 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated; + +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.dns.generated.fluent.DnsManagementClient; +import com.azure.resourcemanager.dns.generated.implementation.DnsManagementClientBuilder; +import com.azure.resourcemanager.dns.generated.implementation.DnsResourceReferencesImpl; +import com.azure.resourcemanager.dns.generated.implementation.DnssecConfigsImpl; +import com.azure.resourcemanager.dns.generated.implementation.RecordSetsImpl; +import com.azure.resourcemanager.dns.generated.implementation.ZonesImpl; +import com.azure.resourcemanager.dns.generated.models.DnsResourceReferences; +import com.azure.resourcemanager.dns.generated.models.DnssecConfigs; +import com.azure.resourcemanager.dns.generated.models.RecordSets; +import com.azure.resourcemanager.dns.generated.models.Zones; +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 DnsManager. The DNS Management Client. */ +public final class DnsManager { + private DnssecConfigs dnssecConfigs; + + private RecordSets recordSets; + + private Zones zones; + + private DnsResourceReferences dnsResourceReferences; + + private final DnsManagementClient clientObject; + + private DnsManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new DnsManagementClientBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of Dns service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Dns service API instance. + */ + public static DnsManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Creates an instance of Dns service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the Dns service API instance. + */ + public static DnsManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new DnsManager(httpPipeline, profile, null); + } + + /** + * Gets a Configurable instance that can be used to create DnsManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new DnsManager.Configurable(); + } + + /** The Configurable allowing configurations to be set. */ + public static final class Configurable { + private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); + private RetryPolicy retryPolicy; + private RetryOptions retryOptions; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the retry options for the HTTP pipeline retry policy. + * + *

This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + * + * @param retryOptions the retry options for the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryOptions(RetryOptions retryOptions) { + this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = + Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of Dns service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Dns service API instance. + */ + public DnsManager 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.dns.generated") + .append("/") + .append("1.0.0-beta.1"); + if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { + userAgentBuilder + .append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } + if (retryPolicy == null) { + if (retryOptions != null) { + retryPolicy = new RetryPolicy(retryOptions); + } else { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new AddHeadersFromContextPolicy()); + policies.add(new RequestIdPolicy()); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new DnsManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** + * Gets the resource collection API of DnssecConfigs. + * + * @return Resource collection API of DnssecConfigs. + */ + public DnssecConfigs dnssecConfigs() { + if (this.dnssecConfigs == null) { + this.dnssecConfigs = new DnssecConfigsImpl(clientObject.getDnssecConfigs(), this); + } + return dnssecConfigs; + } + + /** + * Gets the resource collection API of RecordSets. + * + * @return Resource collection API of RecordSets. + */ + public RecordSets recordSets() { + if (this.recordSets == null) { + this.recordSets = new RecordSetsImpl(clientObject.getRecordSets(), this); + } + return recordSets; + } + + /** + * Gets the resource collection API of Zones. It manages Zone. + * + * @return Resource collection API of Zones. + */ + public Zones zones() { + if (this.zones == null) { + this.zones = new ZonesImpl(clientObject.getZones(), this); + } + return zones; + } + + /** + * Gets the resource collection API of DnsResourceReferences. + * + * @return Resource collection API of DnsResourceReferences. + */ + public DnsResourceReferences dnsResourceReferences() { + if (this.dnsResourceReferences == null) { + this.dnsResourceReferences = new DnsResourceReferencesImpl(clientObject.getDnsResourceReferences(), this); + } + return dnsResourceReferences; + } + + /** + * @return Wrapped service client DnsManagementClient providing direct access to the underlying auto-generated API + * implementation, based on Azure REST API. + */ + public DnsManagementClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/fluent/DnsManagementClient.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/fluent/DnsManagementClient.java new file mode 100644 index 0000000000000..5a33e72b9fcd1 --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/fluent/DnsManagementClient.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for DnsManagementClient class. */ +public interface DnsManagementClient { + /** + * Gets The ID of the target subscription. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the DnssecConfigsClient object to access its operations. + * + * @return the DnssecConfigsClient object. + */ + DnssecConfigsClient getDnssecConfigs(); + + /** + * Gets the RecordSetsClient object to access its operations. + * + * @return the RecordSetsClient object. + */ + RecordSetsClient getRecordSets(); + + /** + * Gets the ZonesClient object to access its operations. + * + * @return the ZonesClient object. + */ + ZonesClient getZones(); + + /** + * Gets the DnsResourceReferencesClient object to access its operations. + * + * @return the DnsResourceReferencesClient object. + */ + DnsResourceReferencesClient getDnsResourceReferences(); +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/fluent/DnsResourceReferencesClient.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/fluent/DnsResourceReferencesClient.java new file mode 100644 index 0000000000000..0a0b7c33bfb8e --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/fluent/DnsResourceReferencesClient.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.dns.generated.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.dns.generated.fluent.models.DnsResourceReferenceResultInner; +import com.azure.resourcemanager.dns.generated.models.DnsResourceReferenceRequest; + +/** An instance of this class provides access to all the operations defined in DnsResourceReferencesClient. */ +public interface DnsResourceReferencesClient { + /** + * Returns the DNS records specified by the referencing targetResourceIds. + * + * @param parameters Properties for dns resource reference request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the properties of the Dns Resource Reference Result along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByTargetResourcesWithResponse( + DnsResourceReferenceRequest parameters, Context context); + + /** + * Returns the DNS records specified by the referencing targetResourceIds. + * + * @param parameters Properties for dns resource reference request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the properties of the Dns Resource Reference Result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DnsResourceReferenceResultInner getByTargetResources(DnsResourceReferenceRequest parameters); +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/fluent/DnssecConfigsClient.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/fluent/DnssecConfigsClient.java new file mode 100644 index 0000000000000..6765a069cfd4e --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/fluent/DnssecConfigsClient.java @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.dns.generated.fluent.models.DnssecConfigInner; + +/** An instance of this class provides access to all the operations defined in DnssecConfigsClient. */ +public interface DnssecConfigsClient { + /** + * Creates or updates the DNSSEC configuration on a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 SyncPoller} for polling of represents the DNSSEC configuration. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DnssecConfigInner> beginCreateOrUpdate( + String resourceGroupName, String zoneName); + + /** + * Creates or updates the DNSSEC configuration on a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param ifMatch The etag of the DNSSEC configuration. Omit this value to always overwrite the DNSSEC + * configuration. Specify the last-seen etag value to prevent accidentally overwriting any concurrent changes. + * @param ifNoneMatch Set to '*' to allow this DNSSEC configuration to be created, but to prevent updating existing + * DNSSEC configuration. Other values will be ignored. + * @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 SyncPoller} for polling of represents the DNSSEC configuration. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DnssecConfigInner> beginCreateOrUpdate( + String resourceGroupName, String zoneName, String ifMatch, String ifNoneMatch, Context context); + + /** + * Creates or updates the DNSSEC configuration on a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 the DNSSEC configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DnssecConfigInner createOrUpdate(String resourceGroupName, String zoneName); + + /** + * Creates or updates the DNSSEC configuration on a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param ifMatch The etag of the DNSSEC configuration. Omit this value to always overwrite the DNSSEC + * configuration. Specify the last-seen etag value to prevent accidentally overwriting any concurrent changes. + * @param ifNoneMatch Set to '*' to allow this DNSSEC configuration to be created, but to prevent updating existing + * DNSSEC configuration. Other values will be ignored. + * @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 the DNSSEC configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DnssecConfigInner createOrUpdate( + String resourceGroupName, String zoneName, String ifMatch, String ifNoneMatch, Context context); + + /** + * Deletes the DNSSEC configuration on a DNS zone. This operation cannot be undone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String zoneName); + + /** + * Deletes the DNSSEC configuration on a DNS zone. This operation cannot be undone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param ifMatch The etag of this DNSSEC configuration. Omit this value to always delete the DNSSEC configuration. + * Specify the last-seen etag value to prevent accidentally deleting any concurrent changes. + * @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 SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String zoneName, String ifMatch, Context context); + + /** + * Deletes the DNSSEC configuration on a DNS zone. This operation cannot be undone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String zoneName); + + /** + * Deletes the DNSSEC configuration on a DNS zone. This operation cannot be undone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param ifMatch The etag of this DNSSEC configuration. Omit this value to always delete the DNSSEC configuration. + * Specify the last-seen etag value to prevent accidentally deleting any concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String zoneName, String ifMatch, Context context); + + /** + * Gets the DNSSEC configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @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 DNSSEC configuration along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String zoneName, Context context); + + /** + * Gets the DNSSEC configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the DNSSEC configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DnssecConfigInner get(String resourceGroupName, String zoneName); + + /** + * Lists the DNSSEC configurations in a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a List DNSSEC configurations operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDnsZone(String resourceGroupName, String zoneName); + + /** + * Lists the DNSSEC configurations in a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a List DNSSEC configurations operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDnsZone(String resourceGroupName, String zoneName, Context context); +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/fluent/RecordSetsClient.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/fluent/RecordSetsClient.java new file mode 100644 index 0000000000000..85d63c8b39bab --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/fluent/RecordSetsClient.java @@ -0,0 +1,296 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.dns.generated.fluent.models.RecordSetInner; +import com.azure.resourcemanager.dns.generated.models.RecordType; + +/** An instance of this class provides access to all the operations defined in RecordSetsClient. */ +public interface RecordSetsClient { + /** + * Updates a record set within a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param recordType The type of DNS record in this record set. + * @param parameters Parameters supplied to the Update operation. + * @param ifMatch The etag of the record set. Omit this value to always overwrite the current record set. Specify + * the last-seen etag value to prevent accidentally overwriting concurrent changes. + * @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 describes a DNS record set (a collection of DNS records with the same name and type) along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String zoneName, + String relativeRecordSetName, + RecordType recordType, + RecordSetInner parameters, + String ifMatch, + Context context); + + /** + * Updates a record set within a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param recordType The type of DNS record in this record set. + * @param parameters Parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a DNS record set (a collection of DNS records with the same name and type). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RecordSetInner update( + String resourceGroupName, + String zoneName, + String relativeRecordSetName, + RecordType recordType, + RecordSetInner parameters); + + /** + * Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they + * are created when the DNS zone is created). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param recordType The type of DNS record in this record set. + * @param parameters Parameters supplied to the CreateOrUpdate operation. + * @param ifMatch The etag of the record set. Omit this value to always overwrite the current record set. Specify + * the last-seen etag value to prevent accidentally overwriting any concurrent changes. + * @param ifNoneMatch Set to '*' to allow a new record set to be created, but to prevent updating an existing record + * set. Other values will be ignored. + * @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 describes a DNS record set (a collection of DNS records with the same name and type) along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String zoneName, + String relativeRecordSetName, + RecordType recordType, + RecordSetInner parameters, + String ifMatch, + String ifNoneMatch, + Context context); + + /** + * Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they + * are created when the DNS zone is created). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param recordType The type of DNS record in this record set. + * @param parameters Parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a DNS record set (a collection of DNS records with the same name and type). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RecordSetInner createOrUpdate( + String resourceGroupName, + String zoneName, + String relativeRecordSetName, + RecordType recordType, + RecordSetInner parameters); + + /** + * Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted + * (they are deleted when the DNS zone is deleted). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param recordType The type of DNS record in this record set. + * @param ifMatch The etag of the record set. Omit this value to always delete the current record set. Specify the + * last-seen etag value to prevent accidentally deleting any concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, + String zoneName, + String relativeRecordSetName, + RecordType recordType, + String ifMatch, + Context context); + + /** + * Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted + * (they are deleted when the DNS zone is deleted). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param recordType The type of DNS record in this record set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String zoneName, String relativeRecordSetName, RecordType recordType); + + /** + * Gets a record set. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param recordType The type of DNS record in this record set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a record set along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String zoneName, + String relativeRecordSetName, + RecordType recordType, + Context context); + + /** + * Gets a record set. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param recordType The type of DNS record in this record set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 record set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RecordSetInner get(String resourceGroupName, String zoneName, String relativeRecordSetName, RecordType recordType); + + /** + * Lists the record sets of a specified type in a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param recordType The type of DNS record in this record set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a record set List operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByType(String resourceGroupName, String zoneName, RecordType recordType); + + /** + * Lists the record sets of a specified type in a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param recordType The type of DNS record in this record set. + * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. + * @param recordsetnamesuffix The suffix label of the record set name that has to be used to filter the record set + * enumerations. If this parameter is specified, Enumeration will return only records that end with + * .<recordSetNameSuffix>. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a record set List operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByType( + String resourceGroupName, + String zoneName, + RecordType recordType, + Integer top, + String recordsetnamesuffix, + Context context); + + /** + * Lists all record sets in a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a record set List operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDnsZone(String resourceGroupName, String zoneName); + + /** + * Lists all record sets in a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. + * @param recordsetnamesuffix The suffix label of the record set name that has to be used to filter the record set + * enumerations. If this parameter is specified, Enumeration will return only records that end with + * .<recordSetNameSuffix>. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a record set List operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDnsZone( + String resourceGroupName, String zoneName, Integer top, String recordsetnamesuffix, Context context); + + /** + * Lists all record sets in a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a record set List operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAllByDnsZone(String resourceGroupName, String zoneName); + + /** + * Lists all record sets in a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. + * @param recordSetNameSuffix The suffix label of the record set name that has to be used to filter the record set + * enumerations. If this parameter is specified, Enumeration will return only records that end with + * .<recordSetNameSuffix>. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a record set List operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAllByDnsZone( + String resourceGroupName, String zoneName, Integer top, String recordSetNameSuffix, Context context); +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/fluent/ZonesClient.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/fluent/ZonesClient.java new file mode 100644 index 0000000000000..e112332b96fda --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/fluent/ZonesClient.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.dns.generated.fluent.models.ZoneInner; +import com.azure.resourcemanager.dns.generated.models.ZoneUpdate; + +/** An instance of this class provides access to all the operations defined in ZonesClient. */ +public interface ZonesClient { + /** + * Creates or updates a DNS zone. Does not modify DNS records within the zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param parameters Parameters supplied to the CreateOrUpdate operation. + * @param ifMatch The etag of the DNS zone. Omit this value to always overwrite the current zone. Specify the + * last-seen etag value to prevent accidentally overwriting any concurrent changes. + * @param ifNoneMatch Set to '*' to allow a new DNS zone to be created, but to prevent updating an existing zone. + * Other values will be ignored. + * @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 describes a DNS zone along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String zoneName, + ZoneInner parameters, + String ifMatch, + String ifNoneMatch, + Context context); + + /** + * Creates or updates a DNS zone. Does not modify DNS records within the zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param parameters Parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ZoneInner createOrUpdate(String resourceGroupName, String zoneName, ZoneInner parameters); + + /** + * Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String zoneName); + + /** + * Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param ifMatch The etag of the DNS zone. Omit this value to always delete the current zone. Specify the last-seen + * etag value to prevent accidentally deleting any concurrent changes. + * @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 SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String zoneName, String ifMatch, Context context); + + /** + * Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String zoneName); + + /** + * Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param ifMatch The etag of the DNS zone. Omit this value to always delete the current zone. Specify the last-seen + * etag value to prevent accidentally deleting any concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String zoneName, String ifMatch, Context context); + + /** + * Gets a DNS zone. Retrieves the zone properties, but not the record sets within the zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DNS zone along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String zoneName, Context context); + + /** + * Gets a DNS zone. Retrieves the zone properties, but not the record sets within the zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ZoneInner getByResourceGroup(String resourceGroupName, String zoneName); + + /** + * Updates a DNS zone. Does not modify DNS records within the zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param parameters Parameters supplied to the Update operation. + * @param ifMatch The etag of the DNS zone. Omit this value to always overwrite the current zone. Specify the + * last-seen etag value to prevent accidentally overwriting any concurrent changes. + * @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 describes a DNS zone along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, String zoneName, ZoneUpdate parameters, String ifMatch, Context context); + + /** + * Updates a DNS zone. Does not modify DNS records within the zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param parameters Parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ZoneInner update(String resourceGroupName, String zoneName, ZoneUpdate parameters); + + /** + * Lists the DNS zones within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a Zone List or ListAll operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists the DNS zones within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a Zone List or ListAll operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Integer top, Context context); + + /** + * Lists the DNS zones in all resource groups in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a Zone List or ListAll operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists the DNS zones in all resource groups in a subscription. + * + * @param top The maximum number of DNS zones to return. If not specified, returns up to 100 zones. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a Zone List or ListAll operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Integer top, Context context); +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/fluent/models/DnsResourceReferenceRequestProperties.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/fluent/models/DnsResourceReferenceRequestProperties.java new file mode 100644 index 0000000000000..fbf76f40ec388 --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/fluent/models/DnsResourceReferenceRequestProperties.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.dns.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Represents the properties of the Dns Resource Reference Request. */ +@Fluent +public final class DnsResourceReferenceRequestProperties { + /* + * A list of references to azure resources for which referencing dns records need to be queried. + */ + @JsonProperty(value = "targetResources") + private List targetResources; + + /** Creates an instance of DnsResourceReferenceRequestProperties class. */ + public DnsResourceReferenceRequestProperties() { + } + + /** + * Get the targetResources property: A list of references to azure resources for which referencing dns records need + * to be queried. + * + * @return the targetResources value. + */ + public List targetResources() { + return this.targetResources; + } + + /** + * Set the targetResources property: A list of references to azure resources for which referencing dns records need + * to be queried. + * + * @param targetResources the targetResources value to set. + * @return the DnsResourceReferenceRequestProperties object itself. + */ + public DnsResourceReferenceRequestProperties withTargetResources(List targetResources) { + this.targetResources = targetResources; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/fluent/models/DnsResourceReferenceResultInner.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/fluent/models/DnsResourceReferenceResultInner.java new file mode 100644 index 0000000000000..6e22296ff1834 --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/fluent/models/DnsResourceReferenceResultInner.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.dns.generated.models.DnsResourceReference; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Represents the properties of the Dns Resource Reference Result. */ +@Fluent +public final class DnsResourceReferenceResultInner { + /* + * The result of dns resource reference request. Returns a list of dns resource references for each of the azure + * resource in the request. + */ + @JsonProperty(value = "properties") + private DnsResourceReferenceResultProperties innerProperties; + + /** Creates an instance of DnsResourceReferenceResultInner class. */ + public DnsResourceReferenceResultInner() { + } + + /** + * Get the innerProperties property: The result of dns resource reference request. Returns a list of dns resource + * references for each of the azure resource in the request. + * + * @return the innerProperties value. + */ + private DnsResourceReferenceResultProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the dnsResourceReferences property: The result of dns resource reference request. A list of dns resource + * references for each of the azure resource in the request. + * + * @return the dnsResourceReferences value. + */ + public List dnsResourceReferences() { + return this.innerProperties() == null ? null : this.innerProperties().dnsResourceReferences(); + } + + /** + * Set the dnsResourceReferences property: The result of dns resource reference request. A list of dns resource + * references for each of the azure resource in the request. + * + * @param dnsResourceReferences the dnsResourceReferences value to set. + * @return the DnsResourceReferenceResultInner object itself. + */ + public DnsResourceReferenceResultInner withDnsResourceReferences(List dnsResourceReferences) { + if (this.innerProperties() == null) { + this.innerProperties = new DnsResourceReferenceResultProperties(); + } + this.innerProperties().withDnsResourceReferences(dnsResourceReferences); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/fluent/models/DnsResourceReferenceResultProperties.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/fluent/models/DnsResourceReferenceResultProperties.java new file mode 100644 index 0000000000000..08952b3244d22 --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/fluent/models/DnsResourceReferenceResultProperties.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.dns.generated.models.DnsResourceReference; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * The result of dns resource reference request. Returns a list of dns resource references for each of the azure + * resource in the request. + */ +@Fluent +public final class DnsResourceReferenceResultProperties { + /* + * The result of dns resource reference request. A list of dns resource references for each of the azure resource + * in the request + */ + @JsonProperty(value = "dnsResourceReferences") + private List dnsResourceReferences; + + /** Creates an instance of DnsResourceReferenceResultProperties class. */ + public DnsResourceReferenceResultProperties() { + } + + /** + * Get the dnsResourceReferences property: The result of dns resource reference request. A list of dns resource + * references for each of the azure resource in the request. + * + * @return the dnsResourceReferences value. + */ + public List dnsResourceReferences() { + return this.dnsResourceReferences; + } + + /** + * Set the dnsResourceReferences property: The result of dns resource reference request. A list of dns resource + * references for each of the azure resource in the request. + * + * @param dnsResourceReferences the dnsResourceReferences value to set. + * @return the DnsResourceReferenceResultProperties object itself. + */ + public DnsResourceReferenceResultProperties withDnsResourceReferences( + List dnsResourceReferences) { + this.dnsResourceReferences = dnsResourceReferences; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dnsResourceReferences() != null) { + dnsResourceReferences().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/fluent/models/DnssecConfigInner.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/fluent/models/DnssecConfigInner.java new file mode 100644 index 0000000000000..4d5d2b332dffc --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/fluent/models/DnssecConfigInner.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.dns.generated.models.SigningKey; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Represents the DNSSEC configuration. */ +@Fluent +public final class DnssecConfigInner extends ProxyResource { + /* + * The DNSSEC properties. + */ + @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) + private DnssecProperties innerProperties; + + /* + * The etag of the DNSSEC configuration. + */ + @JsonProperty(value = "etag") + private String etag; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of DnssecConfigInner class. */ + public DnssecConfigInner() { + } + + /** + * Get the innerProperties property: The DNSSEC properties. + * + * @return the innerProperties value. + */ + private DnssecProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the etag property: The etag of the DNSSEC configuration. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The etag of the DNSSEC configuration. + * + * @param etag the etag value to set. + * @return the DnssecConfigInner object itself. + */ + public DnssecConfigInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the provisioningState property: Provisioning State of the DNSSEC configuration. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the signingKeys property: The list of signing keys. + * + * @return the signingKeys value. + */ + public List signingKeys() { + return this.innerProperties() == null ? null : this.innerProperties().signingKeys(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/fluent/models/DnssecProperties.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/fluent/models/DnssecProperties.java new file mode 100644 index 0000000000000..b9d787aa30f04 --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/fluent/models/DnssecProperties.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.dns.generated.models.SigningKey; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Represents the DNSSEC properties. */ +@Immutable +public final class DnssecProperties { + /* + * Provisioning State of the DNSSEC configuration. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The list of signing keys. + */ + @JsonProperty(value = "signingKeys", access = JsonProperty.Access.WRITE_ONLY) + private List signingKeys; + + /** Creates an instance of DnssecProperties class. */ + public DnssecProperties() { + } + + /** + * Get the provisioningState property: Provisioning State of the DNSSEC configuration. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the signingKeys property: The list of signing keys. + * + * @return the signingKeys value. + */ + public List signingKeys() { + return this.signingKeys; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (signingKeys() != null) { + signingKeys().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/fluent/models/RecordSetInner.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/fluent/models/RecordSetInner.java new file mode 100644 index 0000000000000..d22999ef3bbf5 --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/fluent/models/RecordSetInner.java @@ -0,0 +1,471 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.dns.generated.models.ARecord; +import com.azure.resourcemanager.dns.generated.models.AaaaRecord; +import com.azure.resourcemanager.dns.generated.models.CaaRecord; +import com.azure.resourcemanager.dns.generated.models.CnameRecord; +import com.azure.resourcemanager.dns.generated.models.DsRecord; +import com.azure.resourcemanager.dns.generated.models.MxRecord; +import com.azure.resourcemanager.dns.generated.models.NaptrRecord; +import com.azure.resourcemanager.dns.generated.models.NsRecord; +import com.azure.resourcemanager.dns.generated.models.PtrRecord; +import com.azure.resourcemanager.dns.generated.models.SoaRecord; +import com.azure.resourcemanager.dns.generated.models.SrvRecord; +import com.azure.resourcemanager.dns.generated.models.TlsaRecord; +import com.azure.resourcemanager.dns.generated.models.TxtRecord; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Describes a DNS record set (a collection of DNS records with the same name and type). */ +@Fluent +public final class RecordSetInner extends ProxyResource { + /* + * The etag of the record set. + */ + @JsonProperty(value = "etag") + private String etag; + + /* + * The properties of the record set. + */ + @JsonProperty(value = "properties") + private RecordSetProperties innerProperties; + + /** Creates an instance of RecordSetInner class. */ + public RecordSetInner() { + } + + /** + * Get the etag property: The etag of the record set. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The etag of the record set. + * + * @param etag the etag value to set. + * @return the RecordSetInner object itself. + */ + public RecordSetInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get the innerProperties property: The properties of the record set. + * + * @return the innerProperties value. + */ + private RecordSetProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the metadata property: The metadata attached to the record set. + * + * @return the metadata value. + */ + public Map metadata() { + return this.innerProperties() == null ? null : this.innerProperties().metadata(); + } + + /** + * Set the metadata property: The metadata attached to the record set. + * + * @param metadata the metadata value to set. + * @return the RecordSetInner object itself. + */ + public RecordSetInner withMetadata(Map metadata) { + if (this.innerProperties() == null) { + this.innerProperties = new RecordSetProperties(); + } + this.innerProperties().withMetadata(metadata); + return this; + } + + /** + * Get the ttl property: The TTL (time-to-live) of the records in the record set. + * + * @return the ttl value. + */ + public Long ttl() { + return this.innerProperties() == null ? null : this.innerProperties().ttl(); + } + + /** + * Set the ttl property: The TTL (time-to-live) of the records in the record set. + * + * @param ttl the ttl value to set. + * @return the RecordSetInner object itself. + */ + public RecordSetInner withTtl(Long ttl) { + if (this.innerProperties() == null) { + this.innerProperties = new RecordSetProperties(); + } + this.innerProperties().withTtl(ttl); + return this; + } + + /** + * Get the fqdn property: Fully qualified domain name of the record set. + * + * @return the fqdn value. + */ + public String fqdn() { + return this.innerProperties() == null ? null : this.innerProperties().fqdn(); + } + + /** + * Get the provisioningState property: provisioning State of the record set. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the targetResource property: A reference to an azure resource from where the dns resource value is taken. + * + * @return the targetResource value. + */ + public SubResource targetResource() { + return this.innerProperties() == null ? null : this.innerProperties().targetResource(); + } + + /** + * Set the targetResource property: A reference to an azure resource from where the dns resource value is taken. + * + * @param targetResource the targetResource value to set. + * @return the RecordSetInner object itself. + */ + public RecordSetInner withTargetResource(SubResource targetResource) { + if (this.innerProperties() == null) { + this.innerProperties = new RecordSetProperties(); + } + this.innerProperties().withTargetResource(targetResource); + return this; + } + + /** + * Get the aRecords property: The list of A records in the record set. + * + * @return the aRecords value. + */ + public List aRecords() { + return this.innerProperties() == null ? null : this.innerProperties().aRecords(); + } + + /** + * Set the aRecords property: The list of A records in the record set. + * + * @param aRecords the aRecords value to set. + * @return the RecordSetInner object itself. + */ + public RecordSetInner withARecords(List aRecords) { + if (this.innerProperties() == null) { + this.innerProperties = new RecordSetProperties(); + } + this.innerProperties().withARecords(aRecords); + return this; + } + + /** + * Get the aaaaRecords property: The list of AAAA records in the record set. + * + * @return the aaaaRecords value. + */ + public List aaaaRecords() { + return this.innerProperties() == null ? null : this.innerProperties().aaaaRecords(); + } + + /** + * Set the aaaaRecords property: The list of AAAA records in the record set. + * + * @param aaaaRecords the aaaaRecords value to set. + * @return the RecordSetInner object itself. + */ + public RecordSetInner withAaaaRecords(List aaaaRecords) { + if (this.innerProperties() == null) { + this.innerProperties = new RecordSetProperties(); + } + this.innerProperties().withAaaaRecords(aaaaRecords); + return this; + } + + /** + * Get the mxRecords property: The list of MX records in the record set. + * + * @return the mxRecords value. + */ + public List mxRecords() { + return this.innerProperties() == null ? null : this.innerProperties().mxRecords(); + } + + /** + * Set the mxRecords property: The list of MX records in the record set. + * + * @param mxRecords the mxRecords value to set. + * @return the RecordSetInner object itself. + */ + public RecordSetInner withMxRecords(List mxRecords) { + if (this.innerProperties() == null) { + this.innerProperties = new RecordSetProperties(); + } + this.innerProperties().withMxRecords(mxRecords); + return this; + } + + /** + * Get the nsRecords property: The list of NS records in the record set. + * + * @return the nsRecords value. + */ + public List nsRecords() { + return this.innerProperties() == null ? null : this.innerProperties().nsRecords(); + } + + /** + * Set the nsRecords property: The list of NS records in the record set. + * + * @param nsRecords the nsRecords value to set. + * @return the RecordSetInner object itself. + */ + public RecordSetInner withNsRecords(List nsRecords) { + if (this.innerProperties() == null) { + this.innerProperties = new RecordSetProperties(); + } + this.innerProperties().withNsRecords(nsRecords); + return this; + } + + /** + * Get the ptrRecords property: The list of PTR records in the record set. + * + * @return the ptrRecords value. + */ + public List ptrRecords() { + return this.innerProperties() == null ? null : this.innerProperties().ptrRecords(); + } + + /** + * Set the ptrRecords property: The list of PTR records in the record set. + * + * @param ptrRecords the ptrRecords value to set. + * @return the RecordSetInner object itself. + */ + public RecordSetInner withPtrRecords(List ptrRecords) { + if (this.innerProperties() == null) { + this.innerProperties = new RecordSetProperties(); + } + this.innerProperties().withPtrRecords(ptrRecords); + return this; + } + + /** + * Get the srvRecords property: The list of SRV records in the record set. + * + * @return the srvRecords value. + */ + public List srvRecords() { + return this.innerProperties() == null ? null : this.innerProperties().srvRecords(); + } + + /** + * Set the srvRecords property: The list of SRV records in the record set. + * + * @param srvRecords the srvRecords value to set. + * @return the RecordSetInner object itself. + */ + public RecordSetInner withSrvRecords(List srvRecords) { + if (this.innerProperties() == null) { + this.innerProperties = new RecordSetProperties(); + } + this.innerProperties().withSrvRecords(srvRecords); + return this; + } + + /** + * Get the txtRecords property: The list of TXT records in the record set. + * + * @return the txtRecords value. + */ + public List txtRecords() { + return this.innerProperties() == null ? null : this.innerProperties().txtRecords(); + } + + /** + * Set the txtRecords property: The list of TXT records in the record set. + * + * @param txtRecords the txtRecords value to set. + * @return the RecordSetInner object itself. + */ + public RecordSetInner withTxtRecords(List txtRecords) { + if (this.innerProperties() == null) { + this.innerProperties = new RecordSetProperties(); + } + this.innerProperties().withTxtRecords(txtRecords); + return this; + } + + /** + * Get the cnameRecord property: The CNAME record in the record set. + * + * @return the cnameRecord value. + */ + public CnameRecord cnameRecord() { + return this.innerProperties() == null ? null : this.innerProperties().cnameRecord(); + } + + /** + * Set the cnameRecord property: The CNAME record in the record set. + * + * @param cnameRecord the cnameRecord value to set. + * @return the RecordSetInner object itself. + */ + public RecordSetInner withCnameRecord(CnameRecord cnameRecord) { + if (this.innerProperties() == null) { + this.innerProperties = new RecordSetProperties(); + } + this.innerProperties().withCnameRecord(cnameRecord); + return this; + } + + /** + * Get the soaRecord property: The SOA record in the record set. + * + * @return the soaRecord value. + */ + public SoaRecord soaRecord() { + return this.innerProperties() == null ? null : this.innerProperties().soaRecord(); + } + + /** + * Set the soaRecord property: The SOA record in the record set. + * + * @param soaRecord the soaRecord value to set. + * @return the RecordSetInner object itself. + */ + public RecordSetInner withSoaRecord(SoaRecord soaRecord) { + if (this.innerProperties() == null) { + this.innerProperties = new RecordSetProperties(); + } + this.innerProperties().withSoaRecord(soaRecord); + return this; + } + + /** + * Get the caaRecords property: The list of CAA records in the record set. + * + * @return the caaRecords value. + */ + public List caaRecords() { + return this.innerProperties() == null ? null : this.innerProperties().caaRecords(); + } + + /** + * Set the caaRecords property: The list of CAA records in the record set. + * + * @param caaRecords the caaRecords value to set. + * @return the RecordSetInner object itself. + */ + public RecordSetInner withCaaRecords(List caaRecords) { + if (this.innerProperties() == null) { + this.innerProperties = new RecordSetProperties(); + } + this.innerProperties().withCaaRecords(caaRecords); + return this; + } + + /** + * Get the dsRecords property: The list of DS records in the record set. + * + * @return the dsRecords value. + */ + public List dsRecords() { + return this.innerProperties() == null ? null : this.innerProperties().dsRecords(); + } + + /** + * Set the dsRecords property: The list of DS records in the record set. + * + * @param dsRecords the dsRecords value to set. + * @return the RecordSetInner object itself. + */ + public RecordSetInner withDsRecords(List dsRecords) { + if (this.innerProperties() == null) { + this.innerProperties = new RecordSetProperties(); + } + this.innerProperties().withDsRecords(dsRecords); + return this; + } + + /** + * Get the tlsaRecords property: The list of TLSA records in the record set. + * + * @return the tlsaRecords value. + */ + public List tlsaRecords() { + return this.innerProperties() == null ? null : this.innerProperties().tlsaRecords(); + } + + /** + * Set the tlsaRecords property: The list of TLSA records in the record set. + * + * @param tlsaRecords the tlsaRecords value to set. + * @return the RecordSetInner object itself. + */ + public RecordSetInner withTlsaRecords(List tlsaRecords) { + if (this.innerProperties() == null) { + this.innerProperties = new RecordSetProperties(); + } + this.innerProperties().withTlsaRecords(tlsaRecords); + return this; + } + + /** + * Get the naptrRecords property: The list of NAPTR records in the record set. + * + * @return the naptrRecords value. + */ + public List naptrRecords() { + return this.innerProperties() == null ? null : this.innerProperties().naptrRecords(); + } + + /** + * Set the naptrRecords property: The list of NAPTR records in the record set. + * + * @param naptrRecords the naptrRecords value to set. + * @return the RecordSetInner object itself. + */ + public RecordSetInner withNaptrRecords(List naptrRecords) { + if (this.innerProperties() == null) { + this.innerProperties = new RecordSetProperties(); + } + this.innerProperties().withNaptrRecords(naptrRecords); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/fluent/models/RecordSetProperties.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/fluent/models/RecordSetProperties.java new file mode 100644 index 0000000000000..2314d9b15067a --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/fluent/models/RecordSetProperties.java @@ -0,0 +1,527 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.dns.generated.models.ARecord; +import com.azure.resourcemanager.dns.generated.models.AaaaRecord; +import com.azure.resourcemanager.dns.generated.models.CaaRecord; +import com.azure.resourcemanager.dns.generated.models.CnameRecord; +import com.azure.resourcemanager.dns.generated.models.DsRecord; +import com.azure.resourcemanager.dns.generated.models.MxRecord; +import com.azure.resourcemanager.dns.generated.models.NaptrRecord; +import com.azure.resourcemanager.dns.generated.models.NsRecord; +import com.azure.resourcemanager.dns.generated.models.PtrRecord; +import com.azure.resourcemanager.dns.generated.models.SoaRecord; +import com.azure.resourcemanager.dns.generated.models.SrvRecord; +import com.azure.resourcemanager.dns.generated.models.TlsaRecord; +import com.azure.resourcemanager.dns.generated.models.TxtRecord; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Represents the properties of the records in the record set. */ +@Fluent +public final class RecordSetProperties { + /* + * The metadata attached to the record set. + */ + @JsonProperty(value = "metadata") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map metadata; + + /* + * The TTL (time-to-live) of the records in the record set. + */ + @JsonProperty(value = "TTL") + private Long ttl; + + /* + * Fully qualified domain name of the record set. + */ + @JsonProperty(value = "fqdn", access = JsonProperty.Access.WRITE_ONLY) + private String fqdn; + + /* + * provisioning State of the record set. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * A reference to an azure resource from where the dns resource value is taken. + */ + @JsonProperty(value = "targetResource") + private SubResource targetResource; + + /* + * The list of A records in the record set. + */ + @JsonProperty(value = "ARecords") + private List aRecords; + + /* + * The list of AAAA records in the record set. + */ + @JsonProperty(value = "AAAARecords") + private List aaaaRecords; + + /* + * The list of MX records in the record set. + */ + @JsonProperty(value = "MXRecords") + private List mxRecords; + + /* + * The list of NS records in the record set. + */ + @JsonProperty(value = "NSRecords") + private List nsRecords; + + /* + * The list of PTR records in the record set. + */ + @JsonProperty(value = "PTRRecords") + private List ptrRecords; + + /* + * The list of SRV records in the record set. + */ + @JsonProperty(value = "SRVRecords") + private List srvRecords; + + /* + * The list of TXT records in the record set. + */ + @JsonProperty(value = "TXTRecords") + private List txtRecords; + + /* + * The CNAME record in the record set. + */ + @JsonProperty(value = "CNAMERecord") + private CnameRecord cnameRecord; + + /* + * The SOA record in the record set. + */ + @JsonProperty(value = "SOARecord") + private SoaRecord soaRecord; + + /* + * The list of CAA records in the record set. + */ + @JsonProperty(value = "caaRecords") + private List caaRecords; + + /* + * The list of DS records in the record set. + */ + @JsonProperty(value = "DSRecords") + private List dsRecords; + + /* + * The list of TLSA records in the record set. + */ + @JsonProperty(value = "TLSARecords") + private List tlsaRecords; + + /* + * The list of NAPTR records in the record set. + */ + @JsonProperty(value = "NAPTRRecords") + private List naptrRecords; + + /** Creates an instance of RecordSetProperties class. */ + public RecordSetProperties() { + } + + /** + * Get the metadata property: The metadata attached to the record set. + * + * @return the metadata value. + */ + public Map metadata() { + return this.metadata; + } + + /** + * Set the metadata property: The metadata attached to the record set. + * + * @param metadata the metadata value to set. + * @return the RecordSetProperties object itself. + */ + public RecordSetProperties withMetadata(Map metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get the ttl property: The TTL (time-to-live) of the records in the record set. + * + * @return the ttl value. + */ + public Long ttl() { + return this.ttl; + } + + /** + * Set the ttl property: The TTL (time-to-live) of the records in the record set. + * + * @param ttl the ttl value to set. + * @return the RecordSetProperties object itself. + */ + public RecordSetProperties withTtl(Long ttl) { + this.ttl = ttl; + return this; + } + + /** + * Get the fqdn property: Fully qualified domain name of the record set. + * + * @return the fqdn value. + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Get the provisioningState property: provisioning State of the record set. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the targetResource property: A reference to an azure resource from where the dns resource value is taken. + * + * @return the targetResource value. + */ + public SubResource targetResource() { + return this.targetResource; + } + + /** + * Set the targetResource property: A reference to an azure resource from where the dns resource value is taken. + * + * @param targetResource the targetResource value to set. + * @return the RecordSetProperties object itself. + */ + public RecordSetProperties withTargetResource(SubResource targetResource) { + this.targetResource = targetResource; + return this; + } + + /** + * Get the aRecords property: The list of A records in the record set. + * + * @return the aRecords value. + */ + public List aRecords() { + return this.aRecords; + } + + /** + * Set the aRecords property: The list of A records in the record set. + * + * @param aRecords the aRecords value to set. + * @return the RecordSetProperties object itself. + */ + public RecordSetProperties withARecords(List aRecords) { + this.aRecords = aRecords; + return this; + } + + /** + * Get the aaaaRecords property: The list of AAAA records in the record set. + * + * @return the aaaaRecords value. + */ + public List aaaaRecords() { + return this.aaaaRecords; + } + + /** + * Set the aaaaRecords property: The list of AAAA records in the record set. + * + * @param aaaaRecords the aaaaRecords value to set. + * @return the RecordSetProperties object itself. + */ + public RecordSetProperties withAaaaRecords(List aaaaRecords) { + this.aaaaRecords = aaaaRecords; + return this; + } + + /** + * Get the mxRecords property: The list of MX records in the record set. + * + * @return the mxRecords value. + */ + public List mxRecords() { + return this.mxRecords; + } + + /** + * Set the mxRecords property: The list of MX records in the record set. + * + * @param mxRecords the mxRecords value to set. + * @return the RecordSetProperties object itself. + */ + public RecordSetProperties withMxRecords(List mxRecords) { + this.mxRecords = mxRecords; + return this; + } + + /** + * Get the nsRecords property: The list of NS records in the record set. + * + * @return the nsRecords value. + */ + public List nsRecords() { + return this.nsRecords; + } + + /** + * Set the nsRecords property: The list of NS records in the record set. + * + * @param nsRecords the nsRecords value to set. + * @return the RecordSetProperties object itself. + */ + public RecordSetProperties withNsRecords(List nsRecords) { + this.nsRecords = nsRecords; + return this; + } + + /** + * Get the ptrRecords property: The list of PTR records in the record set. + * + * @return the ptrRecords value. + */ + public List ptrRecords() { + return this.ptrRecords; + } + + /** + * Set the ptrRecords property: The list of PTR records in the record set. + * + * @param ptrRecords the ptrRecords value to set. + * @return the RecordSetProperties object itself. + */ + public RecordSetProperties withPtrRecords(List ptrRecords) { + this.ptrRecords = ptrRecords; + return this; + } + + /** + * Get the srvRecords property: The list of SRV records in the record set. + * + * @return the srvRecords value. + */ + public List srvRecords() { + return this.srvRecords; + } + + /** + * Set the srvRecords property: The list of SRV records in the record set. + * + * @param srvRecords the srvRecords value to set. + * @return the RecordSetProperties object itself. + */ + public RecordSetProperties withSrvRecords(List srvRecords) { + this.srvRecords = srvRecords; + return this; + } + + /** + * Get the txtRecords property: The list of TXT records in the record set. + * + * @return the txtRecords value. + */ + public List txtRecords() { + return this.txtRecords; + } + + /** + * Set the txtRecords property: The list of TXT records in the record set. + * + * @param txtRecords the txtRecords value to set. + * @return the RecordSetProperties object itself. + */ + public RecordSetProperties withTxtRecords(List txtRecords) { + this.txtRecords = txtRecords; + return this; + } + + /** + * Get the cnameRecord property: The CNAME record in the record set. + * + * @return the cnameRecord value. + */ + public CnameRecord cnameRecord() { + return this.cnameRecord; + } + + /** + * Set the cnameRecord property: The CNAME record in the record set. + * + * @param cnameRecord the cnameRecord value to set. + * @return the RecordSetProperties object itself. + */ + public RecordSetProperties withCnameRecord(CnameRecord cnameRecord) { + this.cnameRecord = cnameRecord; + return this; + } + + /** + * Get the soaRecord property: The SOA record in the record set. + * + * @return the soaRecord value. + */ + public SoaRecord soaRecord() { + return this.soaRecord; + } + + /** + * Set the soaRecord property: The SOA record in the record set. + * + * @param soaRecord the soaRecord value to set. + * @return the RecordSetProperties object itself. + */ + public RecordSetProperties withSoaRecord(SoaRecord soaRecord) { + this.soaRecord = soaRecord; + return this; + } + + /** + * Get the caaRecords property: The list of CAA records in the record set. + * + * @return the caaRecords value. + */ + public List caaRecords() { + return this.caaRecords; + } + + /** + * Set the caaRecords property: The list of CAA records in the record set. + * + * @param caaRecords the caaRecords value to set. + * @return the RecordSetProperties object itself. + */ + public RecordSetProperties withCaaRecords(List caaRecords) { + this.caaRecords = caaRecords; + return this; + } + + /** + * Get the dsRecords property: The list of DS records in the record set. + * + * @return the dsRecords value. + */ + public List dsRecords() { + return this.dsRecords; + } + + /** + * Set the dsRecords property: The list of DS records in the record set. + * + * @param dsRecords the dsRecords value to set. + * @return the RecordSetProperties object itself. + */ + public RecordSetProperties withDsRecords(List dsRecords) { + this.dsRecords = dsRecords; + return this; + } + + /** + * Get the tlsaRecords property: The list of TLSA records in the record set. + * + * @return the tlsaRecords value. + */ + public List tlsaRecords() { + return this.tlsaRecords; + } + + /** + * Set the tlsaRecords property: The list of TLSA records in the record set. + * + * @param tlsaRecords the tlsaRecords value to set. + * @return the RecordSetProperties object itself. + */ + public RecordSetProperties withTlsaRecords(List tlsaRecords) { + this.tlsaRecords = tlsaRecords; + return this; + } + + /** + * Get the naptrRecords property: The list of NAPTR records in the record set. + * + * @return the naptrRecords value. + */ + public List naptrRecords() { + return this.naptrRecords; + } + + /** + * Set the naptrRecords property: The list of NAPTR records in the record set. + * + * @param naptrRecords the naptrRecords value to set. + * @return the RecordSetProperties object itself. + */ + public RecordSetProperties withNaptrRecords(List naptrRecords) { + this.naptrRecords = naptrRecords; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (aRecords() != null) { + aRecords().forEach(e -> e.validate()); + } + if (aaaaRecords() != null) { + aaaaRecords().forEach(e -> e.validate()); + } + if (mxRecords() != null) { + mxRecords().forEach(e -> e.validate()); + } + if (nsRecords() != null) { + nsRecords().forEach(e -> e.validate()); + } + if (ptrRecords() != null) { + ptrRecords().forEach(e -> e.validate()); + } + if (srvRecords() != null) { + srvRecords().forEach(e -> e.validate()); + } + if (txtRecords() != null) { + txtRecords().forEach(e -> e.validate()); + } + if (cnameRecord() != null) { + cnameRecord().validate(); + } + if (soaRecord() != null) { + soaRecord().validate(); + } + if (caaRecords() != null) { + caaRecords().forEach(e -> e.validate()); + } + if (dsRecords() != null) { + dsRecords().forEach(e -> e.validate()); + } + if (tlsaRecords() != null) { + tlsaRecords().forEach(e -> e.validate()); + } + if (naptrRecords() != null) { + naptrRecords().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/fluent/models/ZoneInner.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/fluent/models/ZoneInner.java new file mode 100644 index 0000000000000..70c0d7d3da734 --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/fluent/models/ZoneInner.java @@ -0,0 +1,226 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SubResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.dns.generated.models.SigningKey; +import com.azure.resourcemanager.dns.generated.models.ZoneType; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Describes a DNS zone. */ +@Fluent +public final class ZoneInner extends Resource { + /* + * The etag of the zone. + */ + @JsonProperty(value = "etag") + private String etag; + + /* + * The properties of the zone. + */ + @JsonProperty(value = "properties") + private ZoneProperties innerProperties; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of ZoneInner class. */ + public ZoneInner() { + } + + /** + * Get the etag property: The etag of the zone. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The etag of the zone. + * + * @param etag the etag value to set. + * @return the ZoneInner object itself. + */ + public ZoneInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get the innerProperties property: The properties of the zone. + * + * @return the innerProperties value. + */ + private ZoneProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public ZoneInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ZoneInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the maxNumberOfRecordSets property: The maximum number of record sets that can be created in this DNS zone. + * This is a read-only property and any attempt to set this value will be ignored. + * + * @return the maxNumberOfRecordSets value. + */ + public Long maxNumberOfRecordSets() { + return this.innerProperties() == null ? null : this.innerProperties().maxNumberOfRecordSets(); + } + + /** + * Get the maxNumberOfRecordsPerRecordSet property: The maximum number of records per record set that can be created + * in this DNS zone. This is a read-only property and any attempt to set this value will be ignored. + * + * @return the maxNumberOfRecordsPerRecordSet value. + */ + public Long maxNumberOfRecordsPerRecordSet() { + return this.innerProperties() == null ? null : this.innerProperties().maxNumberOfRecordsPerRecordSet(); + } + + /** + * Get the numberOfRecordSets property: The current number of record sets in this DNS zone. This is a read-only + * property and any attempt to set this value will be ignored. + * + * @return the numberOfRecordSets value. + */ + public Long numberOfRecordSets() { + return this.innerProperties() == null ? null : this.innerProperties().numberOfRecordSets(); + } + + /** + * Get the nameServers property: The name servers for this DNS zone. This is a read-only property and any attempt to + * set this value will be ignored. + * + * @return the nameServers value. + */ + public List nameServers() { + return this.innerProperties() == null ? null : this.innerProperties().nameServers(); + } + + /** + * Get the zoneType property: The type of this DNS zone (Public or Private). + * + * @return the zoneType value. + */ + public ZoneType zoneType() { + return this.innerProperties() == null ? null : this.innerProperties().zoneType(); + } + + /** + * Set the zoneType property: The type of this DNS zone (Public or Private). + * + * @param zoneType the zoneType value to set. + * @return the ZoneInner object itself. + */ + public ZoneInner withZoneType(ZoneType zoneType) { + if (this.innerProperties() == null) { + this.innerProperties = new ZoneProperties(); + } + this.innerProperties().withZoneType(zoneType); + return this; + } + + /** + * Get the registrationVirtualNetworks property: A list of references to virtual networks that register hostnames in + * this DNS zone. This is a only when ZoneType is Private. + * + * @return the registrationVirtualNetworks value. + */ + public List registrationVirtualNetworks() { + return this.innerProperties() == null ? null : this.innerProperties().registrationVirtualNetworks(); + } + + /** + * Set the registrationVirtualNetworks property: A list of references to virtual networks that register hostnames in + * this DNS zone. This is a only when ZoneType is Private. + * + * @param registrationVirtualNetworks the registrationVirtualNetworks value to set. + * @return the ZoneInner object itself. + */ + public ZoneInner withRegistrationVirtualNetworks(List registrationVirtualNetworks) { + if (this.innerProperties() == null) { + this.innerProperties = new ZoneProperties(); + } + this.innerProperties().withRegistrationVirtualNetworks(registrationVirtualNetworks); + return this; + } + + /** + * Get the resolutionVirtualNetworks property: A list of references to virtual networks that resolve records in this + * DNS zone. This is a only when ZoneType is Private. + * + * @return the resolutionVirtualNetworks value. + */ + public List resolutionVirtualNetworks() { + return this.innerProperties() == null ? null : this.innerProperties().resolutionVirtualNetworks(); + } + + /** + * Set the resolutionVirtualNetworks property: A list of references to virtual networks that resolve records in this + * DNS zone. This is a only when ZoneType is Private. + * + * @param resolutionVirtualNetworks the resolutionVirtualNetworks value to set. + * @return the ZoneInner object itself. + */ + public ZoneInner withResolutionVirtualNetworks(List resolutionVirtualNetworks) { + if (this.innerProperties() == null) { + this.innerProperties = new ZoneProperties(); + } + this.innerProperties().withResolutionVirtualNetworks(resolutionVirtualNetworks); + return this; + } + + /** + * Get the signingKeys property: The list of signing keys. + * + * @return the signingKeys value. + */ + public List signingKeys() { + return this.innerProperties() == null ? null : this.innerProperties().signingKeys(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/fluent/models/ZoneProperties.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/fluent/models/ZoneProperties.java new file mode 100644 index 0000000000000..f9886368389be --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/fluent/models/ZoneProperties.java @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.dns.generated.models.SigningKey; +import com.azure.resourcemanager.dns.generated.models.ZoneType; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Represents the properties of the zone. */ +@Fluent +public final class ZoneProperties { + /* + * The maximum number of record sets that can be created in this DNS zone. This is a read-only property and any + * attempt to set this value will be ignored. + */ + @JsonProperty(value = "maxNumberOfRecordSets", access = JsonProperty.Access.WRITE_ONLY) + private Long maxNumberOfRecordSets; + + /* + * The maximum number of records per record set that can be created in this DNS zone. This is a read-only property + * and any attempt to set this value will be ignored. + */ + @JsonProperty(value = "maxNumberOfRecordsPerRecordSet", access = JsonProperty.Access.WRITE_ONLY) + private Long maxNumberOfRecordsPerRecordSet; + + /* + * The current number of record sets in this DNS zone. This is a read-only property and any attempt to set this + * value will be ignored. + */ + @JsonProperty(value = "numberOfRecordSets", access = JsonProperty.Access.WRITE_ONLY) + private Long numberOfRecordSets; + + /* + * The name servers for this DNS zone. This is a read-only property and any attempt to set this value will be + * ignored. + */ + @JsonProperty(value = "nameServers", access = JsonProperty.Access.WRITE_ONLY) + private List nameServers; + + /* + * The type of this DNS zone (Public or Private). + */ + @JsonProperty(value = "zoneType") + private ZoneType zoneType; + + /* + * A list of references to virtual networks that register hostnames in this DNS zone. This is a only when ZoneType + * is Private. + */ + @JsonProperty(value = "registrationVirtualNetworks") + private List registrationVirtualNetworks; + + /* + * A list of references to virtual networks that resolve records in this DNS zone. This is a only when ZoneType is + * Private. + */ + @JsonProperty(value = "resolutionVirtualNetworks") + private List resolutionVirtualNetworks; + + /* + * The list of signing keys. + */ + @JsonProperty(value = "signingKeys", access = JsonProperty.Access.WRITE_ONLY) + private List signingKeys; + + /** Creates an instance of ZoneProperties class. */ + public ZoneProperties() { + } + + /** + * Get the maxNumberOfRecordSets property: The maximum number of record sets that can be created in this DNS zone. + * This is a read-only property and any attempt to set this value will be ignored. + * + * @return the maxNumberOfRecordSets value. + */ + public Long maxNumberOfRecordSets() { + return this.maxNumberOfRecordSets; + } + + /** + * Get the maxNumberOfRecordsPerRecordSet property: The maximum number of records per record set that can be created + * in this DNS zone. This is a read-only property and any attempt to set this value will be ignored. + * + * @return the maxNumberOfRecordsPerRecordSet value. + */ + public Long maxNumberOfRecordsPerRecordSet() { + return this.maxNumberOfRecordsPerRecordSet; + } + + /** + * Get the numberOfRecordSets property: The current number of record sets in this DNS zone. This is a read-only + * property and any attempt to set this value will be ignored. + * + * @return the numberOfRecordSets value. + */ + public Long numberOfRecordSets() { + return this.numberOfRecordSets; + } + + /** + * Get the nameServers property: The name servers for this DNS zone. This is a read-only property and any attempt to + * set this value will be ignored. + * + * @return the nameServers value. + */ + public List nameServers() { + return this.nameServers; + } + + /** + * Get the zoneType property: The type of this DNS zone (Public or Private). + * + * @return the zoneType value. + */ + public ZoneType zoneType() { + return this.zoneType; + } + + /** + * Set the zoneType property: The type of this DNS zone (Public or Private). + * + * @param zoneType the zoneType value to set. + * @return the ZoneProperties object itself. + */ + public ZoneProperties withZoneType(ZoneType zoneType) { + this.zoneType = zoneType; + return this; + } + + /** + * Get the registrationVirtualNetworks property: A list of references to virtual networks that register hostnames in + * this DNS zone. This is a only when ZoneType is Private. + * + * @return the registrationVirtualNetworks value. + */ + public List registrationVirtualNetworks() { + return this.registrationVirtualNetworks; + } + + /** + * Set the registrationVirtualNetworks property: A list of references to virtual networks that register hostnames in + * this DNS zone. This is a only when ZoneType is Private. + * + * @param registrationVirtualNetworks the registrationVirtualNetworks value to set. + * @return the ZoneProperties object itself. + */ + public ZoneProperties withRegistrationVirtualNetworks(List registrationVirtualNetworks) { + this.registrationVirtualNetworks = registrationVirtualNetworks; + return this; + } + + /** + * Get the resolutionVirtualNetworks property: A list of references to virtual networks that resolve records in this + * DNS zone. This is a only when ZoneType is Private. + * + * @return the resolutionVirtualNetworks value. + */ + public List resolutionVirtualNetworks() { + return this.resolutionVirtualNetworks; + } + + /** + * Set the resolutionVirtualNetworks property: A list of references to virtual networks that resolve records in this + * DNS zone. This is a only when ZoneType is Private. + * + * @param resolutionVirtualNetworks the resolutionVirtualNetworks value to set. + * @return the ZoneProperties object itself. + */ + public ZoneProperties withResolutionVirtualNetworks(List resolutionVirtualNetworks) { + this.resolutionVirtualNetworks = resolutionVirtualNetworks; + return this; + } + + /** + * Get the signingKeys property: The list of signing keys. + * + * @return the signingKeys value. + */ + public List signingKeys() { + return this.signingKeys; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (signingKeys() != null) { + signingKeys().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/fluent/models/package-info.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/fluent/models/package-info.java new file mode 100644 index 0000000000000..7722f32ccf3d2 --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/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 DnsManagementClient. The DNS Management Client. */ +package com.azure.resourcemanager.dns.generated.fluent.models; diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/fluent/package-info.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/fluent/package-info.java new file mode 100644 index 0000000000000..739b1008181e7 --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/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 DnsManagementClient. The DNS Management Client. */ +package com.azure.resourcemanager.dns.generated.fluent; diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/implementation/DnsManagementClientBuilder.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/implementation/DnsManagementClientBuilder.java new file mode 100644 index 0000000000000..0ce297a329078 --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/implementation/DnsManagementClientBuilder.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** A builder for creating a new instance of the DnsManagementClientImpl type. */ +@ServiceClientBuilder(serviceClients = {DnsManagementClientImpl.class}) +public final class DnsManagementClientBuilder { + /* + * The ID of the target subscription. + */ + private String subscriptionId; + + /** + * Sets The ID of the target subscription. + * + * @param subscriptionId the subscriptionId value. + * @return the DnsManagementClientBuilder. + */ + public DnsManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the DnsManagementClientBuilder. + */ + public DnsManagementClientBuilder 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 DnsManagementClientBuilder. + */ + public DnsManagementClientBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the DnsManagementClientBuilder. + */ + public DnsManagementClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the DnsManagementClientBuilder. + */ + public DnsManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the DnsManagementClientBuilder. + */ + public DnsManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of DnsManagementClientImpl with the provided parameters. + * + * @return an instance of DnsManagementClientImpl. + */ + public DnsManagementClientImpl buildClient() { + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; + AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; + HttpPipeline localPipeline = + (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval = + (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = + (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); + DnsManagementClientImpl client = + new DnsManagementClientImpl( + localPipeline, + localSerializerAdapter, + localDefaultPollInterval, + localEnvironment, + subscriptionId, + localEndpoint); + return client; + } +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/implementation/DnsManagementClientImpl.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/implementation/DnsManagementClientImpl.java new file mode 100644 index 0000000000000..c5db337504bda --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/implementation/DnsManagementClientImpl.java @@ -0,0 +1,332 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.util.Context; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.dns.generated.fluent.DnsManagementClient; +import com.azure.resourcemanager.dns.generated.fluent.DnsResourceReferencesClient; +import com.azure.resourcemanager.dns.generated.fluent.DnssecConfigsClient; +import com.azure.resourcemanager.dns.generated.fluent.RecordSetsClient; +import com.azure.resourcemanager.dns.generated.fluent.ZonesClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the DnsManagementClientImpl type. */ +@ServiceClient(builder = DnsManagementClientBuilder.class) +public final class DnsManagementClientImpl implements DnsManagementClient { + /** The ID of the target subscription. */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** server parameter. */ + private final String endpoint; + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** Api Version. */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** The HTTP pipeline to send requests through. */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** The serializer to serialize an object into a string. */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** The default poll interval for long-running operation. */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** The DnssecConfigsClient object to access its operations. */ + private final DnssecConfigsClient dnssecConfigs; + + /** + * Gets the DnssecConfigsClient object to access its operations. + * + * @return the DnssecConfigsClient object. + */ + public DnssecConfigsClient getDnssecConfigs() { + return this.dnssecConfigs; + } + + /** The RecordSetsClient object to access its operations. */ + private final RecordSetsClient recordSets; + + /** + * Gets the RecordSetsClient object to access its operations. + * + * @return the RecordSetsClient object. + */ + public RecordSetsClient getRecordSets() { + return this.recordSets; + } + + /** The ZonesClient object to access its operations. */ + private final ZonesClient zones; + + /** + * Gets the ZonesClient object to access its operations. + * + * @return the ZonesClient object. + */ + public ZonesClient getZones() { + return this.zones; + } + + /** The DnsResourceReferencesClient object to access its operations. */ + private final DnsResourceReferencesClient dnsResourceReferences; + + /** + * Gets the DnsResourceReferencesClient object to access its operations. + * + * @return the DnsResourceReferencesClient object. + */ + public DnsResourceReferencesClient getDnsResourceReferences() { + return this.dnsResourceReferences; + } + + /** + * Initializes an instance of DnsManagementClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param defaultPollInterval The default poll interval for long-running operation. + * @param environment The Azure environment. + * @param subscriptionId The ID of the target subscription. + * @param endpoint server parameter. + */ + DnsManagementClientImpl( + HttpPipeline httpPipeline, + SerializerAdapter serializerAdapter, + Duration defaultPollInterval, + AzureEnvironment environment, + String subscriptionId, + String endpoint) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = "2023-07-01-preview"; + this.dnssecConfigs = new DnssecConfigsClientImpl(this); + this.recordSets = new RecordSetsClientImpl(this); + this.zones = new ZonesClientImpl(this); + this.dnsResourceReferences = new DnsResourceReferencesClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + return CoreUtils.mergeContexts(this.getContext(), context); + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult( + Mono>> activationResponse, + HttpPipeline httpPipeline, + Type pollResultType, + Type finalResultType, + Context context) { + return PollerFactory + .create( + serializerAdapter, + httpPipeline, + pollResultType, + finalResultType, + defaultPollInterval, + activationResponse, + context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = + new HttpResponseImpl( + lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = + this + .getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + LOGGER.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(s); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DnsManagementClientImpl.class); +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/implementation/DnsResourceReferenceResultImpl.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/implementation/DnsResourceReferenceResultImpl.java new file mode 100644 index 0000000000000..1cfeee4a52d9c --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/implementation/DnsResourceReferenceResultImpl.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.dns.generated.implementation; + +import com.azure.resourcemanager.dns.generated.fluent.models.DnsResourceReferenceResultInner; +import com.azure.resourcemanager.dns.generated.models.DnsResourceReference; +import com.azure.resourcemanager.dns.generated.models.DnsResourceReferenceResult; +import java.util.Collections; +import java.util.List; + +public final class DnsResourceReferenceResultImpl implements DnsResourceReferenceResult { + private DnsResourceReferenceResultInner innerObject; + + private final com.azure.resourcemanager.dns.generated.DnsManager serviceManager; + + DnsResourceReferenceResultImpl( + DnsResourceReferenceResultInner innerObject, + com.azure.resourcemanager.dns.generated.DnsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List dnsResourceReferences() { + List inner = this.innerModel().dnsResourceReferences(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public DnsResourceReferenceResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.dns.generated.DnsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/implementation/DnsResourceReferencesClientImpl.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/implementation/DnsResourceReferencesClientImpl.java new file mode 100644 index 0000000000000..b475297678cda --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/implementation/DnsResourceReferencesClientImpl.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.dns.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.dns.generated.fluent.DnsResourceReferencesClient; +import com.azure.resourcemanager.dns.generated.fluent.models.DnsResourceReferenceResultInner; +import com.azure.resourcemanager.dns.generated.models.DnsResourceReferenceRequest; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in DnsResourceReferencesClient. */ +public final class DnsResourceReferencesClientImpl implements DnsResourceReferencesClient { + /** The proxy service used to perform REST calls. */ + private final DnsResourceReferencesService service; + + /** The service client containing this operation class. */ + private final DnsManagementClientImpl client; + + /** + * Initializes an instance of DnsResourceReferencesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DnsResourceReferencesClientImpl(DnsManagementClientImpl client) { + this.service = + RestProxy + .create(DnsResourceReferencesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DnsManagementClientDnsResourceReferences to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DnsManagementClientD") + public interface DnsResourceReferencesService { + @Headers({"Content-Type: application/json"}) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Network/getDnsResourceReference") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByTargetResources( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") DnsResourceReferenceRequest parameters, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Returns the DNS records specified by the referencing targetResourceIds. + * + * @param parameters Properties for dns resource reference request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the properties of the Dns Resource Reference Result along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByTargetResourcesWithResponseAsync( + DnsResourceReferenceRequest parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (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 + .getByTargetResources( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns the DNS records specified by the referencing targetResourceIds. + * + * @param parameters Properties for dns resource reference request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the properties of the Dns Resource Reference Result along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByTargetResourcesWithResponseAsync( + DnsResourceReferenceRequest parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (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 + .getByTargetResources( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Returns the DNS records specified by the referencing targetResourceIds. + * + * @param parameters Properties for dns resource reference request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the properties of the Dns Resource Reference Result on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByTargetResourcesAsync(DnsResourceReferenceRequest parameters) { + return getByTargetResourcesWithResponseAsync(parameters).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Returns the DNS records specified by the referencing targetResourceIds. + * + * @param parameters Properties for dns resource reference request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the properties of the Dns Resource Reference Result along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByTargetResourcesWithResponse( + DnsResourceReferenceRequest parameters, Context context) { + return getByTargetResourcesWithResponseAsync(parameters, context).block(); + } + + /** + * Returns the DNS records specified by the referencing targetResourceIds. + * + * @param parameters Properties for dns resource reference request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the properties of the Dns Resource Reference Result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DnsResourceReferenceResultInner getByTargetResources(DnsResourceReferenceRequest parameters) { + return getByTargetResourcesWithResponse(parameters, Context.NONE).getValue(); + } +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/implementation/DnsResourceReferencesImpl.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/implementation/DnsResourceReferencesImpl.java new file mode 100644 index 0000000000000..d246b0c2633d9 --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/implementation/DnsResourceReferencesImpl.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.dns.generated.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.dns.generated.fluent.DnsResourceReferencesClient; +import com.azure.resourcemanager.dns.generated.fluent.models.DnsResourceReferenceResultInner; +import com.azure.resourcemanager.dns.generated.models.DnsResourceReferenceRequest; +import com.azure.resourcemanager.dns.generated.models.DnsResourceReferenceResult; +import com.azure.resourcemanager.dns.generated.models.DnsResourceReferences; + +public final class DnsResourceReferencesImpl implements DnsResourceReferences { + private static final ClientLogger LOGGER = new ClientLogger(DnsResourceReferencesImpl.class); + + private final DnsResourceReferencesClient innerClient; + + private final com.azure.resourcemanager.dns.generated.DnsManager serviceManager; + + public DnsResourceReferencesImpl( + DnsResourceReferencesClient innerClient, com.azure.resourcemanager.dns.generated.DnsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getByTargetResourcesWithResponse( + DnsResourceReferenceRequest parameters, Context context) { + Response inner = + this.serviceClient().getByTargetResourcesWithResponse(parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DnsResourceReferenceResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DnsResourceReferenceResult getByTargetResources(DnsResourceReferenceRequest parameters) { + DnsResourceReferenceResultInner inner = this.serviceClient().getByTargetResources(parameters); + if (inner != null) { + return new DnsResourceReferenceResultImpl(inner, this.manager()); + } else { + return null; + } + } + + private DnsResourceReferencesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.dns.generated.DnsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/implementation/DnssecConfigImpl.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/implementation/DnssecConfigImpl.java new file mode 100644 index 0000000000000..63860beb6042b --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/implementation/DnssecConfigImpl.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.dns.generated.fluent.models.DnssecConfigInner; +import com.azure.resourcemanager.dns.generated.models.DnssecConfig; +import com.azure.resourcemanager.dns.generated.models.SigningKey; +import java.util.Collections; +import java.util.List; + +public final class DnssecConfigImpl implements DnssecConfig { + private DnssecConfigInner innerObject; + + private final com.azure.resourcemanager.dns.generated.DnsManager serviceManager; + + DnssecConfigImpl(DnssecConfigInner innerObject, com.azure.resourcemanager.dns.generated.DnsManager 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 etag() { + return this.innerModel().etag(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public List signingKeys() { + List inner = this.innerModel().signingKeys(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public DnssecConfigInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.dns.generated.DnsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/implementation/DnssecConfigsClientImpl.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/implementation/DnssecConfigsClientImpl.java new file mode 100644 index 0000000000000..c6cdbf5bb9b9d --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/implementation/DnssecConfigsClientImpl.java @@ -0,0 +1,1151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.implementation; + +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.dns.generated.fluent.DnssecConfigsClient; +import com.azure.resourcemanager.dns.generated.fluent.models.DnssecConfigInner; +import com.azure.resourcemanager.dns.generated.models.DnssecConfigListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in DnssecConfigsClient. */ +public final class DnssecConfigsClientImpl implements DnssecConfigsClient { + /** The proxy service used to perform REST calls. */ + private final DnssecConfigsService service; + + /** The service client containing this operation class. */ + private final DnsManagementClientImpl client; + + /** + * Initializes an instance of DnssecConfigsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DnssecConfigsClientImpl(DnsManagementClientImpl client) { + this.service = + RestProxy.create(DnssecConfigsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DnsManagementClientDnssecConfigs to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DnsManagementClientD") + public interface DnssecConfigsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/dnssecConfigs/default") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("zoneName") String zoneName, + @HeaderParam("If-Match") String ifMatch, + @HeaderParam("If-None-Match") String ifNoneMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/dnssecConfigs/default") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("zoneName") String zoneName, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/dnssecConfigs/default") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("zoneName") String zoneName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/dnssecConfigs") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDnsZone( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("zoneName") String zoneName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDnsZoneNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Creates or updates the DNSSEC configuration on a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param ifMatch The etag of the DNSSEC configuration. Omit this value to always overwrite the DNSSEC + * configuration. Specify the last-seen etag value to prevent accidentally overwriting any concurrent changes. + * @param ifNoneMatch Set to '*' to allow this DNSSEC configuration to be created, but to prevent updating existing + * DNSSEC configuration. Other values will be ignored. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the DNSSEC configuration along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String zoneName, String ifMatch, String ifNoneMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (zoneName == null) { + return Mono.error(new IllegalArgumentException("Parameter zoneName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + zoneName, + ifMatch, + ifNoneMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates the DNSSEC configuration on a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param ifMatch The etag of the DNSSEC configuration. Omit this value to always overwrite the DNSSEC + * configuration. Specify the last-seen etag value to prevent accidentally overwriting any concurrent changes. + * @param ifNoneMatch Set to '*' to allow this DNSSEC configuration to be created, but to prevent updating existing + * DNSSEC configuration. Other values will be ignored. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the DNSSEC configuration along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String zoneName, String ifMatch, String ifNoneMatch, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (zoneName == null) { + return Mono.error(new IllegalArgumentException("Parameter zoneName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + zoneName, + ifMatch, + ifNoneMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Creates or updates the DNSSEC configuration on a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param ifMatch The etag of the DNSSEC configuration. Omit this value to always overwrite the DNSSEC + * configuration. Specify the last-seen etag value to prevent accidentally overwriting any concurrent changes. + * @param ifNoneMatch Set to '*' to allow this DNSSEC configuration to be created, but to prevent updating existing + * DNSSEC configuration. Other values will be ignored. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 PollerFlux} for polling of represents the DNSSEC configuration. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DnssecConfigInner> beginCreateOrUpdateAsync( + String resourceGroupName, String zoneName, String ifMatch, String ifNoneMatch) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, zoneName, ifMatch, ifNoneMatch); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DnssecConfigInner.class, + DnssecConfigInner.class, + this.client.getContext()); + } + + /** + * Creates or updates the DNSSEC configuration on a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 PollerFlux} for polling of represents the DNSSEC configuration. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DnssecConfigInner> beginCreateOrUpdateAsync( + String resourceGroupName, String zoneName) { + final String ifMatch = null; + final String ifNoneMatch = null; + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, zoneName, ifMatch, ifNoneMatch); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DnssecConfigInner.class, + DnssecConfigInner.class, + this.client.getContext()); + } + + /** + * Creates or updates the DNSSEC configuration on a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param ifMatch The etag of the DNSSEC configuration. Omit this value to always overwrite the DNSSEC + * configuration. Specify the last-seen etag value to prevent accidentally overwriting any concurrent changes. + * @param ifNoneMatch Set to '*' to allow this DNSSEC configuration to be created, but to prevent updating existing + * DNSSEC configuration. Other values will be ignored. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 PollerFlux} for polling of represents the DNSSEC configuration. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DnssecConfigInner> beginCreateOrUpdateAsync( + String resourceGroupName, String zoneName, String ifMatch, String ifNoneMatch, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, zoneName, ifMatch, ifNoneMatch, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), DnssecConfigInner.class, DnssecConfigInner.class, context); + } + + /** + * Creates or updates the DNSSEC configuration on a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 SyncPoller} for polling of represents the DNSSEC configuration. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DnssecConfigInner> beginCreateOrUpdate( + String resourceGroupName, String zoneName) { + final String ifMatch = null; + final String ifNoneMatch = null; + return this.beginCreateOrUpdateAsync(resourceGroupName, zoneName, ifMatch, ifNoneMatch).getSyncPoller(); + } + + /** + * Creates or updates the DNSSEC configuration on a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param ifMatch The etag of the DNSSEC configuration. Omit this value to always overwrite the DNSSEC + * configuration. Specify the last-seen etag value to prevent accidentally overwriting any concurrent changes. + * @param ifNoneMatch Set to '*' to allow this DNSSEC configuration to be created, but to prevent updating existing + * DNSSEC configuration. Other values will be ignored. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 SyncPoller} for polling of represents the DNSSEC configuration. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DnssecConfigInner> beginCreateOrUpdate( + String resourceGroupName, String zoneName, String ifMatch, String ifNoneMatch, Context context) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, zoneName, ifMatch, ifNoneMatch, context) + .getSyncPoller(); + } + + /** + * Creates or updates the DNSSEC configuration on a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param ifMatch The etag of the DNSSEC configuration. Omit this value to always overwrite the DNSSEC + * configuration. Specify the last-seen etag value to prevent accidentally overwriting any concurrent changes. + * @param ifNoneMatch Set to '*' to allow this DNSSEC configuration to be created, but to prevent updating existing + * DNSSEC configuration. Other values will be ignored. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the DNSSEC configuration on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String zoneName, String ifMatch, String ifNoneMatch) { + return beginCreateOrUpdateAsync(resourceGroupName, zoneName, ifMatch, ifNoneMatch) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates the DNSSEC configuration on a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the DNSSEC configuration on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String zoneName) { + final String ifMatch = null; + final String ifNoneMatch = null; + return beginCreateOrUpdateAsync(resourceGroupName, zoneName, ifMatch, ifNoneMatch) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates the DNSSEC configuration on a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param ifMatch The etag of the DNSSEC configuration. Omit this value to always overwrite the DNSSEC + * configuration. Specify the last-seen etag value to prevent accidentally overwriting any concurrent changes. + * @param ifNoneMatch Set to '*' to allow this DNSSEC configuration to be created, but to prevent updating existing + * DNSSEC configuration. Other values will be ignored. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the DNSSEC configuration on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String zoneName, String ifMatch, String ifNoneMatch, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, zoneName, ifMatch, ifNoneMatch, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates the DNSSEC configuration on a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the DNSSEC configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DnssecConfigInner createOrUpdate(String resourceGroupName, String zoneName) { + final String ifMatch = null; + final String ifNoneMatch = null; + return createOrUpdateAsync(resourceGroupName, zoneName, ifMatch, ifNoneMatch).block(); + } + + /** + * Creates or updates the DNSSEC configuration on a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param ifMatch The etag of the DNSSEC configuration. Omit this value to always overwrite the DNSSEC + * configuration. Specify the last-seen etag value to prevent accidentally overwriting any concurrent changes. + * @param ifNoneMatch Set to '*' to allow this DNSSEC configuration to be created, but to prevent updating existing + * DNSSEC configuration. Other values will be ignored. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the DNSSEC configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DnssecConfigInner createOrUpdate( + String resourceGroupName, String zoneName, String ifMatch, String ifNoneMatch, Context context) { + return createOrUpdateAsync(resourceGroupName, zoneName, ifMatch, ifNoneMatch, context).block(); + } + + /** + * Deletes the DNSSEC configuration on a DNS zone. This operation cannot be undone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param ifMatch The etag of this DNSSEC configuration. Omit this value to always delete the DNSSEC configuration. + * Specify the last-seen etag value to prevent accidentally deleting any concurrent changes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String zoneName, String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (zoneName == null) { + return Mono.error(new IllegalArgumentException("Parameter zoneName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + zoneName, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the DNSSEC configuration on a DNS zone. This operation cannot be undone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param ifMatch The etag of this DNSSEC configuration. Omit this value to always delete the DNSSEC configuration. + * Specify the last-seen etag value to prevent accidentally deleting any concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String zoneName, String ifMatch, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (zoneName == null) { + return Mono.error(new IllegalArgumentException("Parameter zoneName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + zoneName, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the DNSSEC configuration on a DNS zone. This operation cannot be undone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param ifMatch The etag of this DNSSEC configuration. Omit this value to always delete the DNSSEC configuration. + * Specify the last-seen etag value to prevent accidentally deleting any concurrent changes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String zoneName, String ifMatch) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, zoneName, ifMatch); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes the DNSSEC configuration on a DNS zone. This operation cannot be undone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String zoneName) { + final String ifMatch = null; + Mono>> mono = deleteWithResponseAsync(resourceGroupName, zoneName, ifMatch); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes the DNSSEC configuration on a DNS zone. This operation cannot be undone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param ifMatch The etag of this DNSSEC configuration. Omit this value to always delete the DNSSEC configuration. + * Specify the last-seen etag value to prevent accidentally deleting any concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String zoneName, String ifMatch, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, zoneName, ifMatch, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the DNSSEC configuration on a DNS zone. This operation cannot be undone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String zoneName) { + final String ifMatch = null; + return this.beginDeleteAsync(resourceGroupName, zoneName, ifMatch).getSyncPoller(); + } + + /** + * Deletes the DNSSEC configuration on a DNS zone. This operation cannot be undone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param ifMatch The etag of this DNSSEC configuration. Omit this value to always delete the DNSSEC configuration. + * Specify the last-seen etag value to prevent accidentally deleting any concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String zoneName, String ifMatch, Context context) { + return this.beginDeleteAsync(resourceGroupName, zoneName, ifMatch, context).getSyncPoller(); + } + + /** + * Deletes the DNSSEC configuration on a DNS zone. This operation cannot be undone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param ifMatch The etag of this DNSSEC configuration. Omit this value to always delete the DNSSEC configuration. + * Specify the last-seen etag value to prevent accidentally deleting any concurrent changes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String zoneName, String ifMatch) { + return beginDeleteAsync(resourceGroupName, zoneName, ifMatch) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the DNSSEC configuration on a DNS zone. This operation cannot be undone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String zoneName) { + final String ifMatch = null; + return beginDeleteAsync(resourceGroupName, zoneName, ifMatch) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the DNSSEC configuration on a DNS zone. This operation cannot be undone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param ifMatch The etag of this DNSSEC configuration. Omit this value to always delete the DNSSEC configuration. + * Specify the last-seen etag value to prevent accidentally deleting any concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String zoneName, String ifMatch, Context context) { + return beginDeleteAsync(resourceGroupName, zoneName, ifMatch, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the DNSSEC configuration on a DNS zone. This operation cannot be undone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String zoneName) { + final String ifMatch = null; + deleteAsync(resourceGroupName, zoneName, ifMatch).block(); + } + + /** + * Deletes the DNSSEC configuration on a DNS zone. This operation cannot be undone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param ifMatch The etag of this DNSSEC configuration. Omit this value to always delete the DNSSEC configuration. + * Specify the last-seen etag value to prevent accidentally deleting any concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String zoneName, String ifMatch, Context context) { + deleteAsync(resourceGroupName, zoneName, ifMatch, context).block(); + } + + /** + * Gets the DNSSEC configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the DNSSEC configuration along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String zoneName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (zoneName == null) { + return Mono.error(new IllegalArgumentException("Parameter zoneName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + zoneName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the DNSSEC configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the DNSSEC configuration along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String zoneName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (zoneName == null) { + return Mono.error(new IllegalArgumentException("Parameter zoneName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + zoneName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the DNSSEC configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the DNSSEC configuration on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String zoneName) { + return getWithResponseAsync(resourceGroupName, zoneName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the DNSSEC configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the DNSSEC configuration along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String zoneName, Context context) { + return getWithResponseAsync(resourceGroupName, zoneName, context).block(); + } + + /** + * Gets the DNSSEC configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the DNSSEC configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DnssecConfigInner get(String resourceGroupName, String zoneName) { + return getWithResponse(resourceGroupName, zoneName, Context.NONE).getValue(); + } + + /** + * Lists the DNSSEC configurations in a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a List DNSSEC configurations operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDnsZoneSinglePageAsync( + String resourceGroupName, String zoneName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (zoneName == null) { + return Mono.error(new IllegalArgumentException("Parameter zoneName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByDnsZone( + this.client.getEndpoint(), + resourceGroupName, + zoneName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the DNSSEC configurations in a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a List DNSSEC configurations operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDnsZoneSinglePageAsync( + String resourceGroupName, String zoneName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (zoneName == null) { + return Mono.error(new IllegalArgumentException("Parameter zoneName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByDnsZone( + this.client.getEndpoint(), + resourceGroupName, + zoneName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the DNSSEC configurations in a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a List DNSSEC configurations operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDnsZoneAsync(String resourceGroupName, String zoneName) { + return new PagedFlux<>( + () -> listByDnsZoneSinglePageAsync(resourceGroupName, zoneName), + nextLink -> listByDnsZoneNextSinglePageAsync(nextLink)); + } + + /** + * Lists the DNSSEC configurations in a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a List DNSSEC configurations operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDnsZoneAsync( + String resourceGroupName, String zoneName, Context context) { + return new PagedFlux<>( + () -> listByDnsZoneSinglePageAsync(resourceGroupName, zoneName, context), + nextLink -> listByDnsZoneNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the DNSSEC configurations in a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a List DNSSEC configurations operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDnsZone(String resourceGroupName, String zoneName) { + return new PagedIterable<>(listByDnsZoneAsync(resourceGroupName, zoneName)); + } + + /** + * Lists the DNSSEC configurations in a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a List DNSSEC configurations operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDnsZone(String resourceGroupName, String zoneName, Context context) { + return new PagedIterable<>(listByDnsZoneAsync(resourceGroupName, zoneName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a List DNSSEC configurations operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDnsZoneNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByDnsZoneNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/implementation/DnssecConfigsImpl.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/implementation/DnssecConfigsImpl.java new file mode 100644 index 0000000000000..bf2f5192ce671 --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/implementation/DnssecConfigsImpl.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.dns.generated.fluent.DnssecConfigsClient; +import com.azure.resourcemanager.dns.generated.fluent.models.DnssecConfigInner; +import com.azure.resourcemanager.dns.generated.models.DnssecConfig; +import com.azure.resourcemanager.dns.generated.models.DnssecConfigs; + +public final class DnssecConfigsImpl implements DnssecConfigs { + private static final ClientLogger LOGGER = new ClientLogger(DnssecConfigsImpl.class); + + private final DnssecConfigsClient innerClient; + + private final com.azure.resourcemanager.dns.generated.DnsManager serviceManager; + + public DnssecConfigsImpl( + DnssecConfigsClient innerClient, com.azure.resourcemanager.dns.generated.DnsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public DnssecConfig createOrUpdate(String resourceGroupName, String zoneName) { + DnssecConfigInner inner = this.serviceClient().createOrUpdate(resourceGroupName, zoneName); + if (inner != null) { + return new DnssecConfigImpl(inner, this.manager()); + } else { + return null; + } + } + + public DnssecConfig createOrUpdate( + String resourceGroupName, String zoneName, String ifMatch, String ifNoneMatch, Context context) { + DnssecConfigInner inner = + this.serviceClient().createOrUpdate(resourceGroupName, zoneName, ifMatch, ifNoneMatch, context); + if (inner != null) { + return new DnssecConfigImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String zoneName) { + this.serviceClient().delete(resourceGroupName, zoneName); + } + + public void delete(String resourceGroupName, String zoneName, String ifMatch, Context context) { + this.serviceClient().delete(resourceGroupName, zoneName, ifMatch, context); + } + + public Response getWithResponse(String resourceGroupName, String zoneName, Context context) { + Response inner = this.serviceClient().getWithResponse(resourceGroupName, zoneName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DnssecConfigImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DnssecConfig get(String resourceGroupName, String zoneName) { + DnssecConfigInner inner = this.serviceClient().get(resourceGroupName, zoneName); + if (inner != null) { + return new DnssecConfigImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listByDnsZone(String resourceGroupName, String zoneName) { + PagedIterable inner = this.serviceClient().listByDnsZone(resourceGroupName, zoneName); + return Utils.mapPage(inner, inner1 -> new DnssecConfigImpl(inner1, this.manager())); + } + + public PagedIterable listByDnsZone(String resourceGroupName, String zoneName, Context context) { + PagedIterable inner = + this.serviceClient().listByDnsZone(resourceGroupName, zoneName, context); + return Utils.mapPage(inner, inner1 -> new DnssecConfigImpl(inner1, this.manager())); + } + + private DnssecConfigsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.dns.generated.DnsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/implementation/RecordSetImpl.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/implementation/RecordSetImpl.java new file mode 100644 index 0000000000000..7e62fe6aa1e3e --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/implementation/RecordSetImpl.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.implementation; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.dns.generated.fluent.models.RecordSetInner; +import com.azure.resourcemanager.dns.generated.models.ARecord; +import com.azure.resourcemanager.dns.generated.models.AaaaRecord; +import com.azure.resourcemanager.dns.generated.models.CaaRecord; +import com.azure.resourcemanager.dns.generated.models.CnameRecord; +import com.azure.resourcemanager.dns.generated.models.DsRecord; +import com.azure.resourcemanager.dns.generated.models.MxRecord; +import com.azure.resourcemanager.dns.generated.models.NaptrRecord; +import com.azure.resourcemanager.dns.generated.models.NsRecord; +import com.azure.resourcemanager.dns.generated.models.PtrRecord; +import com.azure.resourcemanager.dns.generated.models.RecordSet; +import com.azure.resourcemanager.dns.generated.models.SoaRecord; +import com.azure.resourcemanager.dns.generated.models.SrvRecord; +import com.azure.resourcemanager.dns.generated.models.TlsaRecord; +import com.azure.resourcemanager.dns.generated.models.TxtRecord; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class RecordSetImpl implements RecordSet { + private RecordSetInner innerObject; + + private final com.azure.resourcemanager.dns.generated.DnsManager serviceManager; + + RecordSetImpl(RecordSetInner innerObject, com.azure.resourcemanager.dns.generated.DnsManager 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 etag() { + return this.innerModel().etag(); + } + + public Map metadata() { + Map inner = this.innerModel().metadata(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Long ttl() { + return this.innerModel().ttl(); + } + + public String fqdn() { + return this.innerModel().fqdn(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public SubResource targetResource() { + return this.innerModel().targetResource(); + } + + public List aRecords() { + List inner = this.innerModel().aRecords(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List aaaaRecords() { + List inner = this.innerModel().aaaaRecords(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List mxRecords() { + List inner = this.innerModel().mxRecords(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List nsRecords() { + List inner = this.innerModel().nsRecords(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List ptrRecords() { + List inner = this.innerModel().ptrRecords(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List srvRecords() { + List inner = this.innerModel().srvRecords(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List txtRecords() { + List inner = this.innerModel().txtRecords(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public CnameRecord cnameRecord() { + return this.innerModel().cnameRecord(); + } + + public SoaRecord soaRecord() { + return this.innerModel().soaRecord(); + } + + public List caaRecords() { + List inner = this.innerModel().caaRecords(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List dsRecords() { + List inner = this.innerModel().dsRecords(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List tlsaRecords() { + List inner = this.innerModel().tlsaRecords(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List naptrRecords() { + List inner = this.innerModel().naptrRecords(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public RecordSetInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.dns.generated.DnsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/implementation/RecordSetsClientImpl.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/implementation/RecordSetsClientImpl.java new file mode 100644 index 0000000000000..ee7d413801ad0 --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/implementation/RecordSetsClientImpl.java @@ -0,0 +1,2033 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.dns.generated.fluent.RecordSetsClient; +import com.azure.resourcemanager.dns.generated.fluent.models.RecordSetInner; +import com.azure.resourcemanager.dns.generated.models.RecordSetListResult; +import com.azure.resourcemanager.dns.generated.models.RecordType; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in RecordSetsClient. */ +public final class RecordSetsClientImpl implements RecordSetsClient { + /** The proxy service used to perform REST calls. */ + private final RecordSetsService service; + + /** The service client containing this operation class. */ + private final DnsManagementClientImpl client; + + /** + * Initializes an instance of RecordSetsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RecordSetsClientImpl(DnsManagementClientImpl client) { + this.service = + RestProxy.create(RecordSetsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DnsManagementClientRecordSets to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DnsManagementClientR") + public interface RecordSetsService { + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/{recordType}/{relativeRecordSetName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("zoneName") String zoneName, + @PathParam(value = "relativeRecordSetName", encoded = true) String relativeRecordSetName, + @PathParam("recordType") RecordType recordType, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") RecordSetInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/{recordType}/{relativeRecordSetName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("zoneName") String zoneName, + @PathParam(value = "relativeRecordSetName", encoded = true) String relativeRecordSetName, + @PathParam("recordType") RecordType recordType, + @HeaderParam("If-Match") String ifMatch, + @HeaderParam("If-None-Match") String ifNoneMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") RecordSetInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/{recordType}/{relativeRecordSetName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("zoneName") String zoneName, + @PathParam(value = "relativeRecordSetName", encoded = true) String relativeRecordSetName, + @PathParam("recordType") RecordType recordType, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/{recordType}/{relativeRecordSetName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("zoneName") String zoneName, + @PathParam(value = "relativeRecordSetName", encoded = true) String relativeRecordSetName, + @PathParam("recordType") RecordType recordType, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/{recordType}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByType( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("zoneName") String zoneName, + @PathParam("recordType") RecordType recordType, + @QueryParam("$top") Integer top, + @QueryParam("$recordsetnamesuffix") String recordsetnamesuffix, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/recordsets") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDnsZone( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("zoneName") String zoneName, + @QueryParam("$top") Integer top, + @QueryParam("$recordsetnamesuffix") String recordsetnamesuffix, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/all") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAllByDnsZone( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("zoneName") String zoneName, + @QueryParam("$top") Integer top, + @QueryParam("$recordsetnamesuffix") String recordSetNameSuffix, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByTypeNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDnsZoneNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAllByDnsZoneNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Updates a record set within a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param recordType The type of DNS record in this record set. + * @param parameters Parameters supplied to the Update operation. + * @param ifMatch The etag of the record set. Omit this value to always overwrite the current record set. Specify + * the last-seen etag value to prevent accidentally overwriting concurrent changes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a DNS record set (a collection of DNS records with the same name and type) along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String zoneName, + String relativeRecordSetName, + RecordType recordType, + RecordSetInner parameters, + String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (zoneName == null) { + return Mono.error(new IllegalArgumentException("Parameter zoneName is required and cannot be null.")); + } + if (relativeRecordSetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter relativeRecordSetName is required and cannot be null.")); + } + if (recordType == null) { + return Mono.error(new IllegalArgumentException("Parameter recordType is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + zoneName, + relativeRecordSetName, + recordType, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a record set within a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param recordType The type of DNS record in this record set. + * @param parameters Parameters supplied to the Update operation. + * @param ifMatch The etag of the record set. Omit this value to always overwrite the current record set. Specify + * the last-seen etag value to prevent accidentally overwriting concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a DNS record set (a collection of DNS records with the same name and type) along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String zoneName, + String relativeRecordSetName, + RecordType recordType, + RecordSetInner parameters, + String ifMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (zoneName == null) { + return Mono.error(new IllegalArgumentException("Parameter zoneName is required and cannot be null.")); + } + if (relativeRecordSetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter relativeRecordSetName is required and cannot be null.")); + } + if (recordType == null) { + return Mono.error(new IllegalArgumentException("Parameter recordType is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + zoneName, + relativeRecordSetName, + recordType, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates a record set within a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param recordType The type of DNS record in this record set. + * @param parameters Parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a DNS record set (a collection of DNS records with the same name and type) on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String zoneName, + String relativeRecordSetName, + RecordType recordType, + RecordSetInner parameters) { + final String ifMatch = null; + return updateWithResponseAsync( + resourceGroupName, zoneName, relativeRecordSetName, recordType, parameters, ifMatch) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Updates a record set within a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param recordType The type of DNS record in this record set. + * @param parameters Parameters supplied to the Update operation. + * @param ifMatch The etag of the record set. Omit this value to always overwrite the current record set. Specify + * the last-seen etag value to prevent accidentally overwriting concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a DNS record set (a collection of DNS records with the same name and type) along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String zoneName, + String relativeRecordSetName, + RecordType recordType, + RecordSetInner parameters, + String ifMatch, + Context context) { + return updateWithResponseAsync( + resourceGroupName, zoneName, relativeRecordSetName, recordType, parameters, ifMatch, context) + .block(); + } + + /** + * Updates a record set within a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param recordType The type of DNS record in this record set. + * @param parameters Parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a DNS record set (a collection of DNS records with the same name and type). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecordSetInner update( + String resourceGroupName, + String zoneName, + String relativeRecordSetName, + RecordType recordType, + RecordSetInner parameters) { + final String ifMatch = null; + return updateWithResponse( + resourceGroupName, zoneName, relativeRecordSetName, recordType, parameters, ifMatch, Context.NONE) + .getValue(); + } + + /** + * Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they + * are created when the DNS zone is created). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param recordType The type of DNS record in this record set. + * @param parameters Parameters supplied to the CreateOrUpdate operation. + * @param ifMatch The etag of the record set. Omit this value to always overwrite the current record set. Specify + * the last-seen etag value to prevent accidentally overwriting any concurrent changes. + * @param ifNoneMatch Set to '*' to allow a new record set to be created, but to prevent updating an existing record + * set. Other values will be ignored. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a DNS record set (a collection of DNS records with the same name and type) along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String zoneName, + String relativeRecordSetName, + RecordType recordType, + RecordSetInner parameters, + String ifMatch, + String ifNoneMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (zoneName == null) { + return Mono.error(new IllegalArgumentException("Parameter zoneName is required and cannot be null.")); + } + if (relativeRecordSetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter relativeRecordSetName is required and cannot be null.")); + } + if (recordType == null) { + return Mono.error(new IllegalArgumentException("Parameter recordType is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + zoneName, + relativeRecordSetName, + recordType, + ifMatch, + ifNoneMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they + * are created when the DNS zone is created). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param recordType The type of DNS record in this record set. + * @param parameters Parameters supplied to the CreateOrUpdate operation. + * @param ifMatch The etag of the record set. Omit this value to always overwrite the current record set. Specify + * the last-seen etag value to prevent accidentally overwriting any concurrent changes. + * @param ifNoneMatch Set to '*' to allow a new record set to be created, but to prevent updating an existing record + * set. Other values will be ignored. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a DNS record set (a collection of DNS records with the same name and type) along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String zoneName, + String relativeRecordSetName, + RecordType recordType, + RecordSetInner parameters, + String ifMatch, + String ifNoneMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (zoneName == null) { + return Mono.error(new IllegalArgumentException("Parameter zoneName is required and cannot be null.")); + } + if (relativeRecordSetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter relativeRecordSetName is required and cannot be null.")); + } + if (recordType == null) { + return Mono.error(new IllegalArgumentException("Parameter recordType is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + zoneName, + relativeRecordSetName, + recordType, + ifMatch, + ifNoneMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they + * are created when the DNS zone is created). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param recordType The type of DNS record in this record set. + * @param parameters Parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a DNS record set (a collection of DNS records with the same name and type) on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String zoneName, + String relativeRecordSetName, + RecordType recordType, + RecordSetInner parameters) { + final String ifMatch = null; + final String ifNoneMatch = null; + return createOrUpdateWithResponseAsync( + resourceGroupName, zoneName, relativeRecordSetName, recordType, parameters, ifMatch, ifNoneMatch) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they + * are created when the DNS zone is created). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param recordType The type of DNS record in this record set. + * @param parameters Parameters supplied to the CreateOrUpdate operation. + * @param ifMatch The etag of the record set. Omit this value to always overwrite the current record set. Specify + * the last-seen etag value to prevent accidentally overwriting any concurrent changes. + * @param ifNoneMatch Set to '*' to allow a new record set to be created, but to prevent updating an existing record + * set. Other values will be ignored. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a DNS record set (a collection of DNS records with the same name and type) along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String zoneName, + String relativeRecordSetName, + RecordType recordType, + RecordSetInner parameters, + String ifMatch, + String ifNoneMatch, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, + zoneName, + relativeRecordSetName, + recordType, + parameters, + ifMatch, + ifNoneMatch, + context) + .block(); + } + + /** + * Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they + * are created when the DNS zone is created). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param recordType The type of DNS record in this record set. + * @param parameters Parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a DNS record set (a collection of DNS records with the same name and type). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecordSetInner createOrUpdate( + String resourceGroupName, + String zoneName, + String relativeRecordSetName, + RecordType recordType, + RecordSetInner parameters) { + final String ifMatch = null; + final String ifNoneMatch = null; + return createOrUpdateWithResponse( + resourceGroupName, + zoneName, + relativeRecordSetName, + recordType, + parameters, + ifMatch, + ifNoneMatch, + Context.NONE) + .getValue(); + } + + /** + * Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted + * (they are deleted when the DNS zone is deleted). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param recordType The type of DNS record in this record set. + * @param ifMatch The etag of the record set. Omit this value to always delete the current record set. Specify the + * last-seen etag value to prevent accidentally deleting any concurrent changes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, + String zoneName, + String relativeRecordSetName, + RecordType recordType, + String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (zoneName == null) { + return Mono.error(new IllegalArgumentException("Parameter zoneName is required and cannot be null.")); + } + if (relativeRecordSetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter relativeRecordSetName is required and cannot be null.")); + } + if (recordType == null) { + return Mono.error(new IllegalArgumentException("Parameter recordType is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + zoneName, + relativeRecordSetName, + recordType, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted + * (they are deleted when the DNS zone is deleted). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param recordType The type of DNS record in this record set. + * @param ifMatch The etag of the record set. Omit this value to always delete the current record set. Specify the + * last-seen etag value to prevent accidentally deleting any concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, + String zoneName, + String relativeRecordSetName, + RecordType recordType, + String ifMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (zoneName == null) { + return Mono.error(new IllegalArgumentException("Parameter zoneName is required and cannot be null.")); + } + if (relativeRecordSetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter relativeRecordSetName is required and cannot be null.")); + } + if (recordType == null) { + return Mono.error(new IllegalArgumentException("Parameter recordType is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + zoneName, + relativeRecordSetName, + recordType, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted + * (they are deleted when the DNS zone is deleted). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param recordType The type of DNS record in this record set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String zoneName, String relativeRecordSetName, RecordType recordType) { + final String ifMatch = null; + return deleteWithResponseAsync(resourceGroupName, zoneName, relativeRecordSetName, recordType, ifMatch) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted + * (they are deleted when the DNS zone is deleted). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param recordType The type of DNS record in this record set. + * @param ifMatch The etag of the record set. Omit this value to always delete the current record set. Specify the + * last-seen etag value to prevent accidentally deleting any concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, + String zoneName, + String relativeRecordSetName, + RecordType recordType, + String ifMatch, + Context context) { + return deleteWithResponseAsync(resourceGroupName, zoneName, relativeRecordSetName, recordType, ifMatch, context) + .block(); + } + + /** + * Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted + * (they are deleted when the DNS zone is deleted). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param recordType The type of DNS record in this record set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String zoneName, String relativeRecordSetName, RecordType recordType) { + final String ifMatch = null; + deleteWithResponse(resourceGroupName, zoneName, relativeRecordSetName, recordType, ifMatch, Context.NONE); + } + + /** + * Gets a record set. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param recordType The type of DNS record in this record set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 record set along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String zoneName, String relativeRecordSetName, RecordType recordType) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (zoneName == null) { + return Mono.error(new IllegalArgumentException("Parameter zoneName is required and cannot be null.")); + } + if (relativeRecordSetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter relativeRecordSetName is required and cannot be null.")); + } + if (recordType == null) { + return Mono.error(new IllegalArgumentException("Parameter recordType is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + zoneName, + relativeRecordSetName, + recordType, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a record set. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param recordType The type of DNS record in this record set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 record set along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String zoneName, + String relativeRecordSetName, + RecordType recordType, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (zoneName == null) { + return Mono.error(new IllegalArgumentException("Parameter zoneName is required and cannot be null.")); + } + if (relativeRecordSetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter relativeRecordSetName is required and cannot be null.")); + } + if (recordType == null) { + return Mono.error(new IllegalArgumentException("Parameter recordType is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + zoneName, + relativeRecordSetName, + recordType, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets a record set. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param recordType The type of DNS record in this record set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 record set on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String zoneName, String relativeRecordSetName, RecordType recordType) { + return getWithResponseAsync(resourceGroupName, zoneName, relativeRecordSetName, recordType) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a record set. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param recordType The type of DNS record in this record set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 record set along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String zoneName, + String relativeRecordSetName, + RecordType recordType, + Context context) { + return getWithResponseAsync(resourceGroupName, zoneName, relativeRecordSetName, recordType, context).block(); + } + + /** + * Gets a record set. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param recordType The type of DNS record in this record set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 record set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecordSetInner get( + String resourceGroupName, String zoneName, String relativeRecordSetName, RecordType recordType) { + return getWithResponse(resourceGroupName, zoneName, relativeRecordSetName, recordType, Context.NONE).getValue(); + } + + /** + * Lists the record sets of a specified type in a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param recordType The type of DNS record in this record set. + * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. + * @param recordsetnamesuffix The suffix label of the record set name that has to be used to filter the record set + * enumerations. If this parameter is specified, Enumeration will return only records that end with + * .<recordSetNameSuffix>. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a record set List operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByTypeSinglePageAsync( + String resourceGroupName, String zoneName, RecordType recordType, Integer top, String recordsetnamesuffix) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (zoneName == null) { + return Mono.error(new IllegalArgumentException("Parameter zoneName is required and cannot be null.")); + } + if (recordType == null) { + return Mono.error(new IllegalArgumentException("Parameter recordType is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByType( + this.client.getEndpoint(), + resourceGroupName, + zoneName, + recordType, + top, + recordsetnamesuffix, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the record sets of a specified type in a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param recordType The type of DNS record in this record set. + * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. + * @param recordsetnamesuffix The suffix label of the record set name that has to be used to filter the record set + * enumerations. If this parameter is specified, Enumeration will return only records that end with + * .<recordSetNameSuffix>. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a record set List operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByTypeSinglePageAsync( + String resourceGroupName, + String zoneName, + RecordType recordType, + Integer top, + String recordsetnamesuffix, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (zoneName == null) { + return Mono.error(new IllegalArgumentException("Parameter zoneName is required and cannot be null.")); + } + if (recordType == null) { + return Mono.error(new IllegalArgumentException("Parameter recordType is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByType( + this.client.getEndpoint(), + resourceGroupName, + zoneName, + recordType, + top, + recordsetnamesuffix, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the record sets of a specified type in a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param recordType The type of DNS record in this record set. + * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. + * @param recordsetnamesuffix The suffix label of the record set name that has to be used to filter the record set + * enumerations. If this parameter is specified, Enumeration will return only records that end with + * .<recordSetNameSuffix>. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a record set List operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByTypeAsync( + String resourceGroupName, String zoneName, RecordType recordType, Integer top, String recordsetnamesuffix) { + return new PagedFlux<>( + () -> listByTypeSinglePageAsync(resourceGroupName, zoneName, recordType, top, recordsetnamesuffix), + nextLink -> listByTypeNextSinglePageAsync(nextLink)); + } + + /** + * Lists the record sets of a specified type in a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param recordType The type of DNS record in this record set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a record set List operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByTypeAsync( + String resourceGroupName, String zoneName, RecordType recordType) { + final Integer top = null; + final String recordsetnamesuffix = null; + return new PagedFlux<>( + () -> listByTypeSinglePageAsync(resourceGroupName, zoneName, recordType, top, recordsetnamesuffix), + nextLink -> listByTypeNextSinglePageAsync(nextLink)); + } + + /** + * Lists the record sets of a specified type in a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param recordType The type of DNS record in this record set. + * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. + * @param recordsetnamesuffix The suffix label of the record set name that has to be used to filter the record set + * enumerations. If this parameter is specified, Enumeration will return only records that end with + * .<recordSetNameSuffix>. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a record set List operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByTypeAsync( + String resourceGroupName, + String zoneName, + RecordType recordType, + Integer top, + String recordsetnamesuffix, + Context context) { + return new PagedFlux<>( + () -> listByTypeSinglePageAsync(resourceGroupName, zoneName, recordType, top, recordsetnamesuffix, context), + nextLink -> listByTypeNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the record sets of a specified type in a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param recordType The type of DNS record in this record set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a record set List operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByType(String resourceGroupName, String zoneName, RecordType recordType) { + final Integer top = null; + final String recordsetnamesuffix = null; + return new PagedIterable<>(listByTypeAsync(resourceGroupName, zoneName, recordType, top, recordsetnamesuffix)); + } + + /** + * Lists the record sets of a specified type in a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param recordType The type of DNS record in this record set. + * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. + * @param recordsetnamesuffix The suffix label of the record set name that has to be used to filter the record set + * enumerations. If this parameter is specified, Enumeration will return only records that end with + * .<recordSetNameSuffix>. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a record set List operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByType( + String resourceGroupName, + String zoneName, + RecordType recordType, + Integer top, + String recordsetnamesuffix, + Context context) { + return new PagedIterable<>( + listByTypeAsync(resourceGroupName, zoneName, recordType, top, recordsetnamesuffix, context)); + } + + /** + * Lists all record sets in a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. + * @param recordsetnamesuffix The suffix label of the record set name that has to be used to filter the record set + * enumerations. If this parameter is specified, Enumeration will return only records that end with + * .<recordSetNameSuffix>. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a record set List operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDnsZoneSinglePageAsync( + String resourceGroupName, String zoneName, Integer top, String recordsetnamesuffix) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (zoneName == null) { + return Mono.error(new IllegalArgumentException("Parameter zoneName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByDnsZone( + this.client.getEndpoint(), + resourceGroupName, + zoneName, + top, + recordsetnamesuffix, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all record sets in a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. + * @param recordsetnamesuffix The suffix label of the record set name that has to be used to filter the record set + * enumerations. If this parameter is specified, Enumeration will return only records that end with + * .<recordSetNameSuffix>. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a record set List operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDnsZoneSinglePageAsync( + String resourceGroupName, String zoneName, Integer top, String recordsetnamesuffix, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (zoneName == null) { + return Mono.error(new IllegalArgumentException("Parameter zoneName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByDnsZone( + this.client.getEndpoint(), + resourceGroupName, + zoneName, + top, + recordsetnamesuffix, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all record sets in a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. + * @param recordsetnamesuffix The suffix label of the record set name that has to be used to filter the record set + * enumerations. If this parameter is specified, Enumeration will return only records that end with + * .<recordSetNameSuffix>. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a record set List operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDnsZoneAsync( + String resourceGroupName, String zoneName, Integer top, String recordsetnamesuffix) { + return new PagedFlux<>( + () -> listByDnsZoneSinglePageAsync(resourceGroupName, zoneName, top, recordsetnamesuffix), + nextLink -> listByDnsZoneNextSinglePageAsync(nextLink)); + } + + /** + * Lists all record sets in a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a record set List operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDnsZoneAsync(String resourceGroupName, String zoneName) { + final Integer top = null; + final String recordsetnamesuffix = null; + return new PagedFlux<>( + () -> listByDnsZoneSinglePageAsync(resourceGroupName, zoneName, top, recordsetnamesuffix), + nextLink -> listByDnsZoneNextSinglePageAsync(nextLink)); + } + + /** + * Lists all record sets in a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. + * @param recordsetnamesuffix The suffix label of the record set name that has to be used to filter the record set + * enumerations. If this parameter is specified, Enumeration will return only records that end with + * .<recordSetNameSuffix>. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a record set List operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDnsZoneAsync( + String resourceGroupName, String zoneName, Integer top, String recordsetnamesuffix, Context context) { + return new PagedFlux<>( + () -> listByDnsZoneSinglePageAsync(resourceGroupName, zoneName, top, recordsetnamesuffix, context), + nextLink -> listByDnsZoneNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all record sets in a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a record set List operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDnsZone(String resourceGroupName, String zoneName) { + final Integer top = null; + final String recordsetnamesuffix = null; + return new PagedIterable<>(listByDnsZoneAsync(resourceGroupName, zoneName, top, recordsetnamesuffix)); + } + + /** + * Lists all record sets in a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. + * @param recordsetnamesuffix The suffix label of the record set name that has to be used to filter the record set + * enumerations. If this parameter is specified, Enumeration will return only records that end with + * .<recordSetNameSuffix>. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a record set List operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDnsZone( + String resourceGroupName, String zoneName, Integer top, String recordsetnamesuffix, Context context) { + return new PagedIterable<>(listByDnsZoneAsync(resourceGroupName, zoneName, top, recordsetnamesuffix, context)); + } + + /** + * Lists all record sets in a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. + * @param recordSetNameSuffix The suffix label of the record set name that has to be used to filter the record set + * enumerations. If this parameter is specified, Enumeration will return only records that end with + * .<recordSetNameSuffix>. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a record set List operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllByDnsZoneSinglePageAsync( + String resourceGroupName, String zoneName, Integer top, String recordSetNameSuffix) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (zoneName == null) { + return Mono.error(new IllegalArgumentException("Parameter zoneName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listAllByDnsZone( + this.client.getEndpoint(), + resourceGroupName, + zoneName, + top, + recordSetNameSuffix, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all record sets in a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. + * @param recordSetNameSuffix The suffix label of the record set name that has to be used to filter the record set + * enumerations. If this parameter is specified, Enumeration will return only records that end with + * .<recordSetNameSuffix>. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a record set List operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllByDnsZoneSinglePageAsync( + String resourceGroupName, String zoneName, Integer top, String recordSetNameSuffix, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (zoneName == null) { + return Mono.error(new IllegalArgumentException("Parameter zoneName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listAllByDnsZone( + this.client.getEndpoint(), + resourceGroupName, + zoneName, + top, + recordSetNameSuffix, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all record sets in a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. + * @param recordSetNameSuffix The suffix label of the record set name that has to be used to filter the record set + * enumerations. If this parameter is specified, Enumeration will return only records that end with + * .<recordSetNameSuffix>. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a record set List operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAllByDnsZoneAsync( + String resourceGroupName, String zoneName, Integer top, String recordSetNameSuffix) { + return new PagedFlux<>( + () -> listAllByDnsZoneSinglePageAsync(resourceGroupName, zoneName, top, recordSetNameSuffix), + nextLink -> listAllByDnsZoneNextSinglePageAsync(nextLink)); + } + + /** + * Lists all record sets in a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a record set List operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAllByDnsZoneAsync(String resourceGroupName, String zoneName) { + final Integer top = null; + final String recordSetNameSuffix = null; + return new PagedFlux<>( + () -> listAllByDnsZoneSinglePageAsync(resourceGroupName, zoneName, top, recordSetNameSuffix), + nextLink -> listAllByDnsZoneNextSinglePageAsync(nextLink)); + } + + /** + * Lists all record sets in a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. + * @param recordSetNameSuffix The suffix label of the record set name that has to be used to filter the record set + * enumerations. If this parameter is specified, Enumeration will return only records that end with + * .<recordSetNameSuffix>. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a record set List operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAllByDnsZoneAsync( + String resourceGroupName, String zoneName, Integer top, String recordSetNameSuffix, Context context) { + return new PagedFlux<>( + () -> listAllByDnsZoneSinglePageAsync(resourceGroupName, zoneName, top, recordSetNameSuffix, context), + nextLink -> listAllByDnsZoneNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all record sets in a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a record set List operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAllByDnsZone(String resourceGroupName, String zoneName) { + final Integer top = null; + final String recordSetNameSuffix = null; + return new PagedIterable<>(listAllByDnsZoneAsync(resourceGroupName, zoneName, top, recordSetNameSuffix)); + } + + /** + * Lists all record sets in a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. + * @param recordSetNameSuffix The suffix label of the record set name that has to be used to filter the record set + * enumerations. If this parameter is specified, Enumeration will return only records that end with + * .<recordSetNameSuffix>. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a record set List operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAllByDnsZone( + String resourceGroupName, String zoneName, Integer top, String recordSetNameSuffix, Context context) { + return new PagedIterable<>( + listAllByDnsZoneAsync(resourceGroupName, zoneName, top, recordSetNameSuffix, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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

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

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

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

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a record set List operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllByDnsZoneNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listAllByDnsZoneNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/implementation/RecordSetsImpl.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/implementation/RecordSetsImpl.java new file mode 100644 index 0000000000000..f2849fe7cb80b --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/implementation/RecordSetsImpl.java @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.dns.generated.fluent.RecordSetsClient; +import com.azure.resourcemanager.dns.generated.fluent.models.RecordSetInner; +import com.azure.resourcemanager.dns.generated.models.RecordSet; +import com.azure.resourcemanager.dns.generated.models.RecordSets; +import com.azure.resourcemanager.dns.generated.models.RecordType; + +public final class RecordSetsImpl implements RecordSets { + private static final ClientLogger LOGGER = new ClientLogger(RecordSetsImpl.class); + + private final RecordSetsClient innerClient; + + private final com.azure.resourcemanager.dns.generated.DnsManager serviceManager; + + public RecordSetsImpl( + RecordSetsClient innerClient, com.azure.resourcemanager.dns.generated.DnsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response updateWithResponse( + String resourceGroupName, + String zoneName, + String relativeRecordSetName, + RecordType recordType, + RecordSetInner parameters, + String ifMatch, + Context context) { + Response inner = + this + .serviceClient() + .updateWithResponse( + resourceGroupName, zoneName, relativeRecordSetName, recordType, parameters, ifMatch, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RecordSetImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RecordSet update( + String resourceGroupName, + String zoneName, + String relativeRecordSetName, + RecordType recordType, + RecordSetInner parameters) { + RecordSetInner inner = + this.serviceClient().update(resourceGroupName, zoneName, relativeRecordSetName, recordType, parameters); + if (inner != null) { + return new RecordSetImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createOrUpdateWithResponse( + String resourceGroupName, + String zoneName, + String relativeRecordSetName, + RecordType recordType, + RecordSetInner parameters, + String ifMatch, + String ifNoneMatch, + Context context) { + Response inner = + this + .serviceClient() + .createOrUpdateWithResponse( + resourceGroupName, + zoneName, + relativeRecordSetName, + recordType, + parameters, + ifMatch, + ifNoneMatch, + context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RecordSetImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RecordSet createOrUpdate( + String resourceGroupName, + String zoneName, + String relativeRecordSetName, + RecordType recordType, + RecordSetInner parameters) { + RecordSetInner inner = + this + .serviceClient() + .createOrUpdate(resourceGroupName, zoneName, relativeRecordSetName, recordType, parameters); + if (inner != null) { + return new RecordSetImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteWithResponse( + String resourceGroupName, + String zoneName, + String relativeRecordSetName, + RecordType recordType, + String ifMatch, + Context context) { + return this + .serviceClient() + .deleteWithResponse(resourceGroupName, zoneName, relativeRecordSetName, recordType, ifMatch, context); + } + + public void delete(String resourceGroupName, String zoneName, String relativeRecordSetName, RecordType recordType) { + this.serviceClient().delete(resourceGroupName, zoneName, relativeRecordSetName, recordType); + } + + public Response getWithResponse( + String resourceGroupName, + String zoneName, + String relativeRecordSetName, + RecordType recordType, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, zoneName, relativeRecordSetName, recordType, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RecordSetImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RecordSet get( + String resourceGroupName, String zoneName, String relativeRecordSetName, RecordType recordType) { + RecordSetInner inner = this.serviceClient().get(resourceGroupName, zoneName, relativeRecordSetName, recordType); + if (inner != null) { + return new RecordSetImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listByType(String resourceGroupName, String zoneName, RecordType recordType) { + PagedIterable inner = this.serviceClient().listByType(resourceGroupName, zoneName, recordType); + return Utils.mapPage(inner, inner1 -> new RecordSetImpl(inner1, this.manager())); + } + + public PagedIterable listByType( + String resourceGroupName, + String zoneName, + RecordType recordType, + Integer top, + String recordsetnamesuffix, + Context context) { + PagedIterable inner = + this.serviceClient().listByType(resourceGroupName, zoneName, recordType, top, recordsetnamesuffix, context); + return Utils.mapPage(inner, inner1 -> new RecordSetImpl(inner1, this.manager())); + } + + public PagedIterable listByDnsZone(String resourceGroupName, String zoneName) { + PagedIterable inner = this.serviceClient().listByDnsZone(resourceGroupName, zoneName); + return Utils.mapPage(inner, inner1 -> new RecordSetImpl(inner1, this.manager())); + } + + public PagedIterable listByDnsZone( + String resourceGroupName, String zoneName, Integer top, String recordsetnamesuffix, Context context) { + PagedIterable inner = + this.serviceClient().listByDnsZone(resourceGroupName, zoneName, top, recordsetnamesuffix, context); + return Utils.mapPage(inner, inner1 -> new RecordSetImpl(inner1, this.manager())); + } + + public PagedIterable listAllByDnsZone(String resourceGroupName, String zoneName) { + PagedIterable inner = this.serviceClient().listAllByDnsZone(resourceGroupName, zoneName); + return Utils.mapPage(inner, inner1 -> new RecordSetImpl(inner1, this.manager())); + } + + public PagedIterable listAllByDnsZone( + String resourceGroupName, String zoneName, Integer top, String recordSetNameSuffix, Context context) { + PagedIterable inner = + this.serviceClient().listAllByDnsZone(resourceGroupName, zoneName, top, recordSetNameSuffix, context); + return Utils.mapPage(inner, inner1 -> new RecordSetImpl(inner1, this.manager())); + } + + private RecordSetsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.dns.generated.DnsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/implementation/Utils.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/implementation/Utils.java new file mode 100644 index 0000000000000..6b610924cbe6a --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/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.dns.generated.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/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/implementation/ZoneImpl.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/implementation/ZoneImpl.java new file mode 100644 index 0000000000000..e092e9bd45fec --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/implementation/ZoneImpl.java @@ -0,0 +1,288 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.dns.generated.fluent.models.ZoneInner; +import com.azure.resourcemanager.dns.generated.models.SigningKey; +import com.azure.resourcemanager.dns.generated.models.Zone; +import com.azure.resourcemanager.dns.generated.models.ZoneType; +import com.azure.resourcemanager.dns.generated.models.ZoneUpdate; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class ZoneImpl implements Zone, Zone.Definition, Zone.Update { + private ZoneInner innerObject; + + private final com.azure.resourcemanager.dns.generated.DnsManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String etag() { + return this.innerModel().etag(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Long maxNumberOfRecordSets() { + return this.innerModel().maxNumberOfRecordSets(); + } + + public Long maxNumberOfRecordsPerRecordSet() { + return this.innerModel().maxNumberOfRecordsPerRecordSet(); + } + + public Long numberOfRecordSets() { + return this.innerModel().numberOfRecordSets(); + } + + public List nameServers() { + List inner = this.innerModel().nameServers(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ZoneType zoneType() { + return this.innerModel().zoneType(); + } + + public List registrationVirtualNetworks() { + List inner = this.innerModel().registrationVirtualNetworks(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List resolutionVirtualNetworks() { + List inner = this.innerModel().resolutionVirtualNetworks(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List signingKeys() { + List inner = this.innerModel().signingKeys(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ZoneInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.dns.generated.DnsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String zoneName; + + private String createIfMatch; + + private String createIfNoneMatch; + + private String updateIfMatch; + + private ZoneUpdate updateParameters; + + public ZoneImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Zone create() { + this.innerObject = + serviceManager + .serviceClient() + .getZones() + .createOrUpdateWithResponse( + resourceGroupName, zoneName, this.innerModel(), createIfMatch, createIfNoneMatch, Context.NONE) + .getValue(); + return this; + } + + public Zone create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getZones() + .createOrUpdateWithResponse( + resourceGroupName, zoneName, this.innerModel(), createIfMatch, createIfNoneMatch, context) + .getValue(); + return this; + } + + ZoneImpl(String name, com.azure.resourcemanager.dns.generated.DnsManager serviceManager) { + this.innerObject = new ZoneInner(); + this.serviceManager = serviceManager; + this.zoneName = name; + this.createIfMatch = null; + this.createIfNoneMatch = null; + } + + public ZoneImpl update() { + this.updateIfMatch = null; + this.updateParameters = new ZoneUpdate(); + return this; + } + + public Zone apply() { + this.innerObject = + serviceManager + .serviceClient() + .getZones() + .updateWithResponse(resourceGroupName, zoneName, updateParameters, updateIfMatch, Context.NONE) + .getValue(); + return this; + } + + public Zone apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getZones() + .updateWithResponse(resourceGroupName, zoneName, updateParameters, updateIfMatch, context) + .getValue(); + return this; + } + + ZoneImpl(ZoneInner innerObject, com.azure.resourcemanager.dns.generated.DnsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.zoneName = Utils.getValueFromIdByName(innerObject.id(), "dnsZones"); + } + + public Zone refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getZones() + .getByResourceGroupWithResponse(resourceGroupName, zoneName, Context.NONE) + .getValue(); + return this; + } + + public Zone refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getZones() + .getByResourceGroupWithResponse(resourceGroupName, zoneName, context) + .getValue(); + return this; + } + + public ZoneImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ZoneImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ZoneImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public ZoneImpl withEtag(String etag) { + this.innerModel().withEtag(etag); + return this; + } + + public ZoneImpl withZoneType(ZoneType zoneType) { + this.innerModel().withZoneType(zoneType); + return this; + } + + public ZoneImpl withRegistrationVirtualNetworks(List registrationVirtualNetworks) { + this.innerModel().withRegistrationVirtualNetworks(registrationVirtualNetworks); + return this; + } + + public ZoneImpl withResolutionVirtualNetworks(List resolutionVirtualNetworks) { + this.innerModel().withResolutionVirtualNetworks(resolutionVirtualNetworks); + return this; + } + + public ZoneImpl withIfMatch(String ifMatch) { + if (isInCreateMode()) { + this.createIfMatch = ifMatch; + return this; + } else { + this.updateIfMatch = ifMatch; + return this; + } + } + + public ZoneImpl withIfNoneMatch(String ifNoneMatch) { + this.createIfNoneMatch = ifNoneMatch; + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/implementation/ZonesClientImpl.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/implementation/ZonesClientImpl.java new file mode 100644 index 0000000000000..c7c1c39371fcd --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/implementation/ZonesClientImpl.java @@ -0,0 +1,1471 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.dns.generated.fluent.ZonesClient; +import com.azure.resourcemanager.dns.generated.fluent.models.ZoneInner; +import com.azure.resourcemanager.dns.generated.models.ZoneListResult; +import com.azure.resourcemanager.dns.generated.models.ZoneUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ZonesClient. */ +public final class ZonesClientImpl implements ZonesClient { + /** The proxy service used to perform REST calls. */ + private final ZonesService service; + + /** The service client containing this operation class. */ + private final DnsManagementClientImpl client; + + /** + * Initializes an instance of ZonesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ZonesClientImpl(DnsManagementClientImpl client) { + this.service = RestProxy.create(ZonesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DnsManagementClientZones to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DnsManagementClientZ") + public interface ZonesService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("zoneName") String zoneName, + @HeaderParam("If-Match") String ifMatch, + @HeaderParam("If-None-Match") String ifNoneMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ZoneInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("zoneName") String zoneName, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("zoneName") String zoneName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("zoneName") String zoneName, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ZoneUpdate parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("$top") Integer top, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/dnszones") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("$top") Integer top, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Creates or updates a DNS zone. Does not modify DNS records within the zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param parameters Parameters supplied to the CreateOrUpdate operation. + * @param ifMatch The etag of the DNS zone. Omit this value to always overwrite the current zone. Specify the + * last-seen etag value to prevent accidentally overwriting any concurrent changes. + * @param ifNoneMatch Set to '*' to allow a new DNS zone to be created, but to prevent updating an existing zone. + * Other values will be ignored. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a DNS zone along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String zoneName, ZoneInner parameters, String ifMatch, String ifNoneMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (zoneName == null) { + return Mono.error(new IllegalArgumentException("Parameter zoneName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + zoneName, + ifMatch, + ifNoneMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a DNS zone. Does not modify DNS records within the zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param parameters Parameters supplied to the CreateOrUpdate operation. + * @param ifMatch The etag of the DNS zone. Omit this value to always overwrite the current zone. Specify the + * last-seen etag value to prevent accidentally overwriting any concurrent changes. + * @param ifNoneMatch Set to '*' to allow a new DNS zone to be created, but to prevent updating an existing zone. + * Other values will be ignored. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a DNS zone along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String zoneName, + ZoneInner parameters, + String ifMatch, + String ifNoneMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (zoneName == null) { + return Mono.error(new IllegalArgumentException("Parameter zoneName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + zoneName, + ifMatch, + ifNoneMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates a DNS zone. Does not modify DNS records within the zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param parameters Parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a DNS zone on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String zoneName, ZoneInner parameters) { + final String ifMatch = null; + final String ifNoneMatch = null; + return createOrUpdateWithResponseAsync(resourceGroupName, zoneName, parameters, ifMatch, ifNoneMatch) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates or updates a DNS zone. Does not modify DNS records within the zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param parameters Parameters supplied to the CreateOrUpdate operation. + * @param ifMatch The etag of the DNS zone. Omit this value to always overwrite the current zone. Specify the + * last-seen etag value to prevent accidentally overwriting any concurrent changes. + * @param ifNoneMatch Set to '*' to allow a new DNS zone to be created, but to prevent updating an existing zone. + * Other values will be ignored. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a DNS zone along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String zoneName, + ZoneInner parameters, + String ifMatch, + String ifNoneMatch, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, zoneName, parameters, ifMatch, ifNoneMatch, context) + .block(); + } + + /** + * Creates or updates a DNS zone. Does not modify DNS records within the zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param parameters Parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ZoneInner createOrUpdate(String resourceGroupName, String zoneName, ZoneInner parameters) { + final String ifMatch = null; + final String ifNoneMatch = null; + return createOrUpdateWithResponse(resourceGroupName, zoneName, parameters, ifMatch, ifNoneMatch, Context.NONE) + .getValue(); + } + + /** + * Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param ifMatch The etag of the DNS zone. Omit this value to always delete the current zone. Specify the last-seen + * etag value to prevent accidentally deleting any concurrent changes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String zoneName, String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (zoneName == null) { + return Mono.error(new IllegalArgumentException("Parameter zoneName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + zoneName, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param ifMatch The etag of the DNS zone. Omit this value to always delete the current zone. Specify the last-seen + * etag value to prevent accidentally deleting any concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String zoneName, String ifMatch, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (zoneName == null) { + return Mono.error(new IllegalArgumentException("Parameter zoneName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + zoneName, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param ifMatch The etag of the DNS zone. Omit this value to always delete the current zone. Specify the last-seen + * etag value to prevent accidentally deleting any concurrent changes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String zoneName, String ifMatch) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, zoneName, ifMatch); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String zoneName) { + final String ifMatch = null; + Mono>> mono = deleteWithResponseAsync(resourceGroupName, zoneName, ifMatch); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param ifMatch The etag of the DNS zone. Omit this value to always delete the current zone. Specify the last-seen + * etag value to prevent accidentally deleting any concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String zoneName, String ifMatch, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, zoneName, ifMatch, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String zoneName) { + final String ifMatch = null; + return this.beginDeleteAsync(resourceGroupName, zoneName, ifMatch).getSyncPoller(); + } + + /** + * Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param ifMatch The etag of the DNS zone. Omit this value to always delete the current zone. Specify the last-seen + * etag value to prevent accidentally deleting any concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String zoneName, String ifMatch, Context context) { + return this.beginDeleteAsync(resourceGroupName, zoneName, ifMatch, context).getSyncPoller(); + } + + /** + * Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param ifMatch The etag of the DNS zone. Omit this value to always delete the current zone. Specify the last-seen + * etag value to prevent accidentally deleting any concurrent changes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String zoneName, String ifMatch) { + return beginDeleteAsync(resourceGroupName, zoneName, ifMatch) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String zoneName) { + final String ifMatch = null; + return beginDeleteAsync(resourceGroupName, zoneName, ifMatch) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param ifMatch The etag of the DNS zone. Omit this value to always delete the current zone. Specify the last-seen + * etag value to prevent accidentally deleting any concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String zoneName, String ifMatch, Context context) { + return beginDeleteAsync(resourceGroupName, zoneName, ifMatch, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String zoneName) { + final String ifMatch = null; + deleteAsync(resourceGroupName, zoneName, ifMatch).block(); + } + + /** + * Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param ifMatch The etag of the DNS zone. Omit this value to always delete the current zone. Specify the last-seen + * etag value to prevent accidentally deleting any concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String zoneName, String ifMatch, Context context) { + deleteAsync(resourceGroupName, zoneName, ifMatch, context).block(); + } + + /** + * Gets a DNS zone. Retrieves the zone properties, but not the record sets within the zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 DNS zone along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String zoneName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (zoneName == null) { + return Mono.error(new IllegalArgumentException("Parameter zoneName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + zoneName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a DNS zone. Retrieves the zone properties, but not the record sets within the zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 DNS zone along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String zoneName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (zoneName == null) { + return Mono.error(new IllegalArgumentException("Parameter zoneName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + zoneName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets a DNS zone. Retrieves the zone properties, but not the record sets within the zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 DNS zone on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String zoneName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, zoneName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a DNS zone. Retrieves the zone properties, but not the record sets within the zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 DNS zone along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String zoneName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, zoneName, context).block(); + } + + /** + * Gets a DNS zone. Retrieves the zone properties, but not the record sets within the zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ZoneInner getByResourceGroup(String resourceGroupName, String zoneName) { + return getByResourceGroupWithResponse(resourceGroupName, zoneName, Context.NONE).getValue(); + } + + /** + * Updates a DNS zone. Does not modify DNS records within the zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param parameters Parameters supplied to the Update operation. + * @param ifMatch The etag of the DNS zone. Omit this value to always overwrite the current zone. Specify the + * last-seen etag value to prevent accidentally overwriting any concurrent changes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a DNS zone along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String zoneName, ZoneUpdate parameters, String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (zoneName == null) { + return Mono.error(new IllegalArgumentException("Parameter zoneName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + zoneName, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a DNS zone. Does not modify DNS records within the zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param parameters Parameters supplied to the Update operation. + * @param ifMatch The etag of the DNS zone. Omit this value to always overwrite the current zone. Specify the + * last-seen etag value to prevent accidentally overwriting any concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a DNS zone along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String zoneName, ZoneUpdate parameters, String ifMatch, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (zoneName == null) { + return Mono.error(new IllegalArgumentException("Parameter zoneName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + zoneName, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates a DNS zone. Does not modify DNS records within the zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param parameters Parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a DNS zone on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String zoneName, ZoneUpdate parameters) { + final String ifMatch = null; + return updateWithResponseAsync(resourceGroupName, zoneName, parameters, ifMatch) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Updates a DNS zone. Does not modify DNS records within the zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param parameters Parameters supplied to the Update operation. + * @param ifMatch The etag of the DNS zone. Omit this value to always overwrite the current zone. Specify the + * last-seen etag value to prevent accidentally overwriting any concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a DNS zone along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, String zoneName, ZoneUpdate parameters, String ifMatch, Context context) { + return updateWithResponseAsync(resourceGroupName, zoneName, parameters, ifMatch, context).block(); + } + + /** + * Updates a DNS zone. Does not modify DNS records within the zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param parameters Parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ZoneInner update(String resourceGroupName, String zoneName, ZoneUpdate parameters) { + final String ifMatch = null; + return updateWithResponse(resourceGroupName, zoneName, parameters, ifMatch, Context.NONE).getValue(); + } + + /** + * Lists the DNS zones within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a Zone List or ListAll operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, Integer top) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + top, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the DNS zones within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a Zone List or ListAll operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Integer top, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + top, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the DNS zones within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a Zone List or ListAll operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Integer top) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, top), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists the DNS zones within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a Zone List or ListAll operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + final Integer top = null; + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, top), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists the DNS zones within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a Zone List or ListAll operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Integer top, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, top, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the DNS zones within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a Zone List or ListAll operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + final Integer top = null; + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, top)); + } + + /** + * Lists the DNS zones within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a Zone List or ListAll operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Integer top, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, top, context)); + } + + /** + * Lists the DNS zones in all resource groups in a subscription. + * + * @param top The maximum number of DNS zones to return. If not specified, returns up to 100 zones. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a Zone List or ListAll operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Integer top) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + top, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the DNS zones in all resource groups in a subscription. + * + * @param top The maximum number of DNS zones to return. If not specified, returns up to 100 zones. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a Zone List or ListAll operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Integer top, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + top, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the DNS zones in all resource groups in a subscription. + * + * @param top The maximum number of DNS zones to return. If not specified, returns up to 100 zones. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a Zone List or ListAll operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Integer top) { + return new PagedFlux<>(() -> listSinglePageAsync(top), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the DNS zones in all resource groups in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a Zone List or ListAll operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + final Integer top = null; + return new PagedFlux<>(() -> listSinglePageAsync(top), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the DNS zones in all resource groups in a subscription. + * + * @param top The maximum number of DNS zones to return. If not specified, returns up to 100 zones. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a Zone List or ListAll operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Integer top, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(top, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the DNS zones in all resource groups in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a Zone List or ListAll operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final Integer top = null; + return new PagedIterable<>(listAsync(top)); + } + + /** + * Lists the DNS zones in all resource groups in a subscription. + * + * @param top The maximum number of DNS zones to return. If not specified, returns up to 100 zones. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a Zone List or ListAll operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Integer top, Context context) { + return new PagedIterable<>(listAsync(top, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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

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

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a Zone List or ListAll operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/implementation/ZonesImpl.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/implementation/ZonesImpl.java new file mode 100644 index 0000000000000..b25670f214625 --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/implementation/ZonesImpl.java @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.dns.generated.fluent.ZonesClient; +import com.azure.resourcemanager.dns.generated.fluent.models.ZoneInner; +import com.azure.resourcemanager.dns.generated.models.Zone; +import com.azure.resourcemanager.dns.generated.models.Zones; + +public final class ZonesImpl implements Zones { + private static final ClientLogger LOGGER = new ClientLogger(ZonesImpl.class); + + private final ZonesClient innerClient; + + private final com.azure.resourcemanager.dns.generated.DnsManager serviceManager; + + public ZonesImpl(ZonesClient innerClient, com.azure.resourcemanager.dns.generated.DnsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete(String resourceGroupName, String zoneName) { + this.serviceClient().delete(resourceGroupName, zoneName); + } + + public void delete(String resourceGroupName, String zoneName, String ifMatch, Context context) { + this.serviceClient().delete(resourceGroupName, zoneName, ifMatch, context); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String zoneName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, zoneName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ZoneImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Zone getByResourceGroup(String resourceGroupName, String zoneName) { + ZoneInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, zoneName); + if (inner != null) { + return new ZoneImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new ZoneImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Integer top, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, top, context); + return Utils.mapPage(inner, inner1 -> new ZoneImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ZoneImpl(inner1, this.manager())); + } + + public PagedIterable list(Integer top, Context context) { + PagedIterable inner = this.serviceClient().list(top, context); + return Utils.mapPage(inner, inner1 -> new ZoneImpl(inner1, this.manager())); + } + + public Zone getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String zoneName = Utils.getValueFromIdByName(id, "dnsZones"); + if (zoneName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dnsZones'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, zoneName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String zoneName = Utils.getValueFromIdByName(id, "dnsZones"); + if (zoneName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dnsZones'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, zoneName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String zoneName = Utils.getValueFromIdByName(id, "dnsZones"); + if (zoneName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dnsZones'.", id))); + } + String localIfMatch = null; + this.delete(resourceGroupName, zoneName, localIfMatch, Context.NONE); + } + + public void deleteByIdWithResponse(String id, String ifMatch, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String zoneName = Utils.getValueFromIdByName(id, "dnsZones"); + if (zoneName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dnsZones'.", id))); + } + this.delete(resourceGroupName, zoneName, ifMatch, context); + } + + private ZonesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.dns.generated.DnsManager manager() { + return this.serviceManager; + } + + public ZoneImpl define(String name) { + return new ZoneImpl(name, this.manager()); + } +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/implementation/package-info.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/implementation/package-info.java new file mode 100644 index 0000000000000..f97a44491ab75 --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/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 DnsManagementClient. The DNS Management Client. */ +package com.azure.resourcemanager.dns.generated.implementation; diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/ARecord.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/ARecord.java new file mode 100644 index 0000000000000..74174d36ead68 --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/ARecord.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An A record. */ +@Fluent +public final class ARecord { + /* + * The IPv4 address of this A record. + */ + @JsonProperty(value = "ipv4Address") + private String ipv4Address; + + /** Creates an instance of ARecord class. */ + public ARecord() { + } + + /** + * Get the ipv4Address property: The IPv4 address of this A record. + * + * @return the ipv4Address value. + */ + public String ipv4Address() { + return this.ipv4Address; + } + + /** + * Set the ipv4Address property: The IPv4 address of this A record. + * + * @param ipv4Address the ipv4Address value to set. + * @return the ARecord object itself. + */ + public ARecord withIpv4Address(String ipv4Address) { + this.ipv4Address = ipv4Address; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/AaaaRecord.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/AaaaRecord.java new file mode 100644 index 0000000000000..1856c4e7cd0c0 --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/AaaaRecord.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An AAAA record. */ +@Fluent +public final class AaaaRecord { + /* + * The IPv6 address of this AAAA record. + */ + @JsonProperty(value = "ipv6Address") + private String ipv6Address; + + /** Creates an instance of AaaaRecord class. */ + public AaaaRecord() { + } + + /** + * Get the ipv6Address property: The IPv6 address of this AAAA record. + * + * @return the ipv6Address value. + */ + public String ipv6Address() { + return this.ipv6Address; + } + + /** + * Set the ipv6Address property: The IPv6 address of this AAAA record. + * + * @param ipv6Address the ipv6Address value to set. + * @return the AaaaRecord object itself. + */ + public AaaaRecord withIpv6Address(String ipv6Address) { + this.ipv6Address = ipv6Address; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/CaaRecord.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/CaaRecord.java new file mode 100644 index 0000000000000..1a0c5e4dd9b78 --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/CaaRecord.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A CAA record. */ +@Fluent +public final class CaaRecord { + /* + * The flags for this CAA record as an integer between 0 and 255. + */ + @JsonProperty(value = "flags") + private Integer flags; + + /* + * The tag for this CAA record. + */ + @JsonProperty(value = "tag") + private String tag; + + /* + * The value for this CAA record. + */ + @JsonProperty(value = "value") + private String value; + + /** Creates an instance of CaaRecord class. */ + public CaaRecord() { + } + + /** + * Get the flags property: The flags for this CAA record as an integer between 0 and 255. + * + * @return the flags value. + */ + public Integer flags() { + return this.flags; + } + + /** + * Set the flags property: The flags for this CAA record as an integer between 0 and 255. + * + * @param flags the flags value to set. + * @return the CaaRecord object itself. + */ + public CaaRecord withFlags(Integer flags) { + this.flags = flags; + return this; + } + + /** + * Get the tag property: The tag for this CAA record. + * + * @return the tag value. + */ + public String tag() { + return this.tag; + } + + /** + * Set the tag property: The tag for this CAA record. + * + * @param tag the tag value to set. + * @return the CaaRecord object itself. + */ + public CaaRecord withTag(String tag) { + this.tag = tag; + return this; + } + + /** + * Get the value property: The value for this CAA record. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The value for this CAA record. + * + * @param value the value value to set. + * @return the CaaRecord object itself. + */ + public CaaRecord withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/CnameRecord.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/CnameRecord.java new file mode 100644 index 0000000000000..967bc136b65ae --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/CnameRecord.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A CNAME record. */ +@Fluent +public final class CnameRecord { + /* + * The canonical name for this CNAME record. + */ + @JsonProperty(value = "cname") + private String cname; + + /** Creates an instance of CnameRecord class. */ + public CnameRecord() { + } + + /** + * Get the cname property: The canonical name for this CNAME record. + * + * @return the cname value. + */ + public String cname() { + return this.cname; + } + + /** + * Set the cname property: The canonical name for this CNAME record. + * + * @param cname the cname value to set. + * @return the CnameRecord object itself. + */ + public CnameRecord withCname(String cname) { + this.cname = cname; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/DelegationSignerInfo.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/DelegationSignerInfo.java new file mode 100644 index 0000000000000..cc5314c94b606 --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/DelegationSignerInfo.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The delegation signer information. */ +@Immutable +public final class DelegationSignerInfo { + /* + * The digest algorithm type represents the standard digest algorithm number used to construct the digest. See: + * https://www.iana.org/assignments/ds-rr-types/ds-rr-types.xhtml + */ + @JsonProperty(value = "digestAlgorithmType", access = JsonProperty.Access.WRITE_ONLY) + private Integer digestAlgorithmType; + + /* + * The digest value is a cryptographic hash value of the referenced DNSKEY Resource Record. + */ + @JsonProperty(value = "digestValue", access = JsonProperty.Access.WRITE_ONLY) + private String digestValue; + + /* + * The record represents a delegation signer (DS) record. + */ + @JsonProperty(value = "record", access = JsonProperty.Access.WRITE_ONLY) + private String record; + + /** Creates an instance of DelegationSignerInfo class. */ + public DelegationSignerInfo() { + } + + /** + * Get the digestAlgorithmType property: The digest algorithm type represents the standard digest algorithm number + * used to construct the digest. See: https://www.iana.org/assignments/ds-rr-types/ds-rr-types.xhtml. + * + * @return the digestAlgorithmType value. + */ + public Integer digestAlgorithmType() { + return this.digestAlgorithmType; + } + + /** + * Get the digestValue property: The digest value is a cryptographic hash value of the referenced DNSKEY Resource + * Record. + * + * @return the digestValue value. + */ + public String digestValue() { + return this.digestValue; + } + + /** + * Get the record property: The record represents a delegation signer (DS) record. + * + * @return the record value. + */ + public String record() { + return this.record; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/Digest.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/Digest.java new file mode 100644 index 0000000000000..773fbaa05ff0d --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/Digest.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.dns.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A digest. */ +@Fluent +public final class Digest { + /* + * The digest algorithm type represents the standard digest algorithm number used to construct the digest. See: + * https://www.iana.org/assignments/ds-rr-types/ds-rr-types.xhtml + */ + @JsonProperty(value = "algorithmType") + private Integer algorithmType; + + /* + * The digest value is a cryptographic hash value of the referenced DNSKEY Resource Record. + */ + @JsonProperty(value = "value") + private String value; + + /** Creates an instance of Digest class. */ + public Digest() { + } + + /** + * Get the algorithmType property: The digest algorithm type represents the standard digest algorithm number used to + * construct the digest. See: https://www.iana.org/assignments/ds-rr-types/ds-rr-types.xhtml. + * + * @return the algorithmType value. + */ + public Integer algorithmType() { + return this.algorithmType; + } + + /** + * Set the algorithmType property: The digest algorithm type represents the standard digest algorithm number used to + * construct the digest. See: https://www.iana.org/assignments/ds-rr-types/ds-rr-types.xhtml. + * + * @param algorithmType the algorithmType value to set. + * @return the Digest object itself. + */ + public Digest withAlgorithmType(Integer algorithmType) { + this.algorithmType = algorithmType; + return this; + } + + /** + * Get the value property: The digest value is a cryptographic hash value of the referenced DNSKEY Resource Record. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The digest value is a cryptographic hash value of the referenced DNSKEY Resource Record. + * + * @param value the value value to set. + * @return the Digest object itself. + */ + public Digest withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/DnsResourceReference.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/DnsResourceReference.java new file mode 100644 index 0000000000000..d141f42a2cb17 --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/DnsResourceReference.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Represents a single Azure resource and its referencing DNS records. */ +@Fluent +public final class DnsResourceReference { + /* + * A list of dns Records + */ + @JsonProperty(value = "dnsResources") + private List dnsResources; + + /* + * A reference to an azure resource from where the dns resource value is taken. + */ + @JsonProperty(value = "targetResource") + private SubResource targetResource; + + /** Creates an instance of DnsResourceReference class. */ + public DnsResourceReference() { + } + + /** + * Get the dnsResources property: A list of dns Records. + * + * @return the dnsResources value. + */ + public List dnsResources() { + return this.dnsResources; + } + + /** + * Set the dnsResources property: A list of dns Records. + * + * @param dnsResources the dnsResources value to set. + * @return the DnsResourceReference object itself. + */ + public DnsResourceReference withDnsResources(List dnsResources) { + this.dnsResources = dnsResources; + return this; + } + + /** + * Get the targetResource property: A reference to an azure resource from where the dns resource value is taken. + * + * @return the targetResource value. + */ + public SubResource targetResource() { + return this.targetResource; + } + + /** + * Set the targetResource property: A reference to an azure resource from where the dns resource value is taken. + * + * @param targetResource the targetResource value to set. + * @return the DnsResourceReference object itself. + */ + public DnsResourceReference withTargetResource(SubResource targetResource) { + this.targetResource = targetResource; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/DnsResourceReferenceRequest.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/DnsResourceReferenceRequest.java new file mode 100644 index 0000000000000..afdf5746088a7 --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/DnsResourceReferenceRequest.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.dns.generated.fluent.models.DnsResourceReferenceRequestProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Represents the properties of the Dns Resource Reference Request. */ +@Fluent +public final class DnsResourceReferenceRequest { + /* + * The properties of the Resource Reference Request. + */ + @JsonProperty(value = "properties") + private DnsResourceReferenceRequestProperties innerProperties; + + /** Creates an instance of DnsResourceReferenceRequest class. */ + public DnsResourceReferenceRequest() { + } + + /** + * Get the innerProperties property: The properties of the Resource Reference Request. + * + * @return the innerProperties value. + */ + private DnsResourceReferenceRequestProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the targetResources property: A list of references to azure resources for which referencing dns records need + * to be queried. + * + * @return the targetResources value. + */ + public List targetResources() { + return this.innerProperties() == null ? null : this.innerProperties().targetResources(); + } + + /** + * Set the targetResources property: A list of references to azure resources for which referencing dns records need + * to be queried. + * + * @param targetResources the targetResources value to set. + * @return the DnsResourceReferenceRequest object itself. + */ + public DnsResourceReferenceRequest withTargetResources(List targetResources) { + if (this.innerProperties() == null) { + this.innerProperties = new DnsResourceReferenceRequestProperties(); + } + this.innerProperties().withTargetResources(targetResources); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/DnsResourceReferenceResult.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/DnsResourceReferenceResult.java new file mode 100644 index 0000000000000..fe39a9141c666 --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/DnsResourceReferenceResult.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.dns.generated.models; + +import com.azure.resourcemanager.dns.generated.fluent.models.DnsResourceReferenceResultInner; +import java.util.List; + +/** An immutable client-side representation of DnsResourceReferenceResult. */ +public interface DnsResourceReferenceResult { + /** + * Gets the dnsResourceReferences property: The result of dns resource reference request. A list of dns resource + * references for each of the azure resource in the request. + * + * @return the dnsResourceReferences value. + */ + List dnsResourceReferences(); + + /** + * Gets the inner com.azure.resourcemanager.dns.generated.fluent.models.DnsResourceReferenceResultInner object. + * + * @return the inner object. + */ + DnsResourceReferenceResultInner innerModel(); +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/DnsResourceReferences.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/DnsResourceReferences.java new file mode 100644 index 0000000000000..844ee34315559 --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/DnsResourceReferences.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of DnsResourceReferences. */ +public interface DnsResourceReferences { + /** + * Returns the DNS records specified by the referencing targetResourceIds. + * + * @param parameters Properties for dns resource reference request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the properties of the Dns Resource Reference Result along with {@link Response}. + */ + Response getByTargetResourcesWithResponse( + DnsResourceReferenceRequest parameters, Context context); + + /** + * Returns the DNS records specified by the referencing targetResourceIds. + * + * @param parameters Properties for dns resource reference request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the properties of the Dns Resource Reference Result. + */ + DnsResourceReferenceResult getByTargetResources(DnsResourceReferenceRequest parameters); +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/DnssecConfig.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/DnssecConfig.java new file mode 100644 index 0000000000000..fe06954f7fc84 --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/DnssecConfig.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.dns.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.dns.generated.fluent.models.DnssecConfigInner; +import java.util.List; + +/** An immutable client-side representation of DnssecConfig. */ +public interface DnssecConfig { + /** + * 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 etag property: The etag of the DNSSEC configuration. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: Provisioning State of the DNSSEC configuration. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the signingKeys property: The list of signing keys. + * + * @return the signingKeys value. + */ + List signingKeys(); + + /** + * Gets the inner com.azure.resourcemanager.dns.generated.fluent.models.DnssecConfigInner object. + * + * @return the inner object. + */ + DnssecConfigInner innerModel(); +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/DnssecConfigListResult.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/DnssecConfigListResult.java new file mode 100644 index 0000000000000..837a20430103f --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/DnssecConfigListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.dns.generated.fluent.models.DnssecConfigInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response to a List DNSSEC configurations operation. */ +@Fluent +public final class DnssecConfigListResult { + /* + * Information about the DNSSEC configurations in the response. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The continuation token for the next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** Creates an instance of DnssecConfigListResult class. */ + public DnssecConfigListResult() { + } + + /** + * Get the value property: Information about the DNSSEC configurations in the response. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Information about the DNSSEC configurations in the response. + * + * @param value the value value to set. + * @return the DnssecConfigListResult object itself. + */ + public DnssecConfigListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The continuation token for the next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/DnssecConfigs.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/DnssecConfigs.java new file mode 100644 index 0000000000000..f147cd2eab7b5 --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/DnssecConfigs.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of DnssecConfigs. */ +public interface DnssecConfigs { + /** + * Creates or updates the DNSSEC configuration on a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 the DNSSEC configuration. + */ + DnssecConfig createOrUpdate(String resourceGroupName, String zoneName); + + /** + * Creates or updates the DNSSEC configuration on a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param ifMatch The etag of the DNSSEC configuration. Omit this value to always overwrite the DNSSEC + * configuration. Specify the last-seen etag value to prevent accidentally overwriting any concurrent changes. + * @param ifNoneMatch Set to '*' to allow this DNSSEC configuration to be created, but to prevent updating existing + * DNSSEC configuration. Other values will be ignored. + * @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 the DNSSEC configuration. + */ + DnssecConfig createOrUpdate( + String resourceGroupName, String zoneName, String ifMatch, String ifNoneMatch, Context context); + + /** + * Deletes the DNSSEC configuration on a DNS zone. This operation cannot be undone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String zoneName); + + /** + * Deletes the DNSSEC configuration on a DNS zone. This operation cannot be undone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param ifMatch The etag of this DNSSEC configuration. Omit this value to always delete the DNSSEC configuration. + * Specify the last-seen etag value to prevent accidentally deleting any concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String zoneName, String ifMatch, Context context); + + /** + * Gets the DNSSEC configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @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 DNSSEC configuration along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String zoneName, Context context); + + /** + * Gets the DNSSEC configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the DNSSEC configuration. + */ + DnssecConfig get(String resourceGroupName, String zoneName); + + /** + * Lists the DNSSEC configurations in a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a List DNSSEC configurations operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByDnsZone(String resourceGroupName, String zoneName); + + /** + * Lists the DNSSEC configurations in a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a List DNSSEC configurations operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByDnsZone(String resourceGroupName, String zoneName, Context context); +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/DsRecord.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/DsRecord.java new file mode 100644 index 0000000000000..c3e97c6312b9e --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/DsRecord.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A DS record. For more information about the DS record format, see RFC 4034: https://www.rfc-editor.org/rfc/rfc4034. + */ +@Fluent +public final class DsRecord { + /* + * The key tag value is used to determine which DNSKEY Resource Record is used for signature verification. + */ + @JsonProperty(value = "keyTag") + private Integer keyTag; + + /* + * The security algorithm type represents the standard security algorithm number of the DNSKEY Resource Record. + * See: https://www.iana.org/assignments/dns-sec-alg-numbers/dns-sec-alg-numbers.xhtml + */ + @JsonProperty(value = "algorithm") + private Integer algorithm; + + /* + * The digest entity. + */ + @JsonProperty(value = "digest") + private Digest digest; + + /** Creates an instance of DsRecord class. */ + public DsRecord() { + } + + /** + * Get the keyTag property: The key tag value is used to determine which DNSKEY Resource Record is used for + * signature verification. + * + * @return the keyTag value. + */ + public Integer keyTag() { + return this.keyTag; + } + + /** + * Set the keyTag property: The key tag value is used to determine which DNSKEY Resource Record is used for + * signature verification. + * + * @param keyTag the keyTag value to set. + * @return the DsRecord object itself. + */ + public DsRecord withKeyTag(Integer keyTag) { + this.keyTag = keyTag; + return this; + } + + /** + * Get the algorithm property: The security algorithm type represents the standard security algorithm number of the + * DNSKEY Resource Record. See: https://www.iana.org/assignments/dns-sec-alg-numbers/dns-sec-alg-numbers.xhtml. + * + * @return the algorithm value. + */ + public Integer algorithm() { + return this.algorithm; + } + + /** + * Set the algorithm property: The security algorithm type represents the standard security algorithm number of the + * DNSKEY Resource Record. See: https://www.iana.org/assignments/dns-sec-alg-numbers/dns-sec-alg-numbers.xhtml. + * + * @param algorithm the algorithm value to set. + * @return the DsRecord object itself. + */ + public DsRecord withAlgorithm(Integer algorithm) { + this.algorithm = algorithm; + return this; + } + + /** + * Get the digest property: The digest entity. + * + * @return the digest value. + */ + public Digest digest() { + return this.digest; + } + + /** + * Set the digest property: The digest entity. + * + * @param digest the digest value to set. + * @return the DsRecord object itself. + */ + public DsRecord withDigest(Digest digest) { + this.digest = digest; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (digest() != null) { + digest().validate(); + } + } +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/MxRecord.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/MxRecord.java new file mode 100644 index 0000000000000..15aae93f9bd2e --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/MxRecord.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An MX record. */ +@Fluent +public final class MxRecord { + /* + * The preference value for this MX record. + */ + @JsonProperty(value = "preference") + private Integer preference; + + /* + * The domain name of the mail host for this MX record. + */ + @JsonProperty(value = "exchange") + private String exchange; + + /** Creates an instance of MxRecord class. */ + public MxRecord() { + } + + /** + * Get the preference property: The preference value for this MX record. + * + * @return the preference value. + */ + public Integer preference() { + return this.preference; + } + + /** + * Set the preference property: The preference value for this MX record. + * + * @param preference the preference value to set. + * @return the MxRecord object itself. + */ + public MxRecord withPreference(Integer preference) { + this.preference = preference; + return this; + } + + /** + * Get the exchange property: The domain name of the mail host for this MX record. + * + * @return the exchange value. + */ + public String exchange() { + return this.exchange; + } + + /** + * Set the exchange property: The domain name of the mail host for this MX record. + * + * @param exchange the exchange value to set. + * @return the MxRecord object itself. + */ + public MxRecord withExchange(String exchange) { + this.exchange = exchange; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/NaptrRecord.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/NaptrRecord.java new file mode 100644 index 0000000000000..d56b46c191402 --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/NaptrRecord.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A NAPTR record. For more information about the NAPTR record format, see RFC 3403: + * https://www.rfc-editor.org/rfc/rfc3403. + */ +@Fluent +public final class NaptrRecord { + /* + * The order in which the NAPTR records MUST be processed in order to accurately represent the ordered list of + * rules. The ordering is from lowest to highest. Valid values: 0-65535. + */ + @JsonProperty(value = "order") + private Integer order; + + /* + * The preference specifies the order in which NAPTR records with equal 'order' values should be processed, low + * numbers being processed before high numbers. Valid values: 0-65535. + */ + @JsonProperty(value = "preference") + private Integer preference; + + /* + * The flags specific to DDDS applications. Values currently defined in RFC 3404 are uppercase and lowercase + * letters "A", "P", "S", and "U", and the empty string, "". Enclose Flags in quotation marks. + */ + @JsonProperty(value = "flags") + private String flags; + + /* + * The services specific to DDDS applications. Enclose Services in quotation marks. + */ + @JsonProperty(value = "services") + private String services; + + /* + * The regular expression that the DDDS application uses to convert an input value into an output value. For + * example: an IP phone system might use a regular expression to convert a phone number that is entered by a user + * into a SIP URI. Enclose the regular expression in quotation marks. Specify either a value for 'regexp' or a + * value for 'replacement'. + */ + @JsonProperty(value = "regexp") + private String regexp; + + /* + * The replacement is a fully qualified domain name (FQDN) of the next domain name that you want the DDDS + * application to submit a DNS query for. The DDDS application replaces the input value with the value specified + * for replacement. Specify either a value for 'regexp' or a value for 'replacement'. If you specify a value for + * 'regexp', specify a dot (.) for 'replacement'. + */ + @JsonProperty(value = "replacement") + private String replacement; + + /** Creates an instance of NaptrRecord class. */ + public NaptrRecord() { + } + + /** + * Get the order property: The order in which the NAPTR records MUST be processed in order to accurately represent + * the ordered list of rules. The ordering is from lowest to highest. Valid values: 0-65535. + * + * @return the order value. + */ + public Integer order() { + return this.order; + } + + /** + * Set the order property: The order in which the NAPTR records MUST be processed in order to accurately represent + * the ordered list of rules. The ordering is from lowest to highest. Valid values: 0-65535. + * + * @param order the order value to set. + * @return the NaptrRecord object itself. + */ + public NaptrRecord withOrder(Integer order) { + this.order = order; + return this; + } + + /** + * Get the preference property: The preference specifies the order in which NAPTR records with equal 'order' values + * should be processed, low numbers being processed before high numbers. Valid values: 0-65535. + * + * @return the preference value. + */ + public Integer preference() { + return this.preference; + } + + /** + * Set the preference property: The preference specifies the order in which NAPTR records with equal 'order' values + * should be processed, low numbers being processed before high numbers. Valid values: 0-65535. + * + * @param preference the preference value to set. + * @return the NaptrRecord object itself. + */ + public NaptrRecord withPreference(Integer preference) { + this.preference = preference; + return this; + } + + /** + * Get the flags property: The flags specific to DDDS applications. Values currently defined in RFC 3404 are + * uppercase and lowercase letters "A", "P", "S", and "U", and the empty string, "". Enclose Flags in quotation + * marks. + * + * @return the flags value. + */ + public String flags() { + return this.flags; + } + + /** + * Set the flags property: The flags specific to DDDS applications. Values currently defined in RFC 3404 are + * uppercase and lowercase letters "A", "P", "S", and "U", and the empty string, "". Enclose Flags in quotation + * marks. + * + * @param flags the flags value to set. + * @return the NaptrRecord object itself. + */ + public NaptrRecord withFlags(String flags) { + this.flags = flags; + return this; + } + + /** + * Get the services property: The services specific to DDDS applications. Enclose Services in quotation marks. + * + * @return the services value. + */ + public String services() { + return this.services; + } + + /** + * Set the services property: The services specific to DDDS applications. Enclose Services in quotation marks. + * + * @param services the services value to set. + * @return the NaptrRecord object itself. + */ + public NaptrRecord withServices(String services) { + this.services = services; + return this; + } + + /** + * Get the regexp property: The regular expression that the DDDS application uses to convert an input value into an + * output value. For example: an IP phone system might use a regular expression to convert a phone number that is + * entered by a user into a SIP URI. Enclose the regular expression in quotation marks. Specify either a value for + * 'regexp' or a value for 'replacement'. + * + * @return the regexp value. + */ + public String regexp() { + return this.regexp; + } + + /** + * Set the regexp property: The regular expression that the DDDS application uses to convert an input value into an + * output value. For example: an IP phone system might use a regular expression to convert a phone number that is + * entered by a user into a SIP URI. Enclose the regular expression in quotation marks. Specify either a value for + * 'regexp' or a value for 'replacement'. + * + * @param regexp the regexp value to set. + * @return the NaptrRecord object itself. + */ + public NaptrRecord withRegexp(String regexp) { + this.regexp = regexp; + return this; + } + + /** + * Get the replacement property: The replacement is a fully qualified domain name (FQDN) of the next domain name + * that you want the DDDS application to submit a DNS query for. The DDDS application replaces the input value with + * the value specified for replacement. Specify either a value for 'regexp' or a value for 'replacement'. If you + * specify a value for 'regexp', specify a dot (.) for 'replacement'. + * + * @return the replacement value. + */ + public String replacement() { + return this.replacement; + } + + /** + * Set the replacement property: The replacement is a fully qualified domain name (FQDN) of the next domain name + * that you want the DDDS application to submit a DNS query for. The DDDS application replaces the input value with + * the value specified for replacement. Specify either a value for 'regexp' or a value for 'replacement'. If you + * specify a value for 'regexp', specify a dot (.) for 'replacement'. + * + * @param replacement the replacement value to set. + * @return the NaptrRecord object itself. + */ + public NaptrRecord withReplacement(String replacement) { + this.replacement = replacement; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/NsRecord.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/NsRecord.java new file mode 100644 index 0000000000000..63e41869256a2 --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/NsRecord.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An NS record. */ +@Fluent +public final class NsRecord { + /* + * The name server name for this NS record. + */ + @JsonProperty(value = "nsdname") + private String nsdname; + + /** Creates an instance of NsRecord class. */ + public NsRecord() { + } + + /** + * Get the nsdname property: The name server name for this NS record. + * + * @return the nsdname value. + */ + public String nsdname() { + return this.nsdname; + } + + /** + * Set the nsdname property: The name server name for this NS record. + * + * @param nsdname the nsdname value to set. + * @return the NsRecord object itself. + */ + public NsRecord withNsdname(String nsdname) { + this.nsdname = nsdname; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/PtrRecord.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/PtrRecord.java new file mode 100644 index 0000000000000..623d6764937d0 --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/PtrRecord.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A PTR record. */ +@Fluent +public final class PtrRecord { + /* + * The PTR target domain name for this PTR record. + */ + @JsonProperty(value = "ptrdname") + private String ptrdname; + + /** Creates an instance of PtrRecord class. */ + public PtrRecord() { + } + + /** + * Get the ptrdname property: The PTR target domain name for this PTR record. + * + * @return the ptrdname value. + */ + public String ptrdname() { + return this.ptrdname; + } + + /** + * Set the ptrdname property: The PTR target domain name for this PTR record. + * + * @param ptrdname the ptrdname value to set. + * @return the PtrRecord object itself. + */ + public PtrRecord withPtrdname(String ptrdname) { + this.ptrdname = ptrdname; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/RecordSet.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/RecordSet.java new file mode 100644 index 0000000000000..3a226bcdca5bd --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/RecordSet.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.models; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.dns.generated.fluent.models.RecordSetInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of RecordSet. */ +public interface RecordSet { + /** + * 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 etag property: The etag of the record set. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the metadata property: The metadata attached to the record set. + * + * @return the metadata value. + */ + Map metadata(); + + /** + * Gets the ttl property: The TTL (time-to-live) of the records in the record set. + * + * @return the ttl value. + */ + Long ttl(); + + /** + * Gets the fqdn property: Fully qualified domain name of the record set. + * + * @return the fqdn value. + */ + String fqdn(); + + /** + * Gets the provisioningState property: provisioning State of the record set. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the targetResource property: A reference to an azure resource from where the dns resource value is taken. + * + * @return the targetResource value. + */ + SubResource targetResource(); + + /** + * Gets the aRecords property: The list of A records in the record set. + * + * @return the aRecords value. + */ + List aRecords(); + + /** + * Gets the aaaaRecords property: The list of AAAA records in the record set. + * + * @return the aaaaRecords value. + */ + List aaaaRecords(); + + /** + * Gets the mxRecords property: The list of MX records in the record set. + * + * @return the mxRecords value. + */ + List mxRecords(); + + /** + * Gets the nsRecords property: The list of NS records in the record set. + * + * @return the nsRecords value. + */ + List nsRecords(); + + /** + * Gets the ptrRecords property: The list of PTR records in the record set. + * + * @return the ptrRecords value. + */ + List ptrRecords(); + + /** + * Gets the srvRecords property: The list of SRV records in the record set. + * + * @return the srvRecords value. + */ + List srvRecords(); + + /** + * Gets the txtRecords property: The list of TXT records in the record set. + * + * @return the txtRecords value. + */ + List txtRecords(); + + /** + * Gets the cnameRecord property: The CNAME record in the record set. + * + * @return the cnameRecord value. + */ + CnameRecord cnameRecord(); + + /** + * Gets the soaRecord property: The SOA record in the record set. + * + * @return the soaRecord value. + */ + SoaRecord soaRecord(); + + /** + * Gets the caaRecords property: The list of CAA records in the record set. + * + * @return the caaRecords value. + */ + List caaRecords(); + + /** + * Gets the dsRecords property: The list of DS records in the record set. + * + * @return the dsRecords value. + */ + List dsRecords(); + + /** + * Gets the tlsaRecords property: The list of TLSA records in the record set. + * + * @return the tlsaRecords value. + */ + List tlsaRecords(); + + /** + * Gets the naptrRecords property: The list of NAPTR records in the record set. + * + * @return the naptrRecords value. + */ + List naptrRecords(); + + /** + * Gets the inner com.azure.resourcemanager.dns.generated.fluent.models.RecordSetInner object. + * + * @return the inner object. + */ + RecordSetInner innerModel(); +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/RecordSetListResult.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/RecordSetListResult.java new file mode 100644 index 0000000000000..ec860bf823e31 --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/RecordSetListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.dns.generated.fluent.models.RecordSetInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response to a record set List operation. */ +@Fluent +public final class RecordSetListResult { + /* + * Information about the record sets in the response. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The continuation token for the next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** Creates an instance of RecordSetListResult class. */ + public RecordSetListResult() { + } + + /** + * Get the value property: Information about the record sets in the response. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Information about the record sets in the response. + * + * @param value the value value to set. + * @return the RecordSetListResult object itself. + */ + public RecordSetListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The continuation token for the next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/RecordSets.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/RecordSets.java new file mode 100644 index 0000000000000..90e1a31d07c90 --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/RecordSets.java @@ -0,0 +1,279 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.dns.generated.fluent.models.RecordSetInner; + +/** Resource collection API of RecordSets. */ +public interface RecordSets { + /** + * Updates a record set within a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param recordType The type of DNS record in this record set. + * @param parameters Parameters supplied to the Update operation. + * @param ifMatch The etag of the record set. Omit this value to always overwrite the current record set. Specify + * the last-seen etag value to prevent accidentally overwriting concurrent changes. + * @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 describes a DNS record set (a collection of DNS records with the same name and type) along with {@link + * Response}. + */ + Response updateWithResponse( + String resourceGroupName, + String zoneName, + String relativeRecordSetName, + RecordType recordType, + RecordSetInner parameters, + String ifMatch, + Context context); + + /** + * Updates a record set within a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param recordType The type of DNS record in this record set. + * @param parameters Parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a DNS record set (a collection of DNS records with the same name and type). + */ + RecordSet update( + String resourceGroupName, + String zoneName, + String relativeRecordSetName, + RecordType recordType, + RecordSetInner parameters); + + /** + * Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they + * are created when the DNS zone is created). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param recordType The type of DNS record in this record set. + * @param parameters Parameters supplied to the CreateOrUpdate operation. + * @param ifMatch The etag of the record set. Omit this value to always overwrite the current record set. Specify + * the last-seen etag value to prevent accidentally overwriting any concurrent changes. + * @param ifNoneMatch Set to '*' to allow a new record set to be created, but to prevent updating an existing record + * set. Other values will be ignored. + * @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 describes a DNS record set (a collection of DNS records with the same name and type) along with {@link + * Response}. + */ + Response createOrUpdateWithResponse( + String resourceGroupName, + String zoneName, + String relativeRecordSetName, + RecordType recordType, + RecordSetInner parameters, + String ifMatch, + String ifNoneMatch, + Context context); + + /** + * Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they + * are created when the DNS zone is created). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param recordType The type of DNS record in this record set. + * @param parameters Parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a DNS record set (a collection of DNS records with the same name and type). + */ + RecordSet createOrUpdate( + String resourceGroupName, + String zoneName, + String relativeRecordSetName, + RecordType recordType, + RecordSetInner parameters); + + /** + * Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted + * (they are deleted when the DNS zone is deleted). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param recordType The type of DNS record in this record set. + * @param ifMatch The etag of the record set. Omit this value to always delete the current record set. Specify the + * last-seen etag value to prevent accidentally deleting any concurrent changes. + * @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 resourceGroupName, + String zoneName, + String relativeRecordSetName, + RecordType recordType, + String ifMatch, + Context context); + + /** + * Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted + * (they are deleted when the DNS zone is deleted). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param recordType The type of DNS record in this record set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String zoneName, String relativeRecordSetName, RecordType recordType); + + /** + * Gets a record set. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param recordType The type of DNS record in this record set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a record set along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, + String zoneName, + String relativeRecordSetName, + RecordType recordType, + Context context); + + /** + * Gets a record set. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param recordType The type of DNS record in this record set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 record set. + */ + RecordSet get(String resourceGroupName, String zoneName, String relativeRecordSetName, RecordType recordType); + + /** + * Lists the record sets of a specified type in a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param recordType The type of DNS record in this record set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a record set List operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByType(String resourceGroupName, String zoneName, RecordType recordType); + + /** + * Lists the record sets of a specified type in a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param recordType The type of DNS record in this record set. + * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. + * @param recordsetnamesuffix The suffix label of the record set name that has to be used to filter the record set + * enumerations. If this parameter is specified, Enumeration will return only records that end with + * .<recordSetNameSuffix>. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a record set List operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByType( + String resourceGroupName, + String zoneName, + RecordType recordType, + Integer top, + String recordsetnamesuffix, + Context context); + + /** + * Lists all record sets in a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a record set List operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByDnsZone(String resourceGroupName, String zoneName); + + /** + * Lists all record sets in a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. + * @param recordsetnamesuffix The suffix label of the record set name that has to be used to filter the record set + * enumerations. If this parameter is specified, Enumeration will return only records that end with + * .<recordSetNameSuffix>. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a record set List operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByDnsZone( + String resourceGroupName, String zoneName, Integer top, String recordsetnamesuffix, Context context); + + /** + * Lists all record sets in a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a record set List operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listAllByDnsZone(String resourceGroupName, String zoneName); + + /** + * Lists all record sets in a DNS zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. + * @param recordSetNameSuffix The suffix label of the record set name that has to be used to filter the record set + * enumerations. If this parameter is specified, Enumeration will return only records that end with + * .<recordSetNameSuffix>. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a record set List operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listAllByDnsZone( + String resourceGroupName, String zoneName, Integer top, String recordSetNameSuffix, Context context); +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/RecordType.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/RecordType.java new file mode 100644 index 0000000000000..86e23f2224e6c --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/RecordType.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for RecordType. */ +public enum RecordType { + /** Enum value A. */ + A("A"), + + /** Enum value AAAA. */ + AAAA("AAAA"), + + /** Enum value CAA. */ + CAA("CAA"), + + /** Enum value CNAME. */ + CNAME("CNAME"), + + /** Enum value MX. */ + MX("MX"), + + /** Enum value NS. */ + NS("NS"), + + /** Enum value PTR. */ + PTR("PTR"), + + /** Enum value SOA. */ + SOA("SOA"), + + /** Enum value SRV. */ + SRV("SRV"), + + /** Enum value TXT. */ + TXT("TXT"), + + /** Enum value TLSA. */ + TLSA("TLSA"), + + /** Enum value DS. */ + DS("DS"), + + /** Enum value NAPTR. */ + NAPTR("NAPTR"); + + /** The actual serialized value for a RecordType instance. */ + private final String value; + + RecordType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a RecordType instance. + * + * @param value the serialized value to parse. + * @return the parsed RecordType object, or null if unable to parse. + */ + @JsonCreator + public static RecordType fromString(String value) { + if (value == null) { + return null; + } + RecordType[] items = RecordType.values(); + for (RecordType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/SigningKey.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/SigningKey.java new file mode 100644 index 0000000000000..3d52d121dec52 --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/SigningKey.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Represents the signing key. */ +@Immutable +public final class SigningKey { + /* + * The delegation signer information. + */ + @JsonProperty(value = "delegationSignerInfo", access = JsonProperty.Access.WRITE_ONLY) + private List delegationSignerInfo; + + /* + * The flags specifies how the key is used. + */ + @JsonProperty(value = "flags", access = JsonProperty.Access.WRITE_ONLY) + private Integer flags; + + /* + * The key tag value of the DNSKEY Resource Record. + */ + @JsonProperty(value = "keyTag", access = JsonProperty.Access.WRITE_ONLY) + private Integer keyTag; + + /* + * The protocol value. The value is always 3. + */ + @JsonProperty(value = "protocol", access = JsonProperty.Access.WRITE_ONLY) + private Integer protocol; + + /* + * The public key, represented as a Base64 encoding. + */ + @JsonProperty(value = "publicKey", access = JsonProperty.Access.WRITE_ONLY) + private String publicKey; + + /* + * The security algorithm type represents the standard security algorithm number of the DNSKEY Resource Record. + * See: https://www.iana.org/assignments/dns-sec-alg-numbers/dns-sec-alg-numbers.xhtml + */ + @JsonProperty(value = "securityAlgorithmType", access = JsonProperty.Access.WRITE_ONLY) + private Integer securityAlgorithmType; + + /** Creates an instance of SigningKey class. */ + public SigningKey() { + } + + /** + * Get the delegationSignerInfo property: The delegation signer information. + * + * @return the delegationSignerInfo value. + */ + public List delegationSignerInfo() { + return this.delegationSignerInfo; + } + + /** + * Get the flags property: The flags specifies how the key is used. + * + * @return the flags value. + */ + public Integer flags() { + return this.flags; + } + + /** + * Get the keyTag property: The key tag value of the DNSKEY Resource Record. + * + * @return the keyTag value. + */ + public Integer keyTag() { + return this.keyTag; + } + + /** + * Get the protocol property: The protocol value. The value is always 3. + * + * @return the protocol value. + */ + public Integer protocol() { + return this.protocol; + } + + /** + * Get the publicKey property: The public key, represented as a Base64 encoding. + * + * @return the publicKey value. + */ + public String publicKey() { + return this.publicKey; + } + + /** + * Get the securityAlgorithmType property: The security algorithm type represents the standard security algorithm + * number of the DNSKEY Resource Record. See: + * https://www.iana.org/assignments/dns-sec-alg-numbers/dns-sec-alg-numbers.xhtml. + * + * @return the securityAlgorithmType value. + */ + public Integer securityAlgorithmType() { + return this.securityAlgorithmType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (delegationSignerInfo() != null) { + delegationSignerInfo().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/SoaRecord.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/SoaRecord.java new file mode 100644 index 0000000000000..57e40fbc7d883 --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/SoaRecord.java @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An SOA record. */ +@Fluent +public final class SoaRecord { + /* + * The domain name of the authoritative name server for this SOA record. + */ + @JsonProperty(value = "host") + private String host; + + /* + * The email contact for this SOA record. + */ + @JsonProperty(value = "email") + private String email; + + /* + * The serial number for this SOA record. + */ + @JsonProperty(value = "serialNumber") + private Long serialNumber; + + /* + * The refresh value for this SOA record. + */ + @JsonProperty(value = "refreshTime") + private Long refreshTime; + + /* + * The retry time for this SOA record. + */ + @JsonProperty(value = "retryTime") + private Long retryTime; + + /* + * The expire time for this SOA record. + */ + @JsonProperty(value = "expireTime") + private Long expireTime; + + /* + * The minimum value for this SOA record. By convention this is used to determine the negative caching duration. + */ + @JsonProperty(value = "minimumTTL") + private Long minimumTtl; + + /** Creates an instance of SoaRecord class. */ + public SoaRecord() { + } + + /** + * Get the host property: The domain name of the authoritative name server for this SOA record. + * + * @return the host value. + */ + public String host() { + return this.host; + } + + /** + * Set the host property: The domain name of the authoritative name server for this SOA record. + * + * @param host the host value to set. + * @return the SoaRecord object itself. + */ + public SoaRecord withHost(String host) { + this.host = host; + return this; + } + + /** + * Get the email property: The email contact for this SOA record. + * + * @return the email value. + */ + public String email() { + return this.email; + } + + /** + * Set the email property: The email contact for this SOA record. + * + * @param email the email value to set. + * @return the SoaRecord object itself. + */ + public SoaRecord withEmail(String email) { + this.email = email; + return this; + } + + /** + * Get the serialNumber property: The serial number for this SOA record. + * + * @return the serialNumber value. + */ + public Long serialNumber() { + return this.serialNumber; + } + + /** + * Set the serialNumber property: The serial number for this SOA record. + * + * @param serialNumber the serialNumber value to set. + * @return the SoaRecord object itself. + */ + public SoaRecord withSerialNumber(Long serialNumber) { + this.serialNumber = serialNumber; + return this; + } + + /** + * Get the refreshTime property: The refresh value for this SOA record. + * + * @return the refreshTime value. + */ + public Long refreshTime() { + return this.refreshTime; + } + + /** + * Set the refreshTime property: The refresh value for this SOA record. + * + * @param refreshTime the refreshTime value to set. + * @return the SoaRecord object itself. + */ + public SoaRecord withRefreshTime(Long refreshTime) { + this.refreshTime = refreshTime; + return this; + } + + /** + * Get the retryTime property: The retry time for this SOA record. + * + * @return the retryTime value. + */ + public Long retryTime() { + return this.retryTime; + } + + /** + * Set the retryTime property: The retry time for this SOA record. + * + * @param retryTime the retryTime value to set. + * @return the SoaRecord object itself. + */ + public SoaRecord withRetryTime(Long retryTime) { + this.retryTime = retryTime; + return this; + } + + /** + * Get the expireTime property: The expire time for this SOA record. + * + * @return the expireTime value. + */ + public Long expireTime() { + return this.expireTime; + } + + /** + * Set the expireTime property: The expire time for this SOA record. + * + * @param expireTime the expireTime value to set. + * @return the SoaRecord object itself. + */ + public SoaRecord withExpireTime(Long expireTime) { + this.expireTime = expireTime; + return this; + } + + /** + * Get the minimumTtl property: The minimum value for this SOA record. By convention this is used to determine the + * negative caching duration. + * + * @return the minimumTtl value. + */ + public Long minimumTtl() { + return this.minimumTtl; + } + + /** + * Set the minimumTtl property: The minimum value for this SOA record. By convention this is used to determine the + * negative caching duration. + * + * @param minimumTtl the minimumTtl value to set. + * @return the SoaRecord object itself. + */ + public SoaRecord withMinimumTtl(Long minimumTtl) { + this.minimumTtl = minimumTtl; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/SrvRecord.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/SrvRecord.java new file mode 100644 index 0000000000000..fb09b0d912dfa --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/SrvRecord.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An SRV record. */ +@Fluent +public final class SrvRecord { + /* + * The priority value for this SRV record. + */ + @JsonProperty(value = "priority") + private Integer priority; + + /* + * The weight value for this SRV record. + */ + @JsonProperty(value = "weight") + private Integer weight; + + /* + * The port value for this SRV record. + */ + @JsonProperty(value = "port") + private Integer port; + + /* + * The target domain name for this SRV record. + */ + @JsonProperty(value = "target") + private String target; + + /** Creates an instance of SrvRecord class. */ + public SrvRecord() { + } + + /** + * Get the priority property: The priority value for this SRV record. + * + * @return the priority value. + */ + public Integer priority() { + return this.priority; + } + + /** + * Set the priority property: The priority value for this SRV record. + * + * @param priority the priority value to set. + * @return the SrvRecord object itself. + */ + public SrvRecord withPriority(Integer priority) { + this.priority = priority; + return this; + } + + /** + * Get the weight property: The weight value for this SRV record. + * + * @return the weight value. + */ + public Integer weight() { + return this.weight; + } + + /** + * Set the weight property: The weight value for this SRV record. + * + * @param weight the weight value to set. + * @return the SrvRecord object itself. + */ + public SrvRecord withWeight(Integer weight) { + this.weight = weight; + return this; + } + + /** + * Get the port property: The port value for this SRV record. + * + * @return the port value. + */ + public Integer port() { + return this.port; + } + + /** + * Set the port property: The port value for this SRV record. + * + * @param port the port value to set. + * @return the SrvRecord object itself. + */ + public SrvRecord withPort(Integer port) { + this.port = port; + return this; + } + + /** + * Get the target property: The target domain name for this SRV record. + * + * @return the target value. + */ + public String target() { + return this.target; + } + + /** + * Set the target property: The target domain name for this SRV record. + * + * @param target the target value to set. + * @return the SrvRecord object itself. + */ + public SrvRecord withTarget(String target) { + this.target = target; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/TlsaRecord.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/TlsaRecord.java new file mode 100644 index 0000000000000..e9e7fdfed0662 --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/TlsaRecord.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A TLSA record. For more information about the TLSA record format, see RFC 6698: + * https://www.rfc-editor.org/rfc/rfc6698. + */ +@Fluent +public final class TlsaRecord { + /* + * The usage specifies the provided association that will be used to match the certificate presented in the TLS + * handshake. + */ + @JsonProperty(value = "usage") + private Integer usage; + + /* + * The selector specifies which part of the TLS certificate presented by the server will be matched against the + * association data. + */ + @JsonProperty(value = "selector") + private Integer selector; + + /* + * The matching type specifies how the certificate association is presented. + */ + @JsonProperty(value = "matchingType") + private Integer matchingType; + + /* + * This specifies the certificate association data to be matched. + */ + @JsonProperty(value = "certAssociationData") + private String certAssociationData; + + /** Creates an instance of TlsaRecord class. */ + public TlsaRecord() { + } + + /** + * Get the usage property: The usage specifies the provided association that will be used to match the certificate + * presented in the TLS handshake. + * + * @return the usage value. + */ + public Integer usage() { + return this.usage; + } + + /** + * Set the usage property: The usage specifies the provided association that will be used to match the certificate + * presented in the TLS handshake. + * + * @param usage the usage value to set. + * @return the TlsaRecord object itself. + */ + public TlsaRecord withUsage(Integer usage) { + this.usage = usage; + return this; + } + + /** + * Get the selector property: The selector specifies which part of the TLS certificate presented by the server will + * be matched against the association data. + * + * @return the selector value. + */ + public Integer selector() { + return this.selector; + } + + /** + * Set the selector property: The selector specifies which part of the TLS certificate presented by the server will + * be matched against the association data. + * + * @param selector the selector value to set. + * @return the TlsaRecord object itself. + */ + public TlsaRecord withSelector(Integer selector) { + this.selector = selector; + return this; + } + + /** + * Get the matchingType property: The matching type specifies how the certificate association is presented. + * + * @return the matchingType value. + */ + public Integer matchingType() { + return this.matchingType; + } + + /** + * Set the matchingType property: The matching type specifies how the certificate association is presented. + * + * @param matchingType the matchingType value to set. + * @return the TlsaRecord object itself. + */ + public TlsaRecord withMatchingType(Integer matchingType) { + this.matchingType = matchingType; + return this; + } + + /** + * Get the certAssociationData property: This specifies the certificate association data to be matched. + * + * @return the certAssociationData value. + */ + public String certAssociationData() { + return this.certAssociationData; + } + + /** + * Set the certAssociationData property: This specifies the certificate association data to be matched. + * + * @param certAssociationData the certAssociationData value to set. + * @return the TlsaRecord object itself. + */ + public TlsaRecord withCertAssociationData(String certAssociationData) { + this.certAssociationData = certAssociationData; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/TxtRecord.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/TxtRecord.java new file mode 100644 index 0000000000000..f263e517ace41 --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/TxtRecord.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.dns.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A TXT record. */ +@Fluent +public final class TxtRecord { + /* + * The text value of this TXT record. + */ + @JsonProperty(value = "value") + private List value; + + /** Creates an instance of TxtRecord class. */ + public TxtRecord() { + } + + /** + * Get the value property: The text value of this TXT record. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The text value of this TXT record. + * + * @param value the value value to set. + * @return the TxtRecord object itself. + */ + public TxtRecord withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/Zone.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/Zone.java new file mode 100644 index 0000000000000..47f2d144d737b --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/Zone.java @@ -0,0 +1,365 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.dns.generated.fluent.models.ZoneInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of Zone. */ +public interface Zone { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the etag property: The etag of the zone. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the maxNumberOfRecordSets property: The maximum number of record sets that can be created in this DNS zone. + * This is a read-only property and any attempt to set this value will be ignored. + * + * @return the maxNumberOfRecordSets value. + */ + Long maxNumberOfRecordSets(); + + /** + * Gets the maxNumberOfRecordsPerRecordSet property: The maximum number of records per record set that can be + * created in this DNS zone. This is a read-only property and any attempt to set this value will be ignored. + * + * @return the maxNumberOfRecordsPerRecordSet value. + */ + Long maxNumberOfRecordsPerRecordSet(); + + /** + * Gets the numberOfRecordSets property: The current number of record sets in this DNS zone. This is a read-only + * property and any attempt to set this value will be ignored. + * + * @return the numberOfRecordSets value. + */ + Long numberOfRecordSets(); + + /** + * Gets the nameServers property: The name servers for this DNS zone. This is a read-only property and any attempt + * to set this value will be ignored. + * + * @return the nameServers value. + */ + List nameServers(); + + /** + * Gets the zoneType property: The type of this DNS zone (Public or Private). + * + * @return the zoneType value. + */ + ZoneType zoneType(); + + /** + * Gets the registrationVirtualNetworks property: A list of references to virtual networks that register hostnames + * in this DNS zone. This is a only when ZoneType is Private. + * + * @return the registrationVirtualNetworks value. + */ + List registrationVirtualNetworks(); + + /** + * Gets the resolutionVirtualNetworks property: A list of references to virtual networks that resolve records in + * this DNS zone. This is a only when ZoneType is Private. + * + * @return the resolutionVirtualNetworks value. + */ + List resolutionVirtualNetworks(); + + /** + * Gets the signingKeys property: The list of signing keys. + * + * @return the signingKeys value. + */ + List signingKeys(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.dns.generated.fluent.models.ZoneInner object. + * + * @return the inner object. + */ + ZoneInner innerModel(); + + /** The entirety of the Zone definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The Zone definition stages. */ + interface DefinitionStages { + /** The first stage of the Zone definition. */ + interface Blank extends WithLocation { + } + /** The stage of the Zone definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the Zone definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the Zone definition which contains all the minimum required properties for the resource to be + * created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithEtag, + DefinitionStages.WithZoneType, + DefinitionStages.WithRegistrationVirtualNetworks, + DefinitionStages.WithResolutionVirtualNetworks, + DefinitionStages.WithIfMatch, + DefinitionStages.WithIfNoneMatch { + /** + * Executes the create request. + * + * @return the created resource. + */ + Zone create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Zone create(Context context); + } + /** The stage of the Zone definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the Zone definition allowing to specify etag. */ + interface WithEtag { + /** + * Specifies the etag property: The etag of the zone.. + * + * @param etag The etag of the zone. + * @return the next definition stage. + */ + WithCreate withEtag(String etag); + } + /** The stage of the Zone definition allowing to specify zoneType. */ + interface WithZoneType { + /** + * Specifies the zoneType property: The type of this DNS zone (Public or Private).. + * + * @param zoneType The type of this DNS zone (Public or Private). + * @return the next definition stage. + */ + WithCreate withZoneType(ZoneType zoneType); + } + /** The stage of the Zone definition allowing to specify registrationVirtualNetworks. */ + interface WithRegistrationVirtualNetworks { + /** + * Specifies the registrationVirtualNetworks property: A list of references to virtual networks that + * register hostnames in this DNS zone. This is a only when ZoneType is Private.. + * + * @param registrationVirtualNetworks A list of references to virtual networks that register hostnames in + * this DNS zone. This is a only when ZoneType is Private. + * @return the next definition stage. + */ + WithCreate withRegistrationVirtualNetworks(List registrationVirtualNetworks); + } + /** The stage of the Zone definition allowing to specify resolutionVirtualNetworks. */ + interface WithResolutionVirtualNetworks { + /** + * Specifies the resolutionVirtualNetworks property: A list of references to virtual networks that resolve + * records in this DNS zone. This is a only when ZoneType is Private.. + * + * @param resolutionVirtualNetworks A list of references to virtual networks that resolve records in this + * DNS zone. This is a only when ZoneType is Private. + * @return the next definition stage. + */ + WithCreate withResolutionVirtualNetworks(List resolutionVirtualNetworks); + } + /** The stage of the Zone definition allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: The etag of the DNS zone. Omit this value to always overwrite the current + * zone. Specify the last-seen etag value to prevent accidentally overwriting any concurrent changes.. + * + * @param ifMatch The etag of the DNS zone. Omit this value to always overwrite the current zone. Specify + * the last-seen etag value to prevent accidentally overwriting any concurrent changes. + * @return the next definition stage. + */ + WithCreate withIfMatch(String ifMatch); + } + /** The stage of the Zone definition allowing to specify ifNoneMatch. */ + interface WithIfNoneMatch { + /** + * Specifies the ifNoneMatch property: Set to '*' to allow a new DNS zone to be created, but to prevent + * updating an existing zone. Other values will be ignored.. + * + * @param ifNoneMatch Set to '*' to allow a new DNS zone to be created, but to prevent updating an existing + * zone. Other values will be ignored. + * @return the next definition stage. + */ + WithCreate withIfNoneMatch(String ifNoneMatch); + } + } + /** + * Begins update for the Zone resource. + * + * @return the stage of resource update. + */ + Zone.Update update(); + + /** The template for Zone update. */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithIfMatch { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Zone apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Zone apply(Context context); + } + /** The Zone update stages. */ + interface UpdateStages { + /** The stage of the Zone update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the Zone update allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: The etag of the DNS zone. Omit this value to always overwrite the current + * zone. Specify the last-seen etag value to prevent accidentally overwriting any concurrent changes.. + * + * @param ifMatch The etag of the DNS zone. Omit this value to always overwrite the current zone. Specify + * the last-seen etag value to prevent accidentally overwriting any concurrent changes. + * @return the next definition stage. + */ + Update withIfMatch(String ifMatch); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Zone refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Zone refresh(Context context); +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/ZoneListResult.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/ZoneListResult.java new file mode 100644 index 0000000000000..aab892ed4001d --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/ZoneListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.dns.generated.fluent.models.ZoneInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response to a Zone List or ListAll operation. */ +@Fluent +public final class ZoneListResult { + /* + * Information about the DNS zones. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The continuation token for the next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** Creates an instance of ZoneListResult class. */ + public ZoneListResult() { + } + + /** + * Get the value property: Information about the DNS zones. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Information about the DNS zones. + * + * @param value the value value to set. + * @return the ZoneListResult object itself. + */ + public ZoneListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The continuation token for the next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/ZoneType.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/ZoneType.java new file mode 100644 index 0000000000000..f046b8d79bfa7 --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/ZoneType.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.dns.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** The type of this DNS zone (Public or Private). */ +public enum ZoneType { + /** Enum value Public. */ + PUBLIC("Public"), + + /** Enum value Private. */ + PRIVATE("Private"); + + /** The actual serialized value for a ZoneType instance. */ + private final String value; + + ZoneType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ZoneType instance. + * + * @param value the serialized value to parse. + * @return the parsed ZoneType object, or null if unable to parse. + */ + @JsonCreator + public static ZoneType fromString(String value) { + if (value == null) { + return null; + } + ZoneType[] items = ZoneType.values(); + for (ZoneType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/ZoneUpdate.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/ZoneUpdate.java new file mode 100644 index 0000000000000..00bf2a2f1aa92 --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/ZoneUpdate.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Describes a request to update a DNS zone. */ +@Fluent +public final class ZoneUpdate { + /* + * Resource tags. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** Creates an instance of ZoneUpdate class. */ + public ZoneUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the ZoneUpdate object itself. + */ + public ZoneUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/Zones.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/Zones.java new file mode 100644 index 0000000000000..e6f560fb89d85 --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/Zones.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.dns.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Zones. */ +public interface Zones { + /** + * Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String zoneName); + + /** + * Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param ifMatch The etag of the DNS zone. Omit this value to always delete the current zone. Specify the last-seen + * etag value to prevent accidentally deleting any concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String zoneName, String ifMatch, Context context); + + /** + * Gets a DNS zone. Retrieves the zone properties, but not the record sets within the zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DNS zone along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String zoneName, Context context); + + /** + * Gets a DNS zone. Retrieves the zone properties, but not the record sets within the zone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 DNS zone. + */ + Zone getByResourceGroup(String resourceGroupName, String zoneName); + + /** + * Lists the DNS zones within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a Zone List or ListAll operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists the DNS zones within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a Zone List or ListAll operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Integer top, Context context); + + /** + * Lists the DNS zones in all resource groups in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a Zone List or ListAll operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Lists the DNS zones in all resource groups in a subscription. + * + * @param top The maximum number of DNS zones to return. If not specified, returns up to 100 zones. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a Zone List or ListAll operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Integer top, Context context); + + /** + * Gets a DNS zone. Retrieves the zone properties, but not the record sets within the zone. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DNS zone along with {@link Response}. + */ + Zone getById(String id); + + /** + * Gets a DNS zone. Retrieves the zone properties, but not the record sets within the zone. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DNS zone along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone. + * + * @param id the resource ID. + * @param ifMatch The etag of the DNS zone. Omit this value to always delete the current zone. Specify the last-seen + * etag value to prevent accidentally deleting any concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, String ifMatch, Context context); + + /** + * Begins definition for a new Zone resource. + * + * @param name resource name. + * @return the first stage of the new Zone definition. + */ + Zone.DefinitionStages.Blank define(String name); +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/package-info.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/models/package-info.java new file mode 100644 index 0000000000000..93415b0600cd9 --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/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 DnsManagementClient. The DNS Management Client. */ +package com.azure.resourcemanager.dns.generated.models; diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/package-info.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/package-info.java new file mode 100644 index 0000000000000..4d86855f843d7 --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/com/azure/resourcemanager/dns/generated/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 DnsManagementClient. The DNS Management Client. */ +package com.azure.resourcemanager.dns.generated; diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/module-info.java b/sdk/dns/azure-resourcemanager-dns-generated/src/main/java/module-info.java new file mode 100644 index 0000000000000..0d9d8fbfc3756 --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/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.dns.generated { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.dns.generated; + exports com.azure.resourcemanager.dns.generated.fluent; + exports com.azure.resourcemanager.dns.generated.fluent.models; + exports com.azure.resourcemanager.dns.generated.models; + + opens com.azure.resourcemanager.dns.generated.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.dns.generated.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/DnsResourceReferenceGetByTargetResourcesSamples.java b/sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/DnsResourceReferenceGetByTargetResourcesSamples.java new file mode 100644 index 0000000000000..d806669e508a3 --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/DnsResourceReferenceGetByTargetResourcesSamples.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.dns.generated.generated; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.dns.generated.models.DnsResourceReferenceRequest; +import java.util.Arrays; + +/** Samples for DnsResourceReference GetByTargetResources. */ +public final class DnsResourceReferenceGetByTargetResourcesSamples { + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetDnsResourceReference.json + */ + /** + * Sample code: Get DNS resource reference. + * + * @param manager Entry point to DnsManager. + */ + public static void getDNSResourceReference(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .dnsResourceReferences() + .getByTargetResourcesWithResponse( + new DnsResourceReferenceRequest() + .withTargetResources( + Arrays + .asList( + new SubResource() + .withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/trafficManagerProfiles/testpp2"))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/DnssecConfigsCreateOrUpdateSamples.java b/sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/DnssecConfigsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..68ad738c6971e --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/DnssecConfigsCreateOrUpdateSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.generated; + +/** Samples for DnssecConfigs CreateOrUpdate. */ +public final class DnssecConfigsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateDnssecConfig.json + */ + /** + * Sample code: Create DnssecConfig. + * + * @param manager Entry point to DnsManager. + */ + public static void createDnssecConfig(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager.dnssecConfigs().createOrUpdate("rg1", "zone1", null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/DnssecConfigsDeleteSamples.java b/sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/DnssecConfigsDeleteSamples.java new file mode 100644 index 0000000000000..bbe0f8f3aa294 --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/DnssecConfigsDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.generated; + +/** Samples for DnssecConfigs Delete. */ +public final class DnssecConfigsDeleteSamples { + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteDnssecConfig.json + */ + /** + * Sample code: Delete DnssecConfig. + * + * @param manager Entry point to DnsManager. + */ + public static void deleteDnssecConfig(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager.dnssecConfigs().delete("rg1", "zone1", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/DnssecConfigsGetSamples.java b/sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/DnssecConfigsGetSamples.java new file mode 100644 index 0000000000000..0505436b3980c --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/DnssecConfigsGetSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.generated; + +/** Samples for DnssecConfigs Get. */ +public final class DnssecConfigsGetSamples { + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetDnssecConfig.json + */ + /** + * Sample code: Get DnssecConfig. + * + * @param manager Entry point to DnsManager. + */ + public static void getDnssecConfig(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager.dnssecConfigs().getWithResponse("rg1", "zone1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/DnssecConfigsListByDnsZoneSamples.java b/sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/DnssecConfigsListByDnsZoneSamples.java new file mode 100644 index 0000000000000..645520d0c33b6 --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/DnssecConfigsListByDnsZoneSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.generated; + +/** Samples for DnssecConfigs ListByDnsZone. */ +public final class DnssecConfigsListByDnsZoneSamples { + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListDnssecConfigsByZone.json + */ + /** + * Sample code: List DnssecConfigs. + * + * @param manager Entry point to DnsManager. + */ + public static void listDnssecConfigs(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager.dnssecConfigs().listByDnsZone("rg1", "zone1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/RecordSetsCreateOrUpdateSamples.java b/sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/RecordSetsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..8ece69128a6c1 --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/RecordSetsCreateOrUpdateSamples.java @@ -0,0 +1,432 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.generated; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.dns.generated.fluent.models.RecordSetInner; +import com.azure.resourcemanager.dns.generated.models.ARecord; +import com.azure.resourcemanager.dns.generated.models.AaaaRecord; +import com.azure.resourcemanager.dns.generated.models.CaaRecord; +import com.azure.resourcemanager.dns.generated.models.CnameRecord; +import com.azure.resourcemanager.dns.generated.models.Digest; +import com.azure.resourcemanager.dns.generated.models.DsRecord; +import com.azure.resourcemanager.dns.generated.models.MxRecord; +import com.azure.resourcemanager.dns.generated.models.NaptrRecord; +import com.azure.resourcemanager.dns.generated.models.NsRecord; +import com.azure.resourcemanager.dns.generated.models.PtrRecord; +import com.azure.resourcemanager.dns.generated.models.RecordType; +import com.azure.resourcemanager.dns.generated.models.SoaRecord; +import com.azure.resourcemanager.dns.generated.models.SrvRecord; +import com.azure.resourcemanager.dns.generated.models.TlsaRecord; +import com.azure.resourcemanager.dns.generated.models.TxtRecord; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for RecordSets CreateOrUpdate. */ +public final class RecordSetsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateSRVRecordset.json + */ + /** + * Sample code: Create SRV recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void createSRVRecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .createOrUpdateWithResponse( + "rg1", + "zone1", + "record1", + RecordType.SRV, + new RecordSetInner() + .withMetadata(mapOf("key1", "value1")) + .withTtl(3600L) + .withSrvRecords( + Arrays + .asList( + new SrvRecord().withPriority(0).withWeight(10).withPort(80).withTarget("contoso.com"))), + null, + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateCNAMERecordset.json + */ + /** + * Sample code: Create CNAME recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void createCNAMERecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .createOrUpdateWithResponse( + "rg1", + "zone1", + "record1", + RecordType.CNAME, + new RecordSetInner() + .withMetadata(mapOf("key1", "value1")) + .withTtl(3600L) + .withCnameRecord(new CnameRecord().withCname("contoso.com")), + null, + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateAAAARecordset.json + */ + /** + * Sample code: Create AAAA recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void createAAAARecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .createOrUpdateWithResponse( + "rg1", + "zone1", + "record1", + RecordType.AAAA, + new RecordSetInner() + .withMetadata(mapOf("key1", "value1")) + .withTtl(3600L) + .withAaaaRecords(Arrays.asList(new AaaaRecord().withIpv6Address("::1"))), + null, + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateDSRecordset.json + */ + /** + * Sample code: Create DS recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void createDSRecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .createOrUpdateWithResponse( + "rg1", + "zone1", + "record1", + RecordType.DS, + new RecordSetInner() + .withMetadata(mapOf("key1", "value1")) + .withTtl(3600L) + .withDsRecords( + Arrays + .asList( + new DsRecord() + .withKeyTag(60485) + .withAlgorithm(5) + .withDigest( + new Digest() + .withAlgorithmType(1) + .withValue("2BB183AF5F22588179A53B0A98631FAD1A292118")))), + null, + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateNAPTRRecordset.json + */ + /** + * Sample code: Create NAPTR recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void createNAPTRRecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .createOrUpdateWithResponse( + "rg1", + "zone1", + "record1", + RecordType.NAPTR, + new RecordSetInner() + .withMetadata(mapOf("key1", "value1")) + .withTtl(3600L) + .withNaptrRecords( + Arrays + .asList( + new NaptrRecord() + .withOrder(100) + .withPreference(10) + .withFlags("U") + .withServices("E2U+sip") + .withRegexp("!^.*$!sip:user@example.com!") + .withReplacement(""))), + null, + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateNSRecordset.json + */ + /** + * Sample code: Create NS recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void createNSRecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .createOrUpdateWithResponse( + "rg1", + "zone1", + "record1", + RecordType.NS, + new RecordSetInner() + .withMetadata(mapOf("key1", "value1")) + .withTtl(3600L) + .withNsRecords(Arrays.asList(new NsRecord().withNsdname("ns1.contoso.com"))), + null, + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateARecordsetAlias.json + */ + /** + * Sample code: Create A recordset with alias target resource. + * + * @param manager Entry point to DnsManager. + */ + public static void createARecordsetWithAliasTargetResource( + com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .createOrUpdateWithResponse( + "rg1", + "zone1", + "record1", + RecordType.A, + new RecordSetInner() + .withMetadata(mapOf("key1", "value1")) + .withTtl(3600L) + .withTargetResource( + new SubResource() + .withId( + "/subscriptions/726f8cd6-6459-4db4-8e6d-2cd2716904e2/resourceGroups/test/providers/Microsoft.Network/trafficManagerProfiles/testpp2")), + null, + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateARecordset.json + */ + /** + * Sample code: Create A recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void createARecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .createOrUpdateWithResponse( + "rg1", + "zone1", + "record1", + RecordType.A, + new RecordSetInner() + .withMetadata(mapOf("key1", "value1")) + .withTtl(3600L) + .withARecords(Arrays.asList(new ARecord().withIpv4Address("127.0.0.1"))), + null, + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateTLSARecordset.json + */ + /** + * Sample code: Create TLSA recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void createTLSARecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .createOrUpdateWithResponse( + "rg1", + "zone1", + "record1", + RecordType.TLSA, + new RecordSetInner() + .withMetadata(mapOf("key1", "value1")) + .withTtl(3600L) + .withTlsaRecords( + Arrays + .asList( + new TlsaRecord() + .withUsage(3) + .withSelector(1) + .withMatchingType(1) + .withCertAssociationData( + "6EC8A4B7F511454D84DCC055213B8D195E8ADA751FE14300AFE32D54B162438B"))), + null, + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateTXTRecordset.json + */ + /** + * Sample code: Create TXT recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void createTXTRecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .createOrUpdateWithResponse( + "rg1", + "zone1", + "record1", + RecordType.TXT, + new RecordSetInner() + .withMetadata(mapOf("key1", "value1")) + .withTtl(3600L) + .withTxtRecords(Arrays.asList(new TxtRecord().withValue(Arrays.asList("string1", "string2")))), + null, + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateCaaRecordset.json + */ + /** + * Sample code: Create CAA recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void createCAARecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .createOrUpdateWithResponse( + "rg1", + "zone1", + "record1", + RecordType.CAA, + new RecordSetInner() + .withMetadata(mapOf("key1", "value1")) + .withTtl(3600L) + .withCaaRecords( + Arrays.asList(new CaaRecord().withFlags(0).withTag("issue").withValue("ca.contoso.com"))), + null, + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdatePTRRecordset.json + */ + /** + * Sample code: Create PTR recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void createPTRRecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .createOrUpdateWithResponse( + "rg1", + "0.0.127.in-addr.arpa", + "1", + RecordType.PTR, + new RecordSetInner() + .withMetadata(mapOf("key1", "value1")) + .withTtl(3600L) + .withPtrRecords(Arrays.asList(new PtrRecord().withPtrdname("localhost"))), + null, + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateMXRecordset.json + */ + /** + * Sample code: Create MX recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void createMXRecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .createOrUpdateWithResponse( + "rg1", + "zone1", + "record1", + RecordType.MX, + new RecordSetInner() + .withMetadata(mapOf("key1", "value1")) + .withTtl(3600L) + .withMxRecords(Arrays.asList(new MxRecord().withPreference(0).withExchange("mail.contoso.com"))), + null, + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateSOARecordset.json + */ + /** + * Sample code: Create SOA recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void createSOARecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .createOrUpdateWithResponse( + "rg1", + "zone1", + "@", + RecordType.SOA, + new RecordSetInner() + .withMetadata(mapOf("key1", "value1")) + .withTtl(3600L) + .withSoaRecord( + new SoaRecord() + .withHost("ns1.contoso.com") + .withEmail("hostmaster.contoso.com") + .withSerialNumber(1L) + .withRefreshTime(3600L) + .withRetryTime(300L) + .withExpireTime(2419200L) + .withMinimumTtl(300L)), + null, + null, + com.azure.core.util.Context.NONE); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/RecordSetsDeleteSamples.java b/sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/RecordSetsDeleteSamples.java new file mode 100644 index 0000000000000..0f873614673d6 --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/RecordSetsDeleteSamples.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.generated; + +import com.azure.resourcemanager.dns.generated.models.RecordType; + +/** Samples for RecordSets Delete. */ +public final class RecordSetsDeleteSamples { + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteNAPTRRecordset.json + */ + /** + * Sample code: Delete NAPTR recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void deleteNAPTRRecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .deleteWithResponse("rg1", "zone1", "record1", RecordType.NAPTR, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteARecordset.json + */ + /** + * Sample code: Delete A recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void deleteARecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .deleteWithResponse("rg1", "zone1", "record1", RecordType.A, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteAAAARecordset.json + */ + /** + * Sample code: Delete AAAA recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void deleteAAAARecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .deleteWithResponse("rg1", "zone1", "record1", RecordType.AAAA, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteTXTRecordset.json + */ + /** + * Sample code: Delete TXT recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void deleteTXTRecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .deleteWithResponse("rg1", "zone1", "record1", RecordType.TXT, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteDSRecordset.json + */ + /** + * Sample code: Delete DS recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void deleteDSRecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .deleteWithResponse("rg1", "zone1", "record1", RecordType.DS, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteTLSARecordset.json + */ + /** + * Sample code: Delete TLSA recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void deleteTLSARecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .deleteWithResponse("rg1", "zone1", "record1", RecordType.TLSA, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeletePTRRecordset.json + */ + /** + * Sample code: Delete PTR recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void deletePTRRecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .deleteWithResponse( + "rg1", "0.0.127.in-addr.arpa", "1", RecordType.PTR, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteSRVRecordset.json + */ + /** + * Sample code: Delete SRV recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void deleteSRVRecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .deleteWithResponse("rg1", "zone1", "record1", RecordType.SRV, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteMXRecordset.json + */ + /** + * Sample code: Delete MX recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void deleteMXRecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .deleteWithResponse("rg1", "zone1", "record1", RecordType.MX, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteCaaRecordset.json + */ + /** + * Sample code: Delete CAA recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void deleteCAARecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .deleteWithResponse("rg1", "zone1", "record1", RecordType.CAA, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteNSRecordset.json + */ + /** + * Sample code: Delete NS recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void deleteNSRecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .deleteWithResponse("rg1", "zone1", "record1", RecordType.NS, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteCNAMERecordset.json + */ + /** + * Sample code: Delete CNAME recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void deleteCNAMERecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .deleteWithResponse("rg1", "zone1", "record1", RecordType.CNAME, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/RecordSetsGetSamples.java b/sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/RecordSetsGetSamples.java new file mode 100644 index 0000000000000..9a76d4da0ecff --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/RecordSetsGetSamples.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.generated; + +import com.azure.resourcemanager.dns.generated.models.RecordType; + +/** Samples for RecordSets Get. */ +public final class RecordSetsGetSamples { + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetCaaRecordset.json + */ + /** + * Sample code: Get CAA recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void getCAARecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .getWithResponse("rg1", "zone1", "record1", RecordType.CAA, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetPTRRecordset.json + */ + /** + * Sample code: Get PTR recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void getPTRRecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .getWithResponse("rg1", "0.0.127.in-addr.arpa", "1", RecordType.PTR, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetDSRecordset.json + */ + /** + * Sample code: Get DS recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void getDSRecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .getWithResponse("rg1", "zone1", "record1", RecordType.DS, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetARecordset.json + */ + /** + * Sample code: Get A recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void getARecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager.recordSets().getWithResponse("rg1", "zone1", "record1", RecordType.A, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetNAPTRRecordset.json + */ + /** + * Sample code: Get NAPTR recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void getNAPTRRecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .getWithResponse("rg1", "zone1", "record1", RecordType.NAPTR, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetNSRecordset.json + */ + /** + * Sample code: Get NS recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void getNSRecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .getWithResponse("rg1", "zone1", "record1", RecordType.NS, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetAAAARecordset.json + */ + /** + * Sample code: Get AAAA recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void getAAAARecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .getWithResponse("rg1", "zone1", "record1", RecordType.AAAA, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetSRVRecordset.json + */ + /** + * Sample code: Get SRV recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void getSRVRecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .getWithResponse("rg1", "zone1", "record1", RecordType.SRV, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetCNAMERecordset.json + */ + /** + * Sample code: Get CNAME recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void getCNAMERecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .getWithResponse("rg1", "zone1", "record1", RecordType.CNAME, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetTXTRecordset.json + */ + /** + * Sample code: Get TXT recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void getTXTRecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .getWithResponse("rg1", "zone1", "record1", RecordType.TXT, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetTLSARecordset.json + */ + /** + * Sample code: Get TLSA recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void getTLSARecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .getWithResponse("rg1", "zone1", "record1", RecordType.TLSA, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetMXRecordset.json + */ + /** + * Sample code: Get MX recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void getMXRecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .getWithResponse("rg1", "zone1", "record1", RecordType.MX, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetSOARecordset.json + */ + /** + * Sample code: Get SOA recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void getSOARecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager.recordSets().getWithResponse("rg1", "zone1", "@", RecordType.SOA, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/RecordSetsListAllByDnsZoneSamples.java b/sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/RecordSetsListAllByDnsZoneSamples.java new file mode 100644 index 0000000000000..b8b57fe527f81 --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/RecordSetsListAllByDnsZoneSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.generated; + +/** Samples for RecordSets ListAllByDnsZone. */ +public final class RecordSetsListAllByDnsZoneSamples { + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListRecordSetsByZone.json + */ + /** + * Sample code: List all recordsets by zone. + * + * @param manager Entry point to DnsManager. + */ + public static void listAllRecordsetsByZone(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager.recordSets().listAllByDnsZone("rg1", "zone1", null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/RecordSetsListByDnsZoneSamples.java b/sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/RecordSetsListByDnsZoneSamples.java new file mode 100644 index 0000000000000..ff02f349125d0 --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/RecordSetsListByDnsZoneSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.generated; + +/** Samples for RecordSets ListByDnsZone. */ +public final class RecordSetsListByDnsZoneSamples { + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListRecordSetsByZone.json + */ + /** + * Sample code: List recordsets by zone. + * + * @param manager Entry point to DnsManager. + */ + public static void listRecordsetsByZone(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager.recordSets().listByDnsZone("rg1", "zone1", null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/RecordSetsListByTypeSamples.java b/sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/RecordSetsListByTypeSamples.java new file mode 100644 index 0000000000000..db5ba3f54ce68 --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/RecordSetsListByTypeSamples.java @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.generated; + +import com.azure.resourcemanager.dns.generated.models.RecordType; + +/** Samples for RecordSets ListByType. */ +public final class RecordSetsListByTypeSamples { + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListAAAARecordset.json + */ + /** + * Sample code: List AAAA recordsets. + * + * @param manager Entry point to DnsManager. + */ + public static void listAAAARecordsets(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager.recordSets().listByType("rg1", "zone1", RecordType.AAAA, null, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListMXRecordset.json + */ + /** + * Sample code: List MX recordsets. + * + * @param manager Entry point to DnsManager. + */ + public static void listMXRecordsets(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager.recordSets().listByType("rg1", "zone1", RecordType.MX, null, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListNSRecordset.json + */ + /** + * Sample code: List NS recordsets. + * + * @param manager Entry point to DnsManager. + */ + public static void listNSRecordsets(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager.recordSets().listByType("rg1", "zone1", RecordType.NS, null, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListCNAMERecordset.json + */ + /** + * Sample code: List CNAME recordsets. + * + * @param manager Entry point to DnsManager. + */ + public static void listCNAMERecordsets(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager.recordSets().listByType("rg1", "zone1", RecordType.CNAME, null, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListDSRecordset.json + */ + /** + * Sample code: List DS recordsets. + * + * @param manager Entry point to DnsManager. + */ + public static void listDSRecordsets(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager.recordSets().listByType("rg1", "zone1", RecordType.DS, null, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListSRVRecordset.json + */ + /** + * Sample code: List SRV recordsets. + * + * @param manager Entry point to DnsManager. + */ + public static void listSRVRecordsets(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager.recordSets().listByType("rg1", "zone1", RecordType.SRV, null, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListPTRRecordset.json + */ + /** + * Sample code: List PTR recordsets. + * + * @param manager Entry point to DnsManager. + */ + public static void listPTRRecordsets(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .listByType("rg1", "0.0.127.in-addr.arpa", RecordType.PTR, null, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListTLSARecordset.json + */ + /** + * Sample code: List TLSA recordsets. + * + * @param manager Entry point to DnsManager. + */ + public static void listTLSARecordsets(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager.recordSets().listByType("rg1", "zone1", RecordType.TLSA, null, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListARecordset.json + */ + /** + * Sample code: List A recordsets. + * + * @param manager Entry point to DnsManager. + */ + public static void listARecordsets(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager.recordSets().listByType("rg1", "zone1", RecordType.A, null, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListSOARecordset.json + */ + /** + * Sample code: List SOA recordsets. + * + * @param manager Entry point to DnsManager. + */ + public static void listSOARecordsets(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager.recordSets().listByType("rg1", "zone1", RecordType.SOA, null, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListCaaRecordset.json + */ + /** + * Sample code: List CAA recordsets. + * + * @param manager Entry point to DnsManager. + */ + public static void listCAARecordsets(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager.recordSets().listByType("rg1", "zone1", RecordType.CAA, null, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListNAPTRRecordset.json + */ + /** + * Sample code: List NAPTR recordsets. + * + * @param manager Entry point to DnsManager. + */ + public static void listNAPTRRecordsets(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager.recordSets().listByType("rg1", "zone1", RecordType.NAPTR, null, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListTXTRecordset.json + */ + /** + * Sample code: List TXT recordsets. + * + * @param manager Entry point to DnsManager. + */ + public static void listTXTRecordsets(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager.recordSets().listByType("rg1", "zone1", RecordType.TXT, null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/RecordSetsUpdateSamples.java b/sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/RecordSetsUpdateSamples.java new file mode 100644 index 0000000000000..76f2dc72a445c --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/RecordSetsUpdateSamples.java @@ -0,0 +1,297 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.generated; + +import com.azure.resourcemanager.dns.generated.fluent.models.RecordSetInner; +import com.azure.resourcemanager.dns.generated.models.RecordType; +import java.util.HashMap; +import java.util.Map; + +/** Samples for RecordSets Update. */ +public final class RecordSetsUpdateSamples { + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchMXRecordset.json + */ + /** + * Sample code: Patch MX recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void patchMXRecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .updateWithResponse( + "rg1", + "zone1", + "record1", + RecordType.MX, + new RecordSetInner().withMetadata(mapOf("key2", "value2")), + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchNSRecordset.json + */ + /** + * Sample code: Patch NS recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void patchNSRecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .updateWithResponse( + "rg1", + "zone1", + "record1", + RecordType.NS, + new RecordSetInner().withMetadata(mapOf("key2", "value2")), + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchPTRRecordset.json + */ + /** + * Sample code: Patch PTR recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void patchPTRRecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .updateWithResponse( + "rg1", + "0.0.127.in-addr.arpa", + "1", + RecordType.PTR, + new RecordSetInner().withMetadata(mapOf("key2", "value2")), + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchDSRecordset.json + */ + /** + * Sample code: Patch DS recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void patchDSRecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .updateWithResponse( + "rg1", + "zone1", + "record1", + RecordType.DS, + new RecordSetInner().withMetadata(mapOf("key2", "value2")), + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchARecordset.json + */ + /** + * Sample code: Patch A recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void patchARecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .updateWithResponse( + "rg1", + "zone1", + "record1", + RecordType.A, + new RecordSetInner().withMetadata(mapOf("key2", "value2")), + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchTXTRecordset.json + */ + /** + * Sample code: Patch TXT recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void patchTXTRecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .updateWithResponse( + "rg1", + "zone1", + "record1", + RecordType.TXT, + new RecordSetInner().withMetadata(mapOf("key2", "value2")), + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchAAAARecordset.json + */ + /** + * Sample code: Patch AAAA recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void patchAAAARecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .updateWithResponse( + "rg1", + "zone1", + "record1", + RecordType.AAAA, + new RecordSetInner().withMetadata(mapOf("key2", "value2")), + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchSRVRecordset.json + */ + /** + * Sample code: Patch SRV recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void patchSRVRecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .updateWithResponse( + "rg1", + "zone1", + "record1", + RecordType.SRV, + new RecordSetInner().withMetadata(mapOf("key2", "value2")), + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchSOARecordset.json + */ + /** + * Sample code: Patch SOA recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void patchSOARecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .updateWithResponse( + "rg1", + "zone1", + "@", + RecordType.SOA, + new RecordSetInner().withMetadata(mapOf("key2", "value2")), + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchTLSARecordset.json + */ + /** + * Sample code: Patch TLSA recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void patchTLSARecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .updateWithResponse( + "rg1", + "zone1", + "record1", + RecordType.TLSA, + new RecordSetInner().withMetadata(mapOf("key2", "value2")), + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchCaaRecordset.json + */ + /** + * Sample code: Patch CAA recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void patchCAARecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .updateWithResponse( + "rg1", + "zone1", + "record1", + RecordType.CAA, + new RecordSetInner().withMetadata(mapOf("key2", "value2")), + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchCNAMERecordset.json + */ + /** + * Sample code: Patch CNAME recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void patchCNAMERecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .updateWithResponse( + "rg1", + "zone1", + "record1", + RecordType.CNAME, + new RecordSetInner().withMetadata(mapOf("key2", "value2")), + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchNAPTRRecordset.json + */ + /** + * Sample code: Patch NAPTR recordset. + * + * @param manager Entry point to DnsManager. + */ + public static void patchNAPTRRecordset(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .recordSets() + .updateWithResponse( + "rg1", + "zone1", + "record1", + RecordType.NAPTR, + new RecordSetInner().withMetadata(mapOf("key2", "value2")), + null, + com.azure.core.util.Context.NONE); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/ZonesCreateOrUpdateSamples.java b/sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/ZonesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..1bb541ac242d7 --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/ZonesCreateOrUpdateSamples.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.generated; + +import java.util.HashMap; +import java.util.Map; + +/** Samples for Zones CreateOrUpdate. */ +public final class ZonesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateZone.json + */ + /** + * Sample code: Create zone. + * + * @param manager Entry point to DnsManager. + */ + public static void createZone(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager + .zones() + .define("zone1") + .withRegion("Global") + .withExistingResourceGroup("rg1") + .withTags(mapOf("key1", "value1")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/ZonesDeleteSamples.java b/sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/ZonesDeleteSamples.java new file mode 100644 index 0000000000000..34fa94906ec55 --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/ZonesDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.generated; + +/** Samples for Zones Delete. */ +public final class ZonesDeleteSamples { + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteZone.json + */ + /** + * Sample code: Delete zone. + * + * @param manager Entry point to DnsManager. + */ + public static void deleteZone(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager.zones().delete("rg1", "zone1", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/ZonesGetByResourceGroupSamples.java b/sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/ZonesGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..93f05e61c354a --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/ZonesGetByResourceGroupSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.generated; + +/** Samples for Zones GetByResourceGroup. */ +public final class ZonesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetZone.json + */ + /** + * Sample code: Get zone. + * + * @param manager Entry point to DnsManager. + */ + public static void getZone(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager.zones().getByResourceGroupWithResponse("rg1", "zone1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/ZonesListByResourceGroupSamples.java b/sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/ZonesListByResourceGroupSamples.java new file mode 100644 index 0000000000000..d03f3f8e24797 --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/ZonesListByResourceGroupSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.generated; + +/** Samples for Zones ListByResourceGroup. */ +public final class ZonesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListZonesByResourceGroup.json + */ + /** + * Sample code: List zones by resource group. + * + * @param manager Entry point to DnsManager. + */ + public static void listZonesByResourceGroup(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager.zones().listByResourceGroup("rg1", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/ZonesListSamples.java b/sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/ZonesListSamples.java new file mode 100644 index 0000000000000..8a511a830537f --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/ZonesListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.generated; + +/** Samples for Zones List. */ +public final class ZonesListSamples { + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListZonesBySubscription.json + */ + /** + * Sample code: List zones by subscription. + * + * @param manager Entry point to DnsManager. + */ + public static void listZonesBySubscription(com.azure.resourcemanager.dns.generated.DnsManager manager) { + manager.zones().list(null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/ZonesUpdateSamples.java b/sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/ZonesUpdateSamples.java new file mode 100644 index 0000000000000..97bb194c59b4b --- /dev/null +++ b/sdk/dns/azure-resourcemanager-dns-generated/src/samples/java/com/azure/resourcemanager/dns/generated/generated/ZonesUpdateSamples.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dns.generated.generated; + +import com.azure.resourcemanager.dns.generated.models.Zone; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Zones Update. */ +public final class ZonesUpdateSamples { + /* + * x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchZone.json + */ + /** + * Sample code: Patch zone. + * + * @param manager Entry point to DnsManager. + */ + public static void patchZone(com.azure.resourcemanager.dns.generated.DnsManager manager) { + Zone resource = + manager.zones().getByResourceGroupWithResponse("rg1", "zone1", com.azure.core.util.Context.NONE).getValue(); + resource.update().withTags(mapOf("key2", "value2")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/dns/ci.yml b/sdk/dns/ci.yml new file mode 100644 index 0000000000000..b815de9a3fcda --- /dev/null +++ b/sdk/dns/ci.yml @@ -0,0 +1,47 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/dns/ci.yml + - sdk/dns/azure-resourcemanager-dns-generated/ + exclude: + - sdk/dns/pom.xml + - sdk/dns/azure-resourcemanager-dns-generated/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/dns/ci.yml + - sdk/dns/azure-resourcemanager-dns-generated/ + exclude: + - sdk/dns/pom.xml + - sdk/dns/azure-resourcemanager-dns-generated/pom.xml + +parameters: + - name: release_azureresourcemanagerdnsgenerated + displayName: azure-resourcemanager-dns-generated + type: boolean + default: false + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: dns + EnableBatchRelease: true + Artifacts: + - name: azure-resourcemanager-dns-generated + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerdnsgenerated + releaseInBatch: ${{ parameters.release_azureresourcemanagerdnsgenerated }} diff --git a/sdk/dns/pom.xml b/sdk/dns/pom.xml new file mode 100644 index 0000000000000..23ef217d43dc9 --- /dev/null +++ b/sdk/dns/pom.xml @@ -0,0 +1,15 @@ + + + 4.0.0 + com.azure + azure-dns-service + pom + 1.0.0 + + + azure-resourcemanager-dns-generated + +